rushfee/build/classes/html/tick/tenexcustomerdetail.html

350 lines
11 KiB
HTML
Raw Normal View History

2022-05-16 15:07:40 +00:00
<html login="false">
<head>
<title>客户信息明细</title>
</head>
<body>
<div widget="toolbar" >
<a widget="button" iconCls="icon-test" onclick="archives(1)">客户档案</a>
<a widget="button" iconCls="icon-admin" onclick="archives(3)">服务记录</a>
<a widget="button" iconCls="icon-log" onclick="record()">催缴记录</a>
<a widget="button" iconCls="icon-next" onclick="latestrecord()">最近缴费</a>
<a widget="button" iconCls="icon-log" onclick="companyrecord()">处理记录</a>
<a widget="button" iconCls="icon-save" id="savebtn" onclick="save" linkToState="editold,editnew">保存</a>
<a widget="button" iconCls="icon-delete" id="finishbtn" onclick="finishTask()">完成</a>
</div>
<div style="clear:both" id="left_div">
<input name="logid" widget="hidden" />
<input id="customer_id" widget="hidden" />
<input id="cust_name" widget="hidden" />
<input id="onfeedback" widget="hidden" />
<input id="id" widget="hidden" />
<input id="cust_type" widget="hidden" />
<input widget="edit" name="cust_name" label="客户名称" readonly="true" style="width:502px;margin-top:5px"/>
<br/>
<input widget="edit" name="cust_tax_code" label="客户税号" readonly="true" style="margin-top:5px"/>
<input widget="edit" name="org_name" label="分公司" readonly="true" />
<br/>
<!-- <input widget="edit" name="legal_person" label="法人代表" readonly="true" /> -->
<input widget="edit" name="revenuename" label="所属税务机关" readonly="true" style="width:502px"/>
<br/>
<input widget="edit" name="person_tel" label="最新来电" readonly="true" />
<input widget="datechooser" name="enddate" label="服务到期日期" onclick="getCrmCurrentEndDate()" readonly="true" />
<br/>
<br/>
<div style="clear:both">
<div name="feedback" label="反馈结果" widget="radiobuttonlist"
repeatitems="4" repeatlayout="table" textfield="name" valuefield="name" url="rush/excustomer/gettenlist">
</div>
</div>
<br/>
<input widget="textarea" name="remark" label="备注" width="500px" height="78px"/>
<h4 ><font color="blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请注意:当完成按钮可点击时,说明客户已缴费或已注销,可以直接点击完成!不需要做其他操作</font></h4>
</div>
<div widget="toolbar" id="right_top" style="margin-left:510px;width:665px;margin-top:-285px;">
<a widget="button" iconcls="icon-add" onclick="addRow()">新增</a>
<a widget="button" iconcls="icon-delete" onclick="remove">删除</a>
<!-- <a widget="button" iconCls="icon-save" onclick="saveContact">保存</a> -->
</div>
<div style="margin-left:510px;">
<div widget="datagrid" name="grid" style="width:670px; height:254px;" url="rush/customer/getContact" allowcelledit="true" allowcellselect="true" allowalternating="true" editnextonenterkey="true" editnextrowcell="true" >
<div type="checkcolumn" width="20" header="选择" allowNull="true"></div>
<div type="indexcolumn" width="20" header="序号"></div>
<div field="id" visible="false" ></div>
<div field="addrid" visible="false" ></div>
<div field="vital" visible="false" ></div>
<div field="is_default" visible="false" ></div>
<div field="contact" width="50" header="联系人" > <input editor="edit"/></div>
<div field="mobile" width="50" header="联系电话"> <input editor="edit"/></div>
<div field="source" width="50" header="来源" ></div>
<div field="flag" width="45" header="历史操作" ></div>
<div field="operate_date" width="75" header="更新日期" ></div>
<div field="mobile_mark" width="50" header="电话类型" >
<input editor="combox" name="mobile_mark" url="rushtaskcenter/getMobileMarkList"
textField="text" valueField="memo" allowInput="false" showNullItem="true" />
</div>
</div>
</div>
</body>
<script type="text/javascript">
var grid = aos.get('grid');
var flag =true;
function resetHeight(){
var height=$("#left_div").height();
// alert(height);
$("#right_top").css("marginTop",5-height);
}
function init(param){
parent.document.getElementById('logid').value="";
var pageState = param['pageState'];
aos.get("customer_id").setValue(param['customer_id']);
aos.get("id").setValue(param['id']);
aos.get("cust_type").setValue(param['cust_type']);
aos.get("cust_name").setValue(param['cust_name']);
aos.get("onfeedback").setValue(param['onfeedback']);
if(pageState){
aos.setState(pageState)
}
if(param['id']){
aos.post({
url:"rush/excustomer/getCustomerById",
data:param,
success:function(rtnData){
if(rtnData.state==1){
aos.get("savebtn").disable();
aos.get("finishbtn").disable()
}
if(param['end_date']!=rtnData.enddate){
aos.get("savebtn").disable();
}
if(param['end_date']==rtnData.enddate){
aos.get("finishbtn").disable();
}
aos.getForm().setData(rtnData);
resetHeight();
}
});
var custormer_param={customer_id:param['customer_id']};
grid.load(custormer_param);
}
var data = {};
data['customer_id']=aos.get('customer_id').getValue();
aos.post({
url:"rush/post/getCrmrecord",
data:data,
success:function(data){
if(null==data){
aos.tip('今年无来电电话');
}
else{
aos.tip('成功获取最新来电电话');
aos.get('person_tel').setValue(data.person_tel);
}
}
});
}
/**
*实时更新CRM中客户的服务费到期日期
*/
function getCrmCurrentEndDate(){
var data = {};
data['customer_id']=aos.get('customer_id').getValue();
aos.post({
url:"rush/post/getCrmCurrentEndDate",
data:data,
success:function(data){
aos.tip('成功获取最新CRM客户服务费到期日期');
aos.get('end_date').setValue(data.crm_end_date);
}
});
}
function addRow() {
var newRow = {
source:'分公司维护',
is_default:0
};
grid.addRow(newRow,0);
}
function getChangeData(status){
var list=grid.getChanges(status);
return list;
}
function remove(){
var row=grid.getSelected();
if(!row){
aos.alert('选择一行后进行删除!');
return;
}
aos.confirm('确认删除吗?',null,function(action){
if(action == 'cancel')
return;
grid.removeRow(row, true);
});
}
function saveContact(){
var data = {};
data['id']=aos.get('id').getValue();
data['cust_type']=aos.get('cust_type').getValue();
data['cust_name']=aos.get('cust_name').getValue();
data['customer_id']=aos.get('customer_id').getValue();
data['added']=getChangeData("added");
data['modified']=getChangeData("modified");
data['removed']=getChangeData("removed");
aos.post({
url:"rush/excustomer/saveContact",
data:data,
success:function(){
aos.tip('保存联系人电话成功!');
var custormer_param={customer_id:aos.get('customer_id').getValue()};
grid.load(custormer_param);
}
});
}
function SContact(){
var data = {};
data['id']=aos.get('id').getValue();
data['cust_type']=aos.get('cust_type').getValue();
data['cust_name']=aos.get('cust_name').getValue();
data['customer_id']=aos.get('customer_id').getValue();
data['added']=getChangeData("added");
data['modified']=getChangeData("modified");
data['removed']=getChangeData("removed");
aos.post({
url:"rush/excustomer/saveContact",
data:data,
success:function(){
}
});
}
function save(){
if(!flag){
alert('已保存!')
return ;
}
var feedback = aos.get('feedback');
if(feedback.value == null || feedback.value==''){
aos.alert('请录入反馈结果!');
return;
}
if(feedback.value=="信息已更新"){
if(getChangeData("added")==""&&getChangeData("modified")==""&&getChangeData("removed")){
aos.alert('请先对信息进行维护!');
return;
}
}
SContact();
var grid = aos.get('grid');
var data = aos.getForm().getData();
data['grid']=grid.getData();
data['id']=aos.get('id').getValue();
data['cust_type']=aos.get('cust_type').getValue();
data['cust_name']=aos.get('cust_name').getValue();
data['customer_id']=aos.get('customer_id').getValue();
data['onfeedback']=aos.get('onfeedback').getValue();
aos.post({
url:"rush/excustomer/saveRecord",
data:data,
success:function(){
aos.tip('保存成功!');
parent.insertlogid("",2);
CloseWindow();
}
});
flag=false;
}
//查看客户档案和服务记录
function archives(n){
var customer_id = aos.get('customer_id').value;
var url = "";
if(n==1){
url ='http://crm.aisinoha.com/ZHYW/zh/commonInterface.jsp?url=pt/canvas?formid=crm_cus_org_customer_view*FormCreateState=editnew*PERSON_TEL=*org_customer_id='+customer_id+'*ispop=0*callid=&userid=hxcuijiao&userpass=aisino_123';
}else if(n==3){
url='http://crm.aisinoha.com/ZHYW/zh/commonInterface.jsp?url=pt/canvas?formid=zh_sm_customer_archives*FormCreateState=editnew*PERSON_TEL=*CUSTOMER_ID='+customer_id+'*ispop=0*callid=&userid=hxcuijiao&userpass=aisino_123';
}
if(customer_id){
window.open(url,'_blank','width=2000,height=2000,menubar=no,toolbar=no, status=no,scrollbars=yes')
}else{
aos.alert('页面出错!');
return;
}
}
function record(){
var param = {};
param['customer_id'] = aos.get('customer_id').getValue();
aos.showWindow( 'canvas/rush/oldrush', param, '600px','400px','催缴记录(双击可查询录音)',
function(params, rtnData){
}
);}
/**
* 客户最近缴费记录
*/
function latestrecord(){
var param = {};
param['customer_id'] = aos.get('customer_id').getValue();
aos.showWindow( 'canvas/rush/latestrecord', param, '700px','180px','最近缴费记录',
function(params, rtnData){
}
);}
function telsearch(){
var param = {};
param['customer_id'] = aos.get('customer_id').getValue();
aos.showWindow('canvas/rush/telrush', param, '800px','400px','依据电话查询',
function(params, rtnData){
}
);
}
function finishTask(){
if(!flag){
alert('已保存!')
return ;
}
var grid = aos.get('grid');
var data = {}
data['id']=aos.get('id').getValue();
data['cust_type']=aos.get('cust_type').getValue();
data['cust_name']=aos.get('cust_name').getValue();
data['customer_id']=aos.get('customer_id').getValue();
// data['feedback']="客户已缴费";
// data['remark']="完成按钮保存客户已缴费";
data['feedback']=aos.get('feedback').value;
data['remark']="完成按钮保存"+aos.get('feedback').value;
aos.post({
url:"rush/excustomer/saveRecord",
data:data,
success:function(){
aos.tip('保存成功!');
parent.insertlogid("",2);
CloseWindow();
}
});
flag=false;
}
function companyrecord(){
var param = {};
param['obj_id'] = aos.get('id').getValue();
aos.showWindow('canvas/tick/companylog', param, '600px','400px','处理记录',
function(params, rtnData){
}
);
}
</script>
</html>