收货入库
This commit is contained in:
@@ -103,7 +103,6 @@
|
||||
bagCode: '',
|
||||
num: null,
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -149,11 +148,18 @@
|
||||
async _getPalletAssemblyOK () {
|
||||
try {
|
||||
let res = await getPalletAssemblyOK(this.bagCode)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
if (res) {
|
||||
const existingItem = this.dataList.find(item => item.bag_code === res.data.bag_code)
|
||||
if (!existingItem) {
|
||||
this.dataList.push(res.data)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '袋码已存在,不能重复插入',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
|
||||
Reference in New Issue
Block a user