From c9cfcbda7fb7c8b62b27d623feb0418790396740 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 18 九月 2026 11:09:07 +0800
Subject: [PATCH] 天津融邦环保app 1.部署修改

---
 src/pages/oa/_utils/approveListUtils.js |   86 +++++++++++++++++++++---------------------
 1 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/src/pages/oa/_utils/approveListUtils.js b/src/pages/oa/_utils/approveListUtils.js
index f7ddc00..ad0bae9 100644
--- a/src/pages/oa/_utils/approveListUtils.js
+++ b/src/pages/oa/_utils/approveListUtils.js
@@ -6,6 +6,8 @@
   mergeFormConfigForEdit,
 } from "./approvalFormField.js";
 import {
+  appendDotNotationQuery,
+  buildApprovalInstanceSearchDto,
   formatKnownSelectLabel,
   resolveInstanceFormPayload,
   resolveListFieldRawValue,
@@ -178,6 +180,35 @@
     .map(([, node]) => node);
 }
 
+/** 妯℃澘 nodes 鈫� 瀹℃壒浠诲姟锛堜笌 Web mapFlowNodesToTasks 涓�鑷达級 */
+export function mapFlowNodesToTasks(nodes, { instanceId, templateId } = {}) {
+  const list = Array.isArray(nodes) ? nodes : [];
+  const tasks = [];
+  list.forEach((n, i) => {
+    const levelNo = n?.levelNo ?? i + 1;
+    const approveType =
+      String(n?.approveType || "AND").toUpperCase() === "OR" ? "OR" : "AND";
+    (n?.approvers || []).forEach((a, idx) => {
+      if (a?.approverId == null || a.approverId === "") return;
+      const task = {
+        levelNo,
+        approveType,
+        approverId: a.approverId,
+        approverName: a.approverName || "",
+        sortNo: a.sortNo ?? idx + 1,
+      };
+      if (a.id != null) task.id = a.id;
+      if (a.nodeId != null) task.nodeId = a.nodeId;
+      if (a.templateId != null) task.templateId = a.templateId;
+      else if (templateId) task.templateId = templateId;
+      if (instanceId) task.instanceId = instanceId;
+      if (a.status != null) task.status = a.status;
+      tasks.push(task);
+    });
+  });
+  return tasks;
+}
+
 /** 缁勮瀹℃壒鎻愪氦 DTO锛堜笌 Web buildApproveInstanceDto 涓�鑷达級 */
 export function buildApproveInstanceDto(id, uiResult, comment) {
   const opinion = (comment || "").trim();
@@ -188,22 +219,9 @@
   };
 }
 
-/** 鏄惁鏈汉鍙戣捣鐨勫鎵� */
-export function isOwnApplication(item, userStore) {
-  const uid = userStore?.id;
-  if (item?.applicantId != null && uid != null && uid !== "") {
-    return String(item.applicantId) === String(uid);
-  }
-  const loginName = userStore?.nickName || userStore?.name;
-  if (loginName && item?.applicantName) {
-    return String(item.applicantName).trim() === String(loginName).trim();
-  }
-  return false;
-}
-
-/** 浠呰繘琛屼腑涓旀湰浜哄彂璧锋椂鍙紪杈� */
-export function canModifyInstance(item, userStore) {
-  return item?.status === "PENDING" && isOwnApplication(item, userStore);
+/** 浠呰繘琛屼腑鍙紪杈戯紙涓� Web openEditDialog 鍒ゅ畾涓�鑷达級 */
+export function canModifyInstance(item) {
+  return item?.status === "PENDING";
 }
 
 /** 寰呭綋鍓嶇敤鎴峰鎵� */
@@ -272,8 +290,7 @@
 }
 
 /**
- * 涓� Web buildApprovalInstanceListParams 涓�鑷达細鎵佸钩 query锛坈urrent/size/businessType/...锛�
- * 瀹℃壒鍒楄〃涓嶄紶 businessType 鍗虫煡鍏ㄩ儴
+ * 涓� Web buildApprovalInstanceListParams 涓�鑷�
  */
 export function buildInstanceListParams({
   page,
@@ -281,37 +298,20 @@
   extraDto = {},
   searchForm,
 }) {
-  const extra = { ...(extraDto && typeof extraDto === "object" ? extraDto : {}) };
-  if (extra.createTime != null && extra.createTimeStart == null) {
-    extra.createTimeStart = extra.createTime;
+  const dto = buildApprovalInstanceSearchDto(searchForm, extraDto);
+  const bizType = businessType ?? searchForm?.businessType;
+  if (bizType != null && bizType !== "") {
+    dto.businessType = bizType;
   }
-  delete extra.createTime;
 
   const params = {
     current: page.current,
     size: page.size,
-    ...extra,
+    "page.current": page.current,
+    "page.size": page.size,
+    ...dto,
   };
-
-  const bizType = businessType ?? searchForm?.businessType;
-  if (bizType != null && bizType !== "") {
-    params.businessType = bizType;
-  }
-  if (searchForm?.status) {
-    params.status = searchForm.status;
-  }
-
-  const range =
-    searchForm?.createTimeRange ??
-    searchForm?.applyDateRange ??
-    searchForm?.transferDateRange;
-  if (Array.isArray(range) && range[0] && params.createTimeStart == null) {
-    params.createTimeStart = range[0];
-  }
-  if (Array.isArray(range) && range[1] && params.createTimeEnd == null) {
-    params.createTimeEnd = range[1];
-  }
-
+  appendDotNotationQuery(params, "approvalInstanceDto", dto);
   return params;
 }
 

--
Gitblit v1.9.3