|
|
@ -395,42 +395,11 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (mode == 'edit') { |
|
|
|
//新增的盘点结果 |
|
|
|
// if (that.currentEditItem.id == '0') { |
|
|
|
// let a = detail.subList.find(that.currentEditItem); |
|
|
|
// let index = that.currentEditItem.index; |
|
|
|
// // detail.subList |
|
|
|
// detail.subList.splice(index, 1) |
|
|
|
|
|
|
|
// } else { |
|
|
|
// |
|
|
|
// that.currentEditItem.handleQty = 0; |
|
|
|
// that.currentEditItem.scaned = false; |
|
|
|
// that.currentEditItem = {}; |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (itemEditInfo == undefined) { |
|
|
|
//不在任务列表中,提示是否添加到列表 |
|
|
|
if (mode == 'edit') { |
|
|
|
that.currentEditItem.handleQty = 0; |
|
|
|
that.currentEditItem.handleQty = qty; |
|
|
|
that.currentEditItem.inventoryStatus = inventoryStatus; |
|
|
|
|
|
|
|
//新增的盘点结果 |
|
|
|
// if (that.currentEditItem.id == '0') { |
|
|
|
// let a = detail.subList.find(that.currentEditItem); |
|
|
|
// let index = that.currentEditItem.index; |
|
|
|
// // detail.subList |
|
|
|
// detail.subList.splice(index, 1) |
|
|
|
|
|
|
|
// } else { |
|
|
|
// |
|
|
|
// that.currentEditItem.handleQty = 0; |
|
|
|
// that.currentEditItem.scaned = false; |
|
|
|
// that.currentEditItem = {}; |
|
|
|
// } |
|
|
|
} else { |
|
|
|
that.addExistItemCodeToList(detail, qty, inventoryStatus); |
|
|
|
} |
|
|
@ -441,6 +410,13 @@ |
|
|
|
itemEditInfo.balanceQty = that.balance.qty; |
|
|
|
itemEditInfo.stdPackQty = that.package.stdPackQty; |
|
|
|
itemEditInfo.stdPackUnit = that.package.stdPackUnit; |
|
|
|
|
|
|
|
//编辑后的结果对应到其它明细,当前编辑结果为0 |
|
|
|
if (mode == 'edit') { |
|
|
|
itemEditInfo.scaned = false; |
|
|
|
that.currentEditItem.handleQty = 0; |
|
|
|
} |
|
|
|
|
|
|
|
// this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail |
|
|
|
// .subList); |
|
|
|
that.updateData() |
|
|
@ -457,74 +433,6 @@ |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
//盲盘 |
|
|
|
getUnOpenScanResult(result) { |
|
|
|
try { |
|
|
|
//盘点了没有库存余额的数据 |
|
|
|
if (result.balance.length == 0) { |
|
|
|
|
|
|
|
} |
|
|
|
let label = result.label; |
|
|
|
this.balance = result.balance[0]; |
|
|
|
|
|
|
|
var packingNumber = label.packingNumber; |
|
|
|
var batch = label.batch; |
|
|
|
var itemCode = label.itemCode; |
|
|
|
|
|
|
|
var balanceQty = this.balance.qty; |
|
|
|
var inventoryStatus = this.balance.inventoryStatus; |
|
|
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
var itemEditInfo; |
|
|
|
//检查物料号是否存在 |
|
|
|
if (detail == undefined) { |
|
|
|
//物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
|
this.addNewItemCodeToList() |
|
|
|
} else { |
|
|
|
//物料号存在,查询是否在任务列表中 |
|
|
|
itemEditInfo = detail.subList.find(item => { |
|
|
|
if (item.packingNumber == packingNumber && |
|
|
|
item.batch == batch && |
|
|
|
item.inventoryStatus == inventoryStatus) { |
|
|
|
return item; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (itemEditInfo == undefined) { |
|
|
|
//不在任务列表中,提示是否添加到列表 |
|
|
|
this.addExistItemCodeToList(detail); |
|
|
|
|
|
|
|
} else { |
|
|
|
//在列表中,更新已扫描状态, |
|
|
|
if (itemEditInfo.scaned) { |
|
|
|
this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber + |
|
|
|
"】已经完成盘点,是否要编辑数量", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.$refs.countQtyEdit.openEditPopup(itemEditInfo, |
|
|
|
detail.subList); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
itemEditInfo.scaned = true; |
|
|
|
itemEditInfo.handleQty = balanceQty; |
|
|
|
itemEditInfo.balanceQty = balanceQty; |
|
|
|
itemEditInfo.stdPackQty = result.package.stdPackQty; |
|
|
|
itemEditInfo.stdPackUnit = result.package.stdPackUnit; |
|
|
|
this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail |
|
|
|
.subList); |
|
|
|
this.updateData() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
addNewItemCodeToList() { |
|
|
|
this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
@ -540,15 +448,17 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
addExistItemCodeToList(detail, qty, inventoryStatus) { |
|
|
|
this.$refs.comMessage.showQuestionMessage("盘点明细不在列表中,是否添加到列表?", |
|
|
|
let that = this; |
|
|
|
that.scanPopupLoseFocus(); |
|
|
|
this.$refs.comMessage.showQuestionMessage("盘点结果不在明细列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
detail.qty = calc.add(qty, qty) |
|
|
|
let newDetail = this.createAddDetailInfo(qty, inventoryStatus); // |
|
|
|
let newDetail = that.createAddDetailInfo(qty, inventoryStatus); // |
|
|
|
detail.subList.push(newDetail); |
|
|
|
this.updateData() |
|
|
|
|
|
|
|
that.updateData() |
|
|
|
} |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|