|
@ -250,6 +250,63 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
|
|
|
if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){ |
|
|
|
|
|
this.setDataBatch(result) |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.setData(result) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
setDataBatch(result){ |
|
|
|
|
|
try { |
|
|
|
|
|
var packingNumber = result.balance.packingNumber; |
|
|
|
|
|
var batch = result.balance.batch; |
|
|
|
|
|
var qty = result.balance.qty; |
|
|
|
|
|
var itemCode = result.balance.itemCode; |
|
|
|
|
|
var locationCode = result.balance.locationCode; |
|
|
|
|
|
var inventoryStatus = result.balance.inventoryStatus; |
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
|
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
|
|
} else { |
|
|
|
|
|
var itemDetail = detail.subList.find(r => { |
|
|
|
|
|
return r.batch == batch && |
|
|
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
|
|
r.isRecommend==false |
|
|
|
|
|
}) |
|
|
|
|
|
if (itemDetail == undefined) { |
|
|
|
|
|
var newAdd = { |
|
|
|
|
|
itemCode:itemCode, |
|
|
|
|
|
packingNumber:packingNumber, |
|
|
|
|
|
batch:batch, |
|
|
|
|
|
handleQty:Number(result.label.qty), |
|
|
|
|
|
qty:detail.qty, |
|
|
|
|
|
fromLocationCode:locationCode, |
|
|
|
|
|
inventoryStatus:inventoryStatus, |
|
|
|
|
|
toInventoryStatus:inventoryStatus, |
|
|
|
|
|
balance:result.balance, |
|
|
|
|
|
isRecommend:false, |
|
|
|
|
|
isNewAdd:"newAdd" |
|
|
|
|
|
} |
|
|
|
|
|
newAdd.balance.balanceQty = Number(result.balance.qty); |
|
|
|
|
|
newAdd.balance.packQty = Number(result.package.packQty) |
|
|
|
|
|
newAdd.balance.packUnit = result.package.packUnit |
|
|
|
|
|
newAdd.scaned = true; |
|
|
|
|
|
detail.subList.push(newAdd) |
|
|
|
|
|
this.calcHandleQty(); |
|
|
|
|
|
} else { |
|
|
|
|
|
if (itemDetail.scaned) { |
|
|
|
|
|
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); |
|
|
|
|
|
// this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result |
|
|
|
|
|
// .fromLocationCode + "】已经扫描") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
this.showMessage(e.message) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
setData(result){ |
|
|
try { |
|
|
try { |
|
|
var packingNumber = result.balance.packingNumber; |
|
|
var packingNumber = result.balance.packingNumber; |
|
|
var batch = result.balance.batch; |
|
|
var batch = result.balance.batch; |
|
|