From ca030ea1f083821afada9c6badf472897c52815e Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 09 八月 2026 23:46:46 +0800
Subject: [PATCH] fix: 优化页面显示

---
 src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js |   33 ++++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
index 04b26ff..4aee781 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
@@ -12,10 +12,14 @@
 import {
   buildCostReimbursementSaveDto,
   buildFinReimbursementListParams,
+  filterReimbursementRowsBySearch,
+  hasActiveReimbursementSearch,
   canDeleteReimbursementRow,
   canEditReimbursementRow,
+  enrichReimbursementListRowsWithApprovalFlow,
   filterRowsByReimbursementType,
   FIN_REIMBURSEMENT_TYPE,
+  formatReimbursementDate,
   mapCostReimbursementRow,
   mapFinReimbursementDetailRow,
   resolveReimbursementDeleteId,
@@ -69,8 +73,6 @@
 
   const searchForm = reactive({
     applicantKeyword: "",
-    applyTimeFrom: "",
-    applyTimeTo: "",
   });
   const tableLoading = ref(false);
   const page = reactive({ current: 1, size: 10, total: 0 });
@@ -106,11 +108,26 @@
         })
       );
       const { records, total } = unwrapFinReimbursementPage(res);
-      allRows.value = filterRowsByReimbursementType(
+      const filtered = filterRowsByReimbursementType(
         records,
         FIN_REIMBURSEMENT_TYPE.COST
-      ).map(mapCostReimbursementRow);
-      page.total = total;
+      );
+      let mapped = filtered.map(mapCostReimbursementRow);
+      mapped = await enrichReimbursementListRowsWithApprovalFlow(
+        mapped,
+        FIN_REIMBURSEMENT_TYPE.COST
+      );
+      if (hasActiveReimbursementSearch(searchForm)) {
+        mapped = filterReimbursementRowsBySearch(mapped, searchForm);
+      }
+      allRows.value = mapped;
+      const dropped = records.length - filtered.length;
+      let nextTotal =
+        dropped > 0 ? Math.max(0, Number(total) - dropped) : Number(total);
+      if (hasActiveReimbursementSearch(searchForm)) {
+        nextTotal = mapped.length;
+      }
+      page.total = nextTotal;
     } catch {
       allRows.value = [];
       page.total = 0;
@@ -137,8 +154,8 @@
     { label: "鐢宠浜�", prop: "applicantName", minWidth: 90 },
     { label: "鎶ラ攢閲戦(鍏�)", prop: "applyAmount", width: 110 },
     { label: "鎶ラ攢鍘熷洜", prop: "reimburseReason", minWidth: 160, showOverflowTooltip: true },
-    { label: "鐢宠鏃堕棿", prop: "applyTime", width: 165 },
-    { label: "鍒涘缓鏃堕棿", prop: "createTime", width: 165 },
+    { label: "鐢宠鏃堕棿", prop: "applyTime", width: 120, formatData: (v) => formatReimbursementDate(v) },
+    { label: "鍒涘缓鏃堕棿", prop: "createTime", width: 120, formatData: (v) => formatReimbursementDate(v) },
     {
       label: "鎶ラ攢鐘舵��",
       prop: "approvalResult",
@@ -318,8 +335,6 @@
 
   function resetSearch() {
     searchForm.applicantKeyword = "";
-    searchForm.applyTimeFrom = "";
-    searchForm.applyTimeTo = "";
     handleQuery();
   }
 

--
Gitblit v1.9.3