Procházet zdrojové kódy

修改 页面反应迟钝问题

zhangshuangnan %!s(int64=7) %!d(string=před) roky
rodič
revize
619dd26060

+ 0 - 109
CallCenterWeb.UI/WorkOrder/Xga.html

@@ -339,115 +339,6 @@
339 339
 		<script src="../js/comboSelect/jquery.combo.select.js"></script>
340 340
 		<script src="../js/WorkOrder/xgWork.js"></script>
341 341
 		<script src="../js/WorkOrder/jquery.editable-select.js"></script>
342
-		<script>
343
-			function Select(obj) {
344
-				obj.click(function(event) {
345
-					event.preventDefault();
346
-				});
347
-				obj.focus(function() { //
348
-					//失去焦点后触发的事件
349
-					obj.parent().find('.testInput-list').show();
350
-					BindLDdep();
351
-				});
352
-				obj.blur(function() { //增加失去焦点事件
353
-					setTimeout(function() {
354
-						obj.parent().find('.testInput-list').hide();
355
-					}, 100)
356
-
357
-				});
358
-				obj.bind("input propertychange", function() {
359
-					var value = $(this).val();
360
-					obj.parent().find('.testInput-list').show();
361
-					BindLDdep(value)
362
-				});
363
-
364
-				function BindLDdep(str) {
365
-					$('.testInput-list').empty();
366
-					$.ajax({
367
-						type: "get",
368
-						url: huayi.config.callcenter_url + "Customer/BindLDdep",
369
-						dataType: 'json',
370
-						async: true,
371
-						data: {
372
-							keypara: str,
373
-							token: $.cookie("token")
374
-						},
375
-						success: function(data) {
376
-							var Count = data.data.dep;
377
-							console.log(Count);
378
-							var html = '';
379
-							$(Count).each(function(i, n) {
380
-								html = '<li value="' + n + '" id="td' + i + '">' + n + '</li>';
381
-								$(html).appendTo($('.testInput-list'));
382
-							});
383
-							$('.testInput-list>li').click(function() {
384
-								obj.val($(this).html());
385
-//								console.log($(this).html());
386
-								$('.testInput-list').hide();
387
-							})
388
-
389
-						}
390
-					});
391
-				};
392
-				//
393
-
394
-			}
395
-
396
-			//请求单位
397
-
398
-			$(document).ready(function() {
399
-				$('#testInput1').comboSelect();
400
-				$('#testInput2').comboSelect();
401
-				$('#testInput3').comboSelect();
402
-				$('#testInput4').comboSelect();
403
-//				$(document).click(function(e) {
404
-//					if(!$(e.target).is($('.testInput-list>li')) && !$(e.target).is($('#testInput1')) && !$(e.target).is($('#testInput2')) && !$(e.target).is($('#testInput3')) && !$(e.target).is($('#testInput4'))) {
405
-//						$('.testInput-list').hide();
406
-//					}
407
-//				})
408
-				BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4"));
409
-			})
410
-			
411
-			
412
-				function BindLDdep(obj1,obj2,obj3,obj4) {
413
-//					$('.testInput-list').empty();
414
-					$.ajax({
415
-						type: "get",
416
-						url: huayi.config.callcenter_url + "Customer/BindLDdep",
417
-						dataType: 'json',
418
-						async: false,
419
-						data: {
420
-//							keypara: str,
421
-							token: $.cookie("token")
422
-						},
423
-						success: function(data) {
424
-							var Count = data.data.dep;
425
-							var html = '';
426
-							$(Count).each(function(i, n) {
427
-								html = "<option value='" + n + "'>" + n + "</option>";
428
-								$(html).appendTo(obj1);
429
-								$(html).appendTo(obj2);
430
-								$(html).appendTo(obj3);
431
-								$(html).appendTo(obj4);
432
-//								$("<option value='" + n + "'>" + n + "</option>").appendTo(obj1)
433
-							});
434
-							obj1.comboSelect();
435
-							obj2.comboSelect();
436
-							obj3.comboSelect();
437
-							obj4.comboSelect();
438
-//							$('.testInput-list>li').click(function() {
439
-//								$('.testInput-list').show();
440
-//								obj.val($(this).html());
441
-//								$('.testInput-list').hide();
442
-//							})
443
-
444
-						}
445
-					});
446
-				};
447
-		
448
-			
449
-			
450
-		</script>
451 342
 	</body>
452 343
 
453 344
 </html>

+ 13 - 14
CallCenterWeb.UI/js/WorkOrder/AddWorkOrder.js

