|
|
@ -260,7 +260,8 @@ |
|
|
|
item.handleQty = 0; |
|
|
|
for (let detail of item.subList) { |
|
|
|
if (detail != undefined && detail.scaned) { |
|
|
|
item.handleQty = calc.add(item.handleQty, detail.qty) |
|
|
|
item.handleQty = calc.add(Number(item.handleQty), Number(detail.handleQty)); |
|
|
|
// item.handleQty = item.handleQty + detail.handleQty; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -321,9 +322,10 @@ |
|
|
|
let that = this; |
|
|
|
that.package = result.package; |
|
|
|
that.label = result.label; |
|
|
|
|
|
|
|
//盘点了没有库存余额的数据,直接编辑盘点数量和盘点状态 |
|
|
|
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode); |
|
|
|
if (item == undefined) { |
|
|
|
that.scanByBalance(result); |
|
|
|
} else { |
|
|
|
let subItem = item.subList.find(item => { |
|
|
|
if (item.packingNumber == that.label.packingNumber && |
|
|
|
item.batch == that.label.batch) { |
|
|
@ -343,6 +345,16 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
that.scanByBalance(result); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
scanByBalance(result) { |
|
|
|
let that = this; |
|
|
|
if (result.balance.length == 0) { |
|
|
|
that.scanPopupLoseFocus() |
|
|
|
that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode + |
|
|
@ -352,7 +364,7 @@ |
|
|
|
that.editInventoryStatus = true; |
|
|
|
let item = that.package; |
|
|
|
item.packingNumber = that.label.packingNumber; |
|
|
|
item.qty = Number(that.label.qty); |
|
|
|
item.qty = 0 |
|
|
|
item.handleQty = Number(that.label.qty); |
|
|
|
item.balanceQty = 0; |
|
|
|
item.inventoryStatus = "OK"; |
|
|
@ -366,16 +378,14 @@ |
|
|
|
}) |
|
|
|
} else if (result.balance.length == 1) { |
|
|
|
that.balance = result.balance[0]; |
|
|
|
that.balance.qty = 0 |
|
|
|
that.balance.handleQty = Number(that.label.qty); |
|
|
|
that.balance.balanceQty = that.balance.qty; |
|
|
|
that.balance.stdPackQty = that.package.stdPackQty; |
|
|
|
that.balance.stdPackUnit = that.package.stdPackUnit; |
|
|
|
that.$refs.countQtyEdit.openEditPopupShowSeconds(that.balance, |
|
|
|
null); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
editConfirm(qty, inventoryStatus, mode) { |
|
|
@ -385,7 +395,7 @@ |
|
|
|
//检查物料号是否存在 |
|
|
|
if (detail == undefined) { |
|
|
|
//物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
|
that.addNewItemCodeToList() |
|
|
|
that.addNewItemCodeToList(qty, inventoryStatus) |
|
|
|
} else { |
|
|
|
var itemEditInfo = detail.subList.find(item => { |
|
|
|
if (item.packingNumber == that.package.number && |
|
|
@ -433,18 +443,19 @@ |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
addNewItemCodeToList() { |
|
|
|
addNewItemCodeToList(qty, inventoryStatus) { |
|
|
|
this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
var item = this.createAddItemInfo(this.balance, this.package); |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, this.package); // |
|
|
|
let newDetail = this.createAddDetailInfo(qty, inventoryStatus); // |
|
|
|
item.subList.push(newDetail); |
|
|
|
this.detailSource.push(item) |
|
|
|
this.showMessage('添加成功'); |
|
|
|
this.updateData() |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
addExistItemCodeToList(detail, qty, inventoryStatus) { |
|
|
@ -453,9 +464,10 @@ |
|
|
|
this.$refs.comMessage.showQuestionMessage("盘点结果不在明细列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
detail.qty = calc.add(qty, qty) |
|
|
|
// detail.qty = calc.add(qty, qty) |
|
|
|
let newDetail = that.createAddDetailInfo(qty, inventoryStatus); // |
|
|
|
detail.subList.push(newDetail); |
|
|
|
this.showMessage('添加成功'); |
|
|
|
that.updateData() |
|
|
|
} |
|
|
|
that.scanPopupGetFocus(); |
|
|
@ -468,14 +480,16 @@ |
|
|
|
itemName: this.package.itemName, |
|
|
|
stdPackQty: this.package.stdPackQty, |
|
|
|
stdPackUnit: this.package.stdPackUnit, |
|
|
|
qty: Number(qty), |
|
|
|
// qty: Number(qty), |
|
|
|
qty: 0, |
|
|
|
handleQty: 0, |
|
|
|
uom: pack.uom, |
|
|
|
uom: this.package.uom, |
|
|
|
subList: [], |
|
|
|
} |
|
|
|
return item; |
|
|
|
}, |
|
|
|
|
|
|
|
//创建盘盈的明细 |
|
|
|
createAddDetailInfo(qty, inventoryStatus) { |
|
|
|
var detail = { |
|
|
|
id: "0", //新增的明细 |
|
|
|