出库物资规格

master
lion 2 months ago
parent 5532c345e0
commit f40f96a5ea

@ -298,7 +298,7 @@ export default {
zaikushuliang: parseFloat(item.zaikushuliang) - parseFloat(item.wait_num) || 0, //
wuzileixing: item.wuzileixing,
guigexinghao: item.guigexinghao,
wuziguige: item.wuziguige,
wuziguige: item.wuzibianma_material_infos_wuzibianma_relation.wuziguige||item.wuziguige,
jiliangdanwei: item.jiliangdanwei,
shengchanriqi:item.shengchanriqi,
wuzibianma_material_infos_wuzibianma_relation: item.wuzibianma_material_infos_wuzibianma_relation,

@ -261,6 +261,20 @@
/>
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />物资规格
</div>
<div class="xy-table-item-content">
<el-input
v-model="mingxiObj.wuziguige"
type="text"
placeholder="请选择物资规格"
disabled
style="width: 300px;"
/>
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />物资类型
@ -504,6 +518,10 @@ export default {
label: '物资型号',
prop: 'guigexinghao',
width: 180
},{
label: '物资规格',
prop: 'wuziguige',
width: 180
}, {
label: '物资类型',
prop: 'wuzileixing',
@ -584,7 +602,7 @@ export default {
this.$refs['dialog'].reset()
}
},
//
isShowMingxi(newVal) {
if (!newVal) {
@ -766,6 +784,7 @@ export default {
jiliangdanwei : this.mingxiObj.jiliangdanwei,
inventorys_id : item,
guigexinghao : this.mingxiObj.guigexinghao,
wuziguige:this.mingxiObj.wuziguige,
shengchanriqi : this.mingxiObj.shengchanriqi,
jieyongshuliang: 1,
shifouhuiku: this.mingxiObj.shifouhuiku,
@ -783,10 +802,10 @@ export default {
}else{
this.mingxiList.push(this.mingxiObj)
}
//
this.mergeOneCodeItems()
//
this.clearMingxiFormData()
this.isShowMingxi = false
@ -814,12 +833,12 @@ export default {
type: 'success',
message: '删除成功'
})
//
if (row.isMerged && row.originalItems) {
row.originalItems.forEach(originalItem => {
const originalIndex = this.mingxiList.findIndex(item =>
item.wuzibianma === originalItem.wuzibianma &&
const originalIndex = this.mingxiList.findIndex(item =>
item.wuzibianma === originalItem.wuzibianma &&
item.inventorys_id === originalItem.inventorys_id
)
if (originalIndex !== -1) {
@ -830,7 +849,7 @@ export default {
//
this.mingxiList.splice(index, 1)
}
//
this.mergeOneCodeItems()
}
@ -839,16 +858,16 @@ export default {
openMingxiModal() {
//
console.log('打开明细弹窗,保持现有数据状态')
//
this.isShowMingxi = true
},
//
clearMingxiData() {
console.log('开始清除明细弹窗数据...')
console.log('清除前 mergedDisplayList:', this.mergedDisplayList)
//
this.mingxiObj = {
wuzibianma: '',
@ -858,24 +877,24 @@ export default {
otherMetadata: [],
indexList: []
}
//
this.mergedDisplayList = []
//
if (this.$refs.inventorysSelect) {
this.$refs.inventorysSelect.selectItem = {}
this.$refs.inventorysSelect.wuziPageIndex = 1
}
console.log('清除后 mergedDisplayList:', this.mergedDisplayList)
console.log('明细弹窗数据已清除完成')
},
//
clearMingxiFormData() {
console.log('开始清除明细表单数据...')
//
this.mingxiObj = {
wuzibianma: '',
@ -885,24 +904,24 @@ export default {
otherMetadata: [],
indexList: []
}
//
if (this.$refs.inventorysSelect) {
this.$refs.inventorysSelect.selectItem = {}
this.$refs.inventorysSelect.wuziPageIndex = 1
}
console.log('明细表单数据已清除完成')
},
//
clearAllMingxiData() {
console.log('开始清空所有明细相关数据...')
//
this.mingxiList = []
this.mergedDisplayList = []
//
this.mingxiObj = {
wuzibianma: '',
@ -912,16 +931,16 @@ export default {
otherMetadata: [],
indexList: []
}
//
if (this.$refs.inventorysSelect) {
this.$refs.inventorysSelect.selectItem = {}
this.$refs.inventorysSelect.wuziPageIndex = 1
}
console.log('所有明细相关数据已清空完成')
},
showWuzi() {
this.$refs.inventorysSelect.isShowWuzi = true
},
@ -936,8 +955,10 @@ export default {
console.log("- zaikushuliang (在库数量):", e.zaikushuliang)
console.log("- jiliangdanwei (计量单位):", e.jiliangdanwei)
console.log("- guigexinghao (规格型号):", e.guigexinghao)
console.log("- wuziguige (物资规格):", e.wuziguige)
console.log("- shengchanriqi (生产日期):", e.shengchanriqi)
console.log("- 其他字段:", Object.keys(e).filter(key => !['wuzibianma', 'zichanmingcheng', 'wuzileixing', 'rukupici', 'zaikushuliang', 'jiliangdanwei', 'guigexinghao', 'shengchanriqi', 'id'].includes(key)))
console.log("- 其他字段:", Object.keys(e).filter(key => !['wuzibianma', 'zichanmingcheng', 'wuzileixing', 'rukupici', 'zaikushuliang', 'jiliangdanwei', 'guigexinghao','wuziguige','shengchanriqi', 'id'].includes(key)))
//
if(e.wuzileixing==='一物一码'){
@ -956,6 +977,7 @@ export default {
this.mingxiObj.jiliangdanwei = e.jiliangdanwei
this.mingxiObj.inventorys_id = e.id
this.mingxiObj.guigexinghao = e.guigexinghao
this.mingxiObj.wuziguige = e.wuziguige
this.mingxiObj.shengchanriqi = e.shengchanriqi
console.log("this.mingxiObj",this.mingxiObj)
@ -971,11 +993,11 @@ export default {
}
})
}
// mingxiObj
// mingxiList
console.log('物资选择完成,等待确认提交')
this.$forceUpdate()
},
//
@ -1129,19 +1151,19 @@ export default {
this.$emit('refresh')
})
},
//
mergeOneCodeItems() {
//
const mergedDisplayList = []
const mergedMap = new Map()
//
this.mingxiList.forEach(item => {
if (item.wuzileixing === '一物一码') {
// 使key
const key = item.wuzibianma
if (mergedMap.has(key)) {
//
const existingItem = mergedMap.get(key)
@ -1167,34 +1189,34 @@ export default {
})
}
})
//
this.mergedDisplayList = mergedDisplayList
console.log('合并后的显示列表:', this.mergedDisplayList)
console.log('原始明细列表:', this.mingxiList)
},
//
updateMergedDisplayList() {
console.log('开始更新合并显示列表...')
console.log('当前 mingxiObj:', this.mingxiObj)
console.log('当前 mingxiList:', this.mingxiList)
// mingxiObj
if (!this.mingxiObj || !this.mingxiObj.wuzibianma) {
console.log('mingxiObj 为空,跳过更新')
return
}
//
const tempList = [...this.mingxiList]
//
const existingIndex = tempList.findIndex(item =>
const existingIndex = tempList.findIndex(item =>
item.inventorys_id === this.mingxiObj.inventorys_id
)
if (existingIndex === -1) {
//
tempList.push({
@ -1210,16 +1232,16 @@ export default {
}
console.log('已更新已有的物资')
}
//
const mergedDisplayList = []
const mergedMap = new Map()
tempList.forEach(item => {
if (item.wuzileixing === '一物一码') {
// 使key
const key = item.wuzibianma
if (mergedMap.has(key)) {
//
const existingItem = mergedMap.get(key)
@ -1245,29 +1267,29 @@ export default {
})
}
})
//
this.mergedDisplayList = mergedDisplayList
console.log('更新后的合并显示列表:', this.mergedDisplayList)
console.log('临时列表:', tempList)
},
//
getDisplayList() {
//
if (!this.mingxiObj || !this.mingxiObj.wuzibianma) {
return this.mergedDisplayList.length > 0 ? this.mergedDisplayList : this.mingxiList
}
//
const tempList = [...this.mingxiList]
//
const existingIndex = tempList.findIndex(item =>
const existingIndex = tempList.findIndex(item =>
item.inventorys_id === this.mingxiObj.inventorys_id
)
if (existingIndex === -1) {
//
tempList.push({
@ -1281,16 +1303,16 @@ export default {
jieyongshuliang: this.mingxiObj.jieyongshuliang || 1
}
}
//
const mergedDisplayList = []
const mergedMap = new Map()
tempList.forEach(item => {
if (item.wuzileixing === '一物一码') {
// 使key
const key = item.wuzibianma
if (mergedMap.has(key)) {
//
const existingItem = mergedMap.get(key)
@ -1316,7 +1338,7 @@ export default {
})
}
})
return mergedDisplayList
}

@ -17,8 +17,9 @@
<!-- <td>批次</td> -->
<td>批内序号</td>
<td>数量</td>
<td>规格</td>
<td>型号</td>
<td>物资型号</td>
<td>物资规格</td>
<td v-if="isChange"></td>
</tr>
<tr v-for="item in mingxiList">
@ -33,8 +34,9 @@
</td>
<td>{{ item.wuzileixing==='一物一码'?item.inventorys.length:item.jieyongshuliang }}</td>
<td>{{ item.wuziguige }}</td>
<td>{{ item.guigexinghao }}</td>
<td>{{ item.wuziguige }}</td>
<td v-if="isChange">
<el-button @click="changeWz(item)" size="small" type="primary">更改出库序号</el-button>
</td>

@ -97,6 +97,10 @@
label: '物资型号',
prop: 'guigexinghao',
width: 180
},{
label: '物资规格',
prop: 'wuziguige',
width: 180
}, {
label: '物资类型',
prop: 'wuzileixing',

Loading…
Cancel
Save