From f1cb99b6650d2ff22d421489c0cf0da5d7d569ec Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 06 十一月 2026 15:43:35 +0800
Subject: [PATCH] fix(hrm): 离职提交前选择审批流程并传 processDefinitionKey

---
 src/views/hrm/resignation/index.vue |   50 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/src/views/hrm/resignation/index.vue b/src/views/hrm/resignation/index.vue
index cdf72da..a840757 100644
--- a/src/views/hrm/resignation/index.vue
+++ b/src/views/hrm/resignation/index.vue
@@ -2,14 +2,17 @@
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { HrmResignationApi } from '#/api/hrm/resignation';
 
+import { ref } from 'vue';
+
 import { Page, useVbenModal } from '#/packages/effects/common-ui/src';
 
-import { message } from 'ant-design-vue';
+import { message, Modal, Select } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
 import {
   cancelResignation,
   deleteResignation,
+  getResignationApproveProcessDefinitionList,
   getResignationPage,
   submitResignation,
   updateHandoverStatus,
@@ -59,11 +62,34 @@
   }
 }
 
-/** 鎻愪氦绂昏亴鐢宠 */
+const submitModalVisible = ref(false);
+const currentRow = ref<HrmResignationApi.Resignation>();
+const processList = ref<HrmResignationApi.ApproveProcess[]>([]);
+const selectedProcessKey = ref<string>();
+const submitLoading = ref(false);
+
+/** 鎻愪氦绂昏亴鐢宠锛堝厛閫夋嫨瀹℃壒娴佺▼锛� */
 async function handleSubmit(row: HrmResignationApi.Resignation) {
-  await submitResignation(row.id!);
-  message.success('鎻愪氦鎴愬姛');
-  handleRefresh();
+  processList.value = await getResignationApproveProcessDefinitionList();
+  currentRow.value = row;
+  selectedProcessKey.value = undefined;
+  submitModalVisible.value = true;
+}
+
+async function confirmSubmit() {
+  if (!selectedProcessKey.value) {
+    message.warning('璇烽�夋嫨绂昏亴瀹℃壒娴佺▼');
+    return;
+  }
+  submitLoading.value = true;
+  try {
+    await submitResignation(currentRow.value!.id!, selectedProcessKey.value);
+    message.success('鎻愪氦鎴愬姛');
+    submitModalVisible.value = false;
+    handleRefresh();
+  } finally {
+    submitLoading.value = false;
+  }
 }
 
 /** 鎾ら攢绂昏亴鐢宠 */
@@ -186,5 +212,19 @@
         />
       </template>
     </Grid>
+    <Modal
+      v-model:open="submitModalVisible"
+      title="鎻愪氦鑷冲崗鍚屽姙鍏�"
+      width="420px"
+      :confirm-loading="submitLoading"
+      @ok="confirmSubmit"
+    >
+      <Select
+        v-model:value="selectedProcessKey"
+        class="w-full"
+        placeholder="璇烽�夋嫨绂昏亴瀹℃壒娴佺▼"
+        :options="processList.map((item) => ({ label: item.name, value: item.key }))"
+      />
+    </Modal>
   </Page>
 </template>
\ No newline at end of file

--
Gitblit v1.9.3