diff --git a/src/mycomponents/scan/winComScan.vue b/src/mycomponents/scan/winComScan.vue index 110717ac..2fadda24 100644 --- a/src/mycomponents/scan/winComScan.vue +++ b/src/mycomponents/scan/winComScan.vue @@ -101,14 +101,14 @@ }, mounted() { this.boxfocus =true; - uni.hideKeyboard(); + // uni.hideKeyboard(); // #ifdef H5 - if (document.querySelector('textarea') != null) { - document.querySelector('textarea').setAttribute('inputmode', 'none') - } + // if (document.querySelector('textarea') != null) { + // document.querySelector('textarea').setAttribute('inputmode', 'none') + // } // #endif - this.hide() + // this.hide() // #ifdef APP-PLUS // // this.hide() diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 6ba5d072..605ec9ae 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -3,12 +3,12 @@ - + 扫描箱码 - + @@ -122,6 +122,7 @@ export default { name: 'winScanPack', + emits: ["afterScan"], components: { winComScan, balance, @@ -228,24 +229,16 @@ onScan(result) { - if(this.toLocation&&result.package.packUnit){ + if (this.toLocation && result.package.packUnit) { let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode); - if(result.package.packUnit!==item.packUnit){ - this.$refs.comMessage.showModal({ - iconType:'警告', - content:`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, - showConfirmButton:true, - showCancelButton:true, - confirmText:'是', - cancelText:'否', - success:({confirm})=>{ - if(confirm){ + if (result.package.packUnit !== item.packUnit) { + this.$refs.comMessage.showQuestionMessage( + '扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?', res => { + if (res) { this.onScanResult(result) } - } - }); - return - }else { + }); + } else { this.onScanResult(result) } } @@ -340,6 +333,7 @@ that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', res => { that.getfocus(); + return; } ) } @@ -347,6 +341,7 @@ } else { that.addRecord(batch, label, balance, packageInfo) } + that.$emit("afterScan"); } else { that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', res => { @@ -354,6 +349,7 @@ } ) } + } else { if (this.jobContent.allowModifyBatch == "TRUE") { this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + @@ -419,8 +415,8 @@ balance: balance, toLocationCode: this.toLocationCode, supplierCode: label.supplierCode, - packUnit:packageInfo.packUnit, - packQty:packageInfo.packQty + packUnit: packageInfo.packUnit, + packQty: packageInfo.packQty } return record; }, @@ -428,7 +424,7 @@ calcBatchHandleQty(batch) { let handleQty = 0; batch.Records.forEach(res => { - handleQty = calc.add(handleQty,res.qty) + handleQty = calc.add(handleQty, res.qty) }) batch.handleQty = handleQty; @@ -436,9 +432,6 @@ addRecord(batch, label, balance, packageInfo) { let record = this.creatRecord(label, balance, packageInfo); - if(!batch.packingNumber){//解决发料任务删除的bug-wyf - batch.packingNumber = label.packingNumber - } batch.Records.push(record); this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); @@ -490,17 +483,19 @@ this.issueRecord.splice(index, 1) let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); - + if (item != undefined) { - + item.Locations.forEach(l => { - let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b.batch == record.batch); - - if(batch&&batch.Records&&batch.Records.length>0){ - let rIndex = batch.Records.findIndex(r => r.packingNumber == record.packingNumber && r.batch == record.batch); + let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b + .batch == record.batch); + + if (batch && batch.Records && batch.Records.length > 0) { + let rIndex = batch.Records.findIndex(r => r.packingNumber == record + .packingNumber && r.batch == record.batch); batch.Records.splice(rIndex, 1); } - + }) } this.$emit('updateData', item); @@ -559,4 +554,4 @@ max-height: 300rpx; padding: 10rpx; } - + \ No newline at end of file diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 052b6f7a..402b3124 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -21,7 +21,7 @@ - + @@ -34,7 +34,8 @@ - + @@ -64,7 +65,7 @@ import { getManagementPrecisions } from '@/common/balance.js'; - + import { calc } from '@/common/calc.js'; @@ -94,7 +95,7 @@ detailSource: [], //绑定在页面上的数据源 detailOptions: [], scanOptions: [], - jobStatus:"" + jobStatus: "" }; }, @@ -126,7 +127,7 @@ onBackPress(e) { //已经接收但是没提交任务 if (e.from === 'backbutton') { - if (this.jobStatus=="2") { + if (this.jobStatus == "2") { //取消承接任务 cancleTakeIssueJob(this.id).then(res => { uni.navigateBack(); @@ -136,10 +137,10 @@ } else { uni.navigateBack(); } - + return true; } - + }, watch: { @@ -243,7 +244,6 @@ // }, submit() { - uni.showLoading({ title: "提交中....", mask: true @@ -277,7 +277,7 @@ submitJob() { var params = this.setParams() - if(!params.subList||params.subList.length==0){ + if (!params.subList || params.subList.length == 0) { uni.hideLoading() this.showErrorMessage("请扫描您需要提交的发料任务") return @@ -289,7 +289,7 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成发料记录
" + res.data) } else { - this.showErrorMessage("提交失败[" + res.msg+"]") + this.showErrorMessage("提交失败[" + res.msg + "]") } }).catch(error => { uni.hideLoading() @@ -335,16 +335,15 @@ record.singlePrice = single_price; record.amount = single_price * r.qty; - // //使用在途库不改变管理模式 - // if (this.jobContent - // .useOnTheWayLocation == - // 'TRUE') { - // record.toPackingNumber = r - // .packingNumber; - // record.toBatch = r.batch; - // } else { - debugger - var info = getPackingNumberAndBatch( + //使用在途库不改变管理模式 + if (this.jobContent + .useOnTheWayLocation == 'TRUE') { + record.toPackingNumber = r + .packingNumber; + record.toBatch = r.batch; + } else { + var info = + getPackingNumberAndBatch( this.managementList, r .itemCode, r.packingNumber, r @@ -352,7 +351,7 @@ record.toPackingNumber = info .packingNumber; record.toBatch = info.batch; - // } + } subItem.recordList.push(record); }) subList.push(subItem); @@ -400,24 +399,25 @@ }, updateData(record) { - console.log('updateData',record) - console.log('this.detailSource',this.detailSource) - + console.log('updateData', record) + console.log('this.detailSource', this.detailSource) + let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); let itemHandleQty = 0; - + if (item != undefined) { item.Locations.forEach(l => { - let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b.packingNumber == null || b.packingNumber == '') && b.batch == record.batch); + let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b + .packingNumber == null || b.packingNumber == '') && b.batch == record.batch); let handleQty = 0; - + if (batch != undefined) { batch.Records.forEach(res => { - handleQty = calc.add(handleQty,res.qty) + handleQty = calc.add(handleQty, res.qty) }) batch.handleQty = handleQty; - itemHandleQty = calc.add(itemHandleQty,handleQty) + itemHandleQty = calc.add(itemHandleQty, handleQty) } }) } @@ -425,6 +425,31 @@ item.handleQty = itemHandleQty; }, + afterScan() { + this.detailSource.forEach(detail => { + let s = ''; + detail.Items.forEach(item => { + let totalHandleQty = 0; + item.Locations.forEach(lco => { + lco.Batchs.forEach(batch => { + totalHandleQty = calc.add(totalHandleQty, batch.handleQty) + }) + }) + if (item.qty == totalHandleQty) { + this.submit(); + } else { + this.$refs.comMessage.showQuestionMessage('实际扫描数量【' + totalHandleQty + + '】与物料需求数量【' + item.qty + + '】不一致,是否继续提交', res => { + if (res) { + this.submit(); + } + }); + } + }) + }) + }, + scanPopupGetFocus() { if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.getfocus(); @@ -524,4 +549,4 @@ // border-bottom-width: 1px; // border-bottom-color: #ebeef5; // } - + \ No newline at end of file diff --git a/src/pages/repleinsh/job/repleinshDetail.vue b/src/pages/repleinsh/job/repleinshDetail.vue index e23b3a21..76891c58 100644 --- a/src/pages/repleinsh/job/repleinshDetail.vue +++ b/src/pages/repleinsh/job/repleinshDetail.vue @@ -61,10 +61,10 @@ import { getDataSource } from '@/pages/issue/js/issue.js'; - + import { - calc - } from '@/common/calc.js'; + calc + } from '@/common/calc.js'; import { getManagementPrecisions @@ -97,7 +97,7 @@ scanOptions: [], toLocationCode: '', toLocationAreaTypeList: [], - jobStatus:"" + jobStatus: "" }; }, @@ -129,7 +129,7 @@ onBackPress(e) { //已经接收但是没提交任务 if (e.from === 'backbutton') { - if (this.jobStatus=="2") { + if (this.jobStatus == "2") { //取消承接任务 cancleTakeRepleinshJob(this.id).then(res => { uni.navigateBack(); @@ -139,10 +139,10 @@ } else { uni.navigateBack(); } - + return true; } - + }, watch: { @@ -184,7 +184,10 @@ that.toLocationCode = that.subList[0].toLocationCode that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) that.detailSource = getDataSource(that.detailSource, that.subList) - that.resizeCollapse(); + + setTimeout(r => { + that.resizeCollapse(); + }, 100) } else { that.showMessage('列表数据为0'); } @@ -210,30 +213,30 @@ submit() { var scanCount = this.getScanCount(this.subList); - + //允许部分提交 - if(this.jobContent.allowPartialComplete=="TRUE"){ - // 如果扫描数是0,提示扫描数为0,是否提交,点击确定提交,取消提示消失 - if(scanCount == 0){ - this.$refs.comMessage.showQuestionMessage("扫描数为0,是否提交?",res=>{ - if(res){ + if (this.jobContent.allowPartialComplete == "TRUE") { + // 如果扫描数是0,提示扫描数为0,是否提交,点击确定提交,取消提示消失 + if (scanCount == 0) { + this.$refs.comMessage.showQuestionMessage("扫描数为0,是否提交?", res => { + if (res) { this.setSubmitParamsAndSubmit(); } }) - }else { + } else { this.setSubmitParamsAndSubmit(); } - }else { - //不允许部分提交,扫描数必须等于任务数量才可以提交 - if(scanCount == 0){ + } else { + //不允许部分提交,扫描数必须等于任务数量才可以提交 + if (scanCount == 0) { this.showErrorMessage("扫描数为0,当前补料任务不允许部分提交,请先扫描") - }else { + } else { this.setSubmitParamsAndSubmit(); } } }, - - setSubmitParamsAndSubmit(){ + + setSubmitParamsAndSubmit() { //目前任务只到一个库位 var itemCodes = [] let locationCode = this.toLocationCode @@ -242,7 +245,7 @@ itemCodes.push(item.itemCode) }) }) - + //使用在途库,不查询管理模式 if (this.jobContent.useOnTheWayLocation == 'TRUE') { this.submitJob(); @@ -268,6 +271,7 @@ var params = this.setParams() console.log("提交参数", JSON.stringify(params)); + return; repleinshJobSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -311,21 +315,24 @@ record.toLocationCode = this .toLocationCode; record.supplierCode = r.supplierCode; - - if(r.parentPackingNumber!=''&&r.parentPackingNumber!=null) - { - record.fromPackingNumber = r.parentPackingNumber; + + if (r.parentPackingNumber != '' && r + .parentPackingNumber != null) { + record.fromPackingNumber = r + .parentPackingNumber; record.toPackingNumber = r .packingNumber; - } - else - { - record.fromPackingNumber = r.packingNumber; + // record.fromPackUnit = r.packUnit; + record.toPackUnit = r.packUnit; + } else { + record.fromPackingNumber = r + .packingNumber; record.toPackingNumber = r .packingNumber; + record.toPackUnit = r.packUnit; } record.toBatch = r.batch; - + // //使用在途库不改变管理模式 // if (this.jobContent @@ -403,10 +410,10 @@ let handleQty = 0; if (batch != undefined) { batch.Records.forEach(res => { - handleQty = calc.add(handleQty,res.qty) + handleQty = calc.add(handleQty, res.qty) }) batch.handleQty = handleQty; - itemHandleQty = calc.add(itemHandleQty,handleQty) + itemHandleQty = calc.add(itemHandleQty, handleQty) } }) } @@ -491,7 +498,7 @@ fromLocation.Batchs.forEach(batch => { let subItem = batch.detail; if (batch.Records.length > 0) { - scanCount = calc.add(scanCount,batch.Records.length) + scanCount = calc.add(scanCount, batch.Records.length) } }) }) @@ -507,4 +514,4 @@ + \ No newline at end of file