|
@ -44,8 +44,7 @@ |
|
|
<view v-if="operation=='receipt'" class="uni-flex u-col-center space-between padding_10"> |
|
|
<view v-if="operation=='receipt'" class="uni-flex u-col-center space-between padding_10"> |
|
|
<view> |
|
|
<view> |
|
|
<locationCompare ref="locationCompare" title="收货库位" :recommendLocationCode="jobToLocationCode" |
|
|
<locationCompare ref="locationCompare" title="收货库位" :recommendLocationCode="jobToLocationCode" |
|
|
@getLocation='scanLocationCode' |
|
|
@getLocation='scanLocationCode' :locationAreaTypeList="toLocationAreaTypeList"> |
|
|
:locationAreaTypeList="toLocationAreaTypeList"> |
|
|
|
|
|
</locationCompare> |
|
|
</locationCompare> |
|
|
</view> |
|
|
</view> |
|
|
<view> |
|
|
<view> |
|
@ -79,7 +78,7 @@ |
|
|
goHome, |
|
|
goHome, |
|
|
getCurrDateTime, |
|
|
getCurrDateTime, |
|
|
getPackingNumberAndBatch, |
|
|
getPackingNumberAndBatch, |
|
|
compareAsc, |
|
|
compareDesc, |
|
|
navigateBack, |
|
|
navigateBack, |
|
|
getSwitchInfoByCode |
|
|
getSwitchInfoByCode |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
@ -265,7 +264,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); |
|
@ -284,17 +282,19 @@ |
|
|
} else { |
|
|
} else { |
|
|
itemDetail.forEach(item => { |
|
|
itemDetail.forEach(item => { |
|
|
item.scaned = true; |
|
|
item.scaned = true; |
|
|
|
|
|
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('scaned')); //按扫描信息排序 |
|
|
|
|
|
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); |
|
@ -305,39 +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 == |
|
|
for (let subItem of detail.subList) { |
|
|
batch); |
|
|
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) { |
|
|
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 && |
|
|
this.showMessage("箱码【" + packingNumber + "】已经扫描") |
|
|
p.batch == batch) |
|
|
|
|
|
if (pack == undefined) { |
|
|
|
|
|
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") |
|
|
|
|
|
} else { |
|
|
|
|
|
if (pack.scaned) { |
|
|
|
|
|
pack.scanDate = new Date(); |
|
|
|
|
|
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) { |
|
@ -346,21 +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; |
|
|
this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 |
|
|
itemDetail.scanDate = new Date(); |
|
|
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 |
|
|
|
|
|
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() |
|
|
} |
|
|
} |
|
|