gaoluyang
20 小时以前 b0aabd1979c3b4dc1447234125cd7f6b4a41a0a0
feat(hrm): 离职申请改为按系统用户选择申请人

- 申请单字段 employeeId/employeeName 改为 userId/userName,列表与审批详情同步展示「离职申请人」
- 新增表单增加「离职申请人」用户选择组件,新增时默认带出当前登录人

Co-Authored-By: Claude Code <noreply@anthropic.com>
已修改4个文件
28 ■■■■■ 文件已修改
src/api/hrm/resignation/index.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrm/resignation/data.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrm/resignation/detail/approve/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrm/resignation/modules/form.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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');
}
}
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 @@
      },
    },
  ];
}
}
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 },
    {
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>
</template>