Просмотр исходного кода

IVR 关联坐席 绑定 解除

d123 лет назад: 8
Родитель
Сommit
a4530b6aa4
1 измененных файлов с 17 добавлено и 177 удалено
  1. 17 177
      CallCenterWeb.UI/TelCall/PhoneNumber.html

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

@@ -27,9 +27,6 @@
27 27
 			</div>
28 28
 			<div class="th-box">
29 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 30
 					<div class="seach-box fr">
34 31
 						<ul>
35 32
 							<li>关键字:<input class="photo x-color" type="text" id="KeyWords" /></li>
@@ -59,14 +56,12 @@
59 56
 					<table id="list" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
60 57
 						<thead>
61 58
 							<tr>
62
-								<th data-field="state" data-checkbox="true"></th>
63 59
 								<th data-field="F_MobileNum" data-formatter="CallId" data-align="center">编号</th>
64 60
 								<th data-field="tel" data-align="center">区号</th>
65 61
 								<th data-field="province" data-align="center">省份</th>
66 62
 								<th data-field="city" data-align="center">城市</th>
67 63
 								<th data-field="res" data-align="center" data-formatter="res">是否关联坐席</th>
68 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 65
 							</tr>
71 66
 						</thead>
72 67
 						<tbody id="tbody">
@@ -76,96 +71,12 @@
76 71
 			</div>
77 72
 		</div>
78 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 74
 			$(document).ready(function() {
106 75
 				zx();
107 76
 				/*搜索*/
108 77
 				$("#sc_btn").click(function() {
109 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 80
 				initTable();
170 81
 			})
171 82
 			//声明变量
@@ -175,7 +86,7 @@
175 86
 				if(row.res==0){
176 87
 					html='添加'
177 88
 				}else{
178
-					html='修改'
89
+					html='解绑'
179 90
 				}
180 91
 				return '<a onclick="Click(' + val + ',' + row.res + ',' + row.id + ')">'+html+'</a>'
181 92
 			}
@@ -204,7 +115,8 @@
204 115
 							page: params.pageNumber,
205 116
 							pagesize: params.pageSize,
206 117
 							userid: str,
207
-							token: $.cookie("token")
118
+							token: $.cookie("token"),
119
+							location:$("#KeyWords").val()
208 120
 						};
209 121
 						return param;
210 122
 					},
@@ -289,10 +201,6 @@
289 201
 				}
290 202
 				return html;
291 203
 			}
292
-			//删除
293
-//			function Move(val){
294
-//				return  '<a></a>'
295
-//			}
296 204
 			var table = $('#list_');
297 205
 			var str;
298 206
 			var Userid; //坐席id
@@ -306,61 +214,6 @@
306 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 218
 			function Click(val, str, id) {
366 219
 				console.log(id)
@@ -369,30 +222,23 @@
369 222
 						layer.confirm('要关联此坐席么?', {
370 223
 							btn: ['确定', '取消'] //按钮
371 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 228
 					}else{
392 229
 						layer.confirm('要解除关联此坐席么?', {
393 230
 							btn: ['确定', '取消'] //按钮
394 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 242
 								type: "get",
397 243
 								url: huayi.config.callcenter_url + "Mobiledata/AddMobileUsers",
398 244
 								dataType: 'json',
@@ -400,21 +246,15 @@
400 246
 								data: {
401 247
 									tellocid:val,
402 248
 									userid:Userid,
403
-									id:id,
249
+									type:type,
404 250
 									token: $.cookie("token")
405 251
 								},
406 252
 								success: function(data) {
407 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 259
 		</script>
420 260