diff --git a/src/pages/customerReturn/job/returnDetail.vue b/src/pages/customerReturn/job/returnDetail.vue index 22e63d2a..d5eb8641 100644 --- a/src/pages/customerReturn/job/returnDetail.vue +++ b/src/pages/customerReturn/job/returnDetail.vue @@ -14,15 +14,15 @@ - - + + + + + :locationAreaTypeList="toLocationAreaTypeList"> diff --git a/src/pages/deliver/job/deliverDetailBatch.vue b/src/pages/deliver/job/deliverDetailBatch.vue index 9d70e51c..e7a769de 100644 --- a/src/pages/deliver/job/deliverDetailBatch.vue +++ b/src/pages/deliver/job/deliverDetailBatch.vue @@ -120,6 +120,7 @@ const managementType = ref('') const scanCount = ref('') const balanceinfo = ref('') const fromLocationCode = ref('') +const recommendQty = ref('') const managementList = ref([]); const comMessageRef = ref(null); @@ -217,6 +218,34 @@ const resizeCollapse = () => { }; const getScanResult = (result, managementTypeParams)=> { managementType.value = managementTypeParams + let array1 = []//记录推荐的库位 + let array2 = []//记录推荐的批次 + detailSource.value.forEach(item=>{ + item.subList.forEach(cur=>{ + array1.push(cur.fromLocationCode) + array2.push(cur.batch) + }) + }) + // 扫描的库位是否在 + const obj1 = array1.find(item=>item == result.fromLocationCode) + const obj2 = array2.find(item=>item == result.label.batch) + if(jobContent.value.allowModifyLocation == 'FALSE'){ + if(!obj1){ + showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) + return + } + } + if(jobContent.value.allowModifyBatch == 'FALSE'){ + if(!obj2){ + showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) + return + } + } + if(!obj1){ + recommendQty.value = 0 + }else{ + recommendQty.value = result.balance.qty + } if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ setDataBatch(result) }else{ @@ -274,7 +303,7 @@ const setDataBatch = (result)=> { toLocationCode:toLocationCode.value, batch:result.label.batch, handleQty:result.label.qty, - qty:result.balance.qty, + qty:recommendQty.value, inventoryStatus:result.balance.inventoryStatus, toLocation:result.balance.toLocation, balance:result.balance, @@ -468,7 +497,7 @@ const checkCountBatch = ()=> { item.totalQty = 0 item.taskQty = calc.add(item.taskQty, item.qty) item.totalQty = calc.add(item.totalQty, item.handleQty) - if (jobContent.value.allowPartialComplete == "FALSE") { + if (jobContent.value.allowSmallerQty == "FALSE") { if (item.handleQty != item.taskQty) { str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n` } diff --git a/src/pages/inventoryMove/coms/comMoveRecord.vue b/src/pages/inventoryMove/coms/comMoveRecord.vue index 7c9f4924..7f14d7e4 100644 --- a/src/pages/inventoryMove/coms/comMoveRecord.vue +++ b/src/pages/inventoryMove/coms/comMoveRecord.vue @@ -1,7 +1,7 @@ - diff --git a/src/pages/issue/job/issueDetailBatch.vue b/src/pages/issue/job/issueDetailBatch.vue index 90d3b132..0dd9012f 100644 --- a/src/pages/issue/job/issueDetailBatch.vue +++ b/src/pages/issue/job/issueDetailBatch.vue @@ -84,6 +84,8 @@ import { import WinScanButton from '@/mycomponents/scan/winScanButton.vue' import JobTop from '@/mycomponents/job/jobTop.vue' import WinScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" +import WorkStation from '@/mycomponents/workStation/workStation.vue' +import BalanceSelect from '@/mycomponents/balance/balanceSelect.vue' import {ref, nextTick, getCurrentInstance} from 'vue'; import {onLoad, onNavigationBarButtonTap, onBackPress} from '@dcloudio/uni-app'; @@ -104,6 +106,7 @@ const scanCount = ref('') const balanceinfo = ref('') const fromLocationCode = ref('') const scanMessage = ref('') +const recommendQty = ref('') const managementList = ref([]); const comMessageRef = ref(null); @@ -172,6 +175,7 @@ const getDetail = () => { getIssueJobDetail(id.value).then((res) => { uni.hideLoading(); if (res.data && res.data.subList.length > 0) { + // res.data.allowModifyLocation = 'FALSE' jobContent.value = res.data; jobStatus.value = res.data.status; subList.value = res.data.subList; @@ -209,6 +213,34 @@ const resizeCollapse = () => { }; const getScanResult = (result, managementTypeParams)=> { managementType.value = managementTypeParams + let array1 = []//记录推荐的库位 + let array2 = []//记录推荐的批次 + this.detailSource.forEach(item=>{ + item.subList.forEach(cur=>{ + array1.push(cur.fromLocationCode) + array2.push(cur.batch) + }) + }) + // 扫描的库位是否在 + const obj1 = array1.find(item=>item == result.fromLocationCode) + const obj2 = array2.find(item=>item == result.label.batch) + if(jobContent.value.allowModifyLocation == 'FALSE'){ + if(!obj1){ + this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) + return + } + } + if(jobContent.value.allowModifyBatch == 'FALSE'){ + if(!obj2){ + showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) + return + } + } + if(!obj1){ + recommendQty.value = 0 + }else{ + recommendQty.value = result.balance.qty + } if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ setDataBatch(result) } @@ -262,7 +294,7 @@ const setDataBatch = (result)=> { toLocationCode:toLocationCode.value, batch:result.label.batch, handleQty:result.label.qty, - qty:result.balance.qty, + qty:recommendQty.value, inventoryStatus:result.balance.inventoryStatus, toLocation:result.balance.toLocation, balance:result.balance, @@ -604,8 +636,10 @@ const updateData = (record) => { }; const autoCommit = ()=> { // this.$throttle(this.submit, 2000, this)() + jobContent.value.allowBiggerQty = 'FALSE' let str = "" let str1 = "" + let str2 = "" let totalQty = 0; let taskQty = 0; detailSource.value.forEach(detail => { @@ -613,22 +647,35 @@ const autoCommit = ()=> { if (item.scaned) { taskQty = calc.add(taskQty, item.qty) totalQty = calc.add(totalQty, item.handleQty) - if (item.handleQty < item.qty) { - str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.qty}】不一致\n` + if (jobContent.value.allowSmallerQty == "FALSE") { + if(parseFloat(item.handleQty) item.balance.qty) { - str1 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}】` + if (jobContent.value.allowBiggerQty == 'FALSE') { + if (parseFloat( item.handleQty )> parseFloat(item.qty)){ + str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}】` + } + } + if(parseFloat(item.handleQty)>parseFloat( item.balance.qty)){ + str2 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】` } } - }) }) - if(str1){ - comMessageRef.value.showMessage(str1, res => { - if (res) { - afterCloseMessage() - } - }); + if (str) { + str1 = '不允许提交\n' + str + showErrorMessage(str) + return + } + if (str1) { + str1 = '不允许提交\n' + str1 + showErrorMessage(str1) + return + } + if (str2) { + str2 = '不允许提交\n' + str2 + showErrorMessage(str2) return } if(str){ @@ -641,17 +688,6 @@ const autoCommit = ()=> { //防止重复点击 proxy.$throttle(submit, 2000, proxy)() } else { - // this.detailSource.forEach(detail => { - // detail.Items.forEach(item => { - // taskQty =calc.add(taskQty,item.qty) - // item.Locations.forEach(lco => { - // lco.Batchs.forEach(batch => { - // batch.Records = [] - // }) - // }) - // }) - // }) - // this.$refs.comScanIssuePack.clearList() scanPopupGetFocus() } }); diff --git a/src/pages/issue/record/directIssueByBatch.vue b/src/pages/issue/record/directIssueByBatch.vue index e79736e6..858abae6 100644 --- a/src/pages/issue/record/directIssueByBatch.vue +++ b/src/pages/issue/record/directIssueByBatch.vue @@ -345,7 +345,7 @@ const closeScanPopup = () => { const scanPopupGetFocus = () => { if (scanPopup.value) { - scanPopup.value.getfocus(); + scanPopup.value.packGetFocus(); } };