|
|
@ -12,13 +12,9 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<comReceiptDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'"> |
|
|
|
</comReceiptDetailCardBatch> |
|
|
|
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList' v-else> |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList'> |
|
|
|
</com-receipt-detail-card> |
|
|
|
</view> |
|
|
|
<view class='split_line'></view> |
|
|
@ -71,11 +67,14 @@ |
|
|
|
getScanCount |
|
|
|
} from '@/common/detail.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
|
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' |
|
|
|
import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
|
|
|
|
export default { |
|
|
@ -84,7 +83,6 @@ |
|
|
|
winScanButton, |
|
|
|
winScanPack, |
|
|
|
comReceiptDetailCard, |
|
|
|
comReceiptDetailCardBatch, |
|
|
|
locationCompare, |
|
|
|
jobTop |
|
|
|
}, |
|
|
@ -229,6 +227,49 @@ |
|
|
|
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){ |
|
|
|
this.setDataBatch(result) |
|
|
|
}else{ |
|
|
|
this.setData(result) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
setDataBatch(result){ |
|
|
|
try { |
|
|
|
var packingNumber = result.label.packingNumber; |
|
|
|
var batch = result.label.batch; |
|
|
|
var qty = result.label.qty; |
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
|
|
|
|
var itemDetail = detail.subList.find(r => r.batch == batch); |
|
|
|
if (itemDetail == undefined) { |
|
|
|
this.showErrorMessage("批次【" + batch + "】" + "不在列表中") |
|
|
|
} else { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
// this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") |
|
|
|
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.toLocationCode = this.toLocationCode ? this.toLocationCode : itemDetail |
|
|
|
.toLocationCode; |
|
|
|
itemDetail.packQty = result.package.packQty |
|
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
|
this.continueScan() |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
setData(result){ |
|
|
|
try { |
|
|
|
var packingNumber = result.label.packingNumber; |
|
|
|
var batch = result.label.batch; |
|
|
@ -262,7 +303,6 @@ |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
if (this.scanCount == 0) { |
|
|
@ -326,6 +366,7 @@ |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
return |
|
|
|
|
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|