From a57256000c1f55463f11963ce4b6da6ff378684f 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, 11 Nov 2024 17:34:39 +0800 Subject: [PATCH] =?UTF-8?q?deliver/job=20=E6=96=87=E4=BB=B6=E8=BF=81?= =?UTF-8?q?=E7=A7=BBVue2=E5=8D=87=E7=BA=A7Vue3=2010/25-11/8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/count/job/countJob.vue | 7 +- src/pages/count/job/fuzzyCountJob.vue | 2 +- src/pages/customerReturn/job/returnDetail.vue | 106 +++- src/pages/customerReturn/job/returnJob.vue | 2 +- .../customerReturn/record/returnRecord.vue | 55 +- .../coms/comDeliverDetailCardBatch.vue | 95 +-- .../deliver/coms/comScanDeliverPackBatch.vue | 550 +++++++++++++----- src/pages/deliver/job/deliverDetailBatch.vue | 449 +++++++++++--- 8 files changed, 992 insertions(+), 274 deletions(-) diff --git a/src/pages/count/job/countJob.vue b/src/pages/count/job/countJob.vue index 68cd36b1..7849ff3f 100644 --- a/src/pages/count/job/countJob.vue +++ b/src/pages/count/job/countJob.vue @@ -23,7 +23,7 @@ - + @@ -76,7 +76,8 @@ const queryParams = reactive({ creationTime: "", status: "1,2", fromLocationCode: "" -} ) +}) +const manageModel = import.meta.env.VITE_MANAGE_MODEL onShow(() => { setTimeout(()=>{ getList('refresh') @@ -180,7 +181,7 @@ const setQueryParam = ()=> { if (queryParams.creationTime) { filterParams.push({ column: "create_time", - action: "betweeen", + action: "between", value: queryParams.creationTime }) } diff --git a/src/pages/count/job/fuzzyCountJob.vue b/src/pages/count/job/fuzzyCountJob.vue index a562f02f..87cd6c1d 100644 --- a/src/pages/count/job/fuzzyCountJob.vue +++ b/src/pages/count/job/fuzzyCountJob.vue @@ -131,7 +131,7 @@ export default { if (this.checkedToday) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: this.todayTime }) } diff --git a/src/pages/customerReturn/job/returnDetail.vue b/src/pages/customerReturn/job/returnDetail.vue index 3dfcf3d5..22e63d2a 100644 --- a/src/pages/customerReturn/job/returnDetail.vue +++ b/src/pages/customerReturn/job/returnDetail.vue @@ -58,7 +58,7 @@ import { getCustomerReturnJobDetail, takeCustomerReturnJob, cancleTakeCustomerRe import { goHome, navigateBack, getPackingNumberAndBatch, getInventoryStatusName, getDirectoryItemArray } from '@/common/basic.js' import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' - +import { calc } from '@/common/calc' import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' @@ -67,7 +67,7 @@ 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' -// 获取自定义的store + const store = useCountStore() const { proxy } = getCurrentInstance() const id = ref('') @@ -205,13 +205,55 @@ const openDetail = (item) => { detailInfoPopupRef.value.openPopup(item) } const openScanPopup = () => { - detailInfoPopupRef.value.openPopup() + detailInfoPopupRef.value.openPopup(fromLocationCode.value) } const closeScanPopup = () => { scanPopup.value.closeScanPopup() } +const getScanResult = (result)=> { + managementType.value == result.managementType + if(result.managementType == "BY_BATCH" || result.managementType == "BY_QUANTITY" ){ + setDataBatch(result) + }else{ + setData(result) + } +} +const setDataBatch = (result)=>{ + try { + const packingNumber = result.package.number; + const batch = result.label.batch; + const qty = result.label.qty; + const itemCode = result.label.itemCode; + const detail = detailSource.value.find(r => r.itemCode == itemCode); -const getScanResult = (result) => { + if (detail == undefined) { + showErrorMessage("物料号【" + itemCode + "】不在列表中") + } else { + console.log(366,batch) + console.log(366,detail.subList) + let itemDetail = detail.subList.find(r => { + return r.batch == batch + }) + if (itemDetail == undefined) { + showErrorMessage( "批次[" + batch + "]不在列表中") + } else { + if (itemDetail.scaned) { + // this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") + itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty) + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.label.qty) + itemDetail.packQty = Number(result.package.packQty) + itemDetail.packUnit = result.package.packUnit + calcHandleQty(); + } + } + } + } catch (e) { + showMessage(e.message) + } +} +const setData = (result) => { try { const { packingNumber } = result.label const { batch } = result.label @@ -255,12 +297,20 @@ const commit = () => { // //扫描数量和任务数量相等,直接提交 if (scanCount.value == subList.value.length) { - checkCount(); + if(managementType.value == "BY_BATCH" || managementType.value == "BY_QUANTITY" ){ + checkCountBatch() + }else{ + checkCount(); + } } else if (scanCount.value < subList.value.length) { //扫描数量小于任务数量,判断是否允许部分提交 if (jobContent.value.allowPartialComplete == "TRUE") { //提交 - checkCount(); + if(managementType.value == "BY_BATCH" || managementType.value == "BY_QUANTITY" ){ + checkCountBatch() + }else{ + checkCount(); + } } else { //不允许部分提交,提示 comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { @@ -315,6 +365,50 @@ const checkCount = () => { submitJob() } } +const checkCountBatch = ()=>{ + // 提交的数量和任务数量不一致提示 + let str = '' + let str1 = '' + let str2 = '' + detailSource.value.forEach((item) => { + item.subList.forEach(cur => { + if (cur.qty != cur.handleQty) { + let tempHandleQty = 0 + if(cur.handleQty){ + tempHandleQty = cur.handleQty + }else { + tempHandleQty =0 + } + str += `批次【${cur.batch}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` + } + if(cur.handleQty > cur.qty){ + str1 = `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以大于推荐数量【${cur.qty}】` + } + if(cur.handleQty < cur.qty){ + str2 = `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以小于推荐数量【${cur.qty}】` + } + }) + }) + jobContent.value.allowBiggerQty = 'FALSE' + if(jobContent.value.allowBiggerQty == 'FALSE' &&str1){ + comMessageRef.value.showConfirmWarningModal(str1) + return + } + if(jobContent.value.allowSmallerQty == 'FALSE' && str2){ + comMessageRef.value.showConfirmWarningModal(str2) + return + } + if (str) { + str = '任务明细未全部完成,是否提交?\n'+str + comMessageRef.value.showQuestionMessage1(str, 'red', res => { + if (res) { + submitJob() + } + }); + } else { + submitJob() + } +} const submitJob = () => { proxy.$modal.loading('提交中...') const itemCodes = [] diff --git a/src/pages/customerReturn/job/returnJob.vue b/src/pages/customerReturn/job/returnJob.vue index 8b15b3c8..fd31214b 100644 --- a/src/pages/customerReturn/job/returnJob.vue +++ b/src/pages/customerReturn/job/returnJob.vue @@ -111,7 +111,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/customerReturn/record/returnRecord.vue b/src/pages/customerReturn/record/returnRecord.vue index 6f332a0d..c0a058b4 100644 --- a/src/pages/customerReturn/record/returnRecord.vue +++ b/src/pages/customerReturn/record/returnRecord.vue @@ -44,7 +44,7 @@ import { ref, getCurrentInstance, nextTick } from 'vue' import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import { getBasicCustomerList, customerReturnRecordSubmit } from '@/api/request2.js' import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' - +import { calc } from '@/common/calc.js'; import { getPrecisionStrategyList } from '@/common/balance.js' import { goHome, getPackingNumberAndBatchByList, deepCopyData } from '@/common/basic.js' @@ -81,6 +81,7 @@ const comMessageRef = ref() const scanPopup = ref() const scanLocationCode = ref() const toInventoryStatuses = ref('') +const managementType = ref('') onLoad((option) => { uni.setNavigationBarTitle({ title: option.title @@ -103,7 +104,16 @@ onNavigationBarButtonTap((e) => { goHome() } }) -const getScanResult = (result) => { +const getScanResult = (result,managementTypeParams)=> { + managementType.value = managementTypeParams + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + setDataBatch(result) + } else { + setData(result) + } + +} +const setData = (result) => { const { balance } = result const { label } = result const pack = result.package @@ -133,11 +143,42 @@ const getScanResult = (result) => { } handleCalcHandleQty() } - +const setDataBatch = (result)=>{ + let balance = result.balance; + let label = result.label; + let pack = result.package; + let item = detailSource.value.find(res => { + if (res.itemCode == balance.itemCode) { + return res + } + }) + if (item == undefined) { + const itemp = createItemInfo(balance, pack); + let newDetail = createDetailInfo(balance, pack); // + newDetail.packingNumber =pack.number + newDetail.handleQty =result.label.qty + itemp.subList.push(newDetail); + this.detailSource.push(itemp) + } else { + const detail = item.subList.find(r => { + if (r.batch == balance.batch && + r.locationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus) { + return r; + } + }) + if (detail == undefined) { + let newDetail = createDetailInfo(balance, pack); + item.subList.push(newDetail); + } else { + detail.handleQty =calc.add(detail.handleQty, result.label.qty) + } + } + handleCalcHandleQty(); +} const handleCalcHandleQty = () => { calcHandleQty(detailSource.value) } - const removeItem = (index, item) => { detailSource.value.splice(index, 1) } @@ -323,6 +364,12 @@ const showCommitSuccessMessage = (hint) => { } }) } +const showErrorMessage = (message)=> { + comMessageRef.value.showErrorMessage(message, res => { + if (res) { + } + }); +} const clearData = () => { fromLocationCode.value = '' subList.value = [] diff --git a/src/pages/deliver/coms/comDeliverDetailCardBatch.vue b/src/pages/deliver/coms/comDeliverDetailCardBatch.vue index f1ed90e3..5f86b4c1 100644 --- a/src/pages/deliver/coms/comDeliverDetailCardBatch.vue +++ b/src/pages/deliver/coms/comDeliverDetailCardBatch.vue @@ -1,21 +1,27 @@ @@ -23,18 +29,19 @@