diff --git a/src/pages/productPutaway/job/productPutawayJob.vue b/src/pages/productPutaway/job/productPutawayJob.vue index c2c69de1..0d7aa4ec 100644 --- a/src/pages/productPutaway/job/productPutawayJob.vue +++ b/src/pages/productPutaway/job/productPutawayJob.vue @@ -210,7 +210,7 @@ }) }, - openJobDetail(item,packingNumber='') { + openJobDetail(item, packingNumber = '') { uni.navigateTo({ url: './productPutawayDetail?id=' + item.masterId + '&status=' + item.status + '&type=' + item .type + '&scaned=' + packingNumber @@ -333,19 +333,21 @@ action: "==", value: result.label.batch }, + // { + // column: "qty", + // action: "==", + // value: result.label.qty + // }, { - column: "qty", - action: "==", - value: result.label.qty - }, { column: "itemCode", action: "==", value: result.label.itemCode - }, { - column: "fromLocationCode", - action: "==", - value: result.label.fromLocationCode - } + }, + // { + // column: "fromLocationCode", + // action: "==", + // value: result.label.fromLocationCode + // } ] getProductPutawayJobList({ filters: filters, @@ -358,10 +360,14 @@ item.selected = false }) console.log('list', list) - if (list.length > 1) { - this.$refs.jobList.openList(list) + if (list.length > 0) { + if (list.length > 1) { + this.$refs.jobList.openList(list) + } else { + this.selectItem(list[0]) + } } else { - this.selectItem(list[0]) + this.showMessage('未查找到任务') } }).catch(error => { this.showMessage(error) diff --git a/src/pages/productReceipt/job/productReceiptJob.vue b/src/pages/productReceipt/job/productReceiptJob.vue index f42c5995..646302d5 100644 --- a/src/pages/productReceipt/job/productReceiptJob.vue +++ b/src/pages/productReceipt/job/productReceiptJob.vue @@ -52,8 +52,8 @@ import jobInfoPopup from '@/pages/productReceipt/coms/jobInfoPopup.vue' import jobList from '@/mycomponents/jobList/jobList.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue' - import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" - + import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" + export default { name: 'receipt', components: { @@ -212,18 +212,21 @@ }) }, - openJobDetail(item,packingNumber='') { + openJobDetail(item, packingNumber = '') { if (this.type == 'predict') { uni.navigateTo({ - url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber + url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + + packingNumber }); } else if (this.type == 'assemble') { uni.navigateTo({ - url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber + url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status + + '&scaned=' + packingNumber }); } else { uni.navigateTo({ - url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber + url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + + packingNumber }); } }, @@ -336,66 +339,72 @@ return; } this.getList("more"); - }, - 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: "qty", - action: "==", - value: result.label.qty - }, { - column: "itemCode", - action: "==", - value: result.label.itemCode - }, { - column: "fromLocationCode", - action: "==", - value: result.label.fromLocationCode - } - ] - getProductReceiptJobList({ - filters: filters, - pageNo: 1, - pageSize: 100, - }).then(res => { - var list = res.data.list; - list.forEach(item => { - item.title = item.number; - item.selected = false - }) - console.log('list', list.length) - if (list.length > 1) { - this.$refs.jobList.openList(list) - } else { - this.selectItem(list[0]) - } - }).catch(error => { - this.showMessage(error) - }) - - } catch (e) { - this.showMessage(e.message) - } + }, + 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: "qty", + // action: "==", + // value: result.label.qty + // }, + { + column: "itemCode", + action: "==", + value: result.label.itemCode + }, + // { + // column: "fromLocationCode", + // action: "==", + // value: result.label.fromLocationCode + // } + ] + getProductReceiptJobList({ + filters: filters, + pageNo: 1, + pageSize: 100, + }).then(res => { + var list = res.data.list; + list.forEach(item => { + item.title = item.number; + item.selected = false + }) + console.log('list', list.length) + if (list.length > 0) { + 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/purchaseReceipt/job/receiptJob.vue b/src/pages/purchaseReceipt/job/receiptJob.vue index 8aa68183..82047983 100644 --- a/src/pages/purchaseReceipt/job/receiptJob.vue +++ b/src/pages/purchaseReceipt/job/receiptJob.vue @@ -254,7 +254,7 @@ }) }, - openJobDetail(item,packingNumber='') { + openJobDetail(item, packingNumber = '') { uni.navigateTo({ url: './receiptDetail?id=' + item.masterId + '&status=' + item.status + '&operation=' + this .operation + '&scaned=' + packingNumber @@ -342,19 +342,21 @@ action: "==", value: result.label.batch }, + // { + // column: "qty", + // action: "==", + // value: result.label.qty + // }, { - column: "qty", - action: "==", - value: result.label.qty - }, { column: "itemCode", action: "==", value: result.label.itemCode - }, { - column: "fromLocationCode", - action: "==", - value: result.label.fromLocationCode - } + }, + // { + // column: "fromLocationCode", + // action: "==", + // value: result.label.fromLocationCode + // } ] getPurchaseReceiptJobList({ filters: filters, @@ -367,10 +369,14 @@ item.selected = false }) console.log('list', list) - if (list.length > 1) { - this.$refs.jobList.openList(list) + if (list.length > 0) { + if (list.length > 1) { + this.$refs.jobList.openList(list) + } else { + this.selectItem(list[0]) + } } else { - this.selectItem(list[0]) + this.showMessage('未查找到任务') } }).catch(error => { this.showMessage(error)