From 68e397562214f68038b412c68f6359b870e93a07 Mon Sep 17 00:00:00 2001 From: lilu Date: Thu, 23 Feb 2023 14:49:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=B1=E9=87=8F=E5=B1=95=E5=BC=80=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/BookingLedger/detail/index.vue | 16 ++-- .../detail/modules/goodsTable.vue | 79 ++++++++++++++++++- .../detail/modules/operationArea.vue | 47 ++++++++++- 3 files changed, 130 insertions(+), 12 deletions(-) diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 5b59e32..1fd207e 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -977,10 +977,10 @@ export default { }, bookingOrderUpdate() { - if (!this.bookingDetails.mblno) { - this.$message.error('请输入提单号') - return false - } + // if (!this.bookingDetails.mblno) { + // this.$message.error('请输入提单号') + // return false + // } // 自定义必填项验证 - start let basicFrom = true this.$refs.basicInfo.$refs.basicFrom.validate(valid => { @@ -1107,10 +1107,10 @@ export default { }, bookingOrderAdd() { - if (!this.bookingDetails.mblno) { - this.$message.error('请输入提单号') - return false - } + // if (!this.bookingDetails.mblno) { + // this.$message.error('请输入提单号') + // return false + // } // 自定义必填项验证 - start let basicFrom = true this.$refs.basicInfo.$refs.basicFrom.validate(valid => { diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 5fb5e59..7afdca0 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -8,6 +8,7 @@ 多品名 引入场站数据 引入箱皮重 +
@@ -1174,6 +1175,77 @@ export default { }) this.totalPkgs = pkgs }, + developboxLine () { + const arr = [] + let key = 0 + this.tableData.map((item, index) => { + const num = Number(item.ctnnum) + if (num > 1) { + // 件数 + let surplusPkgs = item.pkgs + let surpluskgs = item.kgs * 100000 + let surpluscbm = item.cbm * 100000 + for (let i = 0; i < num; i++) { + // eslint-disable-next-line prefer-const + let sunData = JSON.parse(JSON.stringify(item)) + sunData.ctnnum = 1 + sunData.rowKey = key + key++ + if (!(/(^[1-9]\d*$)/.test(sunData.pkgs / num))) { + if (i !== num - 1) { + const averagePkgs = (sunData.pkgs / num) + '' + const cNum = averagePkgs.indexOf('.') + sunData.pkgs = Number(averagePkgs.substr(0, cNum)) + surplusPkgs = surplusPkgs - sunData.pkgs + } else { + sunData.pkgs = surplusPkgs + } + } else { + sunData.pkgs = sunData.pkgs / num + } + + // 重量 + if (!(/(^[1-9]\d*$)/.test(sunData.kgs * 100000 / num))) { + if (i !== num - 1) { + const averagekgs = (sunData.kgs * 100000 / num) + '' + const cNum = averagekgs.indexOf('.') + sunData.kgs = Number(averagekgs.substr(0, cNum)) / 100000 + surpluskgs = surpluskgs - Number(averagekgs.substr(0, cNum)) + } else { + sunData.kgs = surpluskgs / 100000 + } + } else { + sunData.kgs = ((sunData.kgs * 100000) / num) / 100000 + } + + // 尺码 + if (!(/(^[1-9]\d*$)/.test(sunData.cbm * 100000 / num))) { + if (i !== num - 1) { + const averagecbm = (sunData.cbm * 100000 / num) + '' + const cNum = averagecbm.indexOf('.') + sunData.cbm = Number(averagecbm.substr(0, cNum)) / 100000 + surpluscbm = surpluscbm - Number(averagecbm.substr(0, cNum)) + } else { + sunData.cbm = surpluscbm / 100000 + } + } else { + sunData.cbm = ((sunData.cbm * 100000) / num) / 100000 + } + if (sunData.weightype === '累加') { + sunData['weighkgs'] = this.calc(Number(sunData['kgs']), Number(sunData['tareweight']), '+') + } + // sunData.weighkgs = 1 // 未完成 + arr.push(sunData) + } + } else { + item.rowKey = key + key++ + arr.push(item) + } + }) + this.tableData = arr + console.log(arr) + }, openDialog() { if (this.tableData.length === 0) { return false @@ -1506,11 +1578,12 @@ export default {