From 47c6716e47388efa8f6cc04ea359b38228cc2125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Wed, 30 Oct 2024 15:36:25 +0800 Subject: [PATCH] =?UTF-8?q?page/issue/job=20=E6=96=87=E4=BB=B6=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=208/8-10/25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/job/issueDetail.vue | 120 +++- src/pages/issue/job/issueDetail0816.vue | 608 +++++++++++++++++++ src/pages/issue/job/issueJob.vue | 460 ++++++++------- src/pages/issue/job/issueJob0816.vue | 746 ++++++++++++++++++++++++ 4 files changed, 1701 insertions(+), 233 deletions(-) create mode 100644 src/pages/issue/job/issueDetail0816.vue create mode 100644 src/pages/issue/job/issueJob0816.vue diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 5ec0d283..3ce7b87b 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -23,8 +23,16 @@ - - + + + + @@ -32,7 +40,7 @@ - + @@ -55,13 +63,12 @@ import { getManagementPrecisions } from '@/common/balance.js' import { calc } from '@/common/calc.js' -import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue' import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' import jobTop from '@/mycomponents/job/jobTop.vue' import workStation from '@/mycomponents/workStation/workStation.vue' -import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' +import comIssueDetailCardBatch from '@/pages/issue/coms/comIssueDetailCardBatch.vue' import { useCountStore } from '@/store' // 获取自定义的store const store = useCountStore() @@ -74,12 +81,12 @@ const detailOptions = ref([]) const scanOptions = ref([]) const jobStatus = ref('') const scanMessage = ref('') -const scanPopup = ref() const comScanIssuePackRef = ref() const comMessageRef = ref() const managementList = ref([]) - +const managementType = ref('') const comIssueDetailCardRef = ref() +const fromLocationCode = ref() onLoad((option) => { uni.setNavigationBarTitle({ title: `${option.title}详情` @@ -154,10 +161,26 @@ const getDetail = () => { subList.value = res.data.subList detailSource.value = getDataSource(detailSource.value, subList.value) jobContent.value.detailToLocationCode = res.data.subList[0].toLocationCode + fromLocationCode.value = subList.value[0].fromLocationCode // 任务中已经扫描,模拟扫描赋值 if (scanMessage.value) { openScanPopupSimulate(scanMessage.value) } + //获取管理模式,封装参数 + let itemCodes = [] + detailSource.value.forEach(item => { + item.Items.forEach((cur) => { + itemCodes.push(cur.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' : '' + } + }) setTimeout((r) => { resizeCollapse() }, 100) @@ -210,7 +233,7 @@ const submitJob = () => { .then((res) => { uni.hideLoading() if (res.data) { - showCommitSuccessMessage(`提交成功
生成发料记录
${res.data}`) + showCommitSuccessMessage(`提交成功\n生成发料记录\n${res.data}`) } else { showErrorMessage(`提交失败[${res.msg}]`) } @@ -259,6 +282,8 @@ const setParams = () => { } else { const info = getPackingNumberAndBatch(managementList.value, r.itemCode, r.packingNumber, r.batch) record.toPackingNumber = info.packingNumber + record.packingNumber = info.packingNumber; + record.fromPackingNumber = info.packingNumber; record.toBatch = info.batch } record.fromParentPackingNumber = r.parentPackingNumber @@ -324,38 +349,77 @@ const updateData = (record) => { } const afterScan = () => { resizeCollapse() + autoCommit() +} +const autoCommit = ()=>{ + let str = "" + let totalQty = 0; + let taskQty = 0; detailSource.value.forEach((detail) => { - const s = '' detail.Items.forEach((item) => { - let totalHandleQty = 0 - let isHandleEmpty = false // 多个库位时 handleQty =0; + taskQty = calc.add(taskQty,item.qty) item.Locations.forEach((lco) => { lco.Batchs.forEach((batch) => { - if (batch.handleQty != 0) { - totalHandleQty = calc.add(totalHandleQty, batch.handleQty) - } else { - isHandleEmpty = true - } + batch.Records.forEach(record => { + if (batch.qty != record.qty) { + let tempHandleQty + if (record.qty) { + tempHandleQty = record.qty + } else { + tempHandleQty = 0 + } + if (batch.qty != 0) { + str += + `包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n` + } + } + if(record){ + let hanleQty = record.qty?record.qty:0 + totalQty = calc.add(totalQty,hanleQty) + } + }) }) }) - if (item.qty == totalHandleQty) { - if (isHandleEmpty) { - return - } - submit() + }) + }) + if(str){ + str = '任务明细未全部完成,是否提交?\n' + str + } + if(totalQty != taskQty){ + str =`扫描数量[${totalQty}]与任务数量不一致[${taskQty}],是否提交"` + comMessageRef.value.showQuestionMessage1(str, 'red', res => { + if (res) { + //防止重复点击 + proxy.$throttle(submit, 2000, proxy)() } else { - comMessageRef.value.showQuestionMessage(`实际扫描数量【${totalHandleQty}】与物料需求数量【${item.qty}】不一致,是否继续提交`, (res) => { - if (res) { - submit() - } + // let record = this.creatRecord(label, balance, packageInfo); + // batch.Records.push(record); + // this.issueRecord.unshift(record) + // this.calcBatchHandleQty(batch); + // this.getfocus(); + // this.$emit("afterScan"); + detailSource.value.forEach(detail => { + detail.Items.forEach(item => { + taskQty = calc.add(taskQty,item.qty) + item.Locations.forEach(lco => { + lco.Batchs.forEach(batch => { + batch.Records = [] + }) + }) + }) }) + comScanIssuePackRef.value.clearList() + scanPopupGetFocus() } }) - }) + }else { + //防止重复点击 + proxy.$throttle(submit, 2000, proxy)() + } } const scanPopupGetFocus = () => { - if (!scanPopup.value) { - scanPopup.value.getfocus() + if (comScanIssuePackRef.value) { + comScanIssuePackRef.value.getfocus() } } const showMessage = (message) => { diff --git a/src/pages/issue/job/issueDetail0816.vue b/src/pages/issue/job/issueDetail0816.vue new file mode 100644 index 00000000..baabd9a2 --- /dev/null +++ b/src/pages/issue/job/issueDetail0816.vue @@ -0,0 +1,608 @@ + + + + + \ No newline at end of file diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index 8edede1a..f3cce451 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -1,14 +1,11 @@