From b0aabd1979c3b4dc1447234125cd7f6b4a41a0a0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 30 十月 2026 10:52:44 +0800
Subject: [PATCH] feat(hrm): 离职申请改为按系统用户选择申请人

---
 src/views/hrm/resignation/detail/approve/index.vue |    2 +-
 src/views/hrm/resignation/data.ts                  |   14 ++++++++++++--
 src/views/hrm/resignation/modules/form.vue         |    6 +++++-
 src/api/hrm/resignation/index.ts                   |    6 +++---
 4 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/api/hrm/resignation/index.ts b/src/api/hrm/resignation/index.ts
index 8b90cd2..61e8833 100644
--- a/src/api/hrm/resignation/index.ts
+++ b/src/api/hrm/resignation/index.ts
@@ -7,8 +7,8 @@
   /** 绂昏亴鐢宠 */
   export interface Resignation {
     id?: number;
-    employeeId?: number;
-    employeeName?: string;
+    userId?: number;
+    userName?: string;
     deptName?: string;
     postName?: string;
     resignationType?: number;
@@ -74,4 +74,4 @@
 /** 鑾峰彇鍙敤娴佺▼瀹氫箟鍒楄〃 */
 export function getResignationApproveProcessDefinitionList() {
   return requestClient.get<any[]>('/hrm/resignation/approve-process-definition-list');
-}
\ No newline at end of file
+}
diff --git a/src/views/hrm/resignation/data.ts b/src/views/hrm/resignation/data.ts
index 3131c33..0c7d084 100644
--- a/src/views/hrm/resignation/data.ts
+++ b/src/views/hrm/resignation/data.ts
@@ -2,10 +2,13 @@
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { HrmResignationApi } from '#/api/hrm/resignation';
 
+import { markRaw } from 'vue';
+
 import { DICT_TYPE } from '#/packages/constants/src';
 import { getDictOptions } from '#/packages/effects/hooks/src';
 
 import { getEmployeeSimpleList } from '#/api/hrm/employee';
+import { UserSelect } from '#/views/system/user/components';
 
 /** 琛ㄥ崟绫诲瀷 */
 export type FormType = 'create' | 'detail' | 'update';
@@ -20,6 +23,13 @@
         triggerFields: [''],
         show: () => false,
       },
+    },
+    {
+      fieldName: 'userId',
+      label: '绂昏亴鐢宠浜�',
+      component: markRaw(UserSelect),
+      componentProps: { placeholder: '璇烽�夋嫨绂昏亴鐢宠浜�' },
+      rules: 'selectRequired',
     },
     {
       fieldName: 'resignationType',
@@ -121,7 +131,7 @@
 export function useGridColumns(): VxeTableGridOptions<HrmResignationApi.Resignation>['columns'] {
   return [
     { field: 'id', title: '鐢宠缂栧彿', width: 80 },
-    { field: 'employeeName', title: '鐢宠浜�', minWidth: 100 },
+    { field: 'userName', title: '绂昏亴鐢宠浜�', minWidth: 100 },
     { field: 'deptName', title: '閮ㄩ棬', minWidth: 120 },
     { field: 'postName', title: '宀椾綅', minWidth: 120 },
     {
@@ -168,4 +178,4 @@
       },
     },
   ];
-}
\ No newline at end of file
+}
diff --git a/src/views/hrm/resignation/detail/approve/index.vue b/src/views/hrm/resignation/detail/approve/index.vue
index 4e3a587..7a45b9e 100644
--- a/src/views/hrm/resignation/detail/approve/index.vue
+++ b/src/views/hrm/resignation/detail/approve/index.vue
@@ -30,7 +30,7 @@
   bordered: true,
   column: 2,
   schema: [
-    { label: '鍛樺伐濮撳悕', field: 'employeeName', render: textRender },
+    { label: '绂昏亴鐢宠浜�', field: 'userName', render: textRender },
     { label: '鎵�灞為儴闂�', field: 'deptName', render: textRender },
     { label: '鑱屼綅', field: 'postName', render: textRender },
     {
diff --git a/src/views/hrm/resignation/modules/form.vue b/src/views/hrm/resignation/modules/form.vue
index d1ebf27..85a085d 100644
--- a/src/views/hrm/resignation/modules/form.vue
+++ b/src/views/hrm/resignation/modules/form.vue
@@ -4,6 +4,8 @@
 
 import { computed, ref } from 'vue';
 
+import { useUserStore } from '@vben/stores';
+
 import { useVbenModal } from '#/packages/effects/common-ui/src';
 
 import { message } from 'ant-design-vue';
@@ -16,6 +18,7 @@
 
 const emit = defineEmits(['success']);
 const formType = ref<FormType>('create');
+const userStore = useUserStore();
 
 const isDetail = computed(() => formType.value === 'detail');
 const getTitle = computed(() => {
@@ -74,6 +77,7 @@
     formApi.setDisabled(data.formType === 'detail');
     modalApi.setState({ showConfirmButton: data.formType !== 'detail' });
     if (!data?.id) {
+      await formApi.setFieldValue('userId', userStore.userInfo?.id);
       return;
     }
     modalApi.lock();
@@ -100,4 +104,4 @@
   <Modal :title="getTitle" class="w-[850px]">
     <Form class="mx-4" />
   </Modal>
-</template>
\ No newline at end of file
+</template>

--
Gitblit v1.9.3