Procházet zdrojové kódy

IVR 关联坐席 绑定 解除

d123 %!s(int64=8) %!d(string=před) roky
rodič
revize
a4530b6aa4
1 změnil soubory, kde provedl 17 přidání a 177 odebrání
  1. 17 177
      CallCenterWeb.UI/TelCall/PhoneNumber.html

+ 17 - 177
CallCenterWeb.UI/TelCall/PhoneNumber.html

27
 			</div>
27
 			</div>
28
 			<div class="th-box">
28
 			<div class="th-box">
29
 				<div class="th-bar">
29
 				<div class="th-bar">
30
-					<a class="sc_btn  add max-right">添加</a>
31
-					<a class="sc_btn  xg max-right">修改</a>
32
-					<a class="sc_btn  remove">删除</a>
33
 					<div class="seach-box fr">
30
 					<div class="seach-box fr">
34
 						<ul>
31
 						<ul>
35
 							<li>关键字:<input class="photo x-color" type="text" id="KeyWords" /></li>
32
 							<li>关键字:<input class="photo x-color" type="text" id="KeyWords" /></li>
59
 					<table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
56
 					<table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
60
 						<thead>
57
 						<thead>
61
 							<tr>
58
 							<tr>
62
-								<th data-field="state" data-checkbox="true"></th>
63
 								<th data-field="F_MobileNum" data-formatter="CallId" data-align="center">编号</th>
59
 								<th data-field="F_MobileNum" data-formatter="CallId" data-align="center">编号</th>
64
 								<th data-field="tel" data-align="center">区号</th>
60
 								<th data-field="tel" data-align="center">区号</th>
65
 								<th data-field="province" data-align="center">省份</th>
61
 								<th data-field="province" data-align="center">省份</th>
66
 								<th data-field="city" data-align="center">城市</th>
62
 								<th data-field="city" data-align="center">城市</th>
67
 								<th data-field="res" data-align="center" data-formatter="res">是否关联坐席</th>
63
 								<th data-field="res" data-align="center" data-formatter="res">是否关联坐席</th>
68
 								<th data-field="tel" data-align="center" data-formatter="Cz">关联坐席</th>
64
 								<th data-field="tel" data-align="center" data-formatter="Cz">关联坐席</th>
69
-								<th data-field="id" data-align="center" data-formatter="Move">操作</th>
70
 							</tr>
65
 							</tr>
71
 						</thead>
66
 						</thead>
72
 						<tbody id="tbody">
67
 						<tbody id="tbody">
76
 			</div>
71
 			</div>
77
 		</div>
72
 		</div>
78
 		<script>
73
 		<script>
