chenrui 3 лет назад
Родитель
Сommit
81f6128d47

+ 15 - 1
src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue

@@ -44,7 +44,7 @@
       </a-form-model>
     </a-spin>
     <!-- 选择地址 -->
-    <choose-address-modal :openModal="openAddrModal" @ok="handleOk" @close="openAddrModal=false" />
+    <choose-address-modal :openModal="openAddrModal" @ok="handleOk" @verify="verifyFun" @close="openAddrModal=false" />
   </a-modal>
 </template>
 
@@ -96,6 +96,7 @@ export default {
       purchaseTragetType: [],
       addressVal: '选择地址', //  选择地址/更换地址
       chooseAddr: '', //  当前已选地址信息
+      addressId: undefined,
       openAddrModal: false // 选择地址弹框是否显示
     }
   },
@@ -198,10 +199,23 @@ export default {
         if (res.status == 200) {
           if (res.data.length == 1) {
             res.data[0].address = res.data[0].provinceName + '-' + res.data[0].cityName + '-' + res.data[0].countyName + '-' + res.data[0].addr
+            this.addressId = res.data[0].id || undefined
             this.handleOk(res.data[0])
           }
         }
       })
+    },
+    verifyFun (id) {
+      if (id == this.addressId) {
+        this.chooseAddr = ''
+        this.addressVal = '选择地址'
+        this.form.shippingAddressProvinceName = ''// 省
+        this.form.shippingAddressCityName = '' // 市
+        this.form.shippingAddressCountyName = '' // 区
+        this.form.shippingAddress = ''// 详细地址
+        this.form.consigneeTel = '' // 联系电话
+        this.form.consigneeName = ''
+      }
     }
   },
   watch: {

+ 1 - 0
src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue

@@ -174,6 +174,7 @@ export default {
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
+              _this.$emit('verify', row.id)
               _this.$refs.table.refresh(true)
               _this.spinning = false
             } else {