@@ -33,9 +33,11 @@ $(document).ready(function() {
33 33
 	getOrderType();
34 34
 	//工单状态
35 35
 	getOrderState();
36
-	//来电单位   
37
-//	getAccount('#comeCall_dep');
38
-//	getAccount('#feedbackDep');
36
+	//来电单位
37
+	$('#testInput1').comboSelect();
38
+	$('#testInput2').comboSelect();
39
+	$('#testInput3').comboSelect();
40
+	$('#testInput4').comboSelect();
39 41
 	//编辑器配置 客服部
40 42
 	KindEditor.ready(function(K) {
41 43
 		window.changeEditor = K.create('#feedBackCon'); //修改弹出框编辑器
@@ -51,7 +53,6 @@ $(document).ready(function() {
51 53
 	$('.marketSubmit').click(function() {
52 54
 		saveMarket();
53 55
 	})
54
-		BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4"));
55 56
 	if(id) {
56 57
 		$("#CallID").val(id);
57 58
 		$("#tel").val(phone);
@@ -60,14 +61,15 @@ $(document).ready(function() {
60 61
 			$("#name_market").val(unescape(decodeURI(name)));
61 62
 			$("#name").val(unescape(decodeURI(name)));
62 63
 		}
63
-		if(unescape(decodeURI(depName)) != 'null' && unescape(decodeURI(depName)) != 'undefined') {
64
+		BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4")).then(function(){
65
+			if(unescape(decodeURI(depName)) != 'null' && unescape(decodeURI(depName)) != 'undefined') {
64 66
 			$("#testInput1_input").val(unescape(decodeURI(depName)));
65 67
 			$("#testInput3_input").val(unescape(decodeURI(depName)));
66 68
 		}
67
-
69
+		});
68 70
 }
69
-
70 71
 })
72
+BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4"));
71 73
 //工单类型
72 74
 function getOrderType() {
73 75
 	$.get(huayi.config.callcenter_url + 'WorkType/GetTreeList', {
@@ -182,18 +184,13 @@ function getOrderSource(obj) {
182 184
 	});
183 185
 }
184 186
 
185
-//来电单位
186
-	$('#testInput1').comboSelect();
187
-	$('#testInput2').comboSelect();
188
-	$('#testInput3').comboSelect();
189
-	$('#testInput4').comboSelect();
190
-
191 187
 function BindLDdep(obj1,obj2,obj3,obj4) {
188
+					var deferred = $.Deferred()
192 189
 					$.ajax({
193 190
 						type: "get",
194 191
 						url: huayi.config.callcenter_url + "Customer/BindLDdep",
195 192
 						dataType: 'json',
196
-						async: false,
193
+						async: true,
197 194
 						data: {
198 195
 //							keypara: str,
199 196
 							token: $.cookie("token")
@@ -212,8 +209,10 @@ function BindLDdep(obj1,obj2,obj3,obj4) {
212 209
 							obj2.comboSelect();
213 210
 							obj3.comboSelect();
214 211
 							obj4.comboSelect();
212
+							deferred.resolve();
215 213
 						}
216 214
 					});
215
+					return deferred.promise(); 
217 216
 				};
218 217
 //客服部保存	
219 218
 function saveCustomer() {

+ 59 - 36
CallCenterWeb.UI/js/WorkOrder/xgWork.js

@@ -1,6 +1,5 @@
1 1
 var ns;
2 2
 var id = helper.request.queryString("id");
3
-console.log(id)
4 3
 var phone = helper.request.queryString("phone");
5 4
 var objs = {};
6 5
 $.ajax({
@@ -28,35 +27,35 @@ if(id) {
28 27
 	$("#tel_market").val(phone);
29 28
 	$("#CallID").val(id);
30 29
 }
31
-GDLY();
32
- State();
33
-	//工单类型
34
-	getOrderType();
35
-	//来电单位   
36
-//	getAccount('#comeCall_dep');
37
-	//          getAccount('#comeCall_dep_market');
38
-//	getAccount('#feedbackDep');
39
-	//          getAccount('#feedbackDep_market');
40
-	//保存
41
-	$('.customerSubmit').click(function() {
42
-		saveCustomer();
43
-	})
44
-	$('.marketSubmit').click(function() {
45
-		saveMarket();
30
+	$('#testInput1').comboSelect();
31
+	$('#testInput2').comboSelect();
32
+	$('#testInput3').comboSelect();
33
+	$('#testInput4').comboSelect();
34
+	$(function(){
35
+		GDLY(); //工单来源
36
+		State();//工单状态
37
+		getOrderType();//工单类型
38
+		//保存
39
+		$('.customerSubmit').click(function() {
40
+			saveCustomer();
41
+		});
42
+		$('.marketSubmit').click(function() {
43
+			saveMarket();
44
+		});
45
+		
46 46
 	})
47
-	//  	})
48
-		 	//编辑器配置
49
- KindEditor.ready(function(K) {
50
-                window.changeEditor = K.create('#feedBackCon');//修改弹出框编辑器
51
-                XQ()	
52
-        })
53 47
 		 	//编辑器配置
54
- KindEditor.ready(function(K) {
55
-                window.changeMarket = K.create('#remark_market');//修改弹出框编辑器
56
-                XQ()	
57
-        })
58
-	
59
-	
48
+	 KindEditor.ready(function(K) {
49
+	                window.changeEditor = K.create('#feedBackCon');//修改弹出框编辑器
50
+	        })
51
+			 	//编辑器配置
52
+	 KindEditor.ready(function(K) {
53
+	                window.changeMarket = K.create('#remark_market');//修改弹出框编辑器
54
+	                	
55
+	        })
56
+		BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4")).then(function(){
57
+			XQ();
58
+		})
60 59
 	
61 60
 //工单状态
62 61
  function State(){
@@ -71,7 +70,6 @@ GDLY();
71 70
 		dataType: "json",
72 71
 		success: function(res) {
73 72
 			if(res.state == "success") {
74
-				console.log(res.data);
75 73
 				$(res.data).each(function(i, n) {
76 74
 					$('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#State"));
77 75
 				})
@@ -135,9 +133,7 @@ $.ajax({
135 133
 			$("#testInput4_input").val(data.Source);
136 134
 			$("#typeclass").val(data.GDLXName);
137 135
 			$("#typeclass_market").val(data.GDLXName);
138
-//			$("#feedBackCon").text(decodeURIComponent(data.Detail));
139 136
 			changeEditor.html(data.Detail);			
140
-//			changeMarket.html(decodeURIComponent(data.Detail));			
141 137
 			changeMarket.html(data.Detail);			
142 138
 //			$("#remark_market").text(data.Detail);
143 139
 			$("#express").text(data.Files);
@@ -149,15 +145,12 @@ $.ajax({
149 145
 			} else {
150 146
 				state_ = 472;
151 147
 			}
152
-			console.log(state_)
153 148
 			$("#State").val(state_);
154 149
 			$("#States").val(data.State);
155 150
 			$("#DicValueList").val(data.Type);
156 151
 			$("#DicValueList_market").val(data.Type);
157
-			console.log(data.GDLYName)
158 152
 			$("#typeclassId").val(data.TypeClass);
159 153
 			$("#typeclassId_market").val(data.TypeClass);
160
-			
161 154
 		}
162 155
 		}
163 156
 	});
@@ -228,7 +221,6 @@ $('#typeclass_market').click(function() {
228 221
 $('.treeList_market').mouseleave(function() {
229 222
 	$(this).css('display', 'none')
230 223
 })
231
-
232 224
 //来电单位  
233 225
 function getAccount(obj) {
234 226
 	$.ajax({
@@ -337,7 +329,38 @@ function saveMarket() {
337 329
 	});
338 330
 
339 331
 }
340
-
332
+function BindLDdep(obj1,obj2,obj3,obj4) {
333
+					var deferred = $.Deferred()
334
+					$.ajax({
335
+						type: "get",
336
+						url: huayi.config.callcenter_url + "Customer/BindLDdep",
337
+						dataType: 'json',
338
+						async: true,
339
+						data: {
340
+//							keypara: str,
341
+							token: $.cookie("token")
342
+						},
343
+						success: function(data) {
344
+							var Count = data.data.dep;
345
+							var html = '';
346
+							$(Count).each(function(i, n) {
347
+								html = "<option value='" + n + "'>" + n + "</option>";
348
+								$(html).appendTo(obj1);
349
+								$(html).appendTo(obj2);
350
+								$(html).appendTo(obj3);
351
+								$(html).appendTo(obj4);
352
+							});
353
+							obj1.comboSelect();
354
+							obj2.comboSelect();
355
+							obj3.comboSelect();
356
+							obj4.comboSelect();
357
+							deferred.resolve();
358
+						}
359
+					});
360
+					
361
+						return deferred.promise(); 
362
+				};
363
+		
341 364
 function clear() {
342 365
 	if(ns == 1) {
343 366
 		$('#name').val('');