From 9a50a7ea9688a1e777f98713560e9c599d5064ae Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 08 三月 2023 18:01:34 +0800
Subject: [PATCH] 省市区三级联动修改

---
 management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js b/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js
index df2ae54..c2e71ce 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js
@@ -189,13 +189,17 @@
  * 打开区域选择页面新增
  */
 TBranchOffice.areaAdd = function () {
+
+    var area = $("#area").val();
+    var areaId = $("#areaId").val();
+
     var index = layer.open({
         type: 2,
         title: '区域选择',
         area: ['1000px', '270px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/tBranchOffice/areaPageAdd'
+        content: Feng.ctxPath + '/tBranchOffice/areaPageAdd?area='+area+'&areaId='+areaId
     });
     this.layerIndex = index;
 }
@@ -287,7 +291,10 @@
 
             var city = document.getElementById('city');
             var cityIndex= city.selectedIndex ;
-            var id = city.options[cityIndex].value;
+            var id = city.options[cityIndex].id;
+            if(id == ""){
+                id = city.options[cityIndex].value;
+            }
             var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/areaCity?parentId="+id, function (data) {
                 for(var i=0,n=data.length;i<n;i++){//对区数据进行遍历,动态生成
                     $("#district").append('<option value="'+data[i].id+'">'+data[i].name+'</option>');
@@ -352,7 +359,6 @@
         parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName)
         parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId)
     }
-    console.log()
     TBranchOfficeInfoDlg.close();
 }
 

--
Gitblit v1.7.1