From 668899df83d84d5085ab9abdb051b18e27f88e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Tue, 29 Oct 2024 19:30:47 +0800 Subject: [PATCH] =?UTF-8?q?mycomponents/page/customerReturn/job=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=BF=81=E7=A7=BB=208/8-10/25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/customerReturn/job/returnDetail.vue | 173 +++++++++--------- src/pages/customerReturn/job/returnJob.vue | 3 +- 2 files changed, 89 insertions(+), 87 deletions(-) diff --git a/src/pages/customerReturn/job/returnDetail.vue b/src/pages/customerReturn/job/returnDetail.vue index c9ca2026..3dfcf3d5 100644 --- a/src/pages/customerReturn/job/returnDetail.vue +++ b/src/pages/customerReturn/job/returnDetail.vue @@ -14,7 +14,16 @@ - + + + + @@ -33,7 +42,7 @@ - + @@ -51,9 +60,10 @@ import { goHome, navigateBack, getPackingNumberAndBatch, getInventoryStatusName, import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' import winScanButton from '@/mycomponents/scan/winScanButton.vue' -import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' +import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' -import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' +import comLableDetailCard from "@/mycomponents/detail/comLableDetailCard.vue" +import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue" import detailInfoPopup from '@/pages/customerReturn/coms/detailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' import { useCountStore } from '@/store' @@ -75,6 +85,7 @@ const scanPopup = ref() const detailInfoPopupRef = ref() const comMessageRef = ref() const comScanLocation = ref() +const managementType = ref('') onLoad((option) => { uni.setNavigationBarTitle({ title: `${option.title}详情` @@ -153,6 +164,18 @@ const getDetail = () => { toLocationCode.value = subList.value[0].toLocationCode } toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) + //获取管理模式,封装参数 + let itemCodes = [] + detailSource.value.forEach(item => { + itemCodes.push(item.itemCode) + item.scaned = false + }) + getManagementPrecisions(itemCodes, fromLocationCode.value, res => { + if (res.success) { + managementList.value = res.list; + managementType.value = managementList.value.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' + } + }) } else { showMessage('列表数据为0') } @@ -182,26 +205,7 @@ const openDetail = (item) => { detailInfoPopupRef.value.openPopup(item) } const openScanPopup = () => { - let fromlocationCode = '' - const fromlocationList = [] - for (let i = 0; i < detailSource.value.length; i++) { - const item = detailSource.value[i] - item.subList.forEach((l) => { - // 重复的库位不往里面插入 - const location = fromlocationList.find((res) => res == l.fromLocationCode) - if (location == undefined) { - fromlocationList.push(l.fromLocationCode) - } - // 来源库位赋默认值 - if (fromlocationCode == '') { - if (!l.scaned) { - fromlocationCode = l.fromLocationCode - } - } - }) - } - - scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value) + detailInfoPopupRef.value.openPopup() } const closeScanPopup = () => { scanPopup.value.closeScanPopup() @@ -209,12 +213,10 @@ const closeScanPopup = () => { const getScanResult = (result) => { try { - const { packingNumber } = result.balance - const { batch } = result.balance - const { qty } = result.balance - const { itemCode } = result.balance - const { locationCode } = result.balance - const { inventoryStatus } = result.balance + const { packingNumber } = result.label + const { batch } = result.label + const { qty } = result.label + const { itemCode } = result.label const detail = detailSource.value.find((r) => r.itemCode == itemCode) if (detail == undefined) { @@ -228,40 +230,11 @@ const getScanResult = (result) => { } else if (itemDetail.scaned) { showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`) } else { - const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) - const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) - - if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { - if (jobContent.value.allowModifyInventoryStatus == 'TRUE') { - showQuestionMessage(`实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续退货?`, (res) => { - if (res) { - itemDetail.scaned = true - itemDetail.handleQty = Number(result.balance.qty) - itemDetail.inventoryStatus = result.balance.inventoryStatus - itemDetail.balance = result.balance - itemDetail.balance.balanceQty = Number(result.balance.qty) - itemDetail.balance.packQty = Number(result.package.packQty) - itemDetail.balance.packUnit = result.package.packUnit - calcHandleQty1() - } else { - scanPopupGetFocus() - } - }) - } else { - showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => { - scanPopupGetFocus() - }) - } - } else { - itemDetail.scaned = true - itemDetail.handleQty = Number(result.balance.qty) - itemDetail.toInventoryStatus = result.balance.inventoryStatus - itemDetail.balance = result.balance - itemDetail.balance.balanceQty = Number(result.balance.qty) - itemDetail.balance.packQty = Number(result.package.packQty) - itemDetail.balance.packUnit = result.package.packUnit - calcHandleQty1() - } + itemDetail.scaned = true + itemDetail.handleQty = Number(result.balance.qty) + itemDetail.packQty = Number(result.package.packQty) + itemDetail.packUnit = result.package.packUnit + calcHandleQty(); } } } catch (e) { @@ -279,24 +252,23 @@ const commit = () => { if (!checkLocation()) { return } - // 提交的数量和任务数量不一致提示 - let str = '' - detailSource.value.forEach((item) => { - item.subList.forEach(cur => { - if (cur.qty != cur.handleQty) { - str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致` - } - }) - }) - if (str) { - str += ',是否确认提交?' - comMessageRef.value.showQuestionMessage(str, 'red', res => { - if (res) { - submitJob() - } - }); - } else { - submitJob() + + // //扫描数量和任务数量相等,直接提交 + if (scanCount.value == subList.value.length) { + checkCount(); + } else if (scanCount.value < subList.value.length) { + //扫描数量小于任务数量,判断是否允许部分提交 + if (jobContent.value.allowPartialComplete == "TRUE") { + //提交 + checkCount(); + } else { + //不允许部分提交,提示 + comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { + if (res) { + openScanPopup(); + } + }); + } } // // 扫描数量和任务数量相等,直接提交 // if (scanCount.value == subList.value.length) { @@ -316,6 +288,33 @@ const commit = () => { // } // } } +const checkCount = () => { + // 提交的数量和任务数量不一致提示 + let str = '' + detailSource.value.forEach((item) => { + item.subList.forEach(cur => { + if (cur.qty != cur.handleQty) { + let tempHandleQty + if(cur.handleQty){ + tempHandleQty = cur.handleQty + }else { + tempHandleQty = 0 + } + str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` + } + }) + }) + if (str) { + str = '任务明细未全部完成,是否提交?\n'+str + comMessageRef.value.showQuestionMessage(str, 'red', res => { + if (res) { + submitJob() + } + }); + } else { + submitJob() + } +} const submitJob = () => { proxy.$modal.loading('提交中...') const itemCodes = [] @@ -331,7 +330,7 @@ const submitJob = () => { uni.hideLoading() console.log(res.data) if (res.data) { - showCommitSuccessMessage(`提交成功
生成客户退货记录:${res.data}`) + showCommitSuccessMessage(`提交成功\n生成客户退货记录\n:${res.data}`) } else { showErrorMessage(`提交失败[${res.msg}]`) } @@ -356,9 +355,11 @@ const setParams = () => { if (detail.scaned) { const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch) detail.toPackingNumber = info.packingNumber + detail.packingNumber = info.packingNumber; + detail.fromPackingNumber = info.packingNumber; detail.toContainerNumber = detail.containerNumber detail.toBatch = info.batch - detail.toLocationCode = detail.toLocationCode + detail.toLocationCode = info.toLocationCode detail.toInventoryStatus = 'HOLD' subList.push(detail) } @@ -424,13 +425,13 @@ const showQuestionMessage = (message, callback) => { const scanPopupGetFocus = () => { if (scanPopup.value != undefined) { - scanPopup.value.packGetFocus() + scanPopup.value.getfocus() } } const scanPopupLoseFocus = () => { if (scanPopup.value != undefined) { - scanPopup.value.packLoseFocus() + scanPopup.value.losefocus() } } diff --git a/src/pages/customerReturn/job/returnJob.vue b/src/pages/customerReturn/job/returnJob.vue index 0b2a408c..8b15b3c8 100644 --- a/src/pages/customerReturn/job/returnJob.vue +++ b/src/pages/customerReturn/job/returnJob.vue @@ -129,7 +129,8 @@ const getList = (type) => { const params = { filters, pageNo: pageNo.value, - pageSize: pageSize.value + pageSize: pageSize.value, + sorts:[{sort:"id",by:"DESC"}] } getCustomerReturnJobList(params)