79
-			var html = ' <div>' +
80
-				'<ul class="nav nav-tabs">' +
81
-				'<li class="active"><a href="#">参数信息</a></li> ' +
82
-				'</ul>' +
83
-				'<div class=" add_time">' +
84
-				'<label for="">号段:</label>' +
85
-				'<input type="text" id="hd" value="" class="photo"/><input type="hidden" id="hidhd" value="" class="photo"/>' +
86
-				'</div>' +
87
-				'<div class=" add_time">' +
88
-				'<label for="">区号:</label>' +
89
-				'<input type="text"class="photo"  value="" id="qphone"/>' +
90
-				'</div>' +
91
-				'<div class=" add_time">' +
92
-				'<label for="">城市:</label>' +
93
-				'<input type="text" class="photo" value="" id="city"/>' +
94
-				'</div>' +
95
-				'<div class=" add_time">' +
96
-				'<label for=""  class="Pb_sm">卡类型:</label>' +
97
-				'<textarea type="text"  id="Pb"/>' +
98
-				'</textarea>' +
99
-				'</div>' +
100
-				'<div class=" add_time tc">' +
101
-				'<button  type="button" class="btn sc_btn"  onclick="addedit()">保&nbsp;&nbsp;存</button>' +
102
-				'</div>' +
103
-				' </div>';
104
-			var tc;
105
 			$(document).ready(function() {
74
 			$(document).ready(function() {
106
 				zx();
75
 				zx();
107
 				/*搜索*/
76
 				/*搜索*/
108
 				$("#sc_btn").click(function() {
77
 				$("#sc_btn").click(function() {
109
 					initTable();
78
 					initTable();
110
 				})
79
 				})
111
-				/*删除提示*/
112
-				$(".remove").click(function() {
113
-					var ids = $.map($('#list').bootstrapTable('getSelections'),
114
-						function(row) {
115
-							return row.F_Id;
116
-						});
117
-					/*判断长度*/
118
-					if(ids.length <= 0) {
119
-						layer.confirm('没有可删除的选项?', {
120
-							btn: ['确定'] //按钮
121
-						});
122
-						return;
123
-					}
124
-					remove();
125
-				});
126
-				/*修改弹窗*/
127
-				$(".xg").click(function() {
128
-					var mobileNum = $.map($('#list').bootstrapTable('getSelections'),
129
-						function(row) {
130
-							return row.F_Id;
131
-						});
132
-					if(mobileNum.length != 1) {
133
-						layer.confirm('请选择一行进行修改?', {
134
-							btn: ['确定'] //按钮
135
-						});
136
-						return;
137
-					} else {
138
-						$.getJSON(huayi.config.callcenter_url + "Mobiledata/GetMobiledata", {
139
-							id: mobileNum[0],
140
-							token: $.cookie("token")
141
-						}, function(result) {
142
-							if(result.state.toLowerCase() == "success") {
143
-								tc = layer.open({
144
-									type: 1,
145
-									title: '修改号码归属地',
146
-									area: ['40%', '68%'], //宽高
147
-									content: html
148
-								});
149
-
150
-								$("#hidhd").val(result.data.F_Id);
151
-								$("#hd").val(result.data.F_MobileNum);
152
-								$("#qphone").val(result.data.F_ZipCode);
153
-								$("#city").val(result.data.F_CityDes);
154
-								$("#Pb").val(result.data.F_CardDes);
155
-							}
156
-						})
157
-					}
158
-				});
159
-				/*增加弹框*/
160
-				$(".add").click(function() {
161
-					tc = layer.open({
162
-						type: 1,
163
-						fix: false,
164
-						content: html, //iframe的url,no代表不显示滚动条
165
-						title: '添加号码归属地',
166
-						area: ['35%', '70%'], //宽高
167
-					});
168
-				});
169
 				initTable();
80
 				initTable();
170
 			})
81
 			})
171
 			//声明变量
82
 			//声明变量
175
 				if(row.res==0){
86
 				if(row.res==0){
176
 					html='添加'
87
 					html='添加'
177
 				}else{
88
 				}else{
178
-					html='修改'
89
+					html='解绑'
179
 				}
90
 				}
180
 				return '<a onclick="Click(' + val + ',' + row.res + ',' + row.id + ')">'+html+'</a>'
91
 				return '<a onclick="Click(' + val + ',' + row.res + ',' + row.id + ')">'+html+'</a>'
181
 			}
92
 			}
204
 							page: params.pageNumber,
115
 							page: params.pageNumber,
205
 							pagesize: params.pageSize,
116
 							pagesize: params.pageSize,
206
 							userid: str,
117
 							userid: str,
207
-							token: $.cookie("token")
118
+							token: $.cookie("token"),
119
+							location:$("#KeyWords").val()
208
 						};
120
 						};
209
 						return param;
121
 						return param;
210
 					},
122
 					},
289
 				}
201
 				}
290
 				return html;
202
 				return html;
291
 			}
203
 			}
292
-			//删除
293
-//			function Move(val){
294
-//				return  '<a></a>'
295
-//			}
296
 			var table = $('#list_');
204
 			var table = $('#list_');
297
 			var str;
205
 			var str;
298
 			var Userid; //坐席id
206
 			var Userid; //坐席id
306
 				initTable(str);
214
 				initTable(str);
307
 			});
215
 			});
308
 			//新增或者编辑
216
 			//新增或者编辑
