From 0a58164ce2ea3f1a2b46781757d78b94b212883b Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 20 五月 2026 15:13:49 +0800
Subject: [PATCH] 工作交接/调岗申请/转正申请/请假申请/加班申请新增调用模板

---
 src/views/officeProcessAutomation/ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue |   40 +++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue b/src/views/officeProcessAutomation/ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue
index c05374d..409dd41 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue
@@ -14,17 +14,18 @@
     :title="dialogTitle"
     :width="step === formStep ? 720 : 640"
     append-to-body
-    destroy-on-close
     class="approval-template-bind-dialog"
     @closed="onClosed"
   >
     <template v-if="step === 1">
-      <ApprovalTemplatePicker
-        :cards="templateCards"
-        :loading="templatesLoading"
-        :hint="pickerHint"
-        @pick="onPickTemplate"
-      />
+      <div v-loading="templatesLoading || confirming">
+        <ApprovalTemplatePicker
+          :cards="templateCards"
+          :loading="false"
+          :hint="pickerHint"
+          @pick="onPickTemplate"
+        />
+      </div>
     </template>
 
     <template v-else>
@@ -73,9 +74,11 @@
   visible: { type: Boolean, default: false },
   /** approvalModuleRegistry 涓殑 moduleKey */
   moduleKey: { type: String, required: true },
+  /** 涓� true 鏃堕�夋ā鏉垮悗鐩存帴纭锛岃烦杩囥�岀‘璁ゅ鎵逛俊鎭�嶅~鎶ユ楠� */
+  skipFormConfirm: { type: Boolean, default: false },
 });
 
-const emit = defineEmits(["update:visible", "confirm"]);
+const emit = defineEmits(["update:visible", "confirm", "closed"]);
 
 const dialogVisible = computed({
   get: () => props.visible,
@@ -122,19 +125,33 @@
     step.value = 1;
     await Promise.all([loadTemplates(), loadFlowUsers()]);
     const cfg = getApprovalModuleConfig(props.moduleKey);
-    if (!cfg) ElMessage.warning(`鏈厤缃ā鍧椼��${props.moduleKey}銆嶏紝璇锋鏌� approvalModuleRegistry`);
+    if (!cfg) {
+      ElMessage.warning(`鏈厤缃ā鍧椼��${props.moduleKey}銆嶏紝璇锋鏌� approvalModuleRegistry`);
+      return;
+    }
+    if (!templateCards.value.length) {
+      ElMessage.warning(
+        `銆�${cfg.label}銆嶄笅鏆傛棤宸插惎鐢ㄧ殑瀹℃壒妯℃澘锛岃鍏堝湪瀹℃壒妯℃澘绠$悊涓垱寤哄苟鍚敤瀵瑰簲绫诲瀷鐨勬ā鏉縛
+      );
+    }
   }
 );
 
 async function onPickTemplate(card) {
   const ok = await pickTemplate(card);
-  if (ok) step.value = formStep;
+  if (!ok) return;
+  if (props.skipFormConfirm) {
+    step.value = 1;
+    await onConfirm();
+    return;
+  }
+  step.value = formStep;
 }
 
 async function onConfirm() {
   confirming.value = true;
   try {
-    const check = await validateBinding(formRef.value);
+    const check = await validateBinding(props.skipFormConfirm ? null : formRef.value);
     if (!check.ok) {
       if (check.message) ElMessage.warning(check.message);
       return;
@@ -148,6 +165,7 @@
 
 function onClosed() {
   resetBinding();
+  emit("closed");
 }
 </script>
 

--
Gitblit v1.9.3