소스 검색

bug 修复

lilei 2 년 전
부모
커밋
c1eb79349c

+ 10 - 1
src/views/salesReturnManagement/billOfLading/add.vue

@@ -35,6 +35,7 @@
               <a-form-model-item label="物流公司">
                 <logisticsCompany
                   id="billOfLadingEdit-logisticsCompany"
+                  ref="logisticsCompany"
                   @change="ltcChange"
                   v-model="form.logisticsCompany"
                 />
@@ -44,6 +45,7 @@
               <a-form-model-item label="物流点">
                 <logisticsPoint
                   ref="logisticsPoint"
+                  :defLoad="false"
                   id="billOfLadingEdit-logisticsPoint"
                   v-model.trim="form.logisticsPoint"
                   allowClear />
@@ -265,8 +267,10 @@ export default {
     ltcChange (v, row) {
       if (row) {
         this.$refs.logisticsPoint.getList(row.logisticsPointList)
-        this.form.logisticsPoint = undefined
+      } else {
+        this.$refs.logisticsPoint.clearData()
       }
+      this.form.logisticsPoint = undefined
     },
     // 关联销售退货单
     getReturnOrderList () {
@@ -293,6 +297,11 @@ export default {
           if (this.form.senderSn) {
             this.$refs.dealerSubareaScopeList.getDetail(this.form.senderSn)
           }
+          // 物流点
+          if (this.form.logisticsPoint) {
+            const point = this.$refs.logisticsCompany.getPoint(this.form.logisticsCompany)
+            this.$refs.logisticsPoint.getList(point)
+          }
         } else {
           this.$refs.ruleForm.resetFields()
         }

+ 4 - 0
src/views/salesReturnManagement/billOfLading/logisticsCompany.js

@@ -64,6 +64,10 @@ const LogisticsCompany = {
         }
       })
     },
+    getPoint(v){
+      const row = this.list.find(item => item.logisticsCompany == v)
+      return row ? row.logisticsPointList : []
+    }
   },
 };
 

+ 10 - 1
src/views/salesReturnManagement/billOfLading/logisticsPoint.js

@@ -28,6 +28,10 @@ const LogisticsPoint = {
       type: String,
       default: '请选择物流点'
     },
+    defLoad:{
+      type: Boolean,
+      default: true
+    }
   },
   data() {
     return {
@@ -36,7 +40,9 @@ const LogisticsPoint = {
     };
   },
   mounted() {
-    this.getList()
+    if(this.defLoad){
+      this.getList()
+    }
   },
   watch: {
     value(newValue, oldValue) {
@@ -67,6 +73,9 @@ const LogisticsPoint = {
         this.list = data
       }
     },
+    clearData(){
+      this.list = []
+    }
   },
 };