rushfee/build/classes/html/rush/Contactdetail.html

166 lines
5.5 KiB
HTML
Raw Permalink Normal View History

2022-05-16 15:07:40 +00:00
<html login="false">
<head>
<title>客户信息明细</title>
</head>
<body >
<input name="logid" widget="hidden" />
<input id="customername" widget="hidden" />
<input id="customer_id" widget="hidden" />
<input id="center_id" widget="hidden" />
<input id="task_id" widget="hidden" />
<input id="detail_id" widget="hidden" />
<input id="task_user_id" widget="hidden" />
<input id="is_call" widget="hidden" />
<input id="message" widget="hidden" />
<input id="msglogid" 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="datechooser" name="end_date" label="服务到期日期" onclick="getCrmCurrentEndDate()" readonly="true" />
<br/>
<input widget="edit" name="revenuename" label="所属税务机关" readonly="true" style="width:502px"/>
<br/>
<input widget="textarea" name="invoice_addr" label="开票地址" width="502px" height="30px" readonly="true"/>
<br/>
<div widget="toolbar" style="margin-left:35px;width:460px;margin-top:10px;">
<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 widget="autosize" style="margin-left:35px;">
<div widget="datagrid" name="grid" style="width: 465px; height:370px;" url="rush/customer/getContact" allowcelledit="true" allowcellselect="true" allowalternating="true" editnextonenterkey="true" editnextrowcell="true" >
<div type="checkcolumn" width="35" header="选择" allowNull="true"></div>
<div type="indexcolumn" width="35" header="序号"></div>
<div field="id" visible="false" ></div>
<div field="addrid" visible="false" ></div>
<div field="is_default" visible="false" ></div>
<div field="contact" width="60" header="联系人" > <input editor="edit"/></div>
<div field="mobile" width="80" header="联系电话"> <input editor="edit"/></div>
<div field="source" width="80" header="来源" > </div>
<div field="flag" width="45" 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 init(param){
parent.insertlogid("",2);
parent.document.getElementById('logid').value="";
var pageState = param['pageState'];
var end_date=param['end_date'];
var user_id = param['user_id'];
if(pageState){
aos.setState(pageState)
}
if(param['customer_id']){
aos.post({
url:"rush/ContactMt/getCustomerById",
data:param,
success:function(rtnData){
aos.getForm().setData(rtnData);
}
});
var custormer_param={customer_id:param['customer_id']};
grid.load(custormer_param);
aos.get("customer_id").setValue(param['customer_id']);
}
}
/**
*实时更新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;
}
/* if(row.flag!='删除')
{
aos.confirm('确认删除吗?',null,function(action){
if(action == 'cancel')
return;
grid.removeRow(row, true);
});
} */
aos.confirm('确认删除吗?',null,function(action){
if(action == 'cancel')
return;
grid.removeRow(row, true);
});
}
function saveContact(){
var data = {};
data['customer_id']=aos.get('customer_id').getValue();
data['added']=getChangeData("added");
data['modified']=getChangeData("modified");
data['removed']=getChangeData("removed");
/* var jsonData = JSON.stringify( data['modified']); // 转成JSON格式
var result = $.parseJSON(jsonData);// 转成JSON对象 */
var arr=getChangeData("modified");
for(var i=0;i<arr.length;i++){
var obj = arr[i];//这里获取数组内每个对象。
if(obj['source']!='分公司维护'){
aos.tip('请删除重新添加!');
return;
}
}
aos.post({
url:"rushtaskcenter/post/saveContact",
data:data,
success:function(){
aos.tip('保存联系人电话成功!');
var custormer_param={customer_id:aos.get('customer_id').getValue()};
grid.load(custormer_param);
}
});
}
</script>
</html>