From c3f86967c39a9b59583756c8eecadc2851dfb84c Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Wed, 11 Dec 2024 11:35:16 +0800 Subject: [PATCH] =?UTF-8?q?wms=E2=80=9C=E5=85=A5=E5=BA=93=E6=95=B0?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=87=BA=E5=BA=93=E6=95=B0=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E6=95=B0=E9=87=8F=EF=BC=8C=E8=BF=99=E4=B8=89?= =?UTF-8?q?=E9=A1=B9=E8=8F=9C=E5=8D=95=E9=A1=B9=E7=9B=AE=E7=9A=84=E6=9C=80?= =?UTF-8?q?=E4=B8=8B=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=B1=87=E6=80=BB=E6=95=B0?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=88=86=E5=88=AB=E5=AE=83=E4=BB=AC=E5=90=84?= =?UTF-8?q?=E8=87=AA=E7=9A=84=E6=B1=87=E6=80=BB=E6=95=B0=E9=87=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wms/matetowsn/index.vue | 35 ++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/views/wms/matetowsn/index.vue b/src/views/wms/matetowsn/index.vue index 9e37643..f6930d1 100644 --- a/src/views/wms/matetowsn/index.vue +++ b/src/views/wms/matetowsn/index.vue @@ -96,8 +96,12 @@ - - +
+ @@ -150,7 +154,7 @@ - +
sum + (row.amount || 0), 0); + // const totalOutNumber = data.reduce((sum, row) => sum + (row.outNumber || 0), 0); + // const totalRemaining = totalAmount - totalOutNumber; + // return [ + // { amount: totalAmount, outNumber: totalOutNumber, remaining: totalRemaining }, + // ]; + // }, + getSummary(param) { + const { columns, data } = param; + const totalAmount = data.reduce((sum, row) => sum + (row.amount || 0), 0); + const totalOutNumber = data.reduce((sum, row) => sum + (row.outNumber || 0), 0); + const totalRemaining = totalAmount - totalOutNumber; + const summary = columns.map((column, index) => { + if (index === 7) { // "计划数量"在第8列 + return totalAmount; + } else if (index === 8) { // "已入库数量"在第9列 + return totalOutNumber; + }else if (index === 9) { // "已入库数量"在第9列 + return totalRemaining; + } + return ''; // 其余列不汇总,返回空 + }); + return summary; + }, handlequeryform() { this.showMaterialDialog = true; // 显示领料单信息弹窗 this.fetchMaterials(); // 加载领料单数据