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