From f5bf29ba9e9ba5cedd66ac123e28296b982d0454 Mon Sep 17 00:00:00 2001 From: weiwei Date: Wed, 15 Oct 2025 10:40:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=9B=B6=E5=94=AE=E4=BB=B7=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=88=97=E5=90=88=E8=AE=A1=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchaseManagement/smErpCgBack/form.vue | 8 ++++++-- .../purchaseManagement/smErpCgInventory/form.vue | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/supermarketerp/purchaseManagement/smErpCgBack/form.vue b/src/views/supermarketerp/purchaseManagement/smErpCgBack/form.vue index 11869a4..4be8bfa 100644 --- a/src/views/supermarketerp/purchaseManagement/smErpCgBack/form.vue +++ b/src/views/supermarketerp/purchaseManagement/smErpCgBack/form.vue @@ -73,6 +73,7 @@ { seq: '合计', quantity: total.quantity, + retailPrice: total.retailPrice, purchasePrice: total.purchasePrice, realPrice: `${total.realPrice}元`, totalAmount: total.totalAmount, @@ -129,7 +130,7 @@ - + @@ -256,12 +257,15 @@ const validRules = ref>({ // 合计总金额 const total = computed(() => { const quantity = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.quantity || 0), 0).toFixed(2) + const retailPrice = displayPrice( + vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.retailPrice || 0), 0).toFixed(2), + ) const purchasePrice = displayPrice( vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.purchasePrice || 0), 0), ) const realPrice = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.realPrice || 0), 0).toFixed(2) const totalAmount = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.totalAmount || 0), 0).toFixed(2) - return { quantity, purchasePrice, realPrice, totalAmount } + return { quantity, retailPrice, purchasePrice, realPrice, totalAmount } }) onMounted(async () => { diff --git a/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue b/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue index bf29485..9b48c55 100644 --- a/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue +++ b/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue @@ -101,6 +101,7 @@ { seq: '合计', quantity: total.quantity, + retailPrice: total.retailPrice, purchasePrice: total.purchasePrice, realPrice: `${total.realPrice}元`, totalAmount: total.totalAmount, @@ -157,7 +158,7 @@ - + @@ -284,12 +285,15 @@ const validRules = ref>({ // 合计总金额 const total = computed(() => { const quantity = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.quantity || 0), 0).toFixed(2) + const retailPrice = displayPrice( + vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.retailPrice || 0), 0).toFixed(2), + ) const purchasePrice = displayPrice( vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.purchasePrice || 0), 0), ) const realPrice = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.realPrice || 0), 0).toFixed(2) const totalAmount = vxeTableData.value.reduce((sum: any, row: any) => sum + Number(row.selectedUnitObj?.totalAmount || 0), 0).toFixed(2) - return { quantity, purchasePrice, realPrice, totalAmount } + return { quantity, retailPrice, purchasePrice, realPrice, totalAmount } }) onMounted(async () => {