diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index a94fea2d..09e5fe2a 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -95,6 +95,10 @@ + + + @@ -169,6 +173,25 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; this.scanOptions = getDetailEditRemoveOption(); }, methods: { + openScanPopupForJobSimulate(content, jobcontent) { + this.issueRecord = []; + this.dataContent = content; + this.jobContent = jobcontent; + this.initData(); + // this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode + + // "-" + this.jobContent.subList[0].workStationCode + if (this.$refs.comscansimulate != undefined) { + this.$refs.comscansimulate.getfocus(); + } + let timer = setTimeout(res => { + if(timer){ + clearTimeout(timer) + } + this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent) + this.$refs.comscansimulate.clickScanMsg(); + }, 500) + }, + openScanPopup(content, jobcontent) { this.issueRecord = []; this.dataContent = content; diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 9c75f0f4..4d0c0c1e 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -96,7 +96,8 @@ detailSource: [], //绑定在页面上的数据源 detailOptions: [], scanOptions: [], - jobStatus: "" + jobStatus: "", + scanedPackingNumber: '' }; }, @@ -106,6 +107,7 @@ onLoad(option) { this.id = option.id; + this.scanedPackingNumber = option.scaned || ''; if (this.id != undefined) { //新建的任务自动接收 if (option.status == "1") { @@ -199,8 +201,19 @@ setTimeout(r => { that.resizeCollapse(); }, 100) + // that.detailSource.forEach(r => { + // r.subList.forEach(s => { + // if (this.scanedPackingNumber && this.scanedPackingNumber == s + // .packingNumber) { + // s.scaned = true + // s.cancleScanedHiht = true + // //模拟扫描功能 + // this.openScanPopupSimulate(s); + // this.scanedPackingNumber = '' + // } + // }) + // }) - uni.hideLoading(); } else { that.showMessage('列表数据为0'); } @@ -258,22 +271,18 @@ itemCodes.push(item.itemCode) }) }) + + //获取管理模式,封装参数 + getManagementPrecisions(itemCodes, locationCode, res => { + if (res.success) { + this.managementList = res.list; + this.submitJob(); + } else { + uni.hideLoading(); + this.showErrorMessage(res.message); + } + }); - //使用在途库,不查询管理模式 - if (this.jobContent.useOnTheWayLocation == 'TRUE') { - this.submitJob(); - } else { - //获取管理模式,封装参数 - getManagementPrecisions(itemCodes, locationCode, res => { - if (res.success) { - this.managementList = res.list; - this.submitJob(); - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); - } - }); - } }, submitJob() { @@ -337,8 +346,7 @@ record.amount = single_price * r.qty; //使用在途库不改变管理模式 - if (this.jobContent - .useOnTheWayLocation == 'TRUE') { + if (item.onTheWayLocationCode) { record.toPackingNumber = r .packingNumber; record.toBatch = r.batch; @@ -511,6 +519,11 @@ // Object.assign(datacontent, this.detailSource); this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent); }, + + // openScanPopupSimulate(){ + // this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this.jobContent); + // }, + closeScanPopup() { this.updateCommitBtn(); }, diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index 2010a270..ae213226 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -21,6 +21,9 @@ + + + @@ -45,6 +48,9 @@ import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue' import jobListPopup from '@/pages/issue/coms/jobListPopup.vue' import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue' + import winScanButton from '@/mycomponents/scan/winScanButton.vue' + import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" + import jobList from '@/mycomponents/jobList/jobList.vue' export default { name: 'issue', @@ -53,7 +59,10 @@ jobFilter, comIssueJobCard, jobListPopup, - jobInfoPopup + jobInfoPopup, + winScanPackJob, + winScanButton, + jobList }, data() { return { @@ -223,9 +232,10 @@ }, - openJobDetail(item) { + openJobDetail(item, packingNumber = '') { uni.navigateTo({ - url: './issueDetail?id=' + item.masterId + '&status=' + item.status + url: './issueDetail?id=' + item.masterId + '&status=' + item.status+'&scaned=' + + packingNumber }); }, @@ -236,6 +246,11 @@ selectedItem(item) { this.openJobDetail(item); }, + + selectItem(item) { + this.$refs.scanPopup.closeScanPopup(); + this.openJobDetail(item,item.packingNumber); + }, swipeClick(e, dataContent) { if (e.content.text == "详情") { @@ -306,8 +321,6 @@ filters: filters, pageNo: 1, pageSize: 100, - sort: 'fromLocationCode', - by: 'asc' } getIssueJobList(params).then(res => { uni.hideLoading(); @@ -329,6 +342,63 @@ } }); }, + openScanPopup() { + this.$refs.scanPopup.openScanPopup(); + }, + getScanResult(result) { + try { + var filters = [ + { + column: "status", + action: "in", + value: '1,2' + }, + { + column: "batch", + action: "==", + value: result.label.batch + }, + { + column: "itemCode", + action: "==", + value: result.label.itemCode + } + ] + getIssueJobList({ + filters: filters, + pageNo: 1, + pageSize: 100, + sort: 'createTime', + by: 'asc' + }).then(res => { + 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 > 1) { + this.$refs.jobList.openList(list) + } else { + this.selectItem(list[0]) + } + } else { + this.showMessage('未查找到任务') + } + }).catch(error => { + this.showMessage(error) + }) + + } catch (e) { + this.showMessage(e.message) + } + }, } } diff --git a/src/pages/issue/js/issue.js b/src/pages/issue/js/issue.js index 696ff895..97b8b8b5 100644 --- a/src/pages/issue/js/issue.js +++ b/src/pages/issue/js/issue.js @@ -53,6 +53,7 @@ export function createItemInfo(detail) { let item = { itemCode: detail.itemCode, itemName: detail.itemName, + onTheWayLocationCode:detail.onTheWayLocationCode, productionLineCode: detail.productionLineCode, workStationCode: detail.workStationCode, packQty: detail.packQty, diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index 2cb32dd4..5c0c95c1 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -272,22 +272,24 @@ itemCodes.push(item.itemCode) }) }) + + this.checkSubmit(); //使用在途库,不查询管理模式 - if (this.jobContent.useOnTheWayLocation == 'TRUE') { - this.checkSubmit(); - } else { - //获取管理模式,封装参数 - getManagementPrecisions(itemCodes, locationCode, res => { - if (res.success) { - this.managementList = res.list; - this.checkSubmit(); - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); - } - }); - } + // if (this.jobContent.useOnTheWayLocation == 'TRUE') { + // this.checkSubmit(); + // } else { + // //获取管理模式,封装参数 + // getManagementPrecisions(itemCodes, locationCode, res => { + // if (res.success) { + // this.managementList = res.list; + // this.checkSubmit(); + // } else { + // uni.hideLoading(); + // this.showErrorMessage(res.message); + // } + // }); + // } }, checkSubmit() { var tempHandleQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].handleQty diff --git a/src/pages/productionReceipt/job/productionReceiptDetail.vue b/src/pages/productionReceipt/job/productionReceiptDetail.vue index 22c626ea..a2762da0 100644 --- a/src/pages/productionReceipt/job/productionReceiptDetail.vue +++ b/src/pages/productionReceipt/job/productionReceiptDetail.vue @@ -109,11 +109,13 @@ toLocationAreaTypeList: [], jobStatus: "", jobToLocationCode: "", - isCheckLocation: false + isCheckLocation: false, + scanedPackingNumber: '' }; }, onLoad(option) { this.id = option.id; + this.scanedPackingNumber = option.scaned || ''; if (this.id != undefined) { //新建的任务自动接收 if (option.status == "1") { @@ -191,6 +193,20 @@ } else { that.toLocationCode = that.jobToLocationCode; } + that.detailSource.forEach(r => { + r.subList.forEach(s => { + if (this.scanedPackingNumber && this.scanedPackingNumber == s + .packingNumber) { + s.scaned = true + s.cancleScanedHiht = true + //模拟扫描功能 + this.openScanPopupSimulate(s); + this.scanedPackingNumber = '' + } + }) + }) + + } else { that.showMessage('列表数据为0'); } @@ -251,6 +267,31 @@ this.$refs.scanPopup.closeScanPopup(); }, + //模拟扫描功能 + openScanPopupSimulate(item) { + + let fromlocationCode = ''; + let fromlocationList = []; + for (var i = 0; i < this.detailSource.length; i++) { + let item = this.detailSource[i]; + item.subList.forEach(l => { + //重复的库位不往里面插入 + var location = fromlocationList.find(res => res == l.fromLocationCode) + if (location == undefined) { + fromlocationList.push(l.fromLocationCode); + } + //来源库位赋默认值 + if (fromlocationCode == '') { + if (!l.scaned) { + fromlocationCode = l.fromLocationCode; + } + } + }) + } + this.$refs.scanPopup.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, this.jobContent, + item); + }, + getScanResult(result) { try { // var supplierCode = result.label.supplierCode; @@ -278,7 +319,7 @@ this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]库位[" + locationCode + "]不在列表中") } else { - if (itemDetail.scaned) { + if (!itemDetail.cancleScanedHiht&&itemDetail.scaned) { this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]库位[" + locationCode + "]已经扫描") } else { diff --git a/src/pages/productionReceipt/job/productionReceiptJob.vue b/src/pages/productionReceipt/job/productionReceiptJob.vue index 5a660cf8..7c06df09 100644 --- a/src/pages/productionReceipt/job/productionReceiptJob.vue +++ b/src/pages/productionReceipt/job/productionReceiptJob.vue @@ -22,6 +22,9 @@ + + + @@ -48,6 +51,9 @@ import comProductionJobCard from '@/pages/productionReceipt/coms/comProductionJobCard.vue' import jobListPopup from '@/pages/productionReceipt/coms/jobListPopup.vue' import jobInfoPopup from '@/pages/productionReceipt/coms/jobInfoPopup.vue' + import winScanButton from '@/mycomponents/scan/winScanButton.vue' + import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" + import jobList from '@/mycomponents/jobList/jobList.vue' export default { name: 'productionReceipt', @@ -56,7 +62,10 @@ jobFilter, comProductionJobCard, jobListPopup, - jobInfoPopup + jobInfoPopup, + winScanPackJob, + winScanButton, + jobList }, data() { return { @@ -177,9 +186,10 @@ }) }, - openJobDetail(item) { + openJobDetail(item, packingNumber = '') { uni.navigateTo({ - url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status + url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status+'&scaned=' + + packingNumber }); }, @@ -280,6 +290,64 @@ } }); }, + openScanPopup() { + this.$refs.scanPopup.openScanPopup(); + }, + selectItem(item) { + this.$refs.scanPopup.closeScanPopup(); + this.openJobDetail(item,item.packingNumber); + }, + getScanResult(result) { + try { + var filters = [{ + column: "packingNumber", + action: "==", + value: result.label.packingNumber + }, + { + column: "batch", + action: "==", + value: result.label.batch + }, + { + column: "itemCode", + action: "==", + value: result.label.itemCode + } + ] + getProductionReceiptJobList({ + filters: filters, + pageNo: 1, + pageSize: 100, + }).then(res => { + 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 > 1) { + this.$refs.jobList.openList(list) + } else { + this.selectItem(list[0]) + } + } else { + this.showMessage('未查找到任务') + } + }).catch(error => { + this.showMessage(error) + }) + + } catch (e) { + this.showMessage(e.message) + } + }, } } diff --git a/src/pages/repleinsh/job/repleinshDetail.vue b/src/pages/repleinsh/job/repleinshDetail.vue index 53ec9d9d..f1d1416c 100644 --- a/src/pages/repleinsh/job/repleinshDetail.vue +++ b/src/pages/repleinsh/job/repleinshDetail.vue @@ -227,12 +227,12 @@ // this.setSubmitParamsAndSubmit(); // } // } else { - //不允许部分提交,扫描数必须等于任务数量才可以提交 - if (scanCount == 0) { - this.showErrorMessage("扫描数为0,请先扫描") - } else { - this.setSubmitParamsAndSubmit(); - } + //不允许部分提交,扫描数必须等于任务数量才可以提交 + if (scanCount == 0) { + this.showErrorMessage("扫描数为0,请先扫描") + } else { + this.setSubmitParamsAndSubmit(); + } // } }, @@ -245,22 +245,22 @@ itemCodes.push(item.itemCode) }) }) - + this.submitJob(); //使用在途库,不查询管理模式 - if (this.jobContent.useOnTheWayLocation == 'TRUE') { - this.submitJob(); - } else { - //获取管理模式,封装参数 - getManagementPrecisions(itemCodes, locationCode, res => { - if (res.success) { - this.managementList = res.list; - this.submitJob(); - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); - } - }); - } + // if (this.jobContent.useOnTheWayLocation == 'TRUE') { + // this.submitJob(); + // } else { + // //获取管理模式,封装参数 + // getManagementPrecisions(itemCodes, locationCode, res => { + // if (res.success) { + // this.managementList = res.list; + // this.submitJob(); + // } else { + // uni.hideLoading(); + // this.showErrorMessage(res.message); + // } + // }); + // } }, submitJob() {