浏览代码

【新增】销售政策计划单

howie 2 年之前
父节点
当前提交
3982dcfcd9
共有 1 个文件被更改,包括 29 次插入3 次删除
  1. 29 3
      src/views/supply/policy/components/retail_form.vue

+ 29 - 3
src/views/supply/policy/components/retail_form.vue

@@ -79,7 +79,14 @@
     <div class="main-title">
       <div class="title">货品信息</div>
       <div>
-        <el-select v-model="warehouseValue" placeholder="请选择发货仓库" size="small" style="margin-right: 10px">
+        <el-select
+          v-model="warehouseValue"
+          placeholder="请选择发货仓库"
+          :disabled="!goodsList.length"
+          size="small"
+          style="margin-right: 10px"
+          @change="handleWarehouseValue"
+        >
           <el-option v-for="(item, index) in warehouseList" :key="index" :label="item.name" :value="item.id" />
         </el-select>
         <el-button type="primary" size="small" icon="el-icon-search" @click="checkStock">检查库存</el-button>
@@ -267,6 +274,7 @@
         <!--            <div>{{ scope.row.status1 | status1Filter }}</div>-->
         <!--          </template>-->
         <!--        </el-table-column>-->
+        <el-table-column align="left" label="仓库" prop="correspondName" min-width="150" show-overflow-tooltip />
         <el-table-column
           v-if="!listItem"
           align="left"
@@ -747,7 +755,9 @@ export default {
       type: 1,
       newMultipleSelections: [],
       remark: '',
-      commercialType: false
+      commercialType: false,
+      correspondName: '',
+      correspondId: ''
     }
   },
 
@@ -912,6 +922,18 @@ export default {
     goBack() {
       this.$emit('backListFormDetail')
     },
+    handleWarehouseValue(e) {
+      if (!this.goodsList.length) return
+      this.correspondName = this.warehouseList.find(k => {
+        return k.id === e
+      }).name
+      this.correspondId = e
+      this.goodsList.forEach(k => {
+        this.$set(k, 'correspondName', this.correspondName)
+        this.$set(k, 'correspondId', this.correspondId)
+      })
+      console.log(this.goodsList)
+    },
 
     handleWallets(e, row, index) {
       if (e) {
@@ -1382,6 +1404,8 @@ export default {
           this.mainForm.policyId = data.policyId
           this.mainForm.isPlanOrder = data.isPlanOrder
           this.commercialType = data.commercialType
+          this.correspondId = data.correspondId
+          this.correspondName = data.correspondName
           this.policyId = data.policyId
           this.mainForm.k3ServiceName = data.k3ServiceName
           ;(this.mainForm.k3ServiceId = data.k3ServiceId), (this.mainForm.fileNum = data.fileNum)
@@ -1783,7 +1807,7 @@ export default {
             }
           })
           if (hasCustomerWalletId) return
-          if (this.commercialType && this.mainForm.isPlanOrder && !this.warehouseValue) {
+          if (this.commercialType && !this.mainForm.isPlanOrder && !this.correspondId) {
             this.$errorMsg(`仓库必选`)
             return
           }
@@ -1793,6 +1817,8 @@ export default {
             k3ServiceName: this.mainForm.k3ServiceName,
             isPlanOrder: this.mainForm.isPlanOrder,
             commercialType: this.commercialType,
+            correspondName: this.correspondName,
+            correspondId: this.correspondId,
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,