bug142 库房管理-》统计管理-》库存明细记录-》库存明细页面显示空白

This commit is contained in:
2026-02-25 10:29:15 +08:00
parent 038213a26c
commit 20ab9f890f

View File

@@ -277,7 +277,7 @@
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.purchasePrice?.toFixed(3) + ' 元' }}</span>
<span>{{ Number(scope.row.purchasePrice || 0).toFixed(3) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
@@ -290,7 +290,7 @@
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.salePrice?.toFixed(3) + ' 元' }}</span>
<span>{{ Number(scope.row.salePrice || 0).toFixed(3) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
@@ -303,7 +303,7 @@
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.totalPurchasePrice?.toFixed(3) + ' 元' }}</span>
<span>{{ Number(scope.row.totalPurchasePrice || 0).toFixed(3) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
@@ -316,7 +316,7 @@
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ scope.row.totalSalePrice?.toFixed(3) + ' 元' }}</span>
<span>{{ Number(scope.row.totalSalePrice || 0).toFixed(3) + ' 元' }}</span>
</template>
</el-table-column>
<el-table-column
@@ -671,8 +671,13 @@ function getList() {
total.value = res.data.total;
});
productPageTotal(params).then((res) => {
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);
});
}