|
|
@@ -4,6 +4,7 @@
|
|
4
|
4
|
<meta charset="UTF-8">
|
|
5
|
5
|
<script src="../Script/Common/huayi.load.js"></script>
|
|
6
|
6
|
<script src="../Script/Common/huayi.config.js"></script>
|
|
|
7
|
+ <link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
|
|
7
|
8
|
<link rel="stylesheet" href="../css/init.css" />
|
|
8
|
9
|
<title></title>
|
|
9
|
10
|
<style>
|
|
|
@@ -13,79 +14,6 @@
|
|
13
|
14
|
clear: both;
|
|
14
|
15
|
}
|
|
15
|
16
|
|
|
16
|
|
- .toolBar {
|
|
17
|
|
- padding: 15px 0;
|
|
18
|
|
- border-bottom: 1px solid #ccc;
|
|
19
|
|
- margin-bottom: 25px;
|
|
20
|
|
- padding-right: 45px;
|
|
21
|
|
- }
|
|
22
|
|
-
|
|
23
|
|
- .toolBar input {
|
|
24
|
|
- width: 128px;
|
|
25
|
|
- padding: 2px 2PX 2PX 10PX;
|
|
26
|
|
- height: 28px;
|
|
27
|
|
- border: 1px solid #ebebeb;
|
|
28
|
|
- color: #1ab394;
|
|
29
|
|
- outline: none;
|
|
30
|
|
- vertical-align: middle;
|
|
31
|
|
- }
|
|
32
|
|
- .model {
|
|
33
|
|
- position: fixed;
|
|
34
|
|
- top: 0;
|
|
35
|
|
- right: 0;
|
|
36
|
|
- bottom: 0;
|
|
37
|
|
- left: 0;
|
|
38
|
|
- height: 100%;
|
|
39
|
|
- width: 100%;
|
|
40
|
|
- background: rgba(0, 0, 0, 0.48);
|
|
41
|
|
- z-index: 100;
|
|
42
|
|
- display: none;
|
|
43
|
|
- }
|
|
44
|
|
- .delModel .box{
|
|
45
|
|
- width: 22%;
|
|
46
|
|
- }
|
|
47
|
|
-
|
|
48
|
|
- .box {
|
|
49
|
|
- width: 30%;
|
|
50
|
|
- margin: 0 auto;
|
|
51
|
|
- margin-top: 5%;
|
|
52
|
|
- }
|
|
53
|
|
-
|
|
54
|
|
- .box .btop {
|
|
55
|
|
- height: 35px;
|
|
56
|
|
- background: #1ab394;
|
|
57
|
|
- color: #fff;
|
|
58
|
|
- line-height: 35px;
|
|
59
|
|
- padding: 0 15px;
|
|
60
|
|
- /*margin-bottom: 15px;*/
|
|
61
|
|
- }
|
|
62
|
|
-
|
|
63
|
|
- .box .btop p.btl {
|
|
64
|
|
- float: left;
|
|
65
|
|
- margin: 0;
|
|
66
|
|
- }
|
|
67
|
|
-
|
|
68
|
|
- .box .btop p.btr {
|
|
69
|
|
- float: right;
|
|
70
|
|
- cursor: pointer;
|
|
71
|
|
- margin: 0;
|
|
72
|
|
- font-size: 20px;
|
|
73
|
|
- }
|
|
74
|
|
-
|
|
75
|
|
- .box>input {
|
|
76
|
|
- display: block;
|
|
77
|
|
- height: 34px;
|
|
78
|
|
- padding: 6px 12px;
|
|
79
|
|
- font-size: 14px;
|
|
80
|
|
- line-height: 1.42857143;
|
|
81
|
|
- color: #555;
|
|
82
|
|
- background-color: #fff;
|
|
83
|
|
- background-image: none;
|
|
84
|
|
- border: 1px solid #ccc;
|
|
85
|
|
- border-radius: 4px;
|
|
86
|
|
- margin: 35px auto;
|
|
87
|
|
- }
|
|
88
|
|
-
|
|
89
|
17
|
.boxCon {
|
|
90
|
18
|
width: 100%;
|
|
91
|
19
|
background: #fff;
|
|
|
@@ -113,34 +41,66 @@
|
|
113
|
41
|
.kong{
|
|
114
|
42
|
display: none;
|
|
115
|
43
|
}
|
|
|
44
|
+ .bootstrap-select > .dropdown-toggle.bs-placeholder {
|
|
|
45
|
+ background-color: #ffffff!important;
|
|
|
46
|
+ border-color: #e5e6e7!important;
|
|
|
47
|
+ }
|
|
|
48
|
+ .filter-option{
|
|
|
49
|
+ color: #676b6d;
|
|
|
50
|
+ }
|
|
|
51
|
+ .form-inline{
|
|
|
52
|
+ display: inline-block;
|
|
|
53
|
+ }
|
|
|
54
|
+ .bootstrap-select > .dropdown-toggle.btn-default{
|
|
|
55
|
+ background-color: #ffffff!important;
|
|
|
56
|
+ border-color: #e5e6e7!important;
|
|
|
57
|
+ color: #555;
|
|
|
58
|
+ }
|
|
116
|
59
|
|
|
117
|
60
|
</style>
|
|
118
|
61
|
</head>
|
|
119
|
62
|
<body>
|
|
120
|
63
|
<div class="container-fluid">
|
|
121
|
|
-
|
|
122
|
64
|
<div class="boxCon">
|
|
123
|
65
|
<table>
|
|
124
|
66
|
<tbody>
|
|
125
|
67
|
<tr>
|
|
126
|
68
|
<th>客户名称: </th>
|
|
127
|
|
- <td colspan="3"><input type="text" class="add_name" /><span class="addJsz_kong" style="color: red;">*</span></td>
|
|
128
|
|
- </tr>
|
|
129
|
|
- <tr>
|
|
130
|
|
- <th>客户编号: </th>
|
|
131
|
|
- <td colspan="3"><input type="text" class="add_code" /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
|
|
|
69
|
+ <td>
|
|
|
70
|
+ <div class="form-inline">
|
|
|
71
|
+ <div class="form-group">
|
|
|
72
|
+ <select class="form-control selectpicker" id="customer_name" data-live-search="true">
|
|
|
73
|
+ <option value="">请选择客户名称</option>
|
|
|
74
|
+ </select>
|
|
|
75
|
+ </div>
|
|
|
76
|
+ </div>
|
|
|
77
|
+ <span class="addJsz_kong" style="color: red;">*</span>
|
|
|
78
|
+ </td>
|
|
132
|
79
|
</tr>
|
|
133
|
80
|
<tr>
|
|
134
|
|
- <th>联系电话1: </th>
|
|
135
|
|
- <td colspan="3"><input type="text" class="add_ph1" /><span class="addJsz_kong" style="color: red;">*</span></td>
|
|
|
81
|
+ <th>省份: </th>
|
|
|
82
|
+ <td>
|
|
|
83
|
+ <div class="form-inline">
|
|
|
84
|
+ <div class="form-group">
|
|
|
85
|
+ <select class="form-control selectpicker" id="province" data-live-search="true">
|
|
|
86
|
+ <option value="">请选择省份</option>
|
|
|
87
|
+ </select>
|
|
|
88
|
+ </div>
|
|
|
89
|
+ </div>
|
|
|
90
|
+ <span class="addJsz_kong" style="color: red;">*</span>
|
|
136
|
91
|
</tr>
|
|
137
|
92
|
<tr>
|
|
138
|
|
- <th>联系电话2: </th>
|
|
139
|
|
- <td colspan="3"><input type="text" class="add_ph2" /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
|
|
|
93
|
+ <th>联系人: </th>
|
|
|
94
|
+ <td><input type="text" class="name" />
|
|
|
95
|
+ <!--<span class="addJsz_kong" style="color: red;">*</span>-->
|
|
|
96
|
+ </td>
|
|
140
|
97
|
</tr>
|
|
141
|
98
|
<tr>
|
|
142
|
|
- <th>联系电话3: </th>
|
|
143
|
|
- <td colspan="3"><input type="text" class="add_ph3" /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
|
|
|
99
|
+ <th>电话: </th>
|
|
|
100
|
+ <td >
|
|
|
101
|
+ <input type="text" class="mobile" />
|
|
|
102
|
+ <!--<span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span>-->
|
|
|
103
|
+ </td>
|
|
144
|
104
|
</tr>
|
|
145
|
105
|
</tbody>
|
|
146
|
106
|
</table>
|
|
|
@@ -148,73 +108,140 @@
|
|
148
|
108
|
</div>
|
|
149
|
109
|
|
|
150
|
110
|
</div>
|
|
151
|
|
-
|
|
|
111
|
+ <script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
|
|
152
|
112
|
<script>
|
|
153
|
113
|
var token = $.cookie("token");
|
|
|
114
|
+ var id=helper.request.queryString("ids");
|
|
|
115
|
+
|
|
|
116
|
+ $(document).ready(function(){
|
|
|
117
|
+
|
|
|
118
|
+ var regBox = {
|
|
|
119
|
+ //regEmail: /^([A-Za-z0-9_\.-]+)@([\dA-Za-z_\.-]+)\.([A-Za-z_\.-]{2,6})$/, //邮箱
|
|
|
120
|
+ //regEmail: /@/, //邮箱
|
|
|
121
|
+ //regName: /^[a-z0-9_-]{3,16}$/, //用户名
|
|
|
122
|
+ //regMobile: /^1(3|4|5|7|8)\d{9}$/ //手机
|
|
|
123
|
+ //regTel: /^0[\d]{2,3}-[\d]{7,8}$/,
|
|
|
124
|
+ //regData: /^[0-9]*$/ //数字
|
|
|
125
|
+ regMobOrTel: /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
|
|
|
126
|
+ }
|
|
|
127
|
+ //判断
|
|
|
128
|
+ function Isnullorempty(selstr) {
|
|
|
129
|
+ if (selstr == null || selstr == "" || selstr == undefined || selstr == "null" || selstr == "undefined" || parseFloat(selstr) <= 0) {
|
|
|
130
|
+ return true;
|
|
|
131
|
+ } else {
|
|
|
132
|
+ return false;
|
|
|
133
|
+ }
|
|
|
134
|
+ }
|
|
|
135
|
+ //保存按钮
|
|
154
|
136
|
$('.addCun').click(function() {
|
|
155
|
|
- var khmc = $(".add_name").val();
|
|
156
|
|
- var khbh = $(".add_code").val();
|
|
157
|
|
- var tel1 = $(".add_ph1").val();
|
|
158
|
|
- var tel2 = $(".add_ph2").val();
|
|
159
|
|
- var tel3 = $(".add_ph3").val();
|
|
160
|
|
- if(Isnullorempty(khmc)) {
|
|
161
|
|
- layer.confirm('请输入客户名称!', {
|
|
|
137
|
+ var tel = $(".mobile").val();
|
|
|
138
|
+ if($('#customer_name').val()=='') {
|
|
|
139
|
+ layer.confirm('请选择客户名称!', {
|
|
162
|
140
|
btn: ['确定']
|
|
163
|
141
|
});
|
|
164
|
142
|
return;
|
|
165
|
143
|
}
|
|
166
|
|
- if(Isnullorempty(tel1)) {
|
|
167
|
|
- layer.confirm('请输入联系电话1', {
|
|
|
144
|
+ if($('#province').val()=='') {
|
|
|
145
|
+ layer.confirm('请选择省份!', {
|
|
168
|
146
|
btn: ['确定']
|
|
169
|
147
|
});
|
|
170
|
148
|
return;
|
|
171
|
149
|
}
|
|
172
|
|
- var tflag = regBox.regMobOrTel.test(tel1);
|
|
173
|
|
- if(!tflag) {
|
|
174
|
|
- layer.confirm('请输入正确的联系电话1', {
|
|
175
|
|
- btn: ['确定']
|
|
176
|
|
- });
|
|
177
|
|
- return;
|
|
178
|
|
- }
|
|
179
|
|
- if(!Isnullorempty(tel2)) {
|
|
180
|
|
- var t2flag = regBox.regMobOrTel.test(tel2);
|
|
181
|
|
- if(!t2flag) {
|
|
182
|
|
- layer.confirm('请输入正确的联系电话2', {
|
|
183
|
|
- btn: ['确定']
|
|
184
|
|
- });
|
|
185
|
|
- return;
|
|
186
|
|
- }
|
|
187
|
|
- }
|
|
188
|
|
- if(!Isnullorempty(tel3)) {
|
|
189
|
|
- var t3flag = regBox.regMobOrTel.test(tel3);
|
|
190
|
|
- if(!t3flag) {
|
|
191
|
|
- layer.confirm('请输入正确的联系电话3', {
|
|
|
150
|
+ if(!Isnullorempty(tel)) {
|
|
|
151
|
+ var flag = regBox.regMobOrTel.test(tel);
|
|
|
152
|
+ if(!flag) {
|
|
|
153
|
+ layer.confirm('请输入正确的联系电话', {
|
|
192
|
154
|
btn: ['确定']
|
|
193
|
155
|
});
|
|
194
|
156
|
return;
|
|
195
|
157
|
}
|
|
196
|
158
|
}
|
|
197
|
159
|
$.post(huayi.config.callcenter_url + 'Customer/AddCustomer', {
|
|
198
|
|
- name: khmc,
|
|
199
|
|
- code: khbh,
|
|
200
|
|
- mobile: tel1,
|
|
201
|
|
- telphone: tel2,
|
|
202
|
|
- chargetelephone: tel3,
|
|
|
160
|
+ cid: id,
|
|
|
161
|
+ customerindustry: $('#customer_name').val(),
|
|
|
162
|
+ province: $('#province').val(),
|
|
|
163
|
+ mobile: $('.mobile').val(),
|
|
|
164
|
+ name: $('.name').val(),
|
|
203
|
165
|
"token": $.cookie("token")
|
|
204
|
166
|
}, function(result) {
|
|
205
|
167
|
result = $.parseJSON(result);
|
|
206
|
168
|
if(result.state.toLowerCase() == "success") {
|
|
207
|
169
|
$("#activess").val(result.data);
|
|
208
|
170
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
209
|
|
- parent.layer.close(index); //再执行关闭
|
|
210
|
|
- parent.layer.msg("添加成功!");
|
|
211
|
|
- parent.table.bootstrapTable('refresh');
|
|
|
171
|
+ parent.layer.close(index); //再执行关闭
|
|
|
172
|
+ parent.layer.msg("添加成功!");
|
|
|
173
|
+ parent.table.bootstrapTable('refresh');
|
|
212
|
174
|
}
|
|
213
|
175
|
})
|
|
214
|
|
-// $('.addModel').css('display', 'none');
|
|
|
176
|
+
|
|
215
|
177
|
})
|
|
216
|
|
-
|
|
217
|
|
-
|
|
|
178
|
+ if(id){
|
|
|
179
|
+ $.get(huayi.config.callcenter_url + 'Customer/GetCustomer', {
|
|
|
180
|
+ cid: id,
|
|
|
181
|
+ "token": $.cookie("token")
|
|
|
182
|
+ }, function(result) {
|
|
|
183
|
+ result = $.parseJSON(result);
|
|
|
184
|
+ if(result.state.toLowerCase() == "success") {
|
|
|
185
|
+ var con=result.data;
|
|
|
186
|
+ $("#customer_name").val(con.F_CustomerIndustry);
|
|
|
187
|
+ $('#customer_name').trigger("change");
|
|
|
188
|
+// $("#customer_name").find('option[text='+ con.F_CustomerIndustry +']').attr("selected",true);
|
|
|
189
|
+ $("#province").val(con.F_Province);
|
|
|
190
|
+ $('#province').trigger("change");
|
|
|
191
|
+ $(".mobile").val(con.F_Telephone);
|
|
|
192
|
+ $(".name").val(con.F_CustomerName);
|
|
|
193
|
+ }
|
|
|
194
|
+ })
|
|
|
195
|
+
|
|
|
196
|
+ }
|
|
|
197
|
+// else{
|
|
|
198
|
+// getAccount();
|
|
|
199
|
+// getProvince()
|
|
|
200
|
+// }
|
|
|
201
|
+//
|
|
|
202
|
+
|
|
|
203
|
+ })
|
|
|
204
|
+ //客户名称
|
|
|
205
|
+ getAccount()
|
|
|
206
|
+ function getAccount() {
|
|
|
207
|
+ $.ajax({
|
|
|
208
|
+ type: "get",
|
|
|
209
|
+ url: huayi.config.callcenter_url + "Customer/BindLDdep",
|
|
|
210
|
+ dataType: 'json',
|
|
|
211
|
+ async: true,
|
|
|
212
|
+ data: {
|
|
|
213
|
+ token: $.cookie("token")
|
|
|
214
|
+ },
|
|
|
215
|
+ success: function(data) {
|
|
|
216
|
+ var Count = data.data.dep;
|
|
|
217
|
+ $(Count).each(function(i,n){
|
|
|
218
|
+ $("<option value='" + n + "'>" + n + "</option>").appendTo($("#customer_name"));
|
|
|
219
|
+ })
|
|
|
220
|
+ $('#customer_name').selectpicker('refresh');
|
|
|
221
|
+ }
|
|
|
222
|
+ });
|
|
|
223
|
+ }
|
|
|
224
|
+ //省份
|
|
|
225
|
+ getProvince()
|
|
|
226
|
+ function getProvince() {
|
|
|
227
|
+ $.ajax({
|
|
|
228
|
+ type: "get",
|
|
|
229
|
+ url: 'province.json',
|
|
|
230
|
+ dataType: 'json',
|
|
|
231
|
+ async: true,
|
|
|
232
|
+ data: {
|
|
|
233
|
+// token: $.cookie("token")
|
|
|
234
|
+ },
|
|
|
235
|
+ success: function(data) {
|
|
|
236
|
+ var Count = data.provinces;
|
|
|
237
|
+ $(Count).each(function(i,n){
|
|
|
238
|
+ $("<option value='" + n.provinceName + "'>" + n.provinceName + "</option>").appendTo($("#province"));
|
|
|
239
|
+ })
|
|
|
240
|
+ $('#province').selectpicker('refresh');
|
|
|
241
|
+ }
|
|
|
242
|
+ });
|
|
|
243
|
+ }
|
|
|
244
|
+
|
|
218
|
245
|
</script>
|
|
219
|
246
|
</body>
|
|
220
|
247
|
</html>
|