diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 2d902071..1e724626 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -443,6 +443,14 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; onScan(result) { + if(!result.package){ + this.showErrorMessage('扫描数据错误['+result.label.code+"]", + res => { + this.getfocus(); + } + ) + return; + } if (this.toLocation && result.package.packUnit) { let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode); if (result.package.packUnit !== item.packUnit) { diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index d3f944d9..ca3ec5c7 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -369,6 +369,14 @@ this.$refs.scanPopup.openScanPopup(); }, getScanResult(result) { + if(!result.label.batch){ + this.showMessage("批次为空") + return; + } + if(!result.label.itemCode){ + this.showMessage("物料号为空") + return; + } try { var filters = [ { @@ -390,7 +398,7 @@ getIssueJobList({ filters: filters, pageNo: 1, - pageSize: 100, + pageSize: 1000, sort: 'createTime', by: 'asc' }).then(res => { @@ -407,9 +415,7 @@ list.push(item) } }) - if (list.length > 1) { - this.$refs.jobList.openList(list) - } else { + if(list.length >0){ this.selectItem(list[0]) } } else { diff --git a/src/pages/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue index b43b683f..5570487d 100644 --- a/src/pages/repleinsh/job/repleinshJob.vue +++ b/src/pages/repleinsh/job/repleinshJob.vue @@ -21,6 +21,8 @@ + + @@ -48,7 +50,9 @@ import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue' import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue' import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue' - + import winScanButton from '@/mycomponents/scan/winScanButton.vue' + import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" + export default { name: 'repleinsh', components: { @@ -57,6 +61,8 @@ comRepleinshJobCard, repleinshJobListPopup, repleinshInfoPopup, + winScanPackJob, + winScanButton, }, data() { return { @@ -195,9 +201,10 @@ this.getList('refresh', fromLocationCode, '') }, - openJobDetail(item) { + openJobDetail(item,scanMessage = '') { uni.navigateTo({ - url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + + scanMessage }); }, @@ -300,6 +307,74 @@ } }); }, + openScanPopup() { + this.$refs.scanPopup.openScanPopup(); + }, + selectItem(item) { + this.$refs.scanPopup.closeScanPopup(); + this.openJobDetail(item,this.scanMessage); + }, + getScanResult(result) { + 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 + } + ] + getRepleinshJobList({ + 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("物料号["+result.label.itemCode+"]批次["+result.label.batch+']未查找到任务') + } + }).catch(error => { + this.showMessage(error) + }) + + } catch (e) { + this.showMessage(e.message) + } + }, } }