fix:移库推荐库位

This commit is contained in:
zhengxuming
2025-08-20 10:26:22 +08:00
parent 952f87e295
commit 8bb61fdb73
5 changed files with 70 additions and 30 deletions

View File

@@ -69,8 +69,8 @@
>
<el-option
v-for="item in dict.ST_INV_TYPE_MV"
:disabled="item.value === '21' || item.value === '31'"
:key="item.value"
:disabled="item.value === '21' || item.value === '31'"
:label="item.label"
:value="item.value"
/>
@@ -136,8 +136,8 @@
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
v-if="form.bill_type !== '30'"
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
@@ -157,18 +157,19 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column v-if="crud.status.add!==1" prop="work_status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('work_status',crud.data,'状态')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('qty',crud.data,'重量')" />
<el-table-column prop="qty_unit_name" label="单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
<el-table-column prop="turnout_sect_name" label="移出库区" :min-width="flexWidth('turnout_sect_name',crud.data,'移出库区')" />
<el-table-column prop="turnout_struct_code" label="移出货位" :min-width="flexWidth('turnout_struct_code',crud.data,'移出货位')" />
<el-table-column prop="turnin_sect_name" label="入库区" :min-width="flexWidth('turnin_sect_name',crud.data,'移入库区')" />
<el-table-column prop="turnin_struct_code" label="移入货位" :min-width="flexWidth('turnin_struct_code',crud.data,'移入货位')" align="center">
<!-- key的作用只是让列按照对应顺序排列没有其他作用-->
<el-table-column key="1" type="index" label="序号" width="50" align="center" />
<el-table-column v-if="crud.status.add!==1" key="2" prop="work_status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('work_status',crud.data,'状态')" />
<el-table-column key="3" prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column key="4" prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column key="5" prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
<el-table-column key="6" prop="qty" label="重量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('qty',crud.data,'重量')" />
<el-table-column key="7" prop="qty_unit_name" label="单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
<el-table-column key="8" prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
<el-table-column key="9" prop="turnout_sect_name" label="移出库区" :min-width="flexWidth('turnout_sect_name',crud.data,'移出库区')" />
<el-table-column key="10" prop="turnout_struct_code" label="出货位" :min-width="flexWidth('turnout_struct_code',crud.data,'移出货位')" />
<el-table-column key="11" prop="turnin_sect_name" label="移入库区" :min-width="flexWidth('turnin_sect_name',crud.data,'移入库区')" />
<el-table-column key="12" prop="turnin_struct_code" label="移入货位" :min-width="flexWidth('turnin_struct_code',crud.data,'移入货位')" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.turnin_struct_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryStruct(scope.$index, scope.row)" />
@@ -338,28 +339,30 @@ export default {
tableChanged(rows) {
const tablemap = new Map()
rows.forEach((item) => {
console.log(item)
if (this.form.tableData.length !== 0) {
this.flagnow = false
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].stockrecord_id === item.stockrecord_id) {
if (this.form.tableData[i].storagevehicle_code === item.storagevehicle_code) {
this.flagnow = true
}
}
if (!this.flagnow) {
this.$set(item, 'edit', false)
this.$set(item, 'work_status', '10')
this.$set(item, 'turnin_sect_code', '')
this.$set(item, 'turnin_struct_code', '')
tablemap.set(item.stockrecord_id, item)
/* this.$set(item, 'turnin_sect_code', '')
this.$set(item, 'turnin_struct_code', '') */
tablemap.set(item.storagevehicle_code, item)
}
} else {
this.$set(item, 'edit', false)
this.$set(item, 'work_status', '10')
this.$set(item, 'turnin_sect_code', '')
this.$set(item, 'turnin_struct_code', '')
tablemap.set(item.stockrecord_id, item)
/* this.$set(item, 'turnin_sect_code', '')
this.$set(item, 'turnin_struct_code', '') */
tablemap.set(item.storagevehicle_code, item)
}
})
console.log(tablemap)
for (const value of tablemap.values()) {
this.form.tableData.push(value)
}