From d979f89c4b46729976aa44429922a910aeb5d8da Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 10 八月 2026 11:17:15 +0800
Subject: [PATCH] Merge branch 'dev_pro_山西_德益科技' of http://114.132.189.42:9002/r/product-inventory-management into dev_pro_山西_德益科技

---
 src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js |   92 ++++++++++++++++++++++++++++------------------
 1 files changed, 56 insertions(+), 36 deletions(-)

diff --git a/src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js b/src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js
index 44fd1b4..97801f2 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js
@@ -165,11 +165,49 @@
 function pickApplicantQuery(searchForm = {}) {
   const kw = (searchForm.applicantKeyword || "").trim();
   if (!kw) return {};
-  if (/[\u4e00-\u9fa5]/.test(kw)) return { applicantName: kw };
-  return { applicantCode: kw };
+  // 鍗犱綅銆屽鍚嶆垨缂栧彿銆嶏細濮撳悕璧� applicantName锛涚紪鍙峰彟浼� applicantCode
+  const out = { applicantName: kw };
+  if (!/[\u4e00-\u9fa5]/.test(kw)) {
+    out.applicantCode = kw;
+  }
+  return out;
 }
 
-/** 缁勮 listPage 鏌ヨ鍙傛暟锛坧age + finReimbursementDto锛� */
+/** 鏄惁瀛樺湪鍒楄〃绛涢�夋潯浠讹紙浠呯敵璇蜂汉锛� */
+export function hasActiveReimbursementSearch(searchForm = {}) {
+  return Boolean((searchForm?.applicantKeyword || "").trim());
+}
+
+/** 鏈嶅姟绔湭鐢熸晥鏃讹紝鎸夌敵璇蜂汉鍋氬墠绔厹搴曠瓫閫� */
+export function filterReimbursementRowsBySearch(rows, searchForm = {}) {
+  const list = Array.isArray(rows) ? rows : [];
+  const kw = (searchForm?.applicantKeyword || "").trim().toLowerCase();
+  if (!kw) return list;
+
+  return list.filter((row) => {
+    const parts = [
+      row.applicantName,
+      row.employeeName,
+      row.applicantNo,
+      row.applicantCode,
+      row.employeeNo,
+    ]
+      .filter((v) => v != null && v !== "")
+      .map((v) => String(v).toLowerCase());
+    return parts.some((p) => p.includes(kw));
+  });
+}
+
+/** 鎵佸钩鍖栦负 Spring GET 鍙粦瀹氱殑 query锛坒inReimbursementDto.xxx锛屽嬁鐢ㄦ柟鎷彿锛� */
+function appendDotNotationQuery(target, prefix, fields) {
+  if (!fields || typeof fields !== "object") return;
+  for (const [key, value] of Object.entries(fields)) {
+    if (value == null || value === "") continue;
+    target[`${prefix}.${key}`] = value;
+  }
+}
+
+/** 缁勮 listPage 鏌ヨ鍙傛暟锛堟墎骞� page.* / finReimbursementDto.*锛屼笌 detail 鎺ュ彛涓�鑷达級 */
 export function buildFinReimbursementListParams({
   page,
   searchForm,
@@ -182,40 +220,15 @@
     ...(extraDto && typeof extraDto === "object" ? extraDto : {}),
   };
 
-  if (searchForm?.billStatus) {
-    dto.billStatus = searchForm.billStatus;
-  }
-
-  const range =
-    searchForm?.createTimeRange ??
-    searchForm?.applyDateRange ??
-    (searchForm?.applyTimeFrom || searchForm?.applyTimeTo
-      ? [searchForm.applyTimeFrom, searchForm.applyTimeTo]
-      : null);
-
-  if (Array.isArray(range) && range[0]) {
-    dto.createTimeStart = range[0];
-  }
-  if (Array.isArray(range) && range[1]) {
-    dto.createTimeEnd = range[1];
-  }
-
-  if (reimbursementType === FIN_REIMBURSEMENT_TYPE.TRAVEL) {
-    if (searchForm?.travelStartFrom) {
-      dto.startTimeStart = searchForm.travelStartFrom;
-    }
-    if (searchForm?.travelEndTo) {
-      dto.endTimeEnd = searchForm.travelEndTo;
-    }
-  }
-
-  return {
-    page: {
-      current: page.current,
-      size: page.size,
-    },
-    finReimbursementDto: dto,
+  const params = {
+    current: page.current,
+    size: page.size,
+    "page.current": page.current,
+    "page.size": page.size,
+    ...dto,
   };
+  appendDotNotationQuery(params, "finReimbursementDto", dto);
+  return params;
 }
 
 function pickTravelField(obj, keys) {
@@ -289,6 +302,13 @@
   return hasTime ? d.format("YYYY-MM-DD HH:mm:ss") : d.format("YYYY-MM-DD");
 }
 
+/** 鍒楄〃/璇︽儏浠呭睍绀烘棩鏈燂紙鎶规帀鏃跺垎绉掞級 */
+export function formatReimbursementDate(val) {
+  if (val == null || val === "") return "";
+  const d = dayjs(val);
+  return d.isValid() ? d.format("YYYY-MM-DD") : String(val);
+}
+
 /** 鎺ュ彛琛� 鈫� 宸梾鎶ラ攢鍒楄〃琛岋紙鍏煎 useTravelReimburse 瀛楁锛� */
 export function mapTravelReimbursementRow(row) {
   if (!row) return {};

--
Gitblit v1.9.3