Browse Source

bug修复 省市区更换为与ocs传参一致

chenrui 4 years ago
parent
commit
4689766546

+ 16 - 16
src/views/customerManagement/customerInfo/edit.vue

@@ -46,21 +46,21 @@
                 <a-col span="8">
                   <a-form-model-item prop="provinceSn">
                     <a-select id="customerManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
+                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="8">
                   <a-form-model-item prop="citySn">
                     <a-select id="customerManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                      <a-select-option v-for="item in addrCityList" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
+                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="8">
                   <a-form-model-item prop="countySn">
                     <a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                      <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
+                      <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
@@ -253,7 +253,7 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.sn == val)
+      const index = this.addrProvinceList.findIndex(item => item.id == val)
       if (index >= 0) {
         this.form.provinceName = this.addrProvinceList[index].name
       }
@@ -266,7 +266,7 @@ export default {
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.sn == val)
+      const index = this.addrCityList.findIndex(item => item.id == val)
       if (index >= 0) {
         this.form.cityName = this.addrCityList[index].name
       }
@@ -277,35 +277,35 @@ export default {
     },
     // 区县变更
     areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.sn == val)
+      const index = this.addrDistrictList.findIndex(item => item.id == val)
       if (index >= 0) {
         this.form.countyName = this.addrDistrictList[index].name
       }
       this.form.customerAddr = ''
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }

+ 10 - 10
src/views/customerManagement/customerInfo/list.vue

@@ -302,28 +302,28 @@ export default {
       this.getArea('district', val)
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }

+ 20 - 20
src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue

@@ -38,21 +38,21 @@
           <a-col span="8">
             <a-form-model-item prop="provinceSn">
               <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                <a-select-option v-for="item in addrProvinceList" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
+                <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
           <a-col span="8">
             <a-form-model-item prop="citySn">
               <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                <a-select-option v-for="item in addrCityList" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
+                <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
           <a-col span="8">
             <a-form-model-item prop="countySn">
               <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
+                <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
@@ -156,43 +156,43 @@ export default {
       this.addrDistrictList = []
       this.form.citySn = undefined
       this.form.countySn = undefined
-      this.form.provinceName = this.addrProvinceList.find(item => item.sn == val).name
+      this.form.provinceName = this.addrProvinceList.find(item => item.id == val).name
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
       this.form.countySn = undefined
-      this.form.cityName = this.addrCityList.find(item => item.sn == val).name
+      this.form.cityName = this.addrCityList.find(item => item.id == val).name
       this.getArea('district', val)
     },
     // 区县变更
     areaCharged (val) {
-      this.form.countyName = this.addrDistrictList.find(item => item.sn == val).name
+      this.form.countyName = this.addrDistrictList.find(item => item.id == val).name
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }
@@ -201,14 +201,14 @@ export default {
     // 编辑数据
     setData (data) {
       this.isEdit = true
-      Promise.all([getArea({ level: '1' }), getArea({ psn: data.provinceSn }), getArea({ psn: data.citySn })]).then(res => {
+      Promise.all([getArea({ type: '2' }), getArea({ parentId: data.provinceSn, type: '3' }), getArea({ parentId: data.citySn, type: '4' })]).then(res => {
         console.log(res)
         this.addrProvinceList = res[0].data
-        this.form.provinceName = this.addrProvinceList.find(item => item.sn == data.provinceSn).name
+        this.form.provinceName = this.addrProvinceList.find(item => item.id == data.provinceSn).name
         this.addrCityList = res[1].data
-        this.form.cityName = this.addrCityList.find(item => item.sn == data.citySn).name
+        this.form.cityName = this.addrCityList.find(item => item.id == data.citySn).name
         this.addrDistrictList = res[2].data
-        this.form.countyName = this.addrDistrictList.find(item => item.sn == data.countySn).name
+        this.form.countyName = this.addrDistrictList.find(item => item.id == data.countySn).name
         this.form = Object.assign({}, this.form, data)
       })
     }

+ 10 - 14
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -486,7 +486,6 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      console.log(val, '-------------')
       this.addrCityList = []
       this.addrDistrictList = []
       this.form.shippingAddressCitySn = undefined
@@ -512,28 +511,28 @@ export default {
       this.form.shippingAddressCountyName = this.addrDistrictList.find(item => item.id == val).name
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }
@@ -566,6 +565,3 @@ export default {
   }
 }
 </script>
-
-<style>
-</style>

+ 10 - 11
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -358,7 +358,6 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      console.log(val, '-------------')
       this.addrCityList = []
       this.addrDistrictList = []
       this.form.citySn = undefined
@@ -384,28 +383,28 @@ export default {
       this.form.countyName = this.addrDistrictList.find(item => item.id == val).name
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }

+ 16 - 16
src/views/supplierManagement/supplierInfo/editModal.vue

@@ -33,21 +33,21 @@
             <a-col span="8">
               <a-form-model-item prop="provinceSn">
                 <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
+                  <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col span="8">
               <a-form-model-item prop="citySn">
                 <a-select id="supplierInfoEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                  <a-select-option v-for="item in addrCityList" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
+                  <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col span="8">
               <a-form-model-item prop="countySn">
                 <a-select id="supplierInfoEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                  <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
+                  <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
@@ -222,7 +222,7 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.sn == val)
+      const index = this.addrProvinceList.findIndex(item => item.id == val)
       if (index >= 0) {
         this.form.provinceName = this.addrProvinceList[index].name
       }
@@ -235,7 +235,7 @@ export default {
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.sn == val)
+      const index = this.addrCityList.findIndex(item => item.id == val)
       if (index >= 0) {
         this.form.cityName = this.addrCityList[index].name
       }
@@ -246,35 +246,35 @@ export default {
     },
     // 区县变更
     areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.sn == val)
+      const index = this.addrDistrictList.findIndex(item => item.id == val)
       if (index >= 0) {
         this.form.countyName = this.addrDistrictList[index].name
       }
       this.form.supplierAddress = ''
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }