From 1ac633ed43a887c148cba382088bd11808866d89 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 15 Jan 2024 15:58:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/record/containerBindRecord.vue | 6 +- .../record/containerUnBindRecord.vue | 6 +- pages/count/job/countDetail.vue | 21 +++-- pages/count/record/countRecord.vue | 30 +++---- pages/deliver/coms/comScanDeliverPack.vue | 82 ++++++++++--------- pages/deliver/job/deliverDetail.vue | 30 ++++--- .../deliver/request/deliverRequestCreate.vue | 8 +- pages/inspect/job/inspectFullDetail.vue | 20 +++-- pages/issue/coms/comScanIssuePack.vue | 20 +++-- pages/issue/job/issueDetail.vue | 38 +++++---- pages/issue/js/issue.js | 5 +- pages/issue/record/issueRecord.vue | 22 ++--- pages/issue/request/issueRequestCreate.vue | 17 ++-- pages/package/record/splitPackageRecord.vue | 20 +++-- .../request/putawayRequestCreate.vue | 6 +- .../record/productReceiptRecord.vue | 16 ++-- pages/productionReturn/coms/comReturn.vue | 8 +- .../coms/comScanReturnPack.vue | 63 +++++++------- .../request/returnRequestCreate.vue | 34 ++++---- pages/putaway/record/putawayRecord.vue | 9 +- .../putaway/request/putawayRequestCreate.vue | 9 +- pages/query/container.vue | 6 +- pages/query/location.vue | 6 +- pages/query/location_copy.vue | 6 +- pages/repleinsh/coms/comScanReplishPack.vue | 6 +- pages/repleinsh/job/repleinshDetail.vue | 10 ++- pages/repleinsh/record/repleinshRecord.vue | 47 ++++++----- pages/transfer/job/transferDetail.vue | 12 ++- pages/unPlanned/record/receiptRecord.vue | 6 +- .../request/receiptRequestCreate.vue | 53 ++++++------ 30 files changed, 375 insertions(+), 247 deletions(-) diff --git a/pages/container/record/containerBindRecord.vue b/pages/container/record/containerBindRecord.vue index 2b132196..4c18c77c 100644 --- a/pages/container/record/containerBindRecord.vue +++ b/pages/container/record/containerBindRecord.vue @@ -57,6 +57,10 @@ getDirectoryItemArray } from '@/common/directory.js'; + import { + calc + } from '@/common/calc.js'; + import { getBusinessType, createItemInfo, @@ -226,7 +230,7 @@ item.subList.push(newDetail); items.push(item) } else { - item.qty += detail.qty + item.qty = calc.add(item.qty,detail.qty) let newDetail = this.createDetailInfo(detail); // item.subList.push(newDetail); } diff --git a/pages/container/record/containerUnBindRecord.vue b/pages/container/record/containerUnBindRecord.vue index cd1e1ffa..cad024aa 100644 --- a/pages/container/record/containerUnBindRecord.vue +++ b/pages/container/record/containerUnBindRecord.vue @@ -51,6 +51,10 @@ import { goHome } from '@/common/basic.js'; + + import { + calc + } from '@/common/calc.js'; import { getDirectoryItemArray @@ -171,7 +175,7 @@ item.subList.push(newDetail); items.push(item) } else { - item.qty += detail.qty + item.qty = calc.add(item.qty,detail.qty) let newDetail = this.createDetailInfo(detail); // item.subList.push(newDetail); } diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index a53bfe42..b90f0d6c 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -63,6 +63,9 @@ cancleTakeCountJob, countJobSubmit } from '@/api/request2.js'; + import { + calc + } from '@/common/calc.js'; import { goHome, @@ -72,7 +75,7 @@ import { getCountStageName } from '@/common/directory.js'; - import { calc } from '@/common/calc' + import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -203,8 +206,8 @@ item.subList.push(newDetail); items.push(item) } else { - console.log("数量",item.qty) - item.qty = calc.add(item.qty,detail.qty) + console.log("数量", item.qty) + item.qty = calc.add(item.qty, detail.qty) let newDetail = this.createDetailInfo(detail); // item.subList.push(newDetail); } @@ -253,7 +256,7 @@ item.handleQty = 0; for (let detail of item.subList) { if (detail != undefined && detail.scaned) { - item.handleQty = calc.add(item.handleQty,detail.qty) + item.handleQty = calc.add(item.handleQty, detail.qty) } } } @@ -291,13 +294,13 @@ this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); }, closeScanPopup() { - if(this.$refs.scanPopup!=undefined){ + if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.closeScanPopup(); } }, scanPopupGetFocus() { - if(this.$refs.scanPopup!=undefined){ + if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.packGetFocus(); } }, @@ -381,7 +384,7 @@ "]不在列表中,是否添加到列表?", res => { if (res) { - detail.qty += Number(detail.qty) + detail.qty = calc.add(detail.qty,detail.qty) let newDetail = this.createAddDetailInfo(result.balance, result.package); // detail.subList.push(newDetail); this.updateData() @@ -430,7 +433,7 @@ fromLocationCode: balance.locationCode, stdPackQty: pack.stdPackQty, stdPackUnit: pack.stdPackUnit, - creator:this.$store.state.user.id + creator: this.$store.state.user.id } return detail; @@ -543,7 +546,7 @@ subList.push(detail) }) }) - + this.jobContent.subList = subList this.jobContent.creator = creator; return this.jobContent; diff --git a/pages/count/record/countRecord.vue b/pages/count/record/countRecord.vue index 8f7e4bc7..b5f97081 100644 --- a/pages/count/record/countRecord.vue +++ b/pages/count/record/countRecord.vue @@ -34,7 +34,7 @@ - + @@ -50,11 +50,15 @@ getDataSource, navigateBack } from '@/common/basic.js'; - + + import { + calc + } from '@/common/calc.js'; + import { getDirectoryItemArray } from '@/common/directory.js'; - + import { getBusinessType, } from '@/common/record.js'; @@ -119,7 +123,7 @@ this.showErrorMessage(res.message) } }); - + }, //返回首页 onNavigationBarButtonTap(e) { @@ -136,8 +140,7 @@ uni.stopPullDownRefresh(); }, - mounted() { - }, + mounted() {}, methods: { calcScanCount(closeScan) { let items = this.subList.filter(r => { @@ -156,7 +159,8 @@ item.handleQty = 0; for (let detail of item.subList) { if (item.scaned) { - item.handleQty += Number(detail.qty) + + item.handleQty = calc.add(item.handleQty,detail.qty) } } } @@ -195,7 +199,7 @@ balanceByLocation(this.fromLocationCode, res => { this.subList = res.data.list; this.detailSource = getDataSource(this.subList); - + }); }, @@ -218,13 +222,13 @@ }, closeScanPopup() { - if(this.$refs.scanPopup!=undefined){ + if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.closeScanPopup(); } }, scanPopupGetFocus() { - if(this.$refs.scanPopup!=undefined){ + if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.packGetFocus(); } }, @@ -263,9 +267,7 @@ if (res) { this.$refs.CountQtyEdit.openEditPopup(this.itemEditInfo, detail.subList); - } - else - { + } else { this.scanPopupGetFocus(); } }) @@ -303,7 +305,7 @@ return record; }, addExistItemCodeToList(detail, result) { - detail.qty += detail.qty + detail.qty = calc.add(detail.qty,detail.qty) let newDetail = this.createAddDetailInfo(result.balance, result.package); // detail.subList.push(newDetail); }, diff --git a/pages/deliver/coms/comScanDeliverPack.vue b/pages/deliver/coms/comScanDeliverPack.vue index 885ac385..2534cb80 100644 --- a/pages/deliver/coms/comScanDeliverPack.vue +++ b/pages/deliver/coms/comScanDeliverPack.vue @@ -45,8 +45,8 @@ - + @@ -102,6 +102,11 @@ getDetailOption, getDetailEditRemoveOption } from '@/common/array.js'; + + + import { + calc + } from '@/common/calc.js'; import { getWorkShopLineStation } from '@/api/request2.js'; @@ -128,7 +133,7 @@ type: String, default: "HPQ,HMQ" }, - + }, data() { @@ -150,9 +155,9 @@ positionInfo: "请选择位置", positionList: [], defaultValueList: [], - label:{}, - fromInventoryStatuses :"", - packageInfo:{} + label: {}, + fromInventoryStatuses: "", + packageInfo: {} } }, created() { @@ -185,14 +190,14 @@ let that = this; that.fromLocationList = []; if (that.dataContent != null) { - that.fromInventoryStatuses =this.jobContent.outInventoryStatuses + that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.toLocation = that.dataContent[0]; that.toLocationCode = that.dataContent[0].toLocationCode; that.fromLocationList = that.getFromLocationList(); } }, - - showBalanceSelect(items,packageInfo) { + + showBalanceSelect(items, packageInfo) { this.packageInfo = packageInfo; this.$refs.balanceSelect.openPopup(items); }, @@ -250,38 +255,39 @@ title: '加载中', mask: true }) - getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, balanceRes => { - if (balanceRes.success) { - if (balanceRes.data.list.length == 0) { - this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', - res => { - this.packGetFocus(); - }) - } else if (balanceRes.data.list.length == 1) { - let balance = balanceRes.data.list[0]; - this.afterGetBalance(result.label, balance,packageInfo); + getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, + balanceRes => { + if (balanceRes.success) { + if (balanceRes.data.list.length == 0) { + this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', + res => { + this.packGetFocus(); + }) + } else if (balanceRes.data.list.length == 1) { + let balance = balanceRes.data.list[0]; + this.afterGetBalance(result.label, balance, packageInfo); + } else { + this.label = result.label; + this.showBalanceSelect(balanceRes.data.list, packageInfo); + } } else { - this.label =result.label; - this.showBalanceSelect(balanceRes.data.list,packageInfo); + this.showErrorMessage(balanceRes.message.message); } - } else { - this.showErrorMessage(balanceRes.message.message); - } - uni.hideLoading(); - }); + uni.hideLoading(); + }); } } catch (e) { this.showErrorMessage(e.stack) uni.hideLoading(); } }, - + selectBalanceItem(balance) { - this.afterGetBalance(this.label, balance,this.packageInfo); + this.afterGetBalance(this.label, balance, this.packageInfo); }, - - afterGetBalance(label, balance,packageInfo) { + + afterGetBalance(label, balance, packageInfo) { try { let that = this; let itemCode = label.itemCode; @@ -302,11 +308,11 @@ if (batch.Recommends.length > 0) { let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); if (recommend != undefined) { - that.addRecord(batch, label, balance,packageInfo) + that.addRecord(batch, label, balance, packageInfo) } else { //允许修改箱码 if (this.jobContent.allowModifyPackingNumber == 'TRUE') { - that.addRecord(batch, label, balance,packageInfo); + that.addRecord(batch, label, balance, packageInfo); } else { that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', res => { @@ -316,7 +322,7 @@ } } } else { - that.addRecord(batch, label, balance,packageInfo) + that.addRecord(batch, label, balance, packageInfo) } } else { that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', @@ -371,14 +377,14 @@ return batch; }, - creatRecord(label, balance,packageInfo) { + creatRecord(label, balance, packageInfo) { balance.stdPackQty = packageInfo.stdPackQty balance.stdPackUnit = packageInfo.stdPackUnit let record = { itemCode: label.itemCode, packingNumber: label.packingNumber, batch: label.batch, - qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), + qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), uom: balance.uom, inventoryStatus: balance.inventoryStatus, balance: balance, @@ -391,13 +397,13 @@ calcBatchHandleQty(batch) { let handleQty = 0; batch.Records.forEach(res => { - handleQty += Number(res.qty) + handleQty = calc.add(handleQty,res.qty) }) batch.handleQty = handleQty; }, - addRecord(batch, label, balance,packageInfo) { - let record = this.creatRecord(label, balance,packageInfo); + addRecord(batch, label, balance, packageInfo) { + let record = this.creatRecord(label, balance, packageInfo); batch.Records.push(record); this.issueRecord.unshift(record) this.calcBatchHandleQty(batch); diff --git a/pages/deliver/job/deliverDetail.vue b/pages/deliver/job/deliverDetail.vue index 05e2381f..2596a094 100644 --- a/pages/deliver/job/deliverDetail.vue +++ b/pages/deliver/job/deliverDetail.vue @@ -2,9 +2,9 @@ - + - + 申请单号:{{jobContent.requestNumber}} @@ -22,7 +22,7 @@ - + @@ -55,6 +55,10 @@ deliverJobSubmit } from '@/api/request2.js'; + import { + calc + } from '@/common/calc.js'; + import { goHome, updateTitle, @@ -80,7 +84,7 @@ import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue' import comMessage from '@/mycomponents/common/comMessage.vue' import jobTop from '@/mycomponents/job/jobTop.vue' - + export default { name: 'issueDetail', components: { @@ -99,9 +103,9 @@ detailSource: [], //绑定在页面上的数据源 detailOptions: [], scanOptions: [], - status:"", - received :false, - toLocationCode:"" + status: "", + received: false, + toLocationCode: "" }; }, @@ -168,7 +172,7 @@ that.jobContent = res.data; that.subList = res.data.subList; that.detailSource = getDataSource(that.detailSource, that.subList) - that.toLocationCode =that.subList[0].toLocationCode + that.toLocationCode = that.subList[0].toLocationCode that.resizeCollapse(); } else { that.showMessage('列表数据为0'); @@ -192,7 +196,7 @@ }); }, - + submit() { uni.showLoading({ @@ -204,7 +208,7 @@ var itemCodes = [] let locationCode = this.detailSource[0].toLocationCode this.detailSource.forEach(toLocationCode => { - toLocationCode.Items.forEach(item=>{ + toLocationCode.Items.forEach(item => { itemCodes.push(item.itemCode) }) }) @@ -235,7 +239,7 @@ if (res.data) { this.showCommitSuccessMessage("提交成功
生成发货记录" + res.data) } else { - this.showErrorMessage("提交失败[" + res.msg+"]") + this.showErrorMessage("提交失败[" + res.msg + "]") } }).catch(error => { uni.hideLoading() @@ -338,10 +342,10 @@ let handleQty = 0; if (batch != undefined) { batch.Records.forEach(res => { - handleQty += Number(res.qty) + handleQty = calc.add(handleQty,res.qty) }) batch.handleQty = handleQty; - itemHandleQty += handleQty; + itemHandleQty = calc.add(itemHandleQty,handleQty) } }) } diff --git a/pages/deliver/request/deliverRequestCreate.vue b/pages/deliver/request/deliverRequestCreate.vue index 5a1cc358..e44a1834 100644 --- a/pages/deliver/request/deliverRequestCreate.vue +++ b/pages/deliver/request/deliverRequestCreate.vue @@ -28,6 +28,10 @@ deliverRequestSubmit, issueRecordSubmit } from '@/api/request2.js'; + + import { + calc + } from '@/common/calc.js'; import { goHome, @@ -123,7 +127,7 @@ } else { //有了更新数据 - result[0].qty += item.qty + result[0].qty = calc.add(result[0].qty,item.qty) } } @@ -136,7 +140,7 @@ caclcQty() { var totalQty = 0; this.detailSource.subList.forEach(res => { - totalQty += res.qty + totalQty = calc.add(totalQty,res.qty) }) this.detailSource.totalQty = totalQty; }, diff --git a/pages/inspect/job/inspectFullDetail.vue b/pages/inspect/job/inspectFullDetail.vue index 2e97c3dc..53b517b8 100644 --- a/pages/inspect/job/inspectFullDetail.vue +++ b/pages/inspect/job/inspectFullDetail.vue @@ -59,6 +59,10 @@ getManagementPrecisions } from '@/common/balance.js'; + import { + calc + } from '@/common/calc.js'; + import { getDataSource, createRecordInfo, @@ -254,8 +258,8 @@ for (let item of this.detailSource) { for (let detail of item.subList) { if (detail != undefined && detail.scaned) { - failedQty += Number(detail.failedQty) - crackQty += Number(detail.crackQty) + failedQty= calc.add(failedQty,detail.failedQty) + crackQty= calc.add(crackQty,detail.crackQty) } } } @@ -325,8 +329,9 @@ let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { - if(this.jobContent.allowModifyInventoryStatus=="TRUE"){ - this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + + if (this.jobContent.allowModifyInventoryStatus == "TRUE") { + this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + + itemStatus + ']不一致,是否继续检验?', res => { if (res) { itemDetail.scaned = true; @@ -337,13 +342,14 @@ this.scanPopupGetFocus(); } }); - }else { - this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + + } else { + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + + itemStatus + ']不一致,不允许转移!', res => { this.scanPopupGetFocus(); }); } - + } else { itemDetail.scaned = true; itemDetail.balance = result.balance; diff --git a/pages/issue/coms/comScanIssuePack.vue b/pages/issue/coms/comScanIssuePack.vue index d594bcef..555c37fd 100644 --- a/pages/issue/coms/comScanIssuePack.vue +++ b/pages/issue/coms/comScanIssuePack.vue @@ -45,8 +45,8 @@ - + @@ -106,6 +106,10 @@ getWorkShopLineStation } from '@/api/request2.js'; + import { + calc + } from '@/common/calc.js'; + import { getBalanceByManagementPrecision } from '@/common/balance.js'; @@ -325,9 +329,9 @@ this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + '】的发料明细,是否要继续发料?', res => { if (res) { - let batch = that.createBatchInfo(label, balance,packageInfo); + let batch = that.createBatchInfo(label, balance, packageInfo); //新增加的批次赋值details - if(fromLocation.Batchs.length>0){ + if (fromLocation.Batchs.length > 0) { batch.detail = fromLocation.Batchs[0].detail; } fromLocation.Batchs.unshift(batch); @@ -356,7 +360,7 @@ } }, - createBatchInfo(data, balance,packageInfo) { + createBatchInfo(data, balance, packageInfo) { let batch = { batch: data.batch, qty: 0, @@ -364,7 +368,7 @@ handleQty: Number(data.qty), Records: [] } - let record = this.creatRecord(data, balance,packageInfo); + let record = this.creatRecord(data, balance, packageInfo); batch.Records.push(record); this.issueRecord.unshift(record) return batch; @@ -374,7 +378,7 @@ balance.stdPackQty = packageInfo.stdPackQty balance.stdPackUnit = packageInfo.stdPackUnit let record = { - scaned:true, + scaned: true, itemCode: label.itemCode, packingNumber: label.packingNumber, batch: label.batch, @@ -391,7 +395,7 @@ calcBatchHandleQty(batch) { let handleQty = 0; batch.Records.forEach(res => { - handleQty += Number(res.qty) + handleQty = calc.add(handleQty,res.qty) }) batch.handleQty = handleQty; diff --git a/pages/issue/job/issueDetail.vue b/pages/issue/job/issueDetail.vue index 015ff2df..3c68e8e1 100644 --- a/pages/issue/job/issueDetail.vue +++ b/pages/issue/job/issueDetail.vue @@ -10,9 +10,11 @@ - - + + + @@ -42,6 +44,10 @@ issueJobSubmit } from '@/api/request2.js'; + import { + calc + } from '@/common/calc.js'; + import { goHome, updateTitle, @@ -285,19 +291,19 @@ item.Locations.forEach(fromLocation => { fromLocation.Batchs.forEach(batch => { let subItem = batch.detail; - if(subItem!=undefined){ + if (subItem != undefined) { if (batch.Records.length > 0) { subItem.recordList = []; batch.Records.forEach(r => { let record = {}; record.handleQty = r.qty; - + record.fromPackingNumber = r .packingNumber; record.fromBatch = r.batch; record.fromContainerNumber = r .ContainerNumber; - + record.toContainerNumber = r .ContainerNumber; record.toInventoryStatus = r @@ -305,19 +311,21 @@ record.toLocationCode = subItem .toLocationCode; record.supplierCode = r.supplierCode; - + //使用在途库不改变管理模式 - if (this.jobContent.useOnTheWayLocation == + if (this.jobContent + .useOnTheWayLocation == 'TRUE') { record.toPackingNumber = r .packingNumber; record.toBatch = r.batch; } else { - var info = getPackingNumberAndBatch( - this.managementList, r - .itemCode, - r.packingNumber, r - .batch); + var info = + getPackingNumberAndBatch( + this.managementList, r + .itemCode, + r.packingNumber, r + .batch); record.toPackingNumber = info .packingNumber; record.toBatch = info.batch; @@ -379,10 +387,10 @@ let handleQty = 0; if (batch != undefined) { batch.Records.forEach(res => { - handleQty += Number(res.qty) + handleQty = calc.add(handleQty,res.qty) }) batch.handleQty = handleQty; - itemHandleQty += handleQty; + itemHandleQty = calc.add(itemHandleQty,handleQty) } }) } diff --git a/pages/issue/js/issue.js b/pages/issue/js/issue.js index 93ccf03f..ec2b46c7 100644 --- a/pages/issue/js/issue.js +++ b/pages/issue/js/issue.js @@ -1,3 +1,6 @@ + import { + calc + } from '@/common/calc.js'; export function getDataSource(list, subList) { for (var i = 0; i < subList.length; i++) { let detail = subList[i]; @@ -25,7 +28,7 @@ export function createDetailInfo(location, detail) { item = createItemInfo(detail); location.Items.push(item) } else { - item.qty += detail.qty + item.qty = calc.add(item.qty,detail.qty) //在零件下查找库位 let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode); if (location == undefined) { diff --git a/pages/issue/record/issueRecord.vue b/pages/issue/record/issueRecord.vue index 30efb9df..1b95de9d 100644 --- a/pages/issue/record/issueRecord.vue +++ b/pages/issue/record/issueRecord.vue @@ -341,17 +341,17 @@ var params = this.setParams() console.log("提交参数", JSON.stringify(params)); - // issueRecordSubmit(params).then(res => { - // uni.hideLoading() - // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成发料记录
" + res.data) - // } else { - // this.showErrorMessage("提交失败:" + res.msg) - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + issueRecordSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功
生成发料记录
" + res.data) + } else { + this.showErrorMessage("提交失败:" + res.msg) + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) }, showCommitSuccessMessage(hint) { diff --git a/pages/issue/request/issueRequestCreate.vue b/pages/issue/request/issueRequestCreate.vue index 8b0cce4b..5b039da1 100644 --- a/pages/issue/request/issueRequestCreate.vue +++ b/pages/issue/request/issueRequestCreate.vue @@ -5,7 +5,7 @@
- + @@ -31,6 +31,10 @@ issueRequestSubmit, } from '@/api/request2.js'; + import { + calc + } from '@/common/calc.js'; + import { goHome, updateTitle, @@ -95,11 +99,11 @@ productionLineName: item.productionLineName, workStationCode: item.workStationCode, workStationName: item.workStationName, //工位 - toLocationCode:item.rawLocationCode, + toLocationCode: item.rawLocationCode, totalQty: 0, subList: [] } - + var subItem = { productionLineCode: item.productionLineCode, workStationCode: item.workStationCode, @@ -131,18 +135,17 @@ } else { //有了更新数据 - result[0].qty += item.qty - + result[0].qty = calc.add(result[0].qty,item.qty) } } this.caclcQty(); - + }, caclcQty() { var totalQty = 0; this.detailSource.subList.forEach(res => { - totalQty += res.qty + totalQty = calc.add(totalQty,res.qty) }) this.detailSource.totalQty = totalQty; }, diff --git a/pages/package/record/splitPackageRecord.vue b/pages/package/record/splitPackageRecord.vue index 6d0081c5..fe8aaea3 100644 --- a/pages/package/record/splitPackageRecord.vue +++ b/pages/package/record/splitPackageRecord.vue @@ -48,6 +48,10 @@ splitPackageRecordSubmit } from '@/api/request2.js'; + import { + calc + } from '@/common/calc.js'; + import { getInventoryStatusDesc, getDirectoryItemArray @@ -180,9 +184,9 @@ var sumQty = 0; item.subList[0].Records.forEach(function(item1, index) { - sumQty += item1.qty; + sumQty = calc.add(sumQty,item1.qty) }); - if ((Number(qty) + sumQty) > item.subList[0].qty) { + if (calc.add(qty,sumQty)> item.subList[0].qty) { this.showErrorMessage("扫描数量总和【" + (Number(qty) + sumQty) + "】(当前输入数量【" + qty + "】+已添加数量【" + sumQty + "】)已超过拆包箱码的数量【" + Number(item.subList[0].qty) + "】!"); @@ -200,7 +204,7 @@ if (detail.Records.length > 0) { detail.Records.forEach(r => { - hQty += Number(r.qty) + hQty = calc.add(hQty,r.qty) }) } detail.handleQty = hQty; @@ -292,21 +296,21 @@ subItem.itemName = detail.package.itemName; subItem.itemDesc1 = detail.package.itemDesc1; subItem.itemDesc2 = detail.package.itemDesc2; - + subItem.fromInventoryStatus = subItem.inventoryStatus; subItem.toInventoryStatus = subItem.inventoryStatus; - + subItem.fromQty = subItem.qty subItem.toQty = record.qty - + subItem.fromPackingNumber = subItem.packingNumber; subItem.toPackingNumber = record.packingNumber; - + subItem.fromBatch = subItem.batch; subItem.toBatch = record.batch; subItem.fromLocationCode = subItem.fromLocationCode; subItem.package = "" - subItem.Records="" + subItem.Records = "" subList.push(subItem) } diff --git a/pages/productPutaway/request/putawayRequestCreate.vue b/pages/productPutaway/request/putawayRequestCreate.vue index c82a647c..414b0561 100644 --- a/pages/productPutaway/request/putawayRequestCreate.vue +++ b/pages/productPutaway/request/putawayRequestCreate.vue @@ -61,6 +61,10 @@ getDirectoryItemArray } from '@/common/directory.js'; + import { + calc + } from '@/common/calc.js'; + import { getBusinessType, createItemInfo, @@ -210,7 +214,7 @@ item.qty = 0; for (let detail of item.subList) { if (detail != undefined) { - item.qty += Number(detail.qty) + item.qty = calc.add(item.qty,detail.qty) } } } diff --git a/pages/productReceipt/record/productReceiptRecord.vue b/pages/productReceipt/record/productReceiptRecord.vue index dd183d9e..f6495709 100644 --- a/pages/productReceipt/record/productReceiptRecord.vue +++ b/pages/productReceipt/record/productReceiptRecord.vue @@ -61,6 +61,10 @@ deepCopyData } from '@/common/basic.js'; + import { + calc + } from '@/common/calc.js'; + import { getInventoryStatusDesc, getDirectoryItemArray @@ -210,7 +214,7 @@ item.qty = 0; for (let detail of item.subList) { if (detail != undefined) { - item.qty += Number(detail.qty) + item.qty = calc.add(item.qty,detail.qty) } } } @@ -326,10 +330,10 @@ submitItem.productionlineCode = this.productionLineCode; submitItem.workStationCode = this.workStationCode; - - submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; - submitItem.package =""; - + + submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; + submitItem.package = ""; + subList.push(submitItem) } }) @@ -392,7 +396,7 @@ this.clearData(); }) }, - clearData(){ + clearData() { this.subList = []; this.detailSource = []; this.toLocationCode = ''; diff --git a/pages/productionReturn/coms/comReturn.vue b/pages/productionReturn/coms/comReturn.vue index c8efa490..1d796f3d 100644 --- a/pages/productionReturn/coms/comReturn.vue +++ b/pages/productionReturn/coms/comReturn.vue @@ -57,6 +57,10 @@ getPackingNumberAndBatchByList } from '@/common/basic.js'; + import { + calc + } from '@/common/calc.js'; + import { getDirectoryItemArray } from '@/common/directory.js'; @@ -237,7 +241,7 @@ item.qty = 0; for (let detail of item.subList) { if (detail != undefined) { - item.qty += Number(detail.qty) + item.qty = calc.add(item.qty, detail.qty) } } } @@ -431,7 +435,7 @@ this.clearData(); }) }, - clearData(){ + clearData() { this.subList = []; this.detailSource = []; this.toLocationCode = ''; diff --git a/pages/productionReturn/coms/comScanReturnPack.vue b/pages/productionReturn/coms/comScanReturnPack.vue index 1b2bc367..312c90e7 100644 --- a/pages/productionReturn/coms/comScanReturnPack.vue +++ b/pages/productionReturn/coms/comScanReturnPack.vue @@ -7,7 +7,7 @@ 扫描箱码 关闭 -