黄梓星 2 жил өмнө
parent
commit
29b9f686ca

+ 39 - 1
src/views/purchase/DemandSummary/add.vue

@@ -69,7 +69,13 @@
         <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" width="150"/>
         <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="150"/>
         <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="150"/>
-        <el-table-column show-overflow-tooltip label="收货货位" align="center" prop="deliveryAllocationName" width="150"/>
+        <el-table-column show-overflow-tooltip label="收货货位" align="center" prop="deliveryAllocationName" width="200">
+          <template slot-scope="scope">
+            <el-input clearable :disabled="lineDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clean(scope.row)" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '收货货位', scope.row.deliveryWarehouse)">
+              <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '收货货位', scope.row.deliveryWarehouse)"></el-button>
+            </el-input>
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150"/>
         <el-table-column show-overflow-tooltip label="制单人" align="center" prop="billMaker" width="150"/>
         <el-table-column show-overflow-tooltip label="审核人员" align="center" prop="approver" width="150"/>
@@ -114,13 +120,19 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
 </template>
 
 <script>
+import Refers from '@/components/Refers/refers.vue'
 import {getSummaryDetail, shutDownSummary, editSummaryMx, reloadBatch } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'checkDemandSummary',
+  components: {
+    Refers
+  },
   props: ['pageStu','row', 'disable'],
   model: {
     prop: 'isList',
@@ -160,6 +172,12 @@ export default {
       tableList: [],
       ids: [],
       lineDisable: true,
+      tableIndex: '',
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      }
     }
   },
   created() {
@@ -233,6 +251,26 @@ export default {
       })
       
     },
+    // 明细行选择货位
+    chooseMxHW(index, type, isPage, title, stordocId) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.title == '收货货位') {
+        this.tableList[this.tableIndex].deliveryAllocationName = selection[0].name
+        this.tableList[this.tableIndex].deliveryAllocation = selection[0].id
+      }
+    },
+    // 清空选中的货位
+    clean(row) {
+      row.deliveryAllocation = ''
+      row.deliveryAllocationName = ''
+    }
   }
 }
 </script>