From 1ad14f5a3e1f4a86e8f6bde8d80a65aae8a05d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Mon, 4 Nov 2024 13:30:20 +0800 Subject: [PATCH] =?UTF-8?q?page/repleinsh/job=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=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/repleinsh/job/repleinshDetail.vue | 70 ++- .../repleinsh/job/repleinshDetailBatch.vue | 514 ++++++++++++++++++ src/pages/repleinsh/job/repleinshJob.vue | 351 ++++++------ 3 files changed, 741 insertions(+), 194 deletions(-) create mode 100644 src/pages/repleinsh/job/repleinshDetailBatch.vue diff --git a/src/pages/repleinsh/job/repleinshDetail.vue b/src/pages/repleinsh/job/repleinshDetail.vue index 7ec42dd0..401d6789 100644 --- a/src/pages/repleinsh/job/repleinshDetail.vue +++ b/src/pages/repleinsh/job/repleinshDetail.vue @@ -23,7 +23,7 @@ - + @@ -151,7 +151,7 @@ const receive = (callback) => { const getDetail = () => { proxy.$modal.loading('加载中....') getRepleinshJobDetail(id.value) - .then((res) => { + .then(async (res) => { uni.hideLoading() if (res.data == null) { showMessage('未获取到详情') @@ -162,7 +162,7 @@ const getDetail = () => { toLocationCode.value = subList.value[0].toLocationCode console.log(`库位${toLocationCode.value}`) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) - detailSource.value = getDataSource(detailSource.value, subList.value) + detailSource.value = await getDataSource(detailSource.value, subList.value) if (scanMessage.value) { comScanIssuePackRef.value.openScanPopupForJobSimulate(detailSource.value, jobContent.value, scanMessage.value) } @@ -193,7 +193,56 @@ const resizeCollapse = () => { }) }) } +const clickSubmit = () => { + let str = "" + var totalQty = 0; + var taskQty = 0; + detailSource.value.forEach(detail => { + detail.Items.forEach(item => { + taskQty = calc.add(taskQty, item.qty) + item.Locations.forEach(lco => { + lco.Batchs.forEach(batch => { + batch.Records.forEach(record => { + if (batch.qty != record.qty) { + let tempHandleQty = 0 + 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 (str) { + str = '任务明细未全部完成,是否提交?\n' + str + } + if (totalQty != taskQty) { + str = "扫描数量[" + totalQty + "]与任务数量不一致[" + taskQty + "],是否提交" + comMessageRef.value.showQuestionMessage1(str, 'red', res => { + if (res) { + //防止重复点击 + proxy.$throttle(submitJob, 2000, proxy)() + } else { + this.scanPopupGetFocus() + } + }); + } else { + //防止重复点击 + proxy.$throttle(submitJob, 2000, proxy)() + } +} const submit = () => { const scanCount = getScanCount(subList.value) @@ -240,12 +289,23 @@ const setSubmitParamsAndSubmit = () => { const submitJob = () => { proxy.$modal.loading('提交中....') + let itemCodes = [] + detailSource.value.forEach(item => { + item.Items.forEach(cur=>{ + itemCodes.push(cur.itemCode) + }) + }) const params = setParams() + if (!params.subList || params.subList.length == 0) { + uni.hideLoading() + showErrorMessage("请扫描您需要提交的补料任务") + return + } repleinshJobSubmit(params) .then((res) => { uni.hideLoading() if (res.data) { - showCommitSuccessMessage(`提交成功
生成补料记录
${res.data}`) + showCommitSuccessMessage(`提交成功\n生成补料记录\n${res.data}`) } else { showErrorMessage(`提交失败[${res.msg}]`) } @@ -273,8 +333,6 @@ const setParams = () => { const record = {} record.handleQty = r.qty - // record.fromPackingNumber = r - // .packingNumber; record.fromBatch = r.batch record.fromContainerNumber = r.containerNumber diff --git a/src/pages/repleinsh/job/repleinshDetailBatch.vue b/src/pages/repleinsh/job/repleinshDetailBatch.vue new file mode 100644 index 00000000..d66925c6 --- /dev/null +++ b/src/pages/repleinsh/job/repleinshDetailBatch.vue @@ -0,0 +1,514 @@ + + + + + \ No newline at end of file diff --git a/src/pages/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue index 3c750401..765baf5e 100644 --- a/src/pages/repleinsh/job/repleinshJob.vue +++ b/src/pages/repleinsh/job/repleinshJob.vue @@ -1,11 +1,10 @@