|
|
@@ -8,18 +8,18 @@ $(function() {
|
|
8
|
8
|
if(editId){
|
|
9
|
9
|
$('.edit').show();
|
|
10
|
10
|
$('.add').hide();
|
|
11
|
|
- $('.cusmid').addClass('selectpicker');
|
|
12
|
|
- $('.cusmid').addClass('form-control');
|
|
13
|
|
- myCustomeredit($('.cusmid'));//获取公司名称
|
|
|
11
|
+ $('#cusmidedit').addClass('selectpicker');
|
|
|
12
|
+ $('#cusmidedit').addClass('form-control');
|
|
|
13
|
+ myCustomeredit($('#cusmidedit'));//获取公司名称
|
|
14
|
14
|
setTimeout(function(){
|
|
15
|
15
|
getrelatedInformationDetail(editId);
|
|
16
|
16
|
},1000)
|
|
17
|
17
|
}else{
|
|
18
|
|
- myCustomeradd($('.cusmid'));//获取公司名称
|
|
|
18
|
+ myCustomeradd($('#cusmidadd'));//获取公司名称
|
|
19
|
19
|
$('.add').show();
|
|
20
|
20
|
$('.edit').hide();
|
|
21
|
|
- $('.cusmid').addClass('selectpicker');
|
|
22
|
|
- $('.cusmid').addClass('form-control');
|
|
|
21
|
+ $('#cusmidadd').addClass('selectpicker');
|
|
|
22
|
+ $('#cusmidadd').addClass('form-control');
|
|
23
|
23
|
}
|
|
24
|
24
|
$('#btn_save').click(function() {
|
|
25
|
25
|
saveRelated()
|
|
|
@@ -30,14 +30,14 @@ $(function() {
|
|
30
|
30
|
layer.msg('请选择管理员账号!')
|
|
31
|
31
|
return
|
|
32
|
32
|
}
|
|
33
|
|
- if(!$('.cusmid').val()){
|
|
34
|
|
- layer.msg('请选择公司名称!')
|
|
35
|
|
- return
|
|
36
|
|
- }
|
|
37
|
33
|
if(editId) {
|
|
|
34
|
+ if(!$('#cusmidedit').val()){
|
|
|
35
|
+ layer.msg('请选择公司名称!')
|
|
|
36
|
+ return
|
|
|
37
|
+ }
|
|
38
|
38
|
$.post(huayi.config.callcenter_url + 'MageCus/UpdateManageCustomer', {
|
|
39
|
39
|
mangid: $("#mangid").val().toString(),
|
|
40
|
|
- cusmid: $(".cusmid").val().toString(),
|
|
|
40
|
+ cusmid: $("#cusmidedit").val().toString(),
|
|
41
|
41
|
id:editId,
|
|
42
|
42
|
token: $.cookie("token")
|
|
43
|
43
|
}, function(data) {
|
|
|
@@ -47,13 +47,17 @@ $(function() {
|
|
47
|
47
|
parent.layer.close(index);
|
|
48
|
48
|
parent.layer.msg("保存成功");
|
|
49
|
49
|
parent.initTable();
|
|
50
|
|
- $(".cusmid").val('')
|
|
|
50
|
+ $("#cusmidedit").val('')
|
|
51
|
51
|
}
|
|
52
|
52
|
});
|
|
53
|
53
|
} else {
|
|
54
|
|
- $.post(huayi.config.callcenter_url + 'MageCus/AddManageCustomer', {
|
|
|
54
|
+ if(!$('#cusmidadd').val()){
|
|
|
55
|
+ layer.msg('请选择公司名称!')
|
|
|
56
|
+ return
|
|
|
57
|
+ }
|
|
|
58
|
+ $.post(huayi.config.callcenter_url + 'MageCus/AddManageCustomer', {
|
|
55
|
59
|
mangid: $("#mangid").val().toString(),
|
|
56
|
|
- cusmid: $(".cusmid").val().toString(),
|
|
|
60
|
+ cusmid: $("#cusmidadd").val().toString(),
|
|
57
|
61
|
token: $.cookie("token")
|
|
58
|
62
|
}, function(data) {
|
|
59
|
63
|
data = JSON.parse(data);
|
|
|
@@ -62,7 +66,7 @@ $(function() {
|
|
62
|
66
|
parent.layer.close(index);
|
|
63
|
67
|
parent.layer.msg("保存成功");
|
|
64
|
68
|
parent.initTable();
|
|
65
|
|
- $(".cusmid").val('')
|
|
|
69
|
+ $("#cusmidadd").val('')
|
|
66
|
70
|
}
|
|
67
|
71
|
});
|
|
68
|
72
|
}
|
|
|
@@ -81,8 +85,8 @@ function getrelatedInformationDetail(editId) {
|
|
81
|
85
|
if(data.state=='success'){
|
|
82
|
86
|
$('#mangid').val(data.data.mangid.toString());
|
|
83
|
87
|
$('#mangid').selectpicker('refresh');
|
|
84
|
|
- $('.cusmid').val(data.data.cusmid.toString());
|
|
85
|
|
- $('.cusmid').selectpicker('refresh')
|
|
|
88
|
+ $('#cusmidedit').val(data.data.cusmid.toString());
|
|
|
89
|
+ $('#cusmidedit').selectpicker('refresh')
|
|
86
|
90
|
}
|
|
87
|
91
|
})
|
|
88
|
92
|
}
|
|
|
@@ -105,7 +109,7 @@ function myCustomeredit(obj) {
|
|
105
|
109
|
noneSelectedText: '请选择' //默认显示内容
|
|
106
|
110
|
});
|
|
107
|
111
|
$.getJSON(huayi.config.callcenter_url + "CustomerNew/GetListBycompany", {
|
|
108
|
|
- company:$(".cusmid").val(),
|
|
|
112
|
+ company:$("#cusmidedit").val(),
|
|
109
|
113
|
"token": $.cookie("token"),
|
|
110
|
114
|
}, function(data) {
|
|
111
|
115
|
if(data.state.toLowerCase() == "success") {
|
|
|
@@ -126,7 +130,7 @@ function myCustomeradd(obj) {
|
|
126
|
130
|
noneSelectedText: '请选择' //默认显示内容
|
|
127
|
131
|
});
|
|
128
|
132
|
$.getJSON(huayi.config.callcenter_url + "CustomerNew/GetListBycompany", {
|
|
129
|
|
- company:$(".cusmid").val(),
|
|
|
133
|
+ company:$("#cusmidadd").val(),
|
|
130
|
134
|
"token": $.cookie("token"),
|
|
131
|
135
|
}, function(data) {
|
|
132
|
136
|
if(data.state.toLowerCase() == "success") {
|