diff --git a/src/views/inOut/expenseAccount.vue b/src/views/inOut/expenseAccount.vue index 89018f1..2fe61b1 100644 --- a/src/views/inOut/expenseAccount.vue +++ b/src/views/inOut/expenseAccount.vue @@ -347,34 +347,35 @@ export default { : "支出金额(元)", width: 140, align: "right", + formatter: (cell, data, value) => { + return Number(value) + .toFixed(2) + .replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); + } }, { - prop: "use_money_total", + prop: "apply_money_total", label: this.$route.path.split("_")[1] == 2 ? "实际报销金额(元)" : "实际支出金额(元)", width: 140, align: "right", - customFn: (row) => { - let total = 0; - row.plans?.forEach((i) => { - total += Number(i.money) || 0; - }); - return {total}; - }, + formatter: (cell, data, value) => { + return Number(value) + .toFixed(2) + .replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); + } }, { - prop: "has_money_total", + prop: "fund_log_total", label: "已付金额", width: 140, align: "right", - customFn: (row) => { - let total = 0; - row.plans?.forEach((i) => { - total += Number(i.end_money) || 0; - }); - return {total}; + formatter: (cell, data, value) => { + return Number(value) + .toFixed(2) + .replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); }, }, {