|
|
@ -34,7 +34,7 @@ |
|
|
|
<!-- 管理精度是批次 --> |
|
|
|
<comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' |
|
|
|
v-if="managementType == 'BY_BATCH'"> |
|
|
|
v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY'"> |
|
|
|
</comReceiptDetailCardBacth> |
|
|
|
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" |
|
|
|
@updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else> |
|
|
@ -317,8 +317,11 @@ |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
this.balanceInfo = result.balance |
|
|
|
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY' ){ |
|
|
|
console.log(this.managementType) |
|
|
|
if(this.managementType == 'BY_BATCH'){ |
|
|
|
this.getScanResultAfterBatch(result) |
|
|
|
}else if(this.managementType == 'BY_QUANTITY' ){ |
|
|
|
this.getScanResultAfterQuantity(result) |
|
|
|
}else{ |
|
|
|
this.getScanResultAfter(result) |
|
|
|
} |
|
|
@ -559,6 +562,138 @@ |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 数量扫码之后逻辑 |
|
|
|
getScanResultAfterQuantity(result){ |
|
|
|
try { |
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
return; |
|
|
|
} |
|
|
|
detail.scaned = true; |
|
|
|
if (result.label.labelType == "ContainerLabel") { |
|
|
|
var containerNumber = result.label.container; |
|
|
|
var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber); |
|
|
|
if (itemDetail.length == 0) { |
|
|
|
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中") |
|
|
|
} else { |
|
|
|
if (itemDetail[0].scaned) { |
|
|
|
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描") |
|
|
|
} else { |
|
|
|
itemDetail.forEach(item => { |
|
|
|
item.scaned = true; |
|
|
|
itemDetail.scanDate = new Date(); |
|
|
|
item.handleQty = calc.add(item.handleQty,result.label.qty) |
|
|
|
item.toLocationCode = this.toLocationCode; |
|
|
|
}) |
|
|
|
// calcHandleQty(this.detailSource); |
|
|
|
this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序 |
|
|
|
this.continueScan() |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (result.label.labelType == "PurchaseLabel") { |
|
|
|
var packingNumber = result.package.number; |
|
|
|
var parentpackingNumber = result.package.parentNumber; |
|
|
|
var batch = result.label.batch; |
|
|
|
var qty = result.label.qty; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
console.log(8989,this.detailSource) |
|
|
|
if (detail == undefined) { |
|
|
|
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
//物料在列表中 |
|
|
|
// var itemDetail = detail.subList.find(r => r.batch == |
|
|
|
// batch); |
|
|
|
// if (itemDetail == undefined) { |
|
|
|
// itemDetail = detail.subList.find(r => r.batch == |
|
|
|
// batch); |
|
|
|
|
|
|
|
// if (itemDetail == undefined) { |
|
|
|
// this.showMessage("批次【" + batch + "】不在列表中") |
|
|
|
// } else { |
|
|
|
// var pack = itemDetail.packList.find(p => |
|
|
|
// p.batch == batch) |
|
|
|
// if (pack == undefined) { |
|
|
|
// this.showMessage("批次【" + batch + "】不在列表中") |
|
|
|
// } else { |
|
|
|
let isScan = false |
|
|
|
const itemDetail = detail.subList[0] |
|
|
|
let pack = detail.subList[0] && detail.subList[0].length>0 ?detail.subList[0] : {} |
|
|
|
if(packingNumber){ |
|
|
|
isScan = this.packingNumberList.some(item=>item == packingNumber) |
|
|
|
}else{ |
|
|
|
isScan = false |
|
|
|
} |
|
|
|
if (isScan) { |
|
|
|
detail.subList[0].scanDate = new Date(); |
|
|
|
// this.showMessage("箱码【" + packingNumber + "】已经扫描"); |
|
|
|
|
|
|
|
detail.subList[0].handleQty = calc.add(detail.subList[0].handleQty,result.label.qty) |
|
|
|
} else { |
|
|
|
this.packingNumberList.push(packingNumber) |
|
|
|
detail.subList[0].scaned = true |
|
|
|
detail.subList[0].scanDate = new Date(); |
|
|
|
detail.subList[0].handleQty = Number(result.label.qty); |
|
|
|
detail.subList[0].toLocationCode = this.toLocationCode; |
|
|
|
detail.subList[0].labelQty = Number(result.label.qty); |
|
|
|
} |
|
|
|
// } |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
this.continueScan() |
|
|
|
// itemDetail.packList[0] = detail.subList[0]; //按扫描信息排序 |
|
|
|
this.$forceUpdate() |
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
// //扫描的是外包装,将包装集合全部扫描 |
|
|
|
// var scanedLength = 0; |
|
|
|
// itemDetail.packList.forEach(res => { |
|
|
|
// if (res.scaned) { |
|
|
|
// scanedLength++; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// debugger |
|
|
|
// let isScan = false |
|
|
|
// if(packingNumber){ |
|
|
|
// isScan = this.packingNumberList.some(item=>item == packingNumber) |
|
|
|
// }else{ |
|
|
|
// isScan = false |
|
|
|
// } |
|
|
|
// if (isScan) { |
|
|
|
// itemDetail.scanDate = new Date(); |
|
|
|
// // this.showMessage("箱码【" + packingNumber + "】已经扫描") |
|
|
|
// itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty) |
|
|
|
// } else { |
|
|
|
// this.packingNumberList.push(packingNumber) |
|
|
|
// itemDetail.scaned = true; |
|
|
|
// itemDetail.scanDate = new Date(); |
|
|
|
// itemDetail.handleQty =itemDetail.handleQty ?itemDetail.handleQty:0 |
|
|
|
// itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty) |
|
|
|
// console.log(itemDetail.handleQty) |
|
|
|
// itemDetail.toLocationCode = this.toLocationCode; |
|
|
|
// itemDetail.labelQty = Number(result.label.qty); |
|
|
|
// itemDetail.packList.forEach(pac => { |
|
|
|
// pac.scaned = true |
|
|
|
// pac.scanDate = new Date(); |
|
|
|
// pac.handleQty = calc.add(pac.handleQty,result.label.qty); |
|
|
|
// pac.toLocationCode = this.toLocationCode; |
|
|
|
// }) |
|
|
|
// detail.handleQty = itemDetail.handleQty |
|
|
|
// this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序 |
|
|
|
// this.continueScan() |
|
|
|
// this.$forceUpdate() |
|
|
|
// } |
|
|
|
// calcHandleQty(this.detailSource); |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
//继续扫描 |
|
|
|
continueScan() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
@ -714,7 +849,8 @@ |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
let that = this |
|
|
|
console.log(params) |
|
|
|
console.log(877,params) |
|
|
|
// return; |
|
|
|
purchaseReceiptJobSubmit(params).then(res => { |
|
|
|
if (res.data) { |
|
|
|
let isCheckPrint = getSwitchInfoByCode(this.switchCode)//是否显示上架指引单 |
|
|
|