|
@ -78,7 +78,7 @@ |
|
|
goHome, |
|
|
goHome, |
|
|
getCurrDateTime, |
|
|
getCurrDateTime, |
|
|
getPackingNumberAndBatch, |
|
|
getPackingNumberAndBatch, |
|
|
compareAsc, |
|
|
compareDesc, |
|
|
navigateBack, |
|
|
navigateBack, |
|
|
getSwitchInfoByCode |
|
|
getSwitchInfoByCode |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
@ -282,18 +282,19 @@ |
|
|
} else { |
|
|
} else { |
|
|
itemDetail.forEach(item => { |
|
|
itemDetail.forEach(item => { |
|
|
item.scaned = true; |
|
|
item.scaned = true; |
|
|
itemDetail.scaneDate = new Date(); |
|
|
itemDetail.scanDate = new Date(); |
|
|
item.handleQty = item.qty; |
|
|
item.handleQty = item.qty; |
|
|
item.toLocationCode = this.toLocationCode; |
|
|
item.toLocationCode = this.toLocationCode; |
|
|
}) |
|
|
}) |
|
|
this.detailSource[0].subList.sort(compareAsc('scaneDate')); //按扫描信息排序 |
|
|
|
|
|
calcHandleQty(this.detailSource); |
|
|
calcHandleQty(this.detailSource); |
|
|
|
|
|
this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序 |
|
|
this.continueScan() |
|
|
this.continueScan() |
|
|
this.$forceUpdate() |
|
|
this.$forceUpdate() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else if (result.label.labelType == "PurchaseLabel") { |
|
|
} else if (result.label.labelType == "PurchaseLabel") { |
|
|
var packingNumber = result.label.packingNumber; |
|
|
var packingNumber = result.package.number; |
|
|
|
|
|
var parentpackingNumber = result.package.parentNumber; |
|
|
var batch = result.label.batch; |
|
|
var batch = result.label.batch; |
|
|
var qty = result.label.qty; |
|
|
var qty = result.label.qty; |
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
@ -304,51 +305,35 @@ |
|
|
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == |
|
|
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == |
|
|
batch); |
|
|
batch); |
|
|
if (itemDetail == undefined) { |
|
|
if (itemDetail == undefined) { |
|
|
var isExit; |
|
|
itemDetail = detail.subList.find(r => r.packingNumber == parentpackingNumber && r.batch == |
|
|
let subItem; |
|
|
batch); |
|
|
let index = -1; |
|
|
|
|
|
for (subItem of detail.subList) { |
|
|
|
|
|
var item; |
|
|
|
|
|
for (var i = 0; i < subItem.packList.length; i++) { |
|
|
|
|
|
let pack = subItem.packList[i]; |
|
|
|
|
|
index = i; |
|
|
|
|
|
if (pack.packingNumber == packingNumber && |
|
|
|
|
|
pack.batch == batch) { |
|
|
|
|
|
item = pack; |
|
|
|
|
|
isExit = pack; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// for (let pack of subItem.packList) { |
|
|
|
|
|
// if (pack.packingNumber == packingNumber && |
|
|
|
|
|
// pack.batch == batch) { |
|
|
|
|
|
// item = pack; |
|
|
|
|
|
// isExit = pack; |
|
|
|
|
|
// break; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (item != undefined) { |
|
|
|
|
|
// subItem.scaned = true |
|
|
|
|
|
// subItem.handleQty = 0; |
|
|
|
|
|
// item = undefined |
|
|
|
|
|
// } |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isExit == undefined) { |
|
|
if (itemDetail == undefined) { |
|
|
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") |
|
|
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") |
|
|
} else { |
|
|
} else { |
|
|
if (isExit.scaned) { |
|
|
var pack = itemDetail.packList.find(p => p.packingNumber == packingNumber && |
|
|
|
|
|
p.batch == batch) |
|
|
|
|
|
if (pack == undefined) { |
|
|
|
|
|
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") |
|
|
|
|
|
} else { |
|
|
|
|
|
if (pack.scaned) { |
|
|
|
|
|
pack.scanDate = new Date(); |
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描"); |
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描"); |
|
|
} else { |
|
|
} else { |
|
|
isExit.scaned = true |
|
|
pack.scaned = true |
|
|
isExit.handleQty = Number(result.label.qty); |
|
|
pack.scanDate = new Date(); |
|
|
isExit.toLocationCode = this.toLocationCode; |
|
|
pack.handleQty = Number(result.label.qty); |
|
|
isExit.labelQty = Number(result.label.qty); |
|
|
pack.toLocationCode = this.toLocationCode; |
|
|
|
|
|
pack.labelQty = Number(result.label.qty); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
calcTreeHandleQty(this.detailSource); |
|
|
calcTreeHandleQty(this.detailSource); |
|
|
|
|
|
itemDetail.packList.sort(compareDesc('scanDate')); //按扫描信息排序 |
|
|
this.$forceUpdate() |
|
|
this.$forceUpdate() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
|
|
|
//扫描的是外包装,将包装集合全部扫描 |
|
|
var scanedLength = 0; |
|
|
var scanedLength = 0; |
|
|
itemDetail.packList.forEach(res => { |
|
|
itemDetail.packList.forEach(res => { |
|
|
if (res.scaned) { |
|
|
if (res.scaned) { |
|
@ -357,23 +342,23 @@ |
|
|
}) |
|
|
}) |
|
|
if (itemDetail.scaned && scanedLength == itemDetail |
|
|
if (itemDetail.scaned && scanedLength == itemDetail |
|
|
.packList.length) { |
|
|
.packList.length) { |
|
|
|
|
|
isExit.scanDate = new Date(); |
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描") |
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描") |
|
|
} else { |
|
|
} else { |
|
|
itemDetail.scaned = true; |
|
|
itemDetail.scaned = true; |
|
|
itemDetail.scaneDate = new Date(); |
|
|
itemDetail.scanDate = new Date(); |
|
|
this.detailSource[0].subList.sort(compareAsc('scaneDate')); //按扫描信息排序 |
|
|
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
itemDetail.toLocationCode = this.toLocationCode; |
|
|
itemDetail.toLocationCode = this.toLocationCode; |
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
itemDetail.packList.forEach(pac => { |
|
|
itemDetail.packList.forEach(pac => { |
|
|
pac.scaned = true |
|
|
pac.scaned = true |
|
|
itemDetail.scaneDate = new Date(); |
|
|
pac.scanDate = new Date(); |
|
|
pac.handleQty = Number(pac.qty); |
|
|
pac.handleQty = Number(pac.qty); |
|
|
pac.toLocationCode = this.toLocationCode; |
|
|
pac.toLocationCode = this.toLocationCode; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
calcTreeHandleQty(this.detailSource); |
|
|
calcTreeHandleQty(this.detailSource); |
|
|
var test = this.detailSource |
|
|
this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序 |
|
|
this.continueScan() |
|
|
this.continueScan() |
|
|
this.$forceUpdate() |
|
|
this.$forceUpdate() |
|
|
} |
|
|
} |
|
|