|
|
@ -79,10 +79,11 @@ |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getDataSource, |
|
|
|
getTreeDataSource, |
|
|
|
createRecordInfo, |
|
|
|
calcHandleQty, |
|
|
|
getScanCount |
|
|
|
getScanCount, |
|
|
|
calcTreeHandleQty |
|
|
|
} from '@/common/detail.js'; |
|
|
|
|
|
|
|
|
|
|
@ -200,10 +201,9 @@ |
|
|
|
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes); |
|
|
|
// that.jobContent.toLocationTypeList = that.toLocationTypeList; |
|
|
|
that.subList = res.data.subList; |
|
|
|
that.subList[0].containerNumber = "CN-00000001"; |
|
|
|
that.jobStatus = res.data.status |
|
|
|
that.jobToLocationCode = that.subList[0].toLocationCode |
|
|
|
that.detailSource = getDataSource( that.subList) |
|
|
|
that.detailSource = getTreeDataSource(that.subList) |
|
|
|
console.log(JSON.stringify(this.detailSource)) |
|
|
|
} else { |
|
|
|
that.showMessage('列表数据为0'); |
|
|
@ -219,7 +219,6 @@ |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
try { |
|
|
|
|
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
@ -254,12 +253,51 @@ |
|
|
|
if (detail == undefined) { |
|
|
|
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
//物料在列表中 |
|
|
|
|
|
|
|
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == |
|
|
|
batch); |
|
|
|
if (itemDetail == undefined) { |
|
|
|
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") |
|
|
|
var isExit; |
|
|
|
for (let subItem of detail.subList) { |
|
|
|
var item; |
|
|
|
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) { |
|
|
|
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") |
|
|
|
} else { |
|
|
|
if (isExit.scaned) { |
|
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描") |
|
|
|
} else { |
|
|
|
isExit.scaned = true |
|
|
|
isExit.handleQty = Number(result.label.qty); |
|
|
|
isExit.toLocationCode = this.toLocationCode; |
|
|
|
isExit.labelQty = Number(result.label.qty); |
|
|
|
} |
|
|
|
} |
|
|
|
calcTreeHandleQty(this.detailSource); |
|
|
|
this.$forceUpdate() |
|
|
|
} else { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
var scanedLength =0; |
|
|
|
itemDetail.packList.forEach(res=>{ |
|
|
|
if(res.scaned){ |
|
|
|
scanedLength++; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (itemDetail.scaned&&scanedLength==itemDetail.packList.length) { |
|
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描") |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
@ -267,7 +305,13 @@ |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.toLocationCode = this.toLocationCode; |
|
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
itemDetail.packList.forEach(pac => { |
|
|
|
pac.scaned = true |
|
|
|
pac.handleQty = Number(pac.qty); |
|
|
|
pac.toLocationCode = this.toLocationCode; |
|
|
|
}) |
|
|
|
|
|
|
|
calcTreeHandleQty(this.detailSource); |
|
|
|
this.continueScan() |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
@ -280,7 +324,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//继续扫描 |
|
|
|
continueScan() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|