diff --git a/src/mycomponents/package/packageCard.vue b/src/mycomponents/package/packageCard.vue index 4ddd0e74..e6601d05 100644 --- a/src/mycomponents/package/packageCard.vue +++ b/src/mycomponents/package/packageCard.vue @@ -93,6 +93,19 @@ }, watch: { + // 模拟扫描功能 + dataContent: { + handler(newVal, oldVal) { + if(newVal.scaned){ + newVal.copyContent = "HPQ;V1.0;I" + newVal.itemCode + ";P" + newVal.packingNumber + ";B" + newVal.batch + ";Q" + newVal.qty + }else{ + newVal.copyContent = '' + } + console.log('newVal.copyContent',newVal.copyContent) + }, + immediate: true, + deep: true + } }, methods: { diff --git a/src/mycomponents/scan/winComScan.vue b/src/mycomponents/scan/winComScan.vue index 214881f7..63b5b193 100644 --- a/src/mycomponents/scan/winComScan.vue +++ b/src/mycomponents/scan/winComScan.vue @@ -145,6 +145,9 @@ this.placeholderValue = '请扫描' + this.placeholder; }, methods: { + setItemCodeSimulate(scanMsg) { + this.scanMsg = scanMsg; + }, hide() { // #ifdef APP-PLUS // 只是解决软键盘的闪现 diff --git a/src/mycomponents/scan/winScanPack.vue b/src/mycomponents/scan/winScanPack.vue index 8913073f..1981c301 100644 --- a/src/mycomponents/scan/winScanPack.vue +++ b/src/mycomponents/scan/winScanPack.vue @@ -20,6 +20,8 @@ + + @@ -55,6 +57,10 @@ }, methods: { + simulateScan(item){ + this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent) + this.$refs.comscansimulate.clickScanMsg(); + }, openScanPopup() { setTimeout(res => { this.$refs.popup.open('bottom') @@ -75,6 +81,7 @@ }, getScanResult(result) { + if (result.success) { this.$emit("getResult", result); } else { diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index eef6b720..2a1ab0f6 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -46,6 +46,9 @@ + + + @@ -172,6 +175,38 @@ this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 }, + //模拟扫描 + openScanPopupForJobSimulate(fromLocationCode, fromLocationList, jobContent,item) { + this.fromLocationCode = fromLocationCode; + this.fromLocationList = fromLocationList; + if (fromLocationCode != '') { + // this.packGetFocus(); + if (this.$refs.comscansimulate != undefined) { + this.$refs.comscansimulate.getfocus(); + } + + } else { + 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); //出库库存状态 + let timer = setTimeout(res => { + if(timer){ + clearTimeout(timer) + } + // this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent) + // this.$refs.comscansimulate.clickScanMsg(); + }, 500) + + + }, closeScanPopup(content) { this.$refs.popup.close(); diff --git a/src/pages/productReceipt/job/productReceiptDetail.vue b/src/pages/productReceipt/job/productReceiptDetail.vue index 001c95db..468d20fb 100644 --- a/src/pages/productReceipt/job/productReceiptDetail.vue +++ b/src/pages/productReceipt/job/productReceiptDetail.vue @@ -223,8 +223,9 @@ r.subList.forEach(s => { if (this.scanedPackingNumber && this.scanedPackingNumber == s .packingNumber){ - s.scaned = true - s.handleQty =s.qty + s.scaned = true + this.$refs.scanPopup.simulateScan(s); + // s.handleQty =s.qty } }) }) diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index c2caebec..aa97f967 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -98,10 +98,13 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue' - import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue' - import { - productDismantleJobClose - } from '@/api/request2.js'; + import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue' + import { + productDismantleJobClose + } from '@/api/request2.js'; + import { + nextTick + } from 'vue'; export default { name: 'receipt_detail', @@ -137,7 +140,7 @@ onLoad(option) { this.id = option.id; - // this.scanedPackingNumber = option.scaned || ''; + this.scanedPackingNumber = option.scaned || ''; this.operation = option.operation; if (this.id != undefined) { //新建的任务自动接收 @@ -219,13 +222,19 @@ that.jobStatus = res.data.status that.jobToLocationCode = that.subList[0].toLocationCode that.detailSource = getTreeDataSource(that.subList) - that.detailSource.forEach(r => { - r.subList.forEach(s => { - if (this.scanedPackingNumber && this.scanedPackingNumber == s - .packingNumber) s.scaned = true + that.isAllReceived = false; + nextTick(() => { + that.detailSource.forEach(r => { + r.subList.forEach(s => { + if (this.scanedPackingNumber && this + .scanedPackingNumber == s + .packingNumber) { + s.scaned = true + this.$refs.scanPopup.simulateScan(s); + } + }) }) }) - that.isAllReceived = false; } else { that.showMessage('列表数据为0'); } @@ -395,11 +404,11 @@ } else if (this.scanCount < this.subList.length) { //扫描数量小于任务数量,判断是否允许部分提交 if (this.jobContent.allowPartialComplete == "TRUE") { - //提交 - this.$refs.comMessage.showQuestionMessage('还有未扫描的物料,是否继续提交?', res => { - if (res) { - this.submitJob(); - } + //提交 + this.$refs.comMessage.showQuestionMessage('还有未扫描的物料,是否继续提交?', res => { + if (res) { + this.submitJob(); + } }); } else { //不允许部分提交,提示 @@ -417,21 +426,21 @@ reject() { this.$refs.comMessage.showQuestionMessage('是否要拒收任务
[' + this.jobContent.asnNumber + ']?', res => { - if (res) { - uni.showLoading({ - title: "提交中....", - mask: true - }); - productDismantleJobClose(this.id).then(res => { - console.log('拒收',res) - if (res.data) { - navigateBack(1) - } else { - this.showErrorMessage(res.msg) - } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) + if (res) { + uni.showLoading({ + title: "提交中....", + mask: true + }); + productDismantleJobClose(this.id).then(res => { + console.log('拒收', res) + if (res.data) { + navigateBack(1) + } else { + this.showErrorMessage(res.msg) + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) }) } }) @@ -459,11 +468,11 @@ title: "提交成功,将跳转到打印页面", mask: true }); - + // 获取上架任务 let timerCount = 0 - const timer1 = setInterval(async ()=>{ - if(timerCount == 15){ + const timer1 = setInterval(async () => { + if (timerCount == 15) { clearInterval(timer1) uni.showToast({ title: "跳转打印页面失败", @@ -479,26 +488,33 @@ }], pageNo: 1, pageSize: 1000, - }).then(res1=>{ + }).then(res1 => { timerCount = timerCount + 1 - if(res1.data && res1.data.list&&res1.data.list.length&&(res1.data.total >= res.data.detailCount)){ + if (res1.data && res1.data.list && res1.data + .list.length && (res1.data.total >= res + .data.detailCount)) { uni.hideLoading() clearInterval(timer1) const dataParams = { - toLocationCode: res1.data.list[0].toLocationCode, - number: res1.data.list[0].number, - creator: res1.data.list[0].creator, - createTime: res1.data.list[0].createTime, - ids : res1.data.list.map(item=>item.masterId).join(',') + toLocationCode: res1.data.list[0] + .toLocationCode, + number: res1.data.list[0].number, + creator: res1.data.list[0].creator, + createTime: res1.data.list[0] + .createTime, + ids: res1.data.list.map(item => + item.masterId).join(',') } console.log(dataParams) uni.navigateTo({ - url:'/pages/pointPutawayJob/index?data='+encodeURIComponent(JSON.stringify(dataParams)) + url: '/pages/pointPutawayJob/index?data=' + + encodeURIComponent(JSON + .stringify(dataParams)) }) } }) - },2000) - + }, 2000) + } else { this.showErrorMessage("提交失败[" + res.msg + "]") } diff --git a/src/pages/putaway/job/putawayDetail.vue b/src/pages/putaway/job/putawayDetail.vue index 7551de0a..d90d36c2 100644 --- a/src/pages/putaway/job/putawayDetail.vue +++ b/src/pages/putaway/job/putawayDetail.vue @@ -190,15 +190,6 @@ that.jobStatus = res.data.status that.subList = res.data.subList; that.detailSource = getTreeDataSource(that.subList) - - that.detailSource.forEach(r => { - r.subList.forEach(s => { - if (this.scanedPackingNumber && this.scanedPackingNumber == s - .packingNumber) s.scaned = true - s.inventoryStatus = s.inspectResult; //更新检验结果状态 - }) - }) - that.fromLocationCode = that.subList[0].fromLocationCode that.jobToLocationCode = that.subList[0].toLocationCode; that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) @@ -208,6 +199,18 @@ } else { that.toLocationCode = that.jobToLocationCode; } + that.detailSource.forEach(r => { + r.subList.forEach(s => { + if (this.scanedPackingNumber && this.scanedPackingNumber == s + .packingNumber) { + s.scaned = true + s.packList.forEach(item=>item.scaned = true) + s.inventoryStatus = s.inspectResult; //更新检验结果状态 + this.openScanPopupSimulate(s) + } + + }) + }) } else { that.showMessage('列表数据为0'); @@ -252,6 +255,27 @@ // this.calcHandleQty(); calcTreeHandleQty(this.detailSource) }, + //模拟扫描功能 + 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 == '') { + fromlocationCode = l.fromLocationCode; + } + }) + } + this.$refs.scanPopup.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, this.jobContent,item); + }, openScanPopup() { let fromlocationCode = ''; diff --git a/src/pages/putaway/job/putawayJob.vue b/src/pages/putaway/job/putawayJob.vue index ef54b650..acf3f724 100644 --- a/src/pages/putaway/job/putawayJob.vue +++ b/src/pages/putaway/job/putawayJob.vue @@ -298,7 +298,7 @@ selectItem(item) { this.$refs.scanPopup.closeScanPopup(); uni.navigateTo({ - url: './putawayDetail?id=' + item.masterId + '&status=' + item.status + url: './putawayDetail?id=' + item.masterId + '&status=' + item.status+'&scaned='+item.packingNumber }); }, getScanResult(result) {