From 6c324a234060820d031014ea657af5aa0b0d478e Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 五月 2026 13:29:20 +0800
Subject: [PATCH] 审批模板

---
 src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
index 48103aa..c3c3241 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -15,6 +15,7 @@
   saveStoredRows,
   buildDefaultFlowNodes,
 } from "./approveListConstants.js";
+import { buildSubmitTemplateFromRow } from "../approve-template/formConfigUtils.js";
 
 function advanceFlow(row, result, opinion) {
   const nodes = row.approvalFlowNodes || [];
@@ -110,7 +111,9 @@
     return filteredList.value.slice(start, start + page.size);
   });
 
-  const activeTemplate = computed(() => SUBMIT_TEMPLATES[submitForm.templateKey] || null);
+  const activeTemplate = computed(
+    () => submitForm.templateSnapshot || SUBMIT_TEMPLATES[submitForm.templateKey] || null
+  );
 
   const submitFormRules = computed(() => {
     const rules = {
@@ -232,8 +235,15 @@
     submitDialog.visible = true;
   }
 
-  function onTemplatePick(key) {
-    Object.assign(submitForm, createEmptySubmitForm(key));
+  /** @param {string} key 鍐呯疆妯℃澘 key 鎴栬嚜瀹氫箟 id */
+  function onTemplatePick(key, templateRow) {
+    const base = templateRow
+      ? createEmptySubmitForm(key, buildSubmitTemplateFromRow(templateRow))
+      : createEmptySubmitForm(key);
+    Object.assign(submitForm, {
+      ...base,
+      templateSnapshot: templateRow ? buildSubmitTemplateFromRow(templateRow) : null,
+    });
     submitDialog.step = 2;
   }
 

--
Gitblit v1.9.3