| | |
| | | userId?: number; |
| | | userName?: string; |
| | | deptName?: string; |
| | | date?: string; |
| | | exceptionType?: number; |
| | | exceptionTypeName?: string; |
| | | exceptionDate?: string; |
| | | exceptionTime?: string; |
| | | type?: number; |
| | | reason?: string; |
| | | blobIds?: number[]; |
| | | attachmentList?: SystemStorageApi.StorageBlob[]; |
| | | status?: number; |
| | | exceptionDate?: string; |
| | | // 以下为审核派生字段,由后端在审核时写入,前端只读展示 |
| | | reviewerId?: number; // 审核人ID(实际执行审核的用户) |
| | | reviewerName?: string; // 审核人姓名 |
| | |
| | | pass, |
| | | reviewRemark, |
| | | }); |
| | | } |
| | | } |
| | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail'; |
| | | |
| | | /** 考勤异常类型,与后端 HrmAttendanceExceptionTypeEnum 保持一致 */ |
| | | const EXCEPTION_TYPE_OPTIONS = [ |
| | | { label: '补卡', value: 1 }, |
| | | { label: '加班', value: 2 }, |
| | | { label: '出差', value: 3 }, |
| | | ]; |
| | | |
| | | /** 考勤异常类型名称 */ |
| | | export function formatExceptionType(value?: number) { |
| | | return EXCEPTION_TYPE_OPTIONS.find((item) => item.value === value)?.label ?? '-'; |
| | | } |
| | | |
| | | /** 新增考勤异常申请的表单 */ |
| | | export function useFormSchema(formType: FormType): VbenFormSchema[] { |
| | | return [ |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'date', |
| | | label: '考勤日期', |
| | | fieldName: 'exceptionDate', |
| | | label: '异常日期', |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | placeholder: '请选择考勤日期', |
| | | placeholder: '请选择异常日期', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | style: { width: '100%' }, |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'exceptionType', |
| | | fieldName: 'type', |
| | | label: '异常类型', |
| | | component: 'Select', |
| | | componentProps: { |
| | | placeholder: '请选择异常类型', |
| | | options: [ |
| | | { label: '漏打卡', value: 1 }, |
| | | { label: '迟到', value: 2 }, |
| | | { label: '早退', value: 3 }, |
| | | { label: '其他', value: 4 }, |
| | | ], |
| | | options: EXCEPTION_TYPE_OPTIONS, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | |
| | | return [ |
| | | { field: 'userName', title: '申请人', minWidth: 100 }, |
| | | { field: 'deptName', title: '部门', minWidth: 120 }, |
| | | { field: 'date', title: '考勤日期', width: 110 }, |
| | | { field: 'exceptionTypeName', title: '异常类型', width: 100 }, |
| | | { field: 'exceptionDate', title: '异常日期', width: 110 }, |
| | | { |
| | | field: 'type', |
| | | title: '异常类型', |
| | | width: 100, |
| | | formatter: ({ cellValue }: { cellValue: number }) => |
| | | formatExceptionType(cellValue), |
| | | }, |
| | | { field: 'reason', title: '异常原因', minWidth: 200 }, |
| | | { |
| | | field: 'status', |
| | |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | } |
| | |
| | | import { DictTag } from '#/components/dict-tag'; |
| | | import { useDescription } from '#/components/description'; |
| | | |
| | | import { formatExceptionType } from '../../data'; |
| | | |
| | | defineOptions({ name: 'HrmAttendanceExceptionApproveDetail' }); |
| | | |
| | | const props = defineProps<{ id: string }>(); |
| | |
| | | { label: '所属部门', field: 'deptName', render: textRender }, |
| | | { |
| | | label: '异常日期', |
| | | field: 'date', |
| | | field: 'exceptionDate', |
| | | render: (val) => formatDateTime(val) as string, |
| | | }, |
| | | { label: '异常类型', field: 'exceptionTypeName', render: textRender }, |
| | | { label: '异常类型', field: 'type', render: formatExceptionType }, |
| | | { label: '异常说明', field: 'reason', render: textRender }, |
| | | { |
| | | label: '审批状态', |
| | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { auditAttendanceException } from '#/api/hrm/attendance/exception'; |
| | | |
| | | import { formatExceptionType } from '../data'; |
| | | |
| | | const emit = defineEmits(['success']); |
| | | |
| | | const pass = ref(true); // true=审核通过 / false=审核不通过 |
| | |
| | | <div>申请人:{{ rowData.userName }}</div> |
| | | <div>所属部门:{{ rowData.deptName }}</div> |
| | | <div>异常日期:{{ rowData.exceptionDate }}</div> |
| | | <div>异常类型:{{ rowData.exceptionTypeName }}</div> |
| | | <div>异常类型:{{ formatExceptionType(rowData.type) }}</div> |
| | | <div>申请原因:{{ rowData.reason }}</div> |
| | | </div> |
| | | <Form class="mx-4" /> |