From 1f58572b8f999858f6f58f268ef194e5df08adca Mon Sep 17 00:00:00 2001 From: sugarBecomer Date: Wed, 25 Mar 2026 13:47:11 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=AF=B7=E5=81=87=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cpdaily.ts | 11 + src/types/cpdaily.ts | 34 ++ src/views/cpdaily/CpLeaveManage.vue | 549 ++++++++++++++++++++++++++-- src/views/cpdaily/CpTaskManage.vue | 36 +- src/views/cpdaily/CpUserManage.vue | 33 +- 5 files changed, 630 insertions(+), 33 deletions(-) diff --git a/src/api/cpdaily.ts b/src/api/cpdaily.ts index 0f367d4..a9ef335 100644 --- a/src/api/cpdaily.ts +++ b/src/api/cpdaily.ts @@ -15,6 +15,7 @@ import type { CpTaskExecuteParams, CpTaskFormItem, CpLeaveReportParams, + CpLeaveApplyParams, TaskStatisticsItem, TaskStatisticsV2Item, DashboardSummary, @@ -117,4 +118,14 @@ export const cpLeaveApi = { request.post('/v1/cpdaily/leave/report', data), uploadImage: (formData: FormData) => request.post('/v1/cpdaily/leave/upload', formData), + checkLeave: (cpUserId: number) => + request.get(`/v1/cpdaily/leave/check/${cpUserId}`), + getLeaveTypes: (cpUserId: number) => + request.get(`/v1/cpdaily/leave/types/${cpUserId}`), + getLeaveTypeCfg: (data: { cpUserId: number; code: number }) => + request.post('/v1/cpdaily/leave/typeCfg', data), + getApproveFlow: (data: { cpUserId: number; leaveType: number; startTime: string; endTime: string }) => + request.post('/v1/cpdaily/leave/approveFlow', data), + apply: (data: CpLeaveApplyParams) => + request.post('/v1/cpdaily/leave/apply', data), } diff --git a/src/types/cpdaily.ts b/src/types/cpdaily.ts index 9b6cfb9..2223294 100644 --- a/src/types/cpdaily.ts +++ b/src/types/cpdaily.ts @@ -183,3 +183,37 @@ export interface CpUserCustomDeviceParams { mobileCode: string mobileType: 'random' | 'manual' } + +export interface CpLeaveType { + id: string + code: number + name: string + mustOut: number + reasonWordLimit: number + attachmentNumberLimit: number +} + +export interface CpLeaveApprover { + userWid: string + userId: string + userName: string +} + +export interface CpLeaveApplyParams { + cpUserId: number + leaveType: number + startTime: string + endTime: string + urgencyMobile: string + leaveReason: string + outStatus: boolean + address: string + detailAddress: string + longitude: string + latitude: string + locationAddr: string + imageUrl?: string + approverWid?: string + approverId?: string + approverName?: string +} diff --git a/src/views/cpdaily/CpLeaveManage.vue b/src/views/cpdaily/CpLeaveManage.vue index b87b642..e4b27e8 100644 --- a/src/views/cpdaily/CpLeaveManage.vue +++ b/src/views/cpdaily/CpLeaveManage.vue @@ -1,8 +1,8 @@