From 8247d0259f5083cb16fe3d30c250d955095a70d2 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期一, 10 八月 2026 08:36:47 +0800
Subject: [PATCH] fix: 优化页面显示
---
src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js | 46 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
index 638d533..4aee781 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
@@ -12,15 +12,20 @@
import {
buildCostReimbursementSaveDto,
buildFinReimbursementListParams,
+ filterReimbursementRowsBySearch,
+ hasActiveReimbursementSearch,
canDeleteReimbursementRow,
canEditReimbursementRow,
+ enrichReimbursementListRowsWithApprovalFlow,
filterRowsByReimbursementType,
FIN_REIMBURSEMENT_TYPE,
+ formatReimbursementDate,
mapCostReimbursementRow,
mapFinReimbursementDetailRow,
resolveReimbursementDeleteId,
unwrapFinReimbursementDetail,
unwrapFinReimbursementPage,
+ validateReimbursementApprovalNodes,
validateReimbursementPersistDto,
} from "../shared/finReimbursementMappers.js";
import { consumeReimburseEditFromApprove } from "../shared/reimburseApproveBridge.js";
@@ -68,8 +73,6 @@
const searchForm = reactive({
applicantKeyword: "",
- applyTimeFrom: "",
- applyTimeTo: "",
});
const tableLoading = ref(false);
const page = reactive({ current: 1, size: 10, total: 0 });
@@ -105,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;
@@ -136,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",
@@ -264,7 +282,11 @@
function autoAssignApprovalFlow() {
const amount = Number(form.applyAmount) || detailTotalAmount.value || 0;
- form.approvalFlowNodes = buildAutoApprovalFlow(amount, form.expenseCategory || "other");
+ form.approvalFlowNodes = buildAutoApprovalFlow(
+ amount,
+ form.expenseCategory || "other",
+ form.approvalFlowNodes
+ );
nextTick(() => formRef.value?.validateField?.("approvalFlowNodes"));
}
@@ -313,8 +335,6 @@
function resetSearch() {
searchForm.applicantKeyword = "";
- searchForm.applyTimeFrom = "";
- searchForm.applyTimeTo = "";
handleQuery();
}
@@ -448,7 +468,6 @@
return;
}
syncApplyAmountFromDetails();
- autoAssignApprovalFlow();
if (submitSaving.value) return;
const isEdit = formDialog.mode === "edit";
@@ -458,6 +477,11 @@
proxy?.$modal?.msgWarning?.(check.message);
return;
}
+ const nodeCheck = validateReimbursementApprovalNodes(dto);
+ if (!nodeCheck.ok) {
+ proxy?.$modal?.msgWarning?.(nodeCheck.message);
+ return;
+ }
submitSaving.value = true;
try {
await persistFinReimbursement(dto, isEdit);
--
Gitblit v1.9.3