feat(hrm): 离职申请改为按系统用户选择申请人
- 申请单字段 employeeId/employeeName 改为 userId/userName,列表与审批详情同步展示「离职申请人」
- 新增表单增加「离职申请人」用户选择组件,新增时默认带出当前登录人
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | /** 离职申请 */ |
| | | export interface Resignation { |
| | | id?: number; |
| | | employeeId?: number; |
| | | employeeName?: string; |
| | | userId?: number; |
| | | userName?: string; |
| | | deptName?: string; |
| | | postName?: string; |
| | | resignationType?: number; |
| | |
| | | /** 获取可用流程定义列表 */ |
| | | export function getResignationApproveProcessDefinitionList() { |
| | | return requestClient.get<any[]>('/hrm/resignation/approve-process-definition-list'); |
| | | } |
| | | } |
| | |
| | | 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'; |
| | |
| | | triggerFields: [''], |
| | | show: () => false, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'userId', |
| | | label: '离职申请人', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { placeholder: '请选择离职申请人' }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'resignationType', |
| | |
| | | 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 }, |
| | | { |
| | |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | } |
| | |
| | | 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 }, |
| | | { |
| | |
| | | |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useUserStore } from '@vben/stores'; |
| | | |
| | | import { useVbenModal } from '#/packages/effects/common-ui/src'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | |
| | | |
| | | const emit = defineEmits(['success']); |
| | | const formType = ref<FormType>('create'); |
| | | const userStore = useUserStore(); |
| | | |
| | | const isDetail = computed(() => formType.value === 'detail'); |
| | | const getTitle = computed(() => { |
| | |
| | | formApi.setDisabled(data.formType === 'detail'); |
| | | modalApi.setState({ showConfirmButton: data.formType !== 'detail' }); |
| | | if (!data?.id) { |
| | | await formApi.setFieldValue('userId', userStore.userInfo?.id); |
| | | return; |
| | | } |
| | | modalApi.lock(); |
| | |
| | | <Modal :title="getTitle" class="w-[850px]"> |
| | | <Form class="mx-4" /> |
| | | </Modal> |
| | | </template> |
| | | </template> |