Bladeren bron

fix: 提货新增选择自动获取相同单的数据

zh 2 jaren geleden
bovenliggende
commit
e4925b2856
1 gewijzigde bestanden met toevoegingen van 36 en 36 verwijderingen
  1. 36 36
      src/views/supply/pickup/components/pickup_form.vue

+ 36 - 36
src/views/supply/pickup/components/pickup_form.vue

@@ -136,7 +136,7 @@
           </template>
           <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="备注" prop="remark">
-              <el-input  v-model="mainForm.remark" placeholder="请输入备注" :disabled="flag"></el-input>
+              <el-input v-model="mainForm.remark" placeholder="请输入备注" :disabled="flag"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -419,7 +419,7 @@ import {
 } from '@/api/supply/pickup'
 import { getDictList } from '@/api/common'
 import { mapGetters } from 'vuex'
-  
+
 export default {
   name: 'PickupForm',
   componentName: 'PickupForm',
@@ -547,39 +547,40 @@ export default {
       this.deliverList.forEach(item => {
         if (item.invoiceId === row.invoiceId) {
           this.$set(item, 'warehouseFlag', e)
-        }
-      })
-      if (e == 0) {
-        if (!(row.orderType === 'TRADE' || row.orderType === 'HOME')) {
-          if (row.receivingName && row.phone && row.address) {
-            row.copyReceivingName = row.receivingName
-            row.copyPhone = row.phone
-            row.copyAddress = row.address
-            row.receivingName = ''
-            row.phone = ''
-            row.address = ''
+          if (e == 0) {
+            if (!(item.orderType === 'TRADE' || item.orderType === 'HOME')) {
+              if (item.receivingName && item.phone && item.address) {
+                item.copyReceivingName = item.receivingName
+                item.copyPhone = item.phone
+                item.copyAddress = item.address
+                item.receivingName = ''
+                item.phone = ''
+                item.address = ''
+              }
+            } else {
+              if (item.refLinkman && item.refPhone && item.refInstallAddress) {
+                item.copyRefLinkman = item.refLinkman
+                item.copyRefPhone = item.refPhone
+                item.copyRefInstallAddress = item.refInstallAddress
+                item.refLinkman = ''
+                item.refPhone = ''
+                item.refInstallAddress = ''
+              }
+            }
           }
-        } else {
-          if (row.refLinkman && row.refPhone && row.refInstallAddress) {
-            row.copyRefLinkman = row.refLinkman
-            row.copyRefPhone = row.refPhone
-            row.copyRefInstallAddress = row.refInstallAddress
-            row.refLinkman = ''
-            row.refPhone = ''
-            row.refInstallAddress = ''
+          if (e == 1) {
+            console.log(item.copyRefLinkman, item.refLinkman)
+            item.refLinkman = item.copyRefLinkman || item.copyReceivingName
+            item.refPhone = item.copyRefPhone || item.copyPhone
+            item.refInstallAddress = item.copyRefInstallAddress || item.copyAddress
+          }
+          if (e == 2) {
+            item.receivingName = item.copyReceivingName
+            item.phone = item.copyPhone
+            item.address = item.copyAddress
           }
         }
-      }
-      if (e == 1) {
-        row.refLinkman = row.copyRefLinkman
-        row.refPhone = row.copyRefPhone
-        row.refInstallAddress = row.copyRefInstallAddress
-      }
-      if (e == 2) {
-        row.receivingName = row.copyReceivingName
-        row.phone = row.copyPhone
-        row.address = row.copyAddress
-      }
+      })
     },
     handleInput(e, id, type) {
       console.log(e)
@@ -657,11 +658,11 @@ export default {
     // 获取提货方式列表
     getPickupWayList() {
       getDictList({ sysDictEnum: 'PICK' }).then(res => {
-        console.log(this.userInfo);
+        console.log(this.userInfo)
         this.frontPickType = this.userInfo.frontPickType
         this.isFront = this.userInfo.isFront
         this.isPick = this.userInfo.isPick
-          res.data.forEach(k => {
+        res.data.forEach(k => {
           if (this.frontPickType) {
             if (!this.isFront && k.dictCode == 2) {
               k.disabled = true
@@ -753,8 +754,7 @@ export default {
         if (!k.warehouseFlag) {
           this.$set(k, 'warehouseFlag', null)
           if (this.mainForm.pickupWay == 2 && this.logisticsNumber === '001') {
-                      // 注释默认不选择仓库
-
+            // 注释默认不选择仓库
             // if (k.refLinkman || k.refPhone || k.refInstallAddress) {
             //   this.$set(k, 'warehouseFlag', 1)
             // } else {