解决单据录入中批量换仓库的bug

This commit is contained in:
季圣华
2021-11-26 01:05:10 +08:00
parent f89d8f2a3f
commit 1c1229dfc7

View File

@@ -275,18 +275,24 @@ export const BillModalMixin = {
getMaterialByBarCode(param).then((res) => { getMaterialByBarCode(param).then((res) => {
if (res && res.code === 200) { if (res && res.code === 200) {
let mList = res.data let mList = res.data
if(mList && mList.length) {
//构造新的列表数组,用于存放单据明细信息 //构造新的列表数组,用于存放单据明细信息
let newDetailArr = [] let newDetailArr = []
if(mList && mList.length) {
for (let i = 0; i < detailArr.length; i++) { for (let i = 0; i < detailArr.length; i++) {
let item = detailArr[i] let item = detailArr[i]
item.depotId = depotId item.depotId = depotId
item.stock = mList[i].stock item.stock = mList[i].stock
newDetailArr.push(item) newDetailArr.push(item)
} }
this.materialTable.dataSource = newDetailArr } else {
for (let i = 0; i < detailArr.length; i++) {
let item = detailArr[i]
item.depotId = depotId
newDetailArr.push(item)
} }
} }
this.materialTable.dataSource = newDetailArr
}
}) })
}) })
}, },