lilei před 11 měsíci
rodič
revize
a379a9dc19

+ 9 - 20
src/views/dealerManagement/merchantInfoManagement/detailModal.vue

@@ -111,7 +111,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: { // 单据id
       type: [Number, String],
       default: ''
     },
@@ -149,25 +149,14 @@ export default {
     // 详情编辑
     getDetail () {
       this.spinning = true
-      if (this.isAudit) {
-        dealerFindUpdateInfoBySn({ sn: this.itemId }).then(res => {
-          if (res.status == 200) {
-            this.form = res.data
-            this.spinning = false
-          } else {
-            this.spinning = false
-          }
-        })
-      } else {
-        dealerDetailBySn({ sn: this.itemId }).then(res => {
-          if (res.status == 200) {
-            this.form = res.data
-            this.spinning = false
-          } else {
-            this.spinning = false
-          }
-        })
-      }
+      // 根据是否审核状态选择不同的接口
+      const funs = this.isAudit ? dealerFindUpdateInfoBySn : dealerDetailBySn
+      funs({ sn: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.form = res.data
+        }
+        this.spinning = false
+      })
     }
   },
   watch: {

+ 11 - 10
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -615,7 +615,7 @@ export default {
     },
     // 返回
     handleBack () {
-      this.$router.push({ path: '/dealerManagement/merchantInfoManagement/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'merchantInfoManagementList' })
     },
     // 获取城市列表
     getCityList (val) {
@@ -643,7 +643,6 @@ export default {
     },
     // 区县变更
     areaCharged (val) {
-      console.log(val)
       if (val) {
         this.form.districtName = this.addrDistrictList.find(item => item.areaSn == val).name
       } else {
@@ -692,18 +691,20 @@ export default {
       }
       getArea(params).then(res => {
         if (res.status == 200) {
+          const areaData = JSON.parse(JSON.stringify(res.data || []))
+          // 省
           if (leve == 'province') {
-            this.addrProvinceList = JSON.parse(JSON.stringify(res.data || []))
-            this.addrProvinceList1 = JSON.parse(JSON.stringify(res.data || []))
-          } else if (leve == 'city') {
-            this.addrCityList = JSON.parse(JSON.stringify(res.data || []))
+            this.addrProvinceList = areaData
+            this.addrProvinceList1 = areaData
+          } else if (leve == 'city') { // 市
+            this.addrCityList = areaData
             if (index == 1) {
-              this.addrCityList1 = JSON.parse(JSON.stringify(res.data || []))
+              this.addrCityList1 = areaData
             }
-          } else if (leve == 'district') {
-            this.addrDistrictList = JSON.parse(JSON.stringify(res.data || []))
+          } else if (leve == 'district') { // 县
+            this.addrDistrictList = areaData
             if (index == 1) {
-              this.addrDistrictList1 = JSON.parse(JSON.stringify(res.data || []))
+              this.addrDistrictList1 = areaData
             }
           }
         } else {