From b1d8b61db2fdce34e9f7b5386489be37852eadeb Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 13 十月 2026 08:57:52 +0800
Subject: [PATCH] feat: 添加利润率格式化功能,按百分比展示后端返回的小数

---
 src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js b/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
index 727f896..f41127f 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/approveTemplateConstants.js
@@ -159,16 +159,18 @@
   if (val == null || val === "") return "";
   if (Array.isArray(val) && val.length >= 3) {
     const [y, m, d, h = 0, min = 0, s = 0] = val;
-    return dayjs(new Date(y, m - 1, d, h, min, s)).format("YYYY-MM-DD HH:mm:ss");
+    // return dayjs(new Date(y, m - 1, d, h, min, s)).format("YYYY-MM-DD HH:mm:ss");
+      return dayjs(new Date(y, m - 1, d, h, min, s)).format("YYYY-MM-DD");
+
   }
   if (typeof val === "number") {
     const d = val > 1e12 ? dayjs(val) : dayjs.unix(val);
-    return d.isValid() ? d.format("YYYY-MM-DD HH:mm:ss") : "";
+    return d.isValid() ? d.format("YYYY-MM-DD") : "";
   }
   const s = String(val).trim();
   if (!s) return "";
   const parsed = dayjs(s.includes("T") ? s : s.replace(/-/g, "/"));
-  return parsed.isValid() ? parsed.format("YYYY-MM-DD HH:mm:ss") : s;
+  return parsed.isValid() ? parsed.format("YYYY-MM-DD") : s;
 }
 
 export function formatDisplayTime(val) {
@@ -343,13 +345,31 @@
   return { ok: true, nodes, name };
 }
 
-export function flowNodesSummary(nodes) {
+/** 鑺傜偣灞傜骇涓枃搴忓彿锛氫竴绾� / 浜岀骇 / 鈥� */
+const LEVEL_TEXT = ["涓�绾�", "浜岀骇", "涓夌骇", "鍥涚骇", "浜旂骇", "鍏骇", "涓冪骇", "鍏骇", "涔濈骇", "鍗佺骇"];
+
+export function nodeLevelText(index) {
+  return LEVEL_TEXT[index] || `绗�${index + 1}绾;
+}
+
+/**
+ * 瀹℃壒鑺傜偣鍚嶇О锛氭寜銆屽鎵圭被鍨� + 灞傜骇銆嶅懡鍚嶏紝渚嬪銆屽彂璐у鎵孤蜂竴绾с�嶃��
+ * @param {string} typeName 瀹℃壒绫诲瀷/妯℃澘鍚嶇О锛屽銆屽彂璐у鎵广��
+ * @param {number} index    0 鍩鸿妭鐐瑰簭鍙�
+ */
+export function nodeDisplayName(typeName, index) {
+  const level = nodeLevelText(index);
+  const type = (typeName || "").trim();
+  return type ? `${type}路${level}` : level;
+}
+
+export function flowNodesSummary(nodes, typeName = "") {
   const list = normalizeFlowNodes(nodes);
   if (!list.length) return "鈥�";
   return list
     .map((n, i) => {
       const names = n.approvers.map((a) => a.approverName || "鏈懡鍚�").join("銆�") || "鏈厤缃�";
-      return `鑺傜偣${i + 1}(${nodeSignModeLabel(n.signMode)}:${names})`;
+      return `${nodeDisplayName(typeName, i)}(${nodeSignModeLabel(n.signMode)}:${names})`;
     })
     .join(" 鈫� ");
 }

--
Gitblit v1.9.3