309
-			function addedit() {
310
-				var mobileNumReg = /^\d{1,20}$/,
311
-					zipCodeReg = /^\d{1,10}$/,
312
-					cityDesReg = /^(.){1,25}$/,
313
-					cardDesReg = /^(.){1,25}$/
314
-				if(!mobileNumReg.test($.trim($("#hd").val()))) {
315
-					layer.confirm('号段长度在1-20位之间,且必须是数字。', {
316
-						icon: 2,
317
-						btn: ['确定'] //按钮
318
-					});
319
-					return;
320
-				}
321
-				if(!zipCodeReg.test($.trim($("#qphone").val()))) {
322
-					layer.confirm('区号长度在1-10位之间,且必须是数字。', {
323
-						icon: 2,
324
-						btn: ['确定'] //按钮
325
-					});
326
-					return;
327
-				}
328
-				if(!cityDesReg.test($.trim($("#city").val()))) {
329
-					layer.confirm('城市长度在1-25位之间。', {
330
-						icon: 2,
331
-						btn: ['确定'] //按钮
332
-					});
333
-					return;
334
-				}
335
-				if(!cardDesReg.test($.trim($("#Pb").val()))) {
336
-					layer.confirm('卡类型长度在1-25位之间。', {
337
-						icon: 2,
338
-						btn: ['确定'] //按钮
339
-					});
340
-					return;
341
-				}
342
-				/*发送请求*/
343
-				$.post(huayi.config.callcenter_url + "Mobiledata/AddMobiledata", {
344
-					id: $("#hidhd").val(),
345
-					mobileNum: $("#hd").val(),
346
-					zipCode: $("#qphone").val(),
347
-					cityDes: $("#city").val(),
348
-					cardDes: $("#Pb").val(),
349
-					token: $.cookie("token")
350
-				}, function(result) {
351
-					result = JSON.parse(result);
352
-					if(result.state.toLowerCase() == "success") {
353
-						if($("#hidhd").val()) {
354
-							layer.msg("修改成功");
355
-						} else {
356
-							layer.msg("新增成功");
357
-						}
358
-						layer.close(tc); //关闭弹层
359
-						initTable();
360
-
361
-					}
362
-				})
363
-			}
364
 			//方法
217
 			//方法
365
 			function Click(val, str, id) {
218
 			function Click(val, str, id) {
366
 				console.log(id)
219
 				console.log(id)
369
 						layer.confirm('要关联此坐席么?', {
222
 						layer.confirm('要关联此坐席么?', {
370
 							btn: ['确定', '取消'] //按钮
223
 							btn: ['确定', '取消'] //按钮
371
 						}, function() {
224
 						}, function() {
372
-							$.ajax({
373
-								type: "get",
374
-								url: huayi.config.callcenter_url + "Mobiledata/AddMobileUsers",
375
-								dataType: 'json',
376
-								async: true,
377
-								data: {
378
-									tellocid:id,
379
-									userid:Userid,
380
-//									id:id,
381
-									token: $.cookie("token")
382
-								},
383
-								success: function(data) {
384
-									if(data.state.toLowerCase() == 'success') {
385
-//										 alert('1');
386
-										layer.msg("新增成功");
387
-									}
388
-								}
389
-							});
225
+							type=0;
226
+							Ajax(val,Userid,type)
390
 						});
227
 						});
391
 					}else{
228
 					}else{
392
 						layer.confirm('要解除关联此坐席么?', {
229
 						layer.confirm('要解除关联此坐席么?', {
393
 							btn: ['确定', '取消'] //按钮
230
 							btn: ['确定', '取消'] //按钮
394
 						}, function() {
231
 						}, function() {
395
-							$.ajax({
232
+							type=1;
233
+							Ajax(val,Userid,type)
234
+						});
235
+					}
236
+				}else{
237
+					layer.msg('请选择要关联的坐席')
238
+				}
239
+			}
240
+			function Ajax(val,Userid,type){
241
+				$.ajax({
396
 								type: "get",
242
 								type: "get",
397
 								url: huayi.config.callcenter_url + "Mobiledata/AddMobileUsers",
243
 								url: huayi.config.callcenter_url + "Mobiledata/AddMobileUsers",
398
 								dataType: 'json',
244
 								dataType: 'json',
400
 								data: {
246
 								data: {
401
 									tellocid:val,
247
 									tellocid:val,
402
 									userid:Userid,
248
 									userid:Userid,
403
-									id:id,
249
+									type:type,
404
 									token: $.cookie("token")
250
 									token: $.cookie("token")
405
 								},
251
 								},
406
 								success: function(data) {
252
 								success: function(data) {
407
 									if(data.state.toLowerCase() == 'success') {
253
 									if(data.state.toLowerCase() == 'success') {
408
-										 alert('2');
409
-										layer.msg("修改成功");
254
+										layer.msg("操作成功");
410
 									}
255
 									}
411
 								}
256
 								}
412
 							});
257
 							});
413
-						});
414
-					}
415
-				}else{
416
-					layer.msg('请选择要关联的坐席')
417
-				}
418
 			}
258
 			}
419
 		</script>
259
 		</script>
420
 
260