diff --git a/src/pages/issue/job/issueDetailBatch.vue b/src/pages/issue/job/issueDetailBatch.vue index f6112f63..3043b8c7 100644 --- a/src/pages/issue/job/issueDetailBatch.vue +++ b/src/pages/issue/job/issueDetailBatch.vue @@ -8,17 +8,16 @@ + :rawLocationCode="jobContent.detailToLocationCode" :itemGroup="jobContent.itemGroup" + :isShowItemGroup='true'> - + @@ -40,11 +39,11 @@ - - + + - + @@ -75,8 +74,8 @@ import { calc } from '@/common/calc.js'; - - + + import { getDataSourceBatch, getTreeDataSource, @@ -84,7 +83,7 @@ getScanCount, getThreeDataSource } from '@/common/detail.js'; - + import { calcHandleQtyAdd } from '@/common/record.js'; @@ -124,7 +123,7 @@ scanMessage: '', managementList: [], managementType: "", - fromLocationCode:'' + fromLocationCode: '' }; }, @@ -223,12 +222,12 @@ that.subList = res.data.subList; that.detailSource = getDataSourceBatch(that.subList) that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode - that.toLocationCode= res.data.subList[0].toLocationCode + that.toLocationCode = res.data.subList[0].toLocationCode that.fromLocationCode = that.subList[0].fromLocationCode - + that.detailSource.forEach(r => { r.subList.forEach(s => { - s.isRecommTaskItem = true//为推荐任务 + s.isRecommTaskItem = true //为推荐任务 }) }) //任务中已经扫描,模拟扫描赋值 @@ -266,213 +265,213 @@ this.resizeCollapse(); }, getScanResult(result, managementTypeParams) { - if(!result.package.number){ + if (!result.package.number) { this.showErrorMessage("包装号不能为空") return; } - + this.managementType = managementTypeParams - let array1 = []//记录推荐的库位 - let array2 = []//记录推荐的批次 - this.detailSource.forEach(item=>{ - item.subList.forEach(cur=>{ + let array1 = [] //记录推荐的库位 + let array2 = [] //记录推荐的批次 + this.detailSource.forEach(item => { + item.subList.forEach(cur => { array1.push(cur.fromLocationCode) array2.push(cur.batch) }) }) // 扫描的库位是否在 - const obj1 = array1.find(item=>item == result.fromLocationCode) - const obj2 = array2.find(item=>item == result.label.batch) - if(this.jobContent.allowModifyLocation == 'FALSE'){ - if(!obj1){ + const obj1 = array1.find(item => item == result.fromLocationCode) + const obj2 = array2.find(item => item == result.label.batch) + if (this.jobContent.allowModifyLocation == 'FALSE') { + if (!obj1) { this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) return } } - if(this.jobContent.allowModifyBatch == 'FALSE'){ - if(!obj2){ + if (this.jobContent.allowModifyBatch == 'FALSE') { + if (!obj2) { this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) return } } - if(!obj1){ + if (!obj1) { this.recommendQty = 0 - }else{ + } else { this.recommendQty = result.balance.qty } // this.managementType = managementTypeParams - if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { this.setDataBatch(result) } }, - + setDataBatch11(result) { console.log(result) try { let that = this - this.balanceinfo = result.balance + this.balanceinfo = result.balance var packingNumber = result.label.packingNumber; var batch = result.label.batch; var qty = result.label.qty; var itemCode = result.label.itemCode; var locationCode = result.fromLocationCode; - + if (!result.balance) { this.showMessage("没有库存余额") return; } // var inventoryStatus = "OK"; var detail = this.detailSource.find(r => r.itemCode == itemCode); - + if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - + var itemDetail = detail.subList.find(r => { - return r.batch == batch && - r.fromLocationCode == result.fromLocationCode&& - r.packingNumber==packingNumber - - }) - if (itemDetail == undefined) { - var isExit; - for (let subItem of detail.subList) { - var item; - // for (let pack of subItem.packList) { - // if (pack.batch == batch) { - // item = pack; - // isExit = pack; - // break; - // } - // } - // if (item != undefined) { - // subItem.scaned = true - // subItem.handleQty = 0; - // item = undefined - // } - } - if (isExit == undefined) { - // this.showErrorMessage("批次【" + batch + "】库位【" + result - // .fromLocationCode + "】不在列表中") - detail.subList.push({ - scaned:true, - packingNumber:packingNumber, - fromLocationCode:this.fromLocationCode, - toLocationCode:this.toLocationCode, - batch:result.label.batch, - handleQty:result.label.qty, - qty:0, - inventoryStatus:result.balance.inventoryStatus, - toLocation:result.balance.toLocation, - balance:result.balance, - balanceQty:result.balance.qty, - packQty:result.package.packQty, - packUnit:result.package.packUnit, - uom:result.balance.uom, - isRecommTaskItem:false,//不是推荐任务中的任务 - // packList:[{ - // scaned : true, - // handleQty : Number(result.label.qty), - // toLocationCode : result.balance.toLocationCode, - // }] - }) - detail.handleQty = 0 - detail.qty = 0 - detail.subList.forEach(item=>{ - item.handleQty =item.handleQty || 0 - detail.handleQty = calc.add(detail.handleQty,item.handleQty) - detail.qty = calc.add(detail.qty,item.qty) - // item.packList.forEach(cur=>{ - // cur.handleQty = calc.add(detail.handleQty,item.handleQty) - // }) - }) - setTimeout(r => { - that.resizeCollapse(); - that.$forceUpdate() - }, 100) + return r.batch == batch && + r.fromLocationCode == result.fromLocationCode && + r.packingNumber == packingNumber + + }) + if (itemDetail == undefined) { + var isExit; + for (let subItem of detail.subList) { + var item; + // for (let pack of subItem.packList) { + // if (pack.batch == batch) { + // item = pack; + // isExit = pack; + // break; + // } + // } + // if (item != undefined) { + // subItem.scaned = true + // subItem.handleQty = 0; + // item = undefined + // } + } + if (isExit == undefined) { + // this.showErrorMessage("批次【" + batch + "】库位【" + result + // .fromLocationCode + "】不在列表中") + detail.subList.push({ + scaned: true, + packingNumber: packingNumber, + fromLocationCode: this.fromLocationCode, + toLocationCode: this.toLocationCode, + batch: result.label.batch, + handleQty: result.label.qty, + qty: 0, + inventoryStatus: result.balance.inventoryStatus, + toLocation: result.balance.toLocation, + balance: result.balance, + balanceQty: result.balance.qty, + packQty: result.package.packQty, + packUnit: result.package.packUnit, + uom: result.balance.uom, + isRecommTaskItem: false, //不是推荐任务中的任务 + // packList:[{ + // scaned : true, + // handleQty : Number(result.label.qty), + // toLocationCode : result.balance.toLocationCode, + // }] + }) + detail.handleQty = 0 + detail.qty = 0 + detail.subList.forEach(item => { + item.handleQty = item.handleQty || 0 + detail.handleQty = calc.add(detail.handleQty, item.handleQty) + detail.qty = calc.add(detail.qty, item.qty) + // item.packList.forEach(cur=>{ + // cur.handleQty = calc.add(detail.handleQty,item.handleQty) + // }) + }) + setTimeout(r => { + that.resizeCollapse(); + that.$forceUpdate() + }, 100) + } else { + if (!isExit.cancleScanedHiht && isExit.scaned) { + // this.showMessage("批次【" + batch + "】已经扫描") } else { - if (!isExit.cancleScanedHiht && isExit.scaned) { - // this.showMessage("批次【" + batch + "】已经扫描") + isExit.scaned = true + let qty = 0; + if (result.balance != null) { + qty = Number(result.balance.qty); } else { - isExit.scaned = true - let qty = 0; - if (result.balance != null) { - qty = Number(result.balance.qty); - } else { - qty = Number(result.label.qty); - } - isExit.handleQty = Number(result.label.qty); - isExit.toLocationCode = this.toLocationCode; + qty = Number(result.label.qty); } - itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty); - detail.handleQty = 0 - detail.balance = result.balance, - detail.subList.forEach(item=>{ - item.handleQty =item.handleQty || 0 - detail.handleQty = calc.add(detail.handleQty,item.handleQty) + isExit.handleQty = Number(result.label.qty); + isExit.toLocationCode = this.toLocationCode; + } + itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty); + detail.handleQty = 0 + detail.balance = result.balance, + detail.subList.forEach(item => { + item.handleQty = item.handleQty || 0 + detail.handleQty = calc.add(detail.handleQty, item.handleQty) // item.packList.forEach(cur=>{ // cur.handleQty = calc.add(detail.handleQty,item.handleQty) // }) }) - // calcHandleQtyAdd(this.detailSource, result.label); - } - this.continueScan() - this.$forceUpdate() + // calcHandleQtyAdd(this.detailSource, result.label); + } + this.continueScan() + this.$forceUpdate() + } else { + var scanedLength = 0; + // itemDetail.packList.forEach(res => { + // if (res.scaned) { + // scanedLength++; + // } + // }) + //大哥让加的 + itemDetail.fromInventoryStatus = result.balance.inventoryStatus; + + if (itemDetail.scaned) { + // this.showMessage("箱码【" + packingNumber + "】已经扫描") + // calcHandleQtyAdd(this.detailSource, result.label); + itemDetail.balance = result.balance + itemDetail.balanceQty = result.balance.qty + itemDetail.uom = result.balance.uom, + itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty); + detail.handleQty = 0 + detail.subList.forEach(item => { + detail.handleQty = calc.add(detail.handleQty, item.handleQty) + }) } else { - var scanedLength = 0; - // itemDetail.packList.forEach(res => { - // if (res.scaned) { - // scanedLength++; - // } + itemDetail.scaned = true; + this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 + itemDetail.handleQty = result.label.qty; + itemDetail.scaned = true + itemDetail.balance = result.balance + itemDetail.balanceQty = result.balance.qty + itemDetail.uom = result.balance.uom + itemDetail.packQty = result.package.packQty + itemDetail.packUnit = result.package.packUnit + itemDetail.fromlocationCode = this.fromLocationCode + itemDetail.toLocationCode = this.toLocationCode + itemDetail.isRecommTaskItem = true //是推荐任务中的数量 + // itemDetail.toInventoryStatus = "OK" + // itemDetail.packList.forEach(pac => { + // pac.scaned = true + // pac.handleQty = Number(result.label.qty); + // pac.toLocationCode = result.balance.toLocationCode; // }) - //大哥让加的 - itemDetail.fromInventoryStatus = result.balance.inventoryStatus; - - if (itemDetail.scaned ) { - // this.showMessage("箱码【" + packingNumber + "】已经扫描") - // calcHandleQtyAdd(this.detailSource, result.label); - itemDetail.balance=result.balance - itemDetail.balanceQty=result.balance.qty - itemDetail.uom=result.balance.uom, - itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty); - detail.handleQty = 0 - detail.subList.forEach(item=>{ - detail.handleQty = calc.add(detail.handleQty,item.handleQty) - }) - } else { - itemDetail.scaned = true; - this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 - itemDetail.handleQty = result.label.qty; - itemDetail.scaned = true - itemDetail.balance=result.balance - itemDetail.balanceQty=result.balance.qty - itemDetail.uom=result.balance.uom - itemDetail.packQty=result.package.packQty - itemDetail.packUnit=result.package.packUnit - itemDetail.fromlocationCode=this.fromLocationCode - itemDetail.toLocationCode=this.toLocationCode - itemDetail.isRecommTaskItem = true//是推荐任务中的数量 - // itemDetail.toInventoryStatus = "OK" - // itemDetail.packList.forEach(pac => { - // pac.scaned = true - // pac.handleQty = Number(result.label.qty); - // pac.toLocationCode = result.balance.toLocationCode; + detail.handleQty = 0 + detail.subList.forEach(item => { + console.log(item.handleQty) + item.handleQty = item.handleQty || 0 + detail.handleQty = calc.add(detail.handleQty, item.handleQty) + // item.packList.forEach(cur=>{ + // cur.handleQty = calc.add(detail.handleQty,item.handleQty) // }) - detail.handleQty = 0 - detail.subList.forEach(item=>{ - console.log(item.handleQty) - item.handleQty =item.handleQty || 0 - detail.handleQty = calc.add(detail.handleQty,item.handleQty) - // item.packList.forEach(cur=>{ - // cur.handleQty = calc.add(detail.handleQty,item.handleQty) - // }) - }) - // calcTreeHandleQty(this.detailSource); - this.continueScan() - this.$forceUpdate() - } + }) + // calcTreeHandleQty(this.detailSource); + this.continueScan() + this.$forceUpdate() } + } } // this.detailSource.forEach(item => { // item.subList.forEach(detail => { @@ -483,70 +482,71 @@ this.showMessage(e.message) } }, - - + + setDataBatch(result) { try { let that = this - this.balanceinfo = result.balance + this.balanceinfo = result.balance var packingNumber = result.label.packingNumber; var batch = result.label.batch; var qty = result.label.qty; var itemCode = result.label.itemCode; var locationCode = result.fromLocationCode; - + if (!result.balance) { this.showMessage("没有库存余额") return; } // var inventoryStatus = "OK"; var detail = this.detailSource.find(r => r.itemCode == itemCode); - + if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - + var itemDetail = detail.subList.find(r => { - return r.batch == batch && - r.fromLocationCode == result.fromLocationCode&& - r.packingNumber==packingNumber - }) - //扫描的数据不在任务中,添加到列表 - if (itemDetail == undefined) { - var item ={ - scaned:true, - packingNumber:packingNumber, - fromLocationCode:this.fromLocationCode, - toLocationCode:this.toLocationCode, - batch:result.label.batch, - handleQty:result.label.qty, - qty:0, - inventoryStatus:result.balance.inventoryStatus, - toLocation:result.balance.toLocation, - balance:result.balance, - balanceQty:result.balance.qty, - packQty:result.package.packQty, - packUnit:result.package.packUnit, - uom:result.balance.uom, - isRecommTaskItem:false,//不是推荐任务中的任务 - } - detail.subList.push(item) - //计算数量 - detail.handleQty = 0 - detail.qty = 0 - detail.subList.forEach(item=>{ - item.handleQty =item.handleQty || 0 - detail.handleQty = calc.add(detail.handleQty,item.handleQty) - detail.qty = calc.add(detail.qty,item.qty) - }) - setTimeout(r => { - that.resizeCollapse(); - that.$forceUpdate() - }, 100) - }else { - itemDetail.handleQty=calc.add(itemDetail.handleQty,result.label.qty) + return r.batch == batch && + r.fromLocationCode == result.fromLocationCode && + r.packingNumber == packingNumber + }) + //扫描的数据不在任务中,添加到列表 + if (itemDetail == undefined) { + var item = { + scaned: true, + packingNumber: packingNumber, + fromLocationCode: this.fromLocationCode, + toLocationCode: this.toLocationCode, + batch: result.label.batch, + handleQty: result.label.qty, + qty: 0, + inventoryStatus: result.balance.inventoryStatus, + toLocation: result.balance.toLocation, + balance: result.balance, + balanceQty: result.balance.qty, + packQty: result.package.packQty, + packUnit: result.package.packUnit, + uom: result.balance.uom, + isRecommTaskItem: false, //不是推荐任务中的任务 + supplierCode: result.label.supplierCode } - + detail.subList.push(item) + //计算数量 + detail.handleQty = 0 + detail.qty = 0 + detail.subList.forEach(item => { + item.handleQty = item.handleQty || 0 + detail.handleQty = calc.add(detail.handleQty, item.handleQty) + detail.qty = calc.add(detail.qty, item.qty) + }) + setTimeout(r => { + that.resizeCollapse(); + that.$forceUpdate() + }, 100) + } else { + itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty) + } + } } catch (e) { this.showMessage(e.message) @@ -561,7 +561,7 @@ this.scanPopupGetFocus(); } }, - + submit() { uni.showLoading({ title: "提交中....", @@ -589,23 +589,22 @@ submitJob() { var params = this.setParams() - + // if (!params.subList || params.subList.length == 0) { // uni.hideLoading() // this.showErrorMessage("请扫描您需要提交的发料任务") // return // } - const isTrue = params.subList.some(item=>{ - return item.recordList.some(cur=>cur.scaned) == true + const isTrue = params.subList.some(item => { + return item.recordList.some(cur => cur.scaned) == true }) - - if(!isTrue){ - uni.hideLoading() - this.showErrorMessage("请扫描您需要提交的发料任务") - return + + if (!isTrue) { + uni.hideLoading() + this.showErrorMessage("请扫描您需要提交的发料任务") + return } - - console.log("提交参数", params); + issueJobSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -624,43 +623,47 @@ var creator = this.$store.state.user.id this.detailSource.forEach(toLocationCode => { let arr = [] - toLocationCode.subList.forEach(record=>{ - if(record.scaned){ - let obj = {...toLocationCode,...record} - obj.recordList = [] - delete obj.balance - delete obj.subList - let obj1 ={} - obj1.supplierCode = record.supplierCode; - obj1.batch = record.batch; - obj1.copyContent =record.copyContent; - obj1.fromInventoryStatus =record.fromInventoryStatus; - obj1.fromLocationCode =record.fromLocationCode; - obj1.handleQty =record.handleQty; - obj1.inventoryStatus =record.fromInventoryStatus; - obj1.packQty =record.packQty; - obj1.packUnit =record.packUnit; - obj1.packingNumber =record.packingNumber; - obj1.qty =record.qty; - obj1.scaned =record.scaned; - obj1.toLocationCode =record.toLocationCode; - obj1.fromPackingNumber =record.packingNumber; - obj1.fromBatch = record.batch; - obj1.toBatch = record.batch; - obj1.toInventoryStatus = record.inventoryStatus; - obj1.toPackingNumber =""; - obj1.packingNumber = ""; - - let single_price = record.balance.singlePrice == null ? 0 : record.balance.singlePrice; - - obj1.singlePrice = single_price; - obj1.amount = single_price *record.qty; - obj.recordList.push(obj1) - subList.push(obj) + toLocationCode.subList.forEach(record => { + if (record.scaned) { + let obj = { + ...toLocationCode, + ...record + } + obj.recordList = [] + delete obj.balance + delete obj.subList + let obj1 = {} + obj1.supplierCode = record.supplierCode; + obj1.batch = record.batch; + obj1.copyContent = record.copyContent; + obj1.fromInventoryStatus = record.fromInventoryStatus; + obj1.fromLocationCode = record.fromLocationCode; + obj1.handleQty = record.handleQty; + obj1.inventoryStatus = record.fromInventoryStatus; + obj1.packQty = record.packQty; + obj1.packUnit = record.packUnit; + obj1.packingNumber = record.packingNumber; + obj1.qty = record.qty; + obj1.scaned = record.scaned; + obj1.toLocationCode = record.toLocationCode; + obj1.fromPackingNumber = record.packingNumber; + obj1.fromBatch = record.batch; + obj1.toBatch = record.batch; + obj1.toInventoryStatus = record.inventoryStatus; + obj1.toPackingNumber = ""; + obj1.packingNumber = ""; + + let single_price = record.balance.singlePrice == null ? 0 : record.balance + .singlePrice; + + obj1.singlePrice = single_price; + obj1.amount = single_price * record.qty; + obj.recordList.push(obj1) + subList.push(obj) } }) }) - + this.jobContent.subList = subList this.jobContent.creator = creator; return this.jobContent; @@ -697,10 +700,10 @@ }, updateData(record) { - this.detailSource.forEach(item=>{ - item.handleQty = 0 - item.subList.forEach(cur=>{ - item.handleQty = calc.add(cur.handleQty,item.handleQty) + this.detailSource.forEach(item => { + item.handleQty = 0 + item.subList.forEach(cur => { + item.handleQty = calc.add(cur.handleQty, item.handleQty) }) }) }, @@ -709,33 +712,33 @@ this.resizeCollapse(); // this.autoCommit() }, - autoCommit(){ - let str="" - let str1="" - let str2="" - let str3="" + autoCommit() { + let str = "" + let str1 = "" + let str2 = "" + let str3 = "" let isTrue = true - - - this.detailSource.forEach(detail=>{ - var itemHandleQty=0 - detail.subList.forEach(item=>{ + + + this.detailSource.forEach(detail => { + var itemHandleQty = 0 + detail.subList.forEach(item => { //计算不是推荐的,而是扫描的 - if(item.scaned){ - itemHandleQty=calc.add(itemHandleQty,item.handleQty) + if (item.scaned) { + itemHandleQty = calc.add(itemHandleQty, item.handleQty) } - + }) - if(itemHandleQtydetail.qty){ - str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】` + + if (itemHandleQty > detail.qty) { + str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】` } - + }) - + if (this.jobContent.allowSmallerQty == "FALSE") { if (str) { str = '不允许提交\n' + str @@ -750,15 +753,15 @@ return } } - + if (str2) { str2 = '不允许提交\n' + str2 this.showErrorMessage(str2) return } console.log(str3) - if(str3){ - str3 = str3+"是否提交" + if (str3) { + str3 = str3 + "是否提交" this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => { if (res) { //防止重复点击 @@ -767,48 +770,50 @@ this.scanPopupGetFocus() } }); - }else { + } else { //防止重复点击 this.$throttle(this.submit, 2000, this)() } }, - - autoCommit11(){ - // this.$throttle(this.submit, 2000, this)() - // this.jobContent.allowSmallerQty = 'FALSE' - // this.jobContent.allowBiggerQty = 'FALSE' - let str="" - let str1="" - let str2="" - let str3="" + + autoCommit11() { + // this.$throttle(this.submit, 2000, this)() + // this.jobContent.allowSmallerQty = 'FALSE' + // this.jobContent.allowBiggerQty = 'FALSE' + let str = "" + let str1 = "" + let str2 = "" + let str3 = "" let isTrue = true this.detailSource.forEach(detail => { - const isScaned = detail.subList.some(cur=>cur.scaned) - if(isScaned){ - if(parseFloat(detail.handleQty) cur.scaned) + if (isScaned) { + if (parseFloat(detail.handleQty) < parseFloat(detail.qty)) { + str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}】\n` } - if(parseFloat(detail.handleQty)>parseFloat(detail.qty)){ - str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】` + if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) { + str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】` } } - + detail.subList.forEach(item => { - if(item.scaned){ - if(parseFloat(item.handleQty)>parseFloat(item.balance.qty)){ - str2 += `物料号【${detail.itemCode}】批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】\n` + if (item.scaned) { + if (parseFloat(item.handleQty) > parseFloat(item.balance.qty)) { + str2 += + `物料号【${detail.itemCode}】批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】\n` } } - if(item.isRecommTaskItem){//扫描推荐任务中的任务时候才有这个提示 + if (item.isRecommTaskItem) { //扫描推荐任务中的任务时候才有这个提示 item.handleQty = item.handleQty || 0 - if(item.handleQty == 0 && isTrue){ + if (item.handleQty == 0 && isTrue) { isTrue = false str3 = '推荐的箱码没扫,' } - if(parseFloat(item.handleQty)!=parseFloat(item.qty)){ - str3 += `物料号【${detail.itemCode}】批次【${item.batch}】扫描数量【${parseFloat(item.handleQty)}】和任务数量【${item.qty}】不一致\n` + if (parseFloat(item.handleQty) != parseFloat(item.qty)) { + str3 += + `物料号【${detail.itemCode}】批次【${item.batch}】扫描数量【${parseFloat(item.handleQty)}】和任务数量【${item.qty}】不一致\n` } - + } }) }) @@ -826,15 +831,15 @@ return } } - + if (str2) { str2 = '不允许提交\n' + str2 this.showErrorMessage(str2) return } console.log(str3) - if(str3){ - str3 = str3+"是否提交" + if (str3) { + str3 = str3 + "是否提交" this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => { if (res) { //防止重复点击 @@ -843,7 +848,7 @@ this.scanPopupGetFocus() } }); - }else { + } else { //防止重复点击 this.$throttle(this.submit, 2000, this)() } @@ -932,7 +937,7 @@ closeScanPopup() { // this.updateCommitBtn(); }, - confirmFromLocation(fromLocationCodeParams){ + confirmFromLocation(fromLocationCodeParams) { this.fromLocationCode = fromLocationCodeParams } } diff --git a/src/pages/issue/record/directIssueByBatch.vue b/src/pages/issue/record/directIssueByBatch.vue index 65531537..4be17a26 100644 --- a/src/pages/issue/record/directIssueByBatch.vue +++ b/src/pages/issue/record/directIssueByBatch.vue @@ -245,6 +245,7 @@ let newDetail = createDetailInfo(balance, pack); // newDetail.packingNumber = pack.number newDetail.handleQty =label.qty + newDetail.supplierCode =label.supplierCode itemp.subList.push(newDetail); this.detailSource.push(itemp) } else { @@ -260,6 +261,7 @@ let newDetail = createDetailInfo(balance, pack); newDetail.packingNumber = pack.number newDetail.handleQty =label.qty + newDetail.supplierCode =label.supplierCode item.subList.push(newDetail); } else { detail.handleQty=calc.add(detail.handleQty,result.label.qty) @@ -455,7 +457,6 @@ var params = { ...this.setRecordParams() } - console.log("提交参数", JSON.stringify(params)); const isHaveItem = params.subList.find(item => item.handleQty > item.balanceQty) if (isHaveItem) { this.showErrorMessage(`物料号${isHaveItem.itemCode}`) @@ -520,7 +521,8 @@ fromPackUnit: detail.packUnit, toPackUnit: detail.packUnit, fromPackQty: detail.packQty, - toPackQty: detail.packQty + toPackQty: detail.packQty, + supplierCode:detail.supplierCode }] subList.push(submitItem) }