|
|
@ -253,8 +253,10 @@ |
|
|
|
getScanResult(result) { |
|
|
|
console.log(result.label) |
|
|
|
this.labelInfo = result.label |
|
|
|
if(this.managementType == 'BY_BATCH' ||this.managementType == "BY_QUANTITY" ){ |
|
|
|
if(this.managementType == 'BY_BATCH' ){ |
|
|
|
this.getScanResultAfterBatch(result) |
|
|
|
}else if (this.managementType == "BY_QUANTITY"){ |
|
|
|
this.getScanResultAfterQuantity(result) |
|
|
|
}else{ |
|
|
|
this.getScanResultAfter(result) |
|
|
|
} |
|
|
@ -447,6 +449,105 @@ |
|
|
|
this.showErrorMessage(e.message); |
|
|
|
} |
|
|
|
}, |
|
|
|
getScanResultAfterQuantity(result){ |
|
|
|
try { |
|
|
|
var packingNumber = result.label.packingNumber; |
|
|
|
var batch = result.label.batch; |
|
|
|
var qty = result.label.qty; |
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
var itemDetail = undefined; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
detail.scaned = true |
|
|
|
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); |
|
|
|
//箱码、批次、库位、状态 都相等 |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return |
|
|
|
r.fromLocationCode == result.fromLocationCode && |
|
|
|
r.inventoryStatus == result.balance.inventoryStatus |
|
|
|
|
|
|
|
}) |
|
|
|
if (itemDetail) { |
|
|
|
// 箱码、批次、库位、状态一致 |
|
|
|
if (itemDetail.scaned) { |
|
|
|
// this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result |
|
|
|
// .fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描") |
|
|
|
itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.label.qty)); |
|
|
|
itemDetail.balanceQty = Number(result.label.qty); |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.balanceQty = Number(result.label.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.inventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = Number(result.balance.qty); |
|
|
|
itemDetail.balance.packQty = Number(result.package.packQty) |
|
|
|
itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
} |
|
|
|
this.calcHandleQty(); |
|
|
|
} else { |
|
|
|
//箱码、批次、库位相等 |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return r.fromLocationCode == result.fromLocationCode |
|
|
|
}) |
|
|
|
|
|
|
|
if (itemDetail) { |
|
|
|
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); |
|
|
|
//箱码、批次、库位相等,状态不相等 |
|
|
|
if(balanceStatus!=itemStatus){ |
|
|
|
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { |
|
|
|
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|
|
|
']不一致,是否继续回收?', res => { |
|
|
|
if (res) { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.inventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
itemDetail.balance.packQty = result.package.packQty |
|
|
|
itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
this.calcHandleQty(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + |
|
|
|
itemStatus + |
|
|
|
']不一致,不允许回收!', res => { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}); |
|
|
|
} |
|
|
|
//箱码、批次、库位相等,状态相等 |
|
|
|
}else{ |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.inventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
itemDetail.balance.packQty = result.package.packQty |
|
|
|
itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
this.calcHandleQty(); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result |
|
|
|
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中") |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message); |
|
|
|
} |
|
|
|
}, |
|
|
|
commit() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
if (this.scanCount == 0) { |
|
|
|