diff --git a/openhis-ui-vue3/src/views/medicationmanagement/statisticalManagement/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/statisticalManagement/index.vue
index 77f2bf8e..3495a9fb 100644
--- a/openhis-ui-vue3/src/views/medicationmanagement/statisticalManagement/index.vue
+++ b/openhis-ui-vue3/src/views/medicationmanagement/statisticalManagement/index.vue
@@ -277,7 +277,7 @@
:show-overflow-tooltip="true"
>
- {{ scope.row.purchasePrice?.toFixed(3) + ' 元' }}
+ {{ Number(scope.row.purchasePrice || 0).toFixed(3) + ' 元' }}
- {{ scope.row.salePrice?.toFixed(3) + ' 元' }}
+ {{ Number(scope.row.salePrice || 0).toFixed(3) + ' 元' }}
- {{ scope.row.totalPurchasePrice?.toFixed(3) + ' 元' }}
+ {{ Number(scope.row.totalPurchasePrice || 0).toFixed(3) + ' 元' }}
- {{ scope.row.totalSalePrice?.toFixed(3) + ' 元' }}
+ {{ Number(scope.row.totalSalePrice || 0).toFixed(3) + ' 元' }}
{
- salePriceTotal.value = res.data.purchasePriceStatistics;
- priceTotal.value = res.data.salePriceStatistics;
+ // 使用 Number() 强制转换,解决字符串问题
+ // 使用 || 0 解决 null/undefined 问题
+ const purchasePrice = res.data?.purchasePriceStatistics;
+ const salePrice = res.data?.salePriceStatistics;
+
+ salePriceTotal.value = Number(purchasePrice || 0);
+ priceTotal.value = Number(salePrice || 0);
});
}