| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- var token = $.cookie("token");
- var id = helper.request.queryString("ids");
- var cusid;
- $(document).ready(function() {
- getRegisterDetail()
- })
- //保存按钮
- $('.customerSubmit').click(function() {
- if($('#customer_layer').val() == '') {
- layer.confirm('请输入客户姓名!', {
- btn: ['确定']
- });
- return;
- }
- if($('#customer_bedept').val() == '') {
- layer.confirm('请输入客户电话!', {
- btn: ['确定']
- });
- return;
- }
- $.post(huayi.config.callcenter_url + 'RegRecords/Save', {
- "token": $.cookie("token"),
- id:id,
- token: $.cookie("token"),
- cusid: cusid, //档案id
- direction: 0, // 0来电,1去电
- type: $('#formRegistrationType input[name="type"]:checked').val(), //登记类型
- complained: $("#formComplainedUnit").val(), //被投诉单位
- content: $("#formRegistrationContent").val(), //登记内容/投诉事项
- remark: $("#formRegistrationRemark").val(), //备注
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- $("#activess").val(result.data);
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.layer.msg("保存成功!");
- parent.table.bootstrapTable('refresh');
- }
- })
- })
- function getRegisterDetail() {
- $.get(huayi.config.callcenter_url + 'RegRecords/GetDetails', {
- id: id,
- "token": $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- var con = result.data.model;
- cusid = con.F_CusID;
- $("#formRegistrationType input[name='type'][value='" + con.F_Type +"']").prop("checked","checked"); //登记类型
- $("#formComplainedUnit").val(con.F_Complained); //被投诉单位
- $("#formRegistrationContent").val(con.F_Content); //登记内容/投诉事项
- $("#formRegistrationRemark").val(con.F_Remark); //备注
- }
- })
- }
|