diff --git a/src/pages/productReceipt/coms/comProductDetailCardBatch.vue b/src/pages/productReceipt/coms/comProductDetailCardBatch.vue index b718ad03..3818ef11 100644 --- a/src/pages/productReceipt/coms/comProductDetailCardBatch.vue +++ b/src/pages/productReceipt/coms/comProductDetailCardBatch.vue @@ -20,7 +20,9 @@ - + @@ -60,6 +62,10 @@ const props = defineProps({ type: Array, default: null }, + isNumTips: { + type: Boolean, + default: true + }, }); const emit = defineEmits(['updateData', 'remove']); diff --git a/src/pages/productReceipt/job/productReceiptDetail.vue b/src/pages/productReceipt/job/productReceiptDetail.vue index 68d81e0c..a303c9de 100644 --- a/src/pages/productReceipt/job/productReceiptDetail.vue +++ b/src/pages/productReceipt/job/productReceiptDetail.vue @@ -40,7 +40,7 @@ { await getManagementPrecisions(itemCodes, fromLocationCode.value, (res) => { if (res.success) { managementList.value = res.list; - managementType.value = managementList.value.some(item => item.ManagementPrecision === 'BY_BATCH') ? 'BY_BATCH' : ''; - if (managementType.value === 'BY_BATCH') { + this.managementType = managementList.value && + managementList.value[0] && + managementList.value[0].ManagementPrecision + if(managementType.value == 'BY_BATCH'){ + detailSource.value.forEach(item=>{ + item.subList.forEach(cur=>{ + cur.packingNumber='' + cur.toPackingNumber='' + cur.fromPackingNumber='' + }) + }) + }else if (managementType.value === 'BY_BATCH') { detailSource.value.forEach(item => { item.subList.forEach(cur => { cur.packingNumber = ''; cur.toPackingNumber = ''; cur.fromPackingNumber = ''; + cur.batch = '' }); }); } @@ -257,8 +268,9 @@ const setDataBatch = (result)=>{ const qty = result.label.qty; const itemCode = result.label.itemCode; const detail = detailSource.value.find(r => r.itemCode == itemCode); + let itemcodes = detailSource.value.map(item=>item.itemCode).join(',') if (detail == undefined) { - showErrorMessage("物料号【" + itemCode + "】不在列表中") + showErrorMessage(`扫描的物料【 ${ result.label.itemCode} 】与任务明细中的物料【 ${itemcodes} 】不一致`) } else { let itemDetail = detail.subList.find(r => { return r.batch == batch diff --git a/src/pages/unPlanned/job/issueJobDetail.vue b/src/pages/unPlanned/job/issueJobDetail.vue index c613cf46..5507c876 100644 --- a/src/pages/unPlanned/job/issueJobDetail.vue +++ b/src/pages/unPlanned/job/issueJobDetail.vue @@ -23,6 +23,7 @@ diff --git a/src/pages/unPlanned/job/receiptJobDetail.vue b/src/pages/unPlanned/job/receiptJobDetail.vue index 468af3cc..dd64432a 100644 --- a/src/pages/unPlanned/job/receiptJobDetail.vue +++ b/src/pages/unPlanned/job/receiptJobDetail.vue @@ -13,11 +13,13 @@ - - - + + + + + + @@ -53,9 +55,10 @@ import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/ import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' -import locationCompare from '@/mycomponents/location/locationCompare.vue' +import LocationCompare from '@/mycomponents/location/locationCompare.vue' import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' -import jobTop from '@/mycomponents/job/jobTop.vue' +import ComRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" +import JobTop from '@/mycomponents/job/jobTop.vue' import { useCountStore } from '@/store' // 获取自定义的store const store = useCountStore() @@ -149,6 +152,9 @@ const getDetail = () => { jobContent.value = res.data jobStatus.value = res.data.status subList.value = res.data.subList + subList.value.forEach(item=>{ + item.isRecommend = true + }) detailSource.value = getDataSource(subList.value) jobToLocationCode.value = subList.value[0].toLocationCode toLocationAreaTypeList.value = await getDirectoryItemArray(jobContent.value.toAreaTypes) @@ -161,7 +167,9 @@ const getDetail = () => { getManagementPrecisions(itemCodes, jobToLocationCode.value, res => { if (res.success) { managementList.value = res.list; - managementType.value = managementList.value.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' + managementType.value = managementList.value && + managementList.value[0] && + managementList.value[0].ManagementPrecision } }) } else { @@ -209,14 +217,41 @@ const setDataBatch = (result)=>{ const batch = result.label.batch; const qty = result.label.qty; const itemCode = result.label.itemCode; + const locationCode = result.package.toLocationCode; const detail = detailSource.value.find(r => r.itemCode == itemCode); if (detail == undefined) { showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - - var itemDetail = detail.subList.find(r => r.batch == batch); + const itemDetail = detail.subList.find(r => { + return r.batch == batch && + r.fromLocationCode == result.fromLocationCode&& + r.isRecommend==false + }) + const itemDetail1 = detail.subList.find(r => { + return r.batch == batch && + r.fromLocationCode == result.fromLocationCode&& + r.isRecommend==true + }) if (itemDetail == undefined) { - showErrorMessage("批次【" + batch + "】" + "不在列表中") + let newAdd = { + ...itemDetail1, + itemCode:itemCode, + packingNumber:packingNumber, + batch:batch, + handleQty:Number(result.label.qty), + qty:detail.qty, + toLocationCode:locationCode, + // inventoryStatus:inventoryStatus, + // toInventoryStatus:inventoryStatus, + // balance:result.balance, + isRecommend:false, + isNewAdd:"newAdd" + } + // newAdd.balance.balanceQty = Number(result.balance.qty); + // newAdd.balance.packQty = Number(result.package.packQty) + // newAdd.balance.packUnit = result.package.packUnit + newAdd.scaned = true; + detail.subList.push(newAdd) } else { if (itemDetail.scaned) { // this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") @@ -269,35 +304,94 @@ const setData = (result) => { } const commit = () => { - scanCount.value = getScanCount(subList.value) - if (scanCount.value == 0) { - showErrorMessage('扫描数为0,请先扫描') - return - } - // 校验库位、 - if (!checkLocation()) { - return - } - // 扫描数量和任务数量相等,直接提交 - if (scanCount.value == subList.value.length) { - submitJob() - } else if (scanCount.value < subList.value.length) { - // 扫描数量小于任务数量,判断是否允许部分提交 - if (jobContent.value.allowPartialComplete == 'TRUE') { - // 提交 - comMessageRef.value.showErrorMessage1("任务明细未全部完成,是否提交?", 'red', res => { - if (res) { - submitJob() + if(managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY' ){ + let scanCount = 0; + detailSource.value.forEach((item) => { + item.subList.forEach(cur => { + if(cur.scaned){ + scanCount++; } }) - submitJob() - } else { - // 不允许部分提交,提示 - comMessageRef.value.showErrorMessage(`任务明细未全部完成,不允许部分提交!`, (res) => { - if (res) { - openScanPopup() + }) + if(scanCount==0){ + showErrorMessage("扫描数为0,请先扫描") + return; + } + let str = '' + let str1 = '' + detailSource.value.forEach((item) => { + item.subList.forEach(cur=>{ + if(cur.scaned){ + if(parseFloat(cur.qty)>parseFloat(cur.handleQty)){ + str += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}】` + } + if(parseFloat(cur.qty) { + if (res) { + submitJob() + } + }); + } else { + //不允许部分提交,提示 + comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { + if (res) { + openScanPopup(); + } + }); + } + }else{ + submitJob() + } + }else { + scanCount.value = getScanCount(subList.value) + if (scanCount.value == 0) { + showErrorMessage('扫描数为0,请先扫描') + return + } + // 校验库位、 + if (!checkLocation()) { + return + } + // 扫描数量和任务数量相等,直接提交 + if (scanCount.value == subList.value.length) { + submitJob() + } else if (scanCount.value < subList.value.length) { + // 扫描数量小于任务数量,判断是否允许部分提交 + if (jobContent.value.allowPartialComplete == 'TRUE') { + // 提交 + comMessageRef.value.showErrorMessage1("任务明细未全部完成,是否提交?", 'red', res => { + if (res) { + submitJob() + } + }) + submitJob() + } else { + // 不允许部分提交,提示 + comMessageRef.value.showErrorMessage(`任务明细未全部完成,不允许部分提交!`, (res) => { + if (res) { + openScanPopup() + } + }) + } } } }