From 1da75e1e70af40a8598943b4af5901f1e0ca7b1d Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期六, 07 十一月 2026 19:13:31 +0800
Subject: [PATCH] fix(hrm): 修复考勤异常新增字段错误
---
src/api/hrm/attendance/exception/index.ts | 9 ++++-----
src/views/hrm/attendance/exception/detail/approve/index.vue | 6 ++++--
src/views/hrm/attendance/exception/data.ts | 39 ++++++++++++++++++++++++++-------------
src/views/hrm/attendance/exception/modules/audit-modal.vue | 4 +++-
4 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/src/api/hrm/attendance/exception/index.ts b/src/api/hrm/attendance/exception/index.ts
index 1efb375..86f0c80 100644
--- a/src/api/hrm/attendance/exception/index.ts
+++ b/src/api/hrm/attendance/exception/index.ts
@@ -10,14 +10,13 @@
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; // 瀹℃牳浜篒D锛堝疄闄呮墽琛屽鏍哥殑鐢ㄦ埛锛�
reviewerName?: string; // 瀹℃牳浜哄鍚�
@@ -83,4 +82,4 @@
pass,
reviewRemark,
});
-}
\ No newline at end of file
+}
diff --git a/src/views/hrm/attendance/exception/data.ts b/src/views/hrm/attendance/exception/data.ts
index 6c6784d..980d087 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',
@@ -140,4 +153,4 @@
},
},
];
-}
\ No newline at end of file
+}
diff --git a/src/views/hrm/attendance/exception/detail/approve/index.vue b/src/views/hrm/attendance/exception/detail/approve/index.vue
index e0fef3a..059ec9b 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,10 @@
{ 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: '瀹℃壒鐘舵��',
diff --git a/src/views/hrm/attendance/exception/modules/audit-modal.vue b/src/views/hrm/attendance/exception/modules/audit-modal.vue
index 022ee7e..8e4ed47 100644
--- a/src/views/hrm/attendance/exception/modules/audit-modal.vue
+++ b/src/views/hrm/attendance/exception/modules/audit-modal.vue
@@ -11,6 +11,8 @@
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=瀹℃牳涓嶉�氳繃
@@ -94,7 +96,7 @@
<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" />
--
Gitblit v1.9.3