gaoluyang
7 天以前 a1e9064bb4c0a41c9a1e389cdd0f0f9bab009309
src/views/hrm/overtime/data.ts
@@ -1,7 +1,9 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { HrmEmployeeApi } from '#/api/hrm/employee';
import type { HrmOvertimeApi } from '#/api/hrm/overtime';
import { getEmployeeSimpleList } from '#/api/hrm/employee';
import { DICT_TYPE } from '#/packages/constants/src';
import { getDictOptions } from '#/packages/effects/hooks/src';
@@ -33,8 +35,28 @@
    },
    {
      fieldName: 'employeeId',
      component: 'Input',
      dependencies: { triggerFields: [''], show: () => false },
      label: '申请人',
      component: 'ApiSelect',
      componentProps: {
        api: async () => {
          const list = await getEmployeeSimpleList();
          // 离职员工不可选作加班申请人
          return list.filter((item) => item.employeeStatus !== 3);
        },
        labelField: 'name',
        labelFn: (item: HrmEmployeeApi.EmployeeSimple) =>
          `${item.name}(${item.employeeNo})`,
        valueField: 'id',
        showSearch: true,
        filterOption: (input: string, option: any) =>
          String(option.label ?? '')
            .toLowerCase()
            .includes(input.toLowerCase()),
        placeholder: '请选择申请人',
        style: { width: '100%' },
      },
      rules: 'selectRequired',
      formItemClass: 'col-span-2',
    },
    {
      fieldName: 'baseInfoDivider',
@@ -44,9 +66,9 @@
    },
    {
      fieldName: 'employeeName',
      label: '申请人',
      label: '申请人姓名',
      component: 'Input',
      componentProps: { disabled: true, placeholder: '系统自动带出' },
      componentProps: { disabled: true, placeholder: '选择申请人后自动带出' },
    },
    {
      fieldName: 'employeeNo',