From 4ab0be7d4441f378add1f242b168d80fb27e65fe Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 22 五月 2026 17:57:44 +0800
Subject: [PATCH] OA部分查询条件变更
---
src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js | 85 ++++++++++++++++++++++++------------------
1 files changed, 49 insertions(+), 36 deletions(-)
diff --git a/src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js b/src/views/officeProcessAutomation/ReimburseManage/shared/finReimbursementMappers.js
index 44fd1b4..2525f70 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) {
--
Gitblit v1.9.3