From 40b32f54567dcb5ebab3bb9332d45ea9d6e1e62a 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, 12 Nov 2024 09:47:41 +0800 Subject: [PATCH] =?UTF-8?q?inventoryMove=E6=96=87=E4=BB=B6=E8=BF=81?= =?UTF-8?q?=E7=A7=BB,action:betweeen=E6=94=B9=E6=88=90between=20Vue2?= =?UTF-8?q?=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/inspect/job/inspectJob.vue | 2 +- .../coms/comInventoryDetailCard.vue | 6 +- src/pages/inventoryMove/coms/comMoveJob.vue | 2 +- .../inventoryMove/coms/comMoveRecord.vue | 213 +++++++++++++- .../inventoryMove/coms/comMoveRecordCard.vue | 7 +- .../inventoryMove/coms/okToHoldRecordPack.vue | 261 ++++++++++++++++++ .../inventoryMove/job/inventoryMoveDetail.vue | 207 +++++++++++--- .../inventoryMove/job/inventoryMoveJob.vue | 2 +- src/pages/issue/job/issueJob.vue | 2 +- src/pages/issue/job/issueJob0816.vue | 4 +- src/pages/package/job/overPackageJob.vue | 2 +- .../job/productDismantleJob.vue | 2 +- .../productPutaway/job/productPutawayJob.vue | 2 +- .../job/ccProductReceiptJob.vue | 2 +- .../productReceipt/job/completeReceiveJob.vue | 2 +- .../productReceipt/job/productReceiptJob.vue | 2 +- .../productRecycle/job/productRecycleJob.vue | 2 +- .../job/productionReceiptJob.vue | 2 +- src/pages/productionReturn/job/returnJob.vue | 2 +- src/pages/purchaseReceipt/job/receiptJob.vue | 2 +- src/pages/purchaseReturn/job/returnJob.vue | 2 +- src/pages/putaway/job/putawayJob.vue | 2 +- src/pages/repleinsh/job/repleinshJob.vue | 2 +- src/pages/scrap/job/scrapJob.vue | 2 +- src/pages/stockUp/job/stockUpJob.vue | 2 +- .../record/supplierDeliverRecord.vue | 2 +- src/pages/transfer/job/issueJob.vue | 2 +- src/pages/transfer/job/receiptJob.vue | 2 +- src/pages/unPlanned/job/issueJob.vue | 2 +- src/pages/unPlanned/job/receiptJob.vue | 2 +- 30 files changed, 666 insertions(+), 80 deletions(-) create mode 100644 src/pages/inventoryMove/coms/okToHoldRecordPack.vue diff --git a/src/pages/inspect/job/inspectJob.vue b/src/pages/inspect/job/inspectJob.vue index f01ab9fe..baadc5ce 100644 --- a/src/pages/inspect/job/inspectJob.vue +++ b/src/pages/inspect/job/inspectJob.vue @@ -112,7 +112,7 @@ export default { if (this.checkedToday) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: this.todayTime }) } diff --git a/src/pages/inventoryMove/coms/comInventoryDetailCard.vue b/src/pages/inventoryMove/coms/comInventoryDetailCard.vue index 40205d0c..94e7d2c8 100644 --- a/src/pages/inventoryMove/coms/comInventoryDetailCard.vue +++ b/src/pages/inventoryMove/coms/comInventoryDetailCard.vue @@ -4,7 +4,10 @@ @@ -23,6 +26,7 @@ + + \ No newline at end of file diff --git a/src/pages/inventoryMove/job/inventoryMoveDetail.vue b/src/pages/inventoryMove/job/inventoryMoveDetail.vue index 9149cd3e..7b5a3869 100644 --- a/src/pages/inventoryMove/job/inventoryMoveDetail.vue +++ b/src/pages/inventoryMove/job/inventoryMoveDetail.vue @@ -12,15 +12,10 @@ - - + @openDetail="openDetail"> @@ -48,14 +43,15 @@ import { ref, getCurrentInstance, nextTick } from 'vue' import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import { getInventoryMoveJobDetail, takeInventoryMoveJob, cancleTakeInventoryMoveJob, inventoryMoveSubmit } from '@/api/request2.js' import { getManagementPrecisions, getPrecisionStrategyList } from '@/common/balance.js' - +import { + calc +} from '@/common/calc.js'; import { getDataSource, getScanCount, calcHandleQty } from '@/common/detail.js' import { goHome, navigateBack, getCurrDateTime, getPackingNumberAndBatchByList, getInventoryStatusName } from '@/common/basic.js' import {getDirectoryItemArray} from '@/common/directory.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' -import comInventoryDetailCardBatch from '@/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue' import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -257,8 +253,90 @@ const openScanPopup = () => { scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value) } +const getScanResult = (result,managementPrecision)=> { + managementType.value = managementPrecision + if(managementPrecision == 'BY_BATCH' || managementPrecision == 'BY_QUANTITY' ){ + setDataBatch(result,managementPrecision) + }else{ + setData(result,managementPrecision) + } -const getScanResult = (result,managementPrecision) => { +} +const setDataBatch = (result,managementPrecision)=>{ + try { + let packingNumber = result.label.packingNumber; + let batch = result.label.batch; + let qty = result.label.qty; + let itemCode = result.label.itemCode; + let detail = detailSource.value.find(r => r.itemCode == itemCode); + if (detail == undefined) { + showMessage("物料号【" + itemCode + "】不在列表中") + } else { + let itemDetail = {} + if(managementPrecision == 'BY_QUANTITY'){ + itemDetail = detail.subList.find(r => { + return r.itemCode == result.label.itemCode + }) + }else{ + itemDetail = detail.subList.find(r => { + return r.batch == batch + }) + } + + if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') { + showErrorMessage( "批次[" + batch + "]不在列表中") + } else { + if (itemDetail.scaned) { + // this.showMessage("批次【" + batch + "】已经扫描") + itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.label.qty)); + calcHandleQty(); + } else { + let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); + let 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.label.qty); + itemDetail.fromInventoryStatus = 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 + calcHandleQty(); + } else { + scanPopupGetFocus(); + } + }); + } else { + showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + + itemStatus + + ']不一致,不允许转移!', res => { + scanPopupGetFocus(); + }); + } + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.label.qty); + itemDetail.fromInventoryStatus = 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 + calcHandleQty(); + } + } + } + } + scanPopupGetFocus(); + } catch (e) { + showErrorMessage(e.message); + } +} +const setData = (result,managementPrecision) => { try { const { packingNumber } = result.label const { batch } = result.label @@ -324,22 +402,43 @@ const getScanResult = (result,managementPrecision) => { } } -const commit = () => { +const commit = async () => { scanCount.value = getScanCount(subList.value) if (scanCount.value == 0) { showErrorMessage('扫描数为0,请先扫描') return } + //查询管理模式 + managementList.value = []; + let precisionStrategParams = setPrecisionStrategParams() + await getPrecisionStrategyList(precisionStrategParams, res => { + if (res.success) { + managementList.value = res.list; + managementType.value = managementList.value&& managementList.value[0]&& managementList.value[0].ManagementPrecision ? managementList.value[0].ManagementPrecision : 'BY_PACKAGING' + console.log(11,this.managementType) + } else { + uni.hideLoading(); + showErrorMessage(res.message); + } + }) //允许部分提交 //扫描数量和任务数量相等,直接提交 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 => { @@ -377,39 +476,67 @@ const checkCount = ()=>{ submitJob() } } +const checkCountBatch = ()=> { + // 提交的数量和任务数量不一致提示 + let str = '' + let str1 = '' + 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}】不一致\n` + if( cur.handleQty > cur.balance.balanceQty){ + console.log(2333,cur.handleQty) + console.log(2333,cur.balance.balanceQty) + str1 += + `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以大于库存数量【${cur.balance.balanceQty}】` + } + } + }) + }) + if(str1){ + comMessageRef.value.showConfirmWarningModal(str1) + return + } + if (str) { + str = '任务明细未全部完成,是否提交?\n' + str + comMessageRef.value.showQuestionMessage1(str, 'red', res => { + if (res) { + submitJob() + } + }); + } else { + submitJob() + } +} const submitJob = () => { proxy.$modal.loading('提交中...') // 查询管理模式 - managementList.value = [] - const precisionStrategParams = setPrecisionStrategParams() - getPrecisionStrategyList(precisionStrategParams, (res) => { - if (res.success) { - managementList.value = res.list - - const params = setParams() - inventoryMoveSubmit(params) - .then((res) => { - uni.hideLoading() - if (res.data) { - let showTitle = this.title - if (title.value.indexOf('任务') == title.value.length - 2) { - showTitle = this.title.replace('任务', '') - } - showCommitSuccessMessage(`提交成功\n生成${showTitle}库存转移记录\n${res.data}`) - } else { - showErrorMessage(`提交失败[${res.msg}]`) + const params = setParams() + inventoryMoveSubmit(params) + .then((res) => { + uni.hideLoading() + if (res.data) { + let showTitle = this.title + if (title.value.indexOf('任务') == title.value.length - 2) { + showTitle = this.title.replace('任务', '') } - }) - .catch((error) => { - uni.hideLoading() - showErrorMessage(error) - }) - } else { - uni.hideLoading() - showErrorMessage(res.message) - } - }) + showCommitSuccessMessage(`提交成功\n生成${showTitle}库存转移记录\n${res.data}`) + } else { + showErrorMessage(`提交失败[${res.msg}]`) + } + }) + .catch((error) => { + uni.hideLoading() + showErrorMessage(error) + }) } const setPrecisionStrategParams = () => { diff --git a/src/pages/inventoryMove/job/inventoryMoveJob.vue b/src/pages/inventoryMove/job/inventoryMoveJob.vue index a3e28447..7d15fd45 100644 --- a/src/pages/inventoryMove/job/inventoryMoveJob.vue +++ b/src/pages/inventoryMove/job/inventoryMoveJob.vue @@ -90,7 +90,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index f212c0f4..0a734666 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -229,7 +229,7 @@ const setQueryParam = ()=>{ if (queryParams.creationTime ) { filterParams.push({ column: "create_time", - action: "betweeen", + action: "between", value: queryParams.creationTime }) } diff --git a/src/pages/issue/job/issueJob0816.vue b/src/pages/issue/job/issueJob0816.vue index c8faa6b4..77141697 100644 --- a/src/pages/issue/job/issueJob0816.vue +++ b/src/pages/issue/job/issueJob0816.vue @@ -234,7 +234,7 @@ if (this.checkedToday) { filters.push({ column: "create_time", - action: "betweeen", + action: "between", value: this.todayTime }) } @@ -333,7 +333,7 @@ // if (this.checkedToday) { // filters.push({ // column: "create_time", - // action: "betweeen", + // action: "between", // value: this.todayTime // }) // } diff --git a/src/pages/package/job/overPackageJob.vue b/src/pages/package/job/overPackageJob.vue index 7625d6d3..9f3edc8c 100644 --- a/src/pages/package/job/overPackageJob.vue +++ b/src/pages/package/job/overPackageJob.vue @@ -137,7 +137,7 @@ const setQueryParam = ()=> { if (queryParams.creationTime ) { filterParams.push({ column: "create_time", - action: "betweeen", + action: "between", value: queryParams.creationTime }) } diff --git a/src/pages/productDismantle/job/productDismantleJob.vue b/src/pages/productDismantle/job/productDismantleJob.vue index bbd478b7..3c29c901 100644 --- a/src/pages/productDismantle/job/productDismantleJob.vue +++ b/src/pages/productDismantle/job/productDismantleJob.vue @@ -117,7 +117,7 @@ export default { if (this.checkedToday) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: this.todayTime }) } diff --git a/src/pages/productPutaway/job/productPutawayJob.vue b/src/pages/productPutaway/job/productPutawayJob.vue index 62977b0f..6bcd80d6 100644 --- a/src/pages/productPutaway/job/productPutawayJob.vue +++ b/src/pages/productPutaway/job/productPutawayJob.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/productReceipt/job/ccProductReceiptJob.vue b/src/pages/productReceipt/job/ccProductReceiptJob.vue index 0dfec5c8..36f1265c 100644 --- a/src/pages/productReceipt/job/ccProductReceiptJob.vue +++ b/src/pages/productReceipt/job/ccProductReceiptJob.vue @@ -126,7 +126,7 @@ if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/productReceipt/job/completeReceiveJob.vue b/src/pages/productReceipt/job/completeReceiveJob.vue index 0dd39185..a35a570c 100644 --- a/src/pages/productReceipt/job/completeReceiveJob.vue +++ b/src/pages/productReceipt/job/completeReceiveJob.vue @@ -116,7 +116,7 @@ export default { if (this.checkedToday) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: this.todayTime }) } diff --git a/src/pages/productReceipt/job/productReceiptJob.vue b/src/pages/productReceipt/job/productReceiptJob.vue index 0e34487a..0a28475f 100644 --- a/src/pages/productReceipt/job/productReceiptJob.vue +++ b/src/pages/productReceipt/job/productReceiptJob.vue @@ -101,7 +101,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'request_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/productRecycle/job/productRecycleJob.vue b/src/pages/productRecycle/job/productRecycleJob.vue index 0e3a4c68..fd81005d 100644 --- a/src/pages/productRecycle/job/productRecycleJob.vue +++ b/src/pages/productRecycle/job/productRecycleJob.vue @@ -102,7 +102,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/productionReceipt/job/productionReceiptJob.vue b/src/pages/productionReceipt/job/productionReceiptJob.vue index 859c03fc..d748d320 100644 --- a/src/pages/productionReceipt/job/productionReceiptJob.vue +++ b/src/pages/productionReceipt/job/productionReceiptJob.vue @@ -191,7 +191,7 @@ const setQueryParam = () => { if (queryParams.creationTime) { filterParams.push({ column: "create_time", - action: "betweeen", + action: "between", value: queryParams.creationTime }) } diff --git a/src/pages/productionReturn/job/returnJob.vue b/src/pages/productionReturn/job/returnJob.vue index cbe8aa7e..a8a1b62f 100644 --- a/src/pages/productionReturn/job/returnJob.vue +++ b/src/pages/productionReturn/job/returnJob.vue @@ -109,7 +109,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/purchaseReceipt/job/receiptJob.vue b/src/pages/purchaseReceipt/job/receiptJob.vue index 30e25618..f522a487 100644 --- a/src/pages/purchaseReceipt/job/receiptJob.vue +++ b/src/pages/purchaseReceipt/job/receiptJob.vue @@ -112,7 +112,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/purchaseReturn/job/returnJob.vue b/src/pages/purchaseReturn/job/returnJob.vue index 920c2b7e..8c3ae647 100644 --- a/src/pages/purchaseReturn/job/returnJob.vue +++ b/src/pages/purchaseReturn/job/returnJob.vue @@ -104,7 +104,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/putaway/job/putawayJob.vue b/src/pages/putaway/job/putawayJob.vue index 4061ef5d..f6e3241c 100644 --- a/src/pages/putaway/job/putawayJob.vue +++ b/src/pages/putaway/job/putawayJob.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/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue index 765baf5e..1c39c134 100644 --- a/src/pages/repleinsh/job/repleinshJob.vue +++ b/src/pages/repleinsh/job/repleinshJob.vue @@ -144,7 +144,7 @@ const setQueryParam = ()=> { if (queryParams.creationTime ) { filterParams.push({ column: "create_time", - action: "betweeen", + action: "between", value: queryParams.creationTime }) } diff --git a/src/pages/scrap/job/scrapJob.vue b/src/pages/scrap/job/scrapJob.vue index 2bc25a59..fdc241ff 100644 --- a/src/pages/scrap/job/scrapJob.vue +++ b/src/pages/scrap/job/scrapJob.vue @@ -101,7 +101,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/stockUp/job/stockUpJob.vue b/src/pages/stockUp/job/stockUpJob.vue index 146c6a26..fd1e7116 100644 --- a/src/pages/stockUp/job/stockUpJob.vue +++ b/src/pages/stockUp/job/stockUpJob.vue @@ -100,7 +100,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/supplierDeliver/record/supplierDeliverRecord.vue b/src/pages/supplierDeliver/record/supplierDeliverRecord.vue index 56fa69e9..f1a0d525 100644 --- a/src/pages/supplierDeliver/record/supplierDeliverRecord.vue +++ b/src/pages/supplierDeliver/record/supplierDeliverRecord.vue @@ -108,7 +108,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/transfer/job/issueJob.vue b/src/pages/transfer/job/issueJob.vue index 59ac19dd..0c33ff91 100644 --- a/src/pages/transfer/job/issueJob.vue +++ b/src/pages/transfer/job/issueJob.vue @@ -112,7 +112,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/transfer/job/receiptJob.vue b/src/pages/transfer/job/receiptJob.vue index 0207e3e8..6ef9c64e 100644 --- a/src/pages/transfer/job/receiptJob.vue +++ b/src/pages/transfer/job/receiptJob.vue @@ -102,7 +102,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/unPlanned/job/issueJob.vue b/src/pages/unPlanned/job/issueJob.vue index d5acbe6c..82908b10 100644 --- a/src/pages/unPlanned/job/issueJob.vue +++ b/src/pages/unPlanned/job/issueJob.vue @@ -105,7 +105,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) } diff --git a/src/pages/unPlanned/job/receiptJob.vue b/src/pages/unPlanned/job/receiptJob.vue index 7d2fd61e..23a7b873 100644 --- a/src/pages/unPlanned/job/receiptJob.vue +++ b/src/pages/unPlanned/job/receiptJob.vue @@ -112,7 +112,7 @@ const getList = (type) => { if (checkedToday.value) { filters.push({ column: 'create_time', - action: 'betweeen', + action: 'between', value: todayTime.value }) }