From 25fce45021c160a904dd99d83d1bca6f275839e5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 十一月 2026 20:29:07 +0800
Subject: [PATCH] fix(hrm): 考勤异常申请字段与异常类型修正
---
src/api/hrm/attendance/exception/index.ts | 5 ++---
src/views/hrm/attendance/exception/detail/approve/index.vue | 10 ++++++++--
src/views/hrm/attendance/exception/data.ts | 37 +++++++++++++++++++++++++------------
3 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/src/api/hrm/attendance/exception/index.ts b/src/api/hrm/attendance/exception/index.ts
index 1adeb2a..1d510c5 100644
--- a/src/api/hrm/attendance/exception/index.ts
+++ b/src/api/hrm/attendance/exception/index.ts
@@ -10,9 +10,8 @@
userId?: number;
userName?: string;
deptName?: string;
- date?: string;
- exceptionType?: number;
- exceptionTypeName?: string;
+ exceptionDate?: string;
+ type?: number;
reason?: string;
blobIds?: number[];
attachmentList?: SystemStorageApi.StorageBlob[];
diff --git a/src/views/hrm/attendance/exception/data.ts b/src/views/hrm/attendance/exception/data.ts
index 6c6784d..ca0a0e5 100644
--- a/src/views/hrm/attendance/exception/data.ts
+++ b/src/views/hrm/attendance/exception/data.ts
@@ -8,6 +8,18 @@
/** 琛ㄥ崟绫诲瀷 */
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 [
@@ -20,28 +32,23 @@
},
},
{
- 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',
},
@@ -113,8 +120,14 @@
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',
diff --git a/src/views/hrm/attendance/exception/detail/approve/index.vue b/src/views/hrm/attendance/exception/detail/approve/index.vue
index e0fef3a..ffcfae3 100644
--- a/src/views/hrm/attendance/exception/detail/approve/index.vue
+++ b/src/views/hrm/attendance/exception/detail/approve/index.vue
@@ -14,6 +14,8 @@
import { DictTag } from '#/components/dict-tag';
import { useDescription } from '#/components/description';
+import { formatExceptionType } from '../../data';
+
defineOptions({ name: 'HrmAttendanceExceptionApproveDetail' });
const props = defineProps<{ id: string }>();
@@ -34,10 +36,14 @@
{ 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: (val) => formatExceptionType(val as number),
+ },
{ label: '寮傚父璇存槑', field: 'reason', render: textRender },
{
label: '瀹℃壒鐘舵��',
--
Gitblit v1.9.3