Sfoglia il codice sorgente

限定家贤才要选择仓库

zhouhao 2 anni fa
parent
commit
a96fe8cdbc
1 ha cambiato i file con 48 aggiunte e 45 eliminazioni
  1. 48 45
      src/views/supply/pickup/components/pickup_form.vue

+ 48 - 45
src/views/supply/pickup/components/pickup_form.vue

@@ -111,8 +111,8 @@
           <template v-if="logisticsNumber === '001' && mainForm.pickupWay == 2">
             <el-table-column align="left" label="仓库" prop="invoiceId" min-width="160" show-overflow-tooltip>
               <template v-slot="{ row }">
-                <el-select v-model="row.warehouseFlag" value-key="" placeholder="" :disabled="flag" clearable filterable size="mini"
-                  @change="storeChange($event, row)">
+                <el-select v-model="row.warehouseFlag" value-key="" placeholder="" :disabled="flag" clearable filterable
+                  size="mini" @change="storeChange($event, row)">
                   <el-option v-for="item in storeList" :key="item.value" :label="item.label" :value="item.value">
                   </el-option>
                 </el-select>
@@ -120,35 +120,35 @@
             </el-table-column>
             <el-table-column align="left" label="收货客户" prop="orderTime" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-input v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')" :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
+                <el-input v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')"
+                  :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
                   v-model="scope.row.receivingName" size="mini"
                   @input="handleInput($event, scope.row.invoiceId, 1)"></el-input>
                 <template v-else>
-                  <el-input
-                    :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
+                  <el-input :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
                     v-model="scope.row.refLinkman" size="mini"></el-input>
                 </template>
               </template>
             </el-table-column>
             <el-table-column align="left" label="电话" prop="orderTime" min-width="150" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-input v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')" :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
+                <el-input v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')"
+                  :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
                   v-model="scope.row.phone" size="mini" @input="handleInput($event, scope.row.invoiceId, 2)"></el-input>
                 <template v-else>
-                  <el-input
-                    :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
+                  <el-input :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
                     v-model="scope.row.refPhone" size="mini"></el-input>
                 </template>
               </template>
             </el-table-column>
             <el-table-column align="left" label="收货地址" prop="orderTime" min-width="200" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-input v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')" :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
+                <el-input v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')"
+                  :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
                   v-model="scope.row.address" size="mini"
                   @input="handleInput($event, scope.row.invoiceId, 3)"></el-input>
                 <template v-else>
-                  <el-input
-                    :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
+                  <el-input :disabled="flag || ((scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null))"
                     v-model="scope.row.refInstallAddress" size="mini"></el-input>
                 </template>
               </template>
@@ -342,7 +342,7 @@ export default {
       console.log(e, row);
       this.deliverList.forEach(item => {
         if (item.invoiceId === row.invoiceId) {
-          this.$set(item,'warehouseFlag',e)
+          this.$set(item, 'warehouseFlag', e)
         }
       })
       if (e == 0) {
@@ -415,34 +415,34 @@ export default {
           const item = this.companyList.find(k => k.id === data.logisticsId)
           this.logisticsNumber = item.logisticsNumber
         }
-        data.invoicePickBeans.forEach(k=>{
+        data.invoicePickBeans.forEach(k => {
           if (k.warehouseFlag == 0) {
-        if (!(k.orderType === 'TRADE' || k.orderType === 'HOME')) {
-          if ((k.receivingName && k.phone && k.address)) {
-            k.copyReceivingName = k.receivingName
-            k.copyPhone = k.phone
-            k.copyAddress = k.address
-            k.receivingName = ''
-            k.phone = ''
-            k.address = ''
-          }
-        } else {
-          if ((k.refLinkman && k.refPhone && k.refInstallAddress)) {
-            k.copyRefLinkman = k.refLinkman
-            k.copyRefPhone = k.refPhone
-            k.copyRefInstallAddress = k.refInstallAddress
-            k.refLinkman = ''
-            k.refPhone = ''
-            k.refInstallAddress = ''
-          }
+            if (!(k.orderType === 'TRADE' || k.orderType === 'HOME')) {
+              if ((k.receivingName && k.phone && k.address)) {
+                k.copyReceivingName = k.receivingName
+                k.copyPhone = k.phone
+                k.copyAddress = k.address
+                k.receivingName = ''
+                k.phone = ''
+                k.address = ''
+              }
+            } else {
+              if ((k.refLinkman && k.refPhone && k.refInstallAddress)) {
+                k.copyRefLinkman = k.refLinkman
+                k.copyRefPhone = k.refPhone
+                k.copyRefInstallAddress = k.refInstallAddress
+                k.refLinkman = ''
+                k.refPhone = ''
+                k.refInstallAddress = ''
+              }
 
-        }
+            }
 
-      }
+          }
         })
         this.deliverList = data.invoicePickBeans
 
-   
+
       })
     },
 
@@ -548,7 +548,7 @@ export default {
       getDeliverList({ correspondId: this.mainForm.warehouse }).then(res => {
         this.deliverList = res.data
         this.deliverList.forEach(k => {
-          this.$set(k,'warehouseFlag',null)
+          this.$set(k, 'warehouseFlag', null)
           if (k.refLinkman || k.refPhone || k.refInstallAddress) {
             this.$set(k, 'warehouseFlag', 1)
           }
@@ -578,7 +578,14 @@ export default {
           if (this.tableSelection.length < 1) {
             return this.$errorMsg('请选择发货申请单')
           }
-
+          if (this.mainForm.pickupWay == 2 && this.logisticsNumber === '001') {
+            for (let i = 0; i < this.tableSelection.length; i++) {
+              if (this.tableSelection[i].warehouseFlag == null) {
+                this.$errorMsg('仓库必选')
+                return
+              }
+            }
+          }
           for (let i = 0; i < this.tableSelection.length; i++) {
             if (this.tableSelection[i].warehouseFlag == 2) {
               let el = this.tableSelection[i]
@@ -634,16 +641,12 @@ export default {
       // let correspondName = this.warehouseList.find(o => o.id == this.mainForm.warehouse).name;
 
       let orderList = []
-      for (let i = 0; i <this.tableSelection.length; i++) {
-          if (this.tableSelection[i].warehouseFlag == null || this.tableSelection[i].warehouseFlag == '') {
-            this.$errorMsg('仓库必选')
-            return
-          }        
-      }
+
+
       this.tableSelection.forEach(item => {
-       
+
         if (!(item.orderType === 'TRADE' || item.orderType === 'HOME')) {
-       
+
         } else {
           if ((item.refLinkman && item.refPhone && item.refInstallAddress)) {
             item.receivingName = item.refLinkman
@@ -653,7 +656,7 @@ export default {
 
         }
         orderList.push({
-          warehouseFlag:item.warehouseFlag,
+          warehouseFlag: item.warehouseFlag,
           address: item.address,
           id: this.listItem ? item.id : '',
           invoiceOrderId: item.invoiceOrderId,