From c4450633fbf43615f35014413dc72086e70a1696 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 19 Mar 2024 15:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E5=8C=85=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/directory.js | 42 ++++- src/common/record.js | 4 + src/mycomponents/scan/winScanLocation.vue | 19 +- src/pages/index/index.vue | 3 +- .../package/job/overPackageJobDetail.vue | 74 ++++---- .../package/record/overPackageRecord.vue | 165 +++++++++++------- 6 files changed, 197 insertions(+), 110 deletions(-) diff --git a/src/common/directory.js b/src/common/directory.js index c72deb20..5eae6dcb 100644 --- a/src/common/directory.js +++ b/src/common/directory.js @@ -19,6 +19,8 @@ let inspectTypeList = []; let sampleMethodList = []; let transferModeList = []; let countStageList = []; +let locationAreaTypeList = []; + // 获取业务类型字典项 @@ -57,6 +59,7 @@ export function clearCacheData() { sampleMethodList = []; transferModeList = []; countStageList = []; + locationAreaTypeList=[] } //获取字典信息 @@ -144,6 +147,16 @@ export function getJobStateStyle(value) { } } +//获取库区描述(多个库区) +export function getListLocationAreaTypeDesc(list) { + let desc = ''; + list.forEach(res => { + desc += getLocationAreaTypeInfo(res).label + "," + }) + desc = desc.slice(0, -1); + return desc; +} + //获取库位描述(多个库位) export function getListLocationTypeDesc(list) { let desc = ''; @@ -212,6 +225,23 @@ export function getItemStateInfo(value) { return resultInfo } +//获取库区类型 +export function getLocationAreaTypeInfo(value) { + var resultInfo = ""; + if (locationAreaTypeList.length == 0) { + locationAreaTypeList = getDirectoryInfo("area_type") + } + if (locationAreaTypeList.length > 0) { + for (let item of locationAreaTypeList) { + if (item.value == value) { + resultInfo = item + break; + } + } + } + return resultInfo +} + //获取库位类型 export function getLocationTypeInfo(value) { var resultInfo = ""; @@ -228,6 +258,13 @@ export function getLocationTypeInfo(value) { } return resultInfo } +//获取库区类型名称 +export function getLocationAreaTypeName(value) { + let location = getLocationAreaTypeInfo(value); + + return location == '' ? value : location.label; +} + //获取库位类型名称 export function getLocationTypeName(value) { @@ -529,4 +566,7 @@ export function getPackUnitName(value) { } } return resultInfo -} \ No newline at end of file +} + + +locationAreaTypeList \ No newline at end of file diff --git a/src/common/record.js b/src/common/record.js index 09bff6d6..cf6763c6 100644 --- a/src/common/record.js +++ b/src/common/record.js @@ -79,6 +79,8 @@ export function getBusinessType(typeCode, callback) { success: true, businessType: '', fromlocationTypeList: '', + fromLocationAreaTypeList:'', + toAreaTypes:'', tolocationTypeList: '', itemCodeTypeList:"", useOnTheWay:"FALSE", @@ -89,6 +91,8 @@ export function getBusinessType(typeCode, callback) { getBusinesstypeByCode(typeCode).then(res => { if (res.data.total > 0) { result.businessType = res.data.list[0]; + result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes) ; + result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes) ; result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes) result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes) result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes) diff --git a/src/mycomponents/scan/winScanLocation.vue b/src/mycomponents/scan/winScanLocation.vue index 8f40ed87..95b191c2 100644 --- a/src/mycomponents/scan/winScanLocation.vue +++ b/src/mycomponents/scan/winScanLocation.vue @@ -27,8 +27,8 @@ getBasicLocationByCode, } from '@/api/request2.js'; import { - getLocationTypeName, - getListLocationTypeDesc, + getLocationAreaTypeName, + getListLocationAreaTypeDesc, checkDirectoryItemExist } from '@/common/directory.js'; import winComScan from '@/mycomponents/scan/winComScan.vue' @@ -44,7 +44,7 @@ }, locationTypeList: { type: Array, - default: [] + default: null }, isShowHistory: { type: Boolean, @@ -98,15 +98,22 @@ if (res.data.total > 0) { let result = res.data.list[0]; var type = result.type; + var areaType = "" + if(this.code=="RAW"){ + areaType="RAW" + }else { + areaType="SUPPER" + } + var available = result.available; if (available == "TRUE") { - if (checkDirectoryItemExist(this.locationTypeList, type)) { + if (checkDirectoryItemExist(this.locationTypeList, areaType)) { this.location = result; this.callBack(); } else { - var hint = getListLocationTypeDesc(this.locationTypeList); + var hint = getListLocationAreaTypeDesc(this.locationTypeList); this.showErrorMessage("扫描库位[" + this.code + "]是[" + - getLocationTypeName(type) + "],需要的库位类型是[" + hint + "]") + getLocationAreaTypeName(areaType) + "],需要的库区是[" + hint + "]") } } else { this.showErrorMessage("扫描库位[" + this.code + "]不可用") diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 3ae14fe0..45cad563 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -93,7 +93,6 @@ forcedLogin: false, count: 1, position: [-10, -10], - timer: null, menusCount: {}, filterList: [], serchval: "" @@ -337,7 +336,7 @@ "inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason", "unplanned_issue_reason", "scrap_reason", "inspect_failed_reason", "request_status", "inspect_type", "next_action", "sample_method", "transfer_mode", - "count_stage", "inspect_result" + "count_stage", "inspect_result","area_type" ] } getDictionaryItem(params).then(res => { diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index daf9aa03..8039ea93 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -25,13 +25,14 @@ 新标包数量 : {{subList[0].toPackQty}} - - + + - + @@ -75,7 +76,7 @@ import { getManagementPrecisions } from '@/common/balance.js'; - + import { calc } from '@/common/calc.js'; @@ -105,7 +106,7 @@ detailSource: [], //绑定在页面上的数据源 detailOptions: [], scanOptions: [], - jobStatus:"" + jobStatus: "" }; }, @@ -137,7 +138,7 @@ onBackPress(e) { //已经接收但是没提交任务 if (e.from === 'backbutton') { - if (this.jobStatus=="2") { + if (this.jobStatus == "2") { //取消承接任务 cancleTakeOverPageJob(this.id).then(res => { uni.navigateBack(); @@ -147,10 +148,10 @@ } else { uni.navigateBack(); } - + return true; } - + }, watch: { @@ -280,31 +281,32 @@ }); } }, - checkSubmit(){ + checkSubmit() { var tempHandleQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].handleQty var tempQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].qty var toPackQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].toPackQty - if(tempHandleQty>tempQty){ + if (tempHandleQty > tempQty) { //大于需求数量 - this.showCommitMessage("实际数量【"+tempHandleQty+"】大于需求数量"+"【"+tempQty+"】, 是否提交?",tempHandleQty,toPackQty) - }else if (tempHandleQty0){ - var count= Math.ceil(tempHandleQty / toPackQty); - //发翻两包 - this.$refs.comMessage.showQuestionMessage("新标包数量是【"+toPackQty+"】,扫描数量【"+tempHandleQty+"】,将不能翻成【"+count+"】个整包,是否提交?", res => { - if (res) { - this.submitJob() - } - }); - - }else{ + if (tempHandleQty % toPackQty > 0) { + this.$refs.comMessage.showQuestionMessage("扫描数量【" + tempHandleQty + + "】,将有1个非整包,是否提交?", res => { + if (res) { + this.submitJob() + } + }); + + } else { this.submitJob() } }, @@ -321,7 +323,7 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成发料记录
" + res.data) } else { - this.showErrorMessage("提交失败[" + res.msg+"]") + this.showErrorMessage("提交失败[" + res.msg + "]") } }).catch(error => { uni.hideLoading() @@ -366,11 +368,13 @@ record.singlePrice = single_price; record.amount = single_price * r.qty; - record.fromPackUnit = subItem.fromPackUnit; + record.fromPackUnit = subItem + .fromPackUnit; record.toPackUnit = subItem.toPackUnit; - record.fromPackQty = subItem.fromPackQty; + record.fromPackQty = subItem + .fromPackQty; record.toPackQty = subItem.toPackQty; - + record.toBatch = r.batch; record.toPackingNumber = "" @@ -450,10 +454,10 @@ let handleQty = 0; if (batch != undefined) { batch.Records.forEach(res => { - handleQty = calc.add(handleQty,res.qty) + handleQty = calc.add(handleQty, res.qty) }) batch.handleQty = handleQty; - itemHandleQty = calc.add(itemHandleQty,handleQty) + itemHandleQty = calc.add(itemHandleQty, handleQty) } }) } @@ -481,10 +485,10 @@ } }); }, - showCommitMessage(message,tempHandleQty,toPackQty) { + showCommitMessage(message, tempHandleQty, toPackQty) { this.$refs.comMessage.showQuestionMessage(message, res => { if (res) { - this.packageHint(tempHandleQty,toPackQty) + this.packageHint(tempHandleQty, toPackQty) } }); }, @@ -563,4 +567,4 @@ // border-bottom-width: 1px; // border-bottom-color: #ebeef5; // } - + \ No newline at end of file diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index 33e54e40..88c4977c 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -9,11 +9,13 @@ - + 来源库位 : {{item.subList[0].locationCode}} - 来源包装规格 : {{getPackUnitName(packUnit)}} + 来源包装规格 : + {{fromPackUnit}}/{{item.subList[0].packQty}}{{getUomInfo(item.subList[0].uom)}} + - + 目标包装规格 : - {{toPackUnit}} + {{toPackUnitShow}} + @confirm="confirmSelect"> + + - + @@ -53,10 +57,10 @@ + :locationTypeList="fromLocationAreaTypeList"> - +