From 64035597b53b84b3c6286099608b7b29bb7ac7d2 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Sun, 11 Aug 2024 15:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E5=8C=85=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=AB=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scan/winComScanBalanceLocation.vue | 31 +++++ src/pages/package/coms/comScanPackagePack.vue | 12 ++ src/pages/package/job/overPackageJob.vue | 130 +++++++++++++++++- .../package/job/overPackageJobDetail.vue | 10 +- 4 files changed, 176 insertions(+), 7 deletions(-) diff --git a/src/mycomponents/scan/winComScanBalanceLocation.vue b/src/mycomponents/scan/winComScanBalanceLocation.vue index 68f9ae8e..188bd60e 100644 --- a/src/mycomponents/scan/winComScanBalanceLocation.vue +++ b/src/mycomponents/scan/winComScanBalanceLocation.vue @@ -63,6 +63,10 @@ getBalanceByParams, getBasicItemByCode } from '@/api/request2.js'; + + import { + getLabelInfo + } from '@/common/label.js'; import { getListLocationAreaTypeDesc, @@ -165,6 +169,33 @@ this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 }, + //模拟扫描 + openScanPopupForJobSimulate(fromLocationCode, fromLocationList, jobContent, scanMessage) { + this.fromLocationCode = fromLocationCode; + this.fromLocationList = fromLocationList; + if (!fromLocationCode) { + if (this.fromLocationList.length == 0) { + // this.locationGetFocus(); + alert('没有来源库位:List') + } else { + this.fromLocationCode = this.fromLocationList[0]; + } + } + + this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) + this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 + this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 + getLabelInfo(scanMessage, this.headerType, callback => { + if (callback.success) { + this.getScanResult(callback); + } else { + this.showErrorMessage(callback.message, res => {}) + } + + }) + + }, + handleConfirm() { this.$emit('confirm', this.fromLocationCode) }, diff --git a/src/pages/package/coms/comScanPackagePack.vue b/src/pages/package/coms/comScanPackagePack.vue index e1e04d3d..d6b8b098 100644 --- a/src/pages/package/coms/comScanPackagePack.vue +++ b/src/pages/package/coms/comScanPackagePack.vue @@ -95,6 +95,17 @@ import { getDirectoryItemArray } from '@/common/directory'; that.fromLocationList = that.getFromLocationList(); } }, + + //模拟扫描 + openScanPopupForJobSimulate(content, jobcontent, scanMessage) { + this.issueRecord = []; + this.dataContent = content; + this.jobContent = jobcontent; + this.initData(); + this.$refs.scanPopup.openScanPopupForJobSimulate(this.fromLocationCode, this.fromLocationList, this.jobContent, + scanMessage); + + }, showBalanceSelect(items) { this.$refs.balanceSelect.openPopup(items); @@ -342,6 +353,7 @@ import { getDirectoryItemArray } from '@/common/directory'; batch.Records.push(record); this.calcBatchHandleQty(batch); this.packGetFocus(); + this.$emit('refresh'); }, swipeClick(e, item, index) { diff --git a/src/pages/package/job/overPackageJob.vue b/src/pages/package/job/overPackageJob.vue index 92c25cca..f1473476 100644 --- a/src/pages/package/job/overPackageJob.vue +++ b/src/pages/package/job/overPackageJob.vue @@ -19,6 +19,13 @@ + + + + + @@ -32,6 +39,10 @@ goHome, updateTitle } from '@/common/basic.js'; + + import { + getBusinessType + } from '@/common/record.js'; import { planRefreshTime } from '@/common/config.js'; @@ -45,6 +56,9 @@ import jobFilter from '@/mycomponents/job/jobFilter.vue' import comOverPackJobCard from '@/pages/package/coms/comOverPackJobCard.vue' import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue' + import winScanButton from '@/mycomponents/scan/winScanButton.vue' + import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' + import jobList from '@/mycomponents/jobList/jobList.vue' export default { name: 'issue', @@ -52,7 +66,10 @@ comEmptyView, jobFilter, comOverPackJobCard, - jobInfoPopup + jobInfoPopup, + winComScanBalance, + winScanButton, + jobList }, data() { return { @@ -68,7 +85,11 @@ detailOptions: [], detailGiveupOptions: [], title:'', - timer:null + businessTypeCode: "OverPackage", + businessType: null, + timer:null, + scanMessage:"" + }; }, @@ -125,6 +146,16 @@ }, methods: { + getBusinessTypeFunc() { + getBusinessType(this.businessTypeCode, res => { + if (res.success) { + this.businessType = res.businessType; + this.openScanPopup(); + } else { + this.showErrorMessage(res.message) + } + }); + }, timerRefresh() { this.getList('refresh') this.stopRefresh(); @@ -225,8 +256,8 @@ }, - openJobDetail(item) { - this.getJobInfoByNumber(item.number) + openJobDetail(item,scanMessage = '') { + this.getJobInfoByNumber(item.number,scanMessage) }, showItemList(itemList) { @@ -327,8 +358,16 @@ } }); }, + openScanPopup() { + if (this.businessType == null) { + this.getBusinessTypeFunc() + } else { + this.$refs.scanPopup.openScanPopup(this.businessType); + } + }, - getJobInfoByNumber(number){ + getJobInfoByNumber(number,scanMessage){ + console.log("扫描",scanMessage) let that = this; uni.showLoading({ title: "加载中....", @@ -367,14 +406,93 @@ return; } uni.navigateTo({ - url: './overPackageJobDetail?id=' + result.masterId + '&status=' + result.status+'&title='+this.title + url: './overPackageJobDetail?id=' + result.masterId + '&status=' + result.status+'&title='+this.title+'&scanMessage=' + + scanMessage }); + this.scanMessage="" } }).catch(error => { uni.hideLoading(); that.showMessage(error); }) }, + + selectItem(item) { + this.$refs.scanPopup.closeScanPopup(); + this.openJobDetail(item, this.scanMessage); + }, + + getScanResult(result) { + let balance = result.balance; + if (balance != null) { + this.scanMessage = "" + if (!result.label.batch) { + this.showMessage("批次为空") + return; + } + if (!result.label.itemCode) { + this.showMessage("物料号为空") + return; + } + try { + var filters = [{ + column: "status", + action: "in", + value: '1,2' + }, + { + column: "batch", + action: "==", + value: result.label.batch + }, + { + column: "itemCode", + action: "==", + value: result.label.itemCode + }, + { + column: "fromLocationCode", + action: "==", + value: balance.locationCode + } + ] + getOverPageJobList({ + filters: filters, + pageNo: 1, + pageSize: 1000, + sort: 'createTime', + by: 'asc' + }).then(res => { + this.scanMessage = result.scanMessage + let resultList = res.data.list; + if (resultList.length > 0) { + resultList.forEach(item => { + item.title = item.number; + item.selected = false + }) + let list = [] + resultList.forEach(item => { + if (!list.find(subItem => subItem.title == item.title)) { + list.push(item) + } + }) + if (list.length > 0) { + this.selectItem(list[0]) + } + } else { + this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch + + "]物料号[" + result.label.itemCode + "]未查找到任务\n" + "扫描[" + result + .scanMessage + "]") + } + }).catch(error => { + this.showMessage(error + "\n扫描[" + result.scanMessage + "]") + }) + + } catch (e) { + this.showMessage(e.message) + } + } + } } } diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index 2d91d17b..9c2d2319 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -58,7 +58,7 @@ - + @@ -128,6 +128,7 @@ detailOptions: [], scanOptions: [], jobStatus: "", + scanMessage: '' // printDeafult: {}, //默认打印机 // templateDeafult: {} //默认的模板 @@ -143,6 +144,7 @@ title: option.title + '详情' }) this.id = option.id; + this.scanMessage = option.scanMessage || ''; if (this.id != undefined) { //新建的任务自动接收 if (option.status == "1") { @@ -229,6 +231,9 @@ that.jobStatus = res.data.status that.subList = res.data.subList; that.detailSource = getDataSource(that.detailSource, that.subList) + if (this.scanMessage) { + this.openScanPopupSimulate(this.scanMessage); + } // this.$nextTick(() => { // if (uni.getStorageSync('overPackageJobDetailPointParams')) { // const overPackageJobDetailPointParams = uni.getStorageSync( @@ -255,6 +260,9 @@ this.showErrorMessage(error) }) }, + openScanPopupSimulate(scanMessage) { + this.$refs.comScanPackagePack.openScanPopupForJobSimulate(this.detailSource, this.jobContent, scanMessage); + }, closeScan() { this.resizeCollapse();