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 () => {