|
|
@ -250,6 +250,13 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
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; |
|
|
@ -258,13 +265,12 @@ |
|
|
|
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.packingNumber == packingNumber && |
|
|
|
r.batch == batch && |
|
|
|
return r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
r.isRecommend==false |
|
|
|
}) |
|
|
@ -273,7 +279,7 @@ |
|
|
|
itemCode:itemCode, |
|
|
|
packingNumber:packingNumber, |
|
|
|
batch:batch, |
|
|
|
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty), |
|
|
|
handleQty:Number(result.label.qty), |
|
|
|
qty:detail.qty, |
|
|
|
fromLocationCode:locationCode, |
|
|
|
inventoryStatus:inventoryStatus, |
|
|
@ -290,8 +296,9 @@ |
|
|
|
this.calcHandleQty(); |
|
|
|
} else { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result |
|
|
|
.fromLocationCode + "】已经扫描") |
|
|
|
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); |
|
|
|
// this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result |
|
|
|
// .fromLocationCode + "】已经扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -299,7 +306,57 @@ |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
setData(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.packingNumber == packingNumber && |
|
|
|
r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
r.isRecommend==false |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
var newAdd = { |
|
|
|
itemCode:itemCode, |
|
|
|
packingNumber:packingNumber, |
|
|
|
batch:batch, |
|
|
|
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.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) { |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result |
|
|
|
.fromLocationCode + "】已经扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
var scanCount=0; |
|
|
|
this.detailSource.forEach((item) => { |
|
|
|