zhoufan 7 yıl önce
ebeveyn
işleme
4def0a6d08
1 değiştirilmiş dosya ile 66 ekleme ve 66 silme
  1. 66 66
      WebUI/CallCenterWeb.UI/Script/Common/huayi.http.js

+ 66 - 66
WebUI/CallCenterWeb.UI/Script/Common/huayi.http.js

@@ -387,72 +387,72 @@ helper.sys = {
387 387
 };
388 388
 
389 389
 helper.getDropList = {
390
-	//根据id 获取 区县,主干道、乡镇,路社区村
391
-	getAreas(obj, aid) {
392
-		var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
393
-		obj.empty();
394
-		$.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
395
-			id: aid,
396
-			token: $.cookie("token"),
397
-		}, function(data) {
398
-			if(data.state.toLowerCase() == "success") {
399
-				var content = data.data;
400
-				if(content && content.length > 0) {
401
-					obj.append('<option selected="selected" value="0">请选择</option>');
402
-					$(content).each(function(i, n) {
403
-						$("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
404
-					});
405
-				}else{
406
-					obj.append('<option selected="selected" value="0">没有数据</option>');
407
-				}
408
-				dtd.resolve(); // 改变Deferred对象的执行状态
409
-			}
410
-		});
411
-		return dtd.promise(); // 返回promise对象
412
-	},
413
-
414
-	//区县,主干道、乡镇,路社区村三级联动(目前在来电弹屏中使用)
415
-	getLocations(obj, obj1, obj2) {
416
-		var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
417
-		helper.getDropList.getAreas(obj, 0).then(function() {
418
-			//主干道、乡镇
419
-			obj.change(function() {
420
-				if(obj.find("option:selected").val() != 0) {
421
-					helper.getDropList.getAreas(obj1, obj.find("option:selected").val());
422
-				} else {
423
-					obj1.empty();
424
-					obj1.append('<option selected="selected" value="0">请选择</option>');
425
-					$('#sourceaddress').val('');
426
-				}
427
-				obj1.trigger('change');
428
-			});
429
-
430
-			//路社区村
431
-			obj1.change(function() {
432
-				if(obj1.find("option:selected").val() != 0) {
433
-					helper.getDropList.getAreas(obj2, obj1.find("option:selected").val());
434
-					$('#sourceaddress').val(obj1.find("option:selected").text());
435
-				} else if(obj.find("option:selected").val() != 0){
436
-					obj2.empty();
437
-					obj2.append('<option selected="selected" value="0">请选择</option>');
438
-					$('#sourceaddress').val('');
439
-				}
440
-				obj2.trigger('change');
441
-			});
442
-
443
-			obj2.change(function() {
444
-				if(obj2.find("option:selected").val() != 0) {
445
-					$('#sourceaddress').val(obj1.find("option:selected").text() + obj2.find("option:selected").text());
446
-				} else if(obj1.find("option:selected").val() != 0){
447
-					$('#sourceaddress').val(obj1.find("option:selected").text());
448
-				}
449
-				dtd.resolve(); // 改变Deferred对象的执行状态
450
-			});
451
-
452
-		});
453
-
454
-		return dtd.promise(); // 返回promise对象
455
-	},
390
+    //根据id 获取 区县,主干道、乡镇,路社区村
391
+    getAreas: function (obj, aid) {
392
+        var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
393
+        obj.empty();
394
+        $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
395
+            id: aid,
396
+            token: $.cookie("token"),
397
+        }, function (data) {
398
+            if (data.state.toLowerCase() == "success") {
399
+                var content = data.data;
400
+                if (content && content.length > 0) {
401
+                    obj.append('<option selected="selected" value="0">请选择</option>');
402
+                    $(content).each(function (i, n) {
403
+                        $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
404
+                    });
405
+                } else {
406
+                    obj.append('<option selected="selected" value="0">没有数据</option>');
407
+                }
408
+                dtd.resolve(); // 改变Deferred对象的执行状态
409
+            }
410
+        });
411
+        return dtd.promise(); // 返回promise对象
412
+    },
413
+
414
+    //区县,主干道、乡镇,路社区村三级联动(目前在来电弹屏中使用)
415
+    getLocations: function (obj, obj1, obj2) {
416
+        var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
417
+        helper.getDropList.getAreas(obj, 0).then(function () {
418
+            //主干道、乡镇
419
+            obj.change(function () {
420
+                if (obj.find("option:selected").val() != 0) {
421
+                    helper.getDropList.getAreas(obj1, obj.find("option:selected").val());
422
+                } else {
423
+                    obj1.empty();
424
+                    obj1.append('<option selected="selected" value="0">请选择</option>');
425
+                    $('#sourceaddress').val('');
426
+                }
427
+                obj1.trigger('change');
428
+            });
429
+
430
+            //路社区村
431
+            obj1.change(function () {
432
+                if (obj1.find("option:selected").val() != 0) {
433
+                    helper.getDropList.getAreas(obj2, obj1.find("option:selected").val());
434
+                    $('#sourceaddress').val(obj1.find("option:selected").text());
435
+                } else if (obj.find("option:selected").val() != 0) {
436
+                    obj2.empty();
437
+                    obj2.append('<option selected="selected" value="0">请选择</option>');
438
+                    $('#sourceaddress').val('');
439
+                }
440
+                obj2.trigger('change');
441
+            });
442
+
443
+            obj2.change(function () {
444
+                if (obj2.find("option:selected").val() != 0) {
445
+                    $('#sourceaddress').val(obj1.find("option:selected").text() + obj2.find("option:selected").text());
446
+                } else if (obj1.find("option:selected").val() != 0) {
447
+                    $('#sourceaddress').val(obj1.find("option:selected").text());
448
+                }
449
+                dtd.resolve(); // 改变Deferred对象的执行状态
450
+            });
451
+
452
+        });
453
+
454
+        return dtd.promise(); // 返回promise对象
455
+    }
456 456
 }
457 457
 
458 458
 helper.DateFormat = {