From 0b5311c23e88abe2d3199efe32fcc63d6e9d9b15 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 29 六月 2026 13:56:50 +0800
Subject: [PATCH] fix(account):新增一次收款单后,再次新增剩余金额查询不到对应单据问题修复;

---
 src/views/financialManagement/payable/paymentApply.vue |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/views/financialManagement/payable/paymentApply.vue b/src/views/financialManagement/payable/paymentApply.vue
index e34793f..309d6d3 100644
--- a/src/views/financialManagement/payable/paymentApply.vue
+++ b/src/views/financialManagement/payable/paymentApply.vue
@@ -52,6 +52,8 @@
         :column="columns"
         :tableData="dataList"
         :tableLoading="tableLoading"
+        isShowSummary
+        :summaryMethod="getSummaries"
         :page="{
           current: pagination.currentPage,
           size: pagination.pageSize,
@@ -477,6 +479,24 @@
   applyDate: [{ required: true, message: "璇烽�夋嫨鐢宠鏃ユ湡", trigger: "change" }],
 };
 
+const getSummaries = ({ columns, data }) => {
+  const sums = [];
+  columns.forEach((col, index) => {
+    if (index === 0) {
+      sums[index] = "鍚堣";
+    } else if (col.property === "amount") {
+      const total = data.reduce((prev, cur) => {
+        const v = Number(cur.amount);
+        return prev + (isNaN(v) ? 0 : v);
+      }, 0);
+      sums[index] = total.toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
+    } else {
+      sums[index] = "";
+    }
+  });
+  return sums;
+};
+
 const formatMoney = (value) => {
   if (value === undefined || value === null) return "0.00";
   return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");

--
Gitblit v1.9.3