From 843937038983adeb3df336acba9830849a63d160 Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Tue, 8 Apr 2025 18:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/project/attendance/echarts.ts | 17 +- src/api/project/attendance/index.ts | 2 +- src/api/project/attendance/types.ts | 2 +- src/api/project/attendanceRecords/index.ts | 63 +++ src/api/project/attendanceRecords/types.ts | 146 +++++++ src/api/project/leave/index.ts | 76 ++++ src/api/project/leave/types.ts | 206 +++++++++ src/api/project/reissueCard/index.ts | 75 ++++ src/api/project/reissueCard/types.ts | 173 ++++++++ src/views/project/attendance/index.vue | 8 +- src/views/project/attendanceRecords/index.vue | 182 ++++++++ src/views/project/leave/index.vue | 394 ++++++++++++++++++ src/views/project/reissueCard/index.vue | 350 ++++++++++++++++ 13 files changed, 1682 insertions(+), 12 deletions(-) create mode 100644 src/api/project/attendanceRecords/index.ts create mode 100644 src/api/project/attendanceRecords/types.ts create mode 100644 src/api/project/leave/index.ts create mode 100644 src/api/project/leave/types.ts create mode 100644 src/api/project/reissueCard/index.ts create mode 100644 src/api/project/reissueCard/types.ts create mode 100644 src/views/project/attendanceRecords/index.vue create mode 100644 src/views/project/leave/index.vue create mode 100644 src/views/project/reissueCard/index.vue diff --git a/src/api/project/attendance/echarts.ts b/src/api/project/attendance/echarts.ts index 407f23d..ce4cc04 100644 --- a/src/api/project/attendance/echarts.ts +++ b/src/api/project/attendance/echarts.ts @@ -6,11 +6,12 @@ const grid = { bottom: 50 }; -const color = ['#91CC75', '#409EFF', '#fff']; +const color = ['#4FD6A9', '#409EFF', '#ECF5FF', '#FFC069']; const titleList = [ - { name: '出勤人数', color: '#fff' }, + { name: '全勤人数', color: '#fff' }, { name: '半勤人数', color: '#fff' }, - { name: '缺勤人数', color: '#000' } + { name: '缺勤人数', color: '#000' }, + { name: '请假人数', color: '#000' } ]; export const echartsConfig = (ref: any, list?: any) => { @@ -18,12 +19,13 @@ export const echartsConfig = (ref: any, list?: any) => { const attendanceArray = list.map((item) => item.attendance); const halfAttendanceArray = list.map((item) => item.halfAttendance); const absenteeismArray = list.map((item) => item.absenteeism); + const leaveArray = list.map((item) => item.leave); - const rawData = [attendanceArray, halfAttendanceArray, absenteeismArray]; + const rawData = [attendanceArray, halfAttendanceArray, absenteeismArray, leaveArray]; //y轴数据 const data = list.map((item) => item.clockDate); - const series: echarts.BarSeriesOption[] = titleList.map((item, sid) => { + const series: any = titleList.map((item, sid) => { return { name: item.name, type: 'bar', @@ -32,7 +34,10 @@ export const echartsConfig = (ref: any, list?: any) => { label: { show: true, color: item.color, - fontSize: 10 + fontSize: 10, + formatter: function (params) { + return params.value > 0 ? params.value : ''; + } }, data: rawData[sid] }; diff --git a/src/api/project/attendance/index.ts b/src/api/project/attendance/index.ts index cc38049..02967c3 100644 --- a/src/api/project/attendance/index.ts +++ b/src/api/project/attendance/index.ts @@ -46,7 +46,7 @@ export const listAttendanceTwoWeek = (query?: AttendanceTwoWeekQuery): AxiosProm export const listAttendanceMonth = (query?: AttendanceMonthQuery): AxiosPromise => { return request({ - url: '/project/constructionUser/list/attendance/month', + url: '/project/attendance/list/month/byUserId', method: 'get', params: query }); diff --git a/src/api/project/attendance/types.ts b/src/api/project/attendance/types.ts index 530b464..2b80ba4 100644 --- a/src/api/project/attendance/types.ts +++ b/src/api/project/attendance/types.ts @@ -46,7 +46,7 @@ export interface AttendanceTwoWeekQuery { } export interface AttendanceMonthQuery { - id: string | number; + userId: string | number; clockMonth?: string; } diff --git a/src/api/project/attendanceRecords/index.ts b/src/api/project/attendanceRecords/index.ts new file mode 100644 index 0000000..edd9542 --- /dev/null +++ b/src/api/project/attendanceRecords/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { AttendanceVO, AttendanceForm, AttendanceQuery } from '@/api/project/attendance/types'; + +/** + * 查询考勤列表 + * @param query + * @returns {*} + */ + +export const listAttendance = (query?: AttendanceQuery): AxiosPromise => { + return request({ + url: '/project/attendance/list', + method: 'get', + params: query + }); +}; + +/** + * 查询考勤详细 + * @param id + */ +export const getAttendance = (id: string | number): AxiosPromise => { + return request({ + url: '/project/attendance/' + id, + method: 'get' + }); +}; + +/** + * 新增考勤 + * @param data + */ +export const addAttendance = (data: AttendanceForm) => { + return request({ + url: '/project/attendance', + method: 'post', + data: data + }); +}; + +/** + * 修改考勤 + * @param data + */ +export const updateAttendance = (data: AttendanceForm) => { + return request({ + url: '/project/attendance', + method: 'put', + data: data + }); +}; + +/** + * 删除考勤 + * @param id + */ +export const delAttendance = (id: string | number | Array) => { + return request({ + url: '/project/attendance/' + id, + method: 'delete' + }); +}; diff --git a/src/api/project/attendanceRecords/types.ts b/src/api/project/attendanceRecords/types.ts new file mode 100644 index 0000000..d51f73d --- /dev/null +++ b/src/api/project/attendanceRecords/types.ts @@ -0,0 +1,146 @@ +export interface AttendanceVO { + /** + * 人员姓名 + */ + userName: string; + + /** + * 上班打卡时间 + */ + onClockTime: string; + + /** + * 下班打卡时间 + */ + offClockTime: string; + + /** + * 打卡日期 + */ + clockDate: string; + + /** + * 1正常,2迟到,3早退,4缺勤,5补卡 + */ + clockStatus: string; + + /** + * 上下班(1上班,2下班) + */ + commuter: string; + + /** + * 备注 + */ + remark: string; +} + +export interface AttendanceForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 人员id + */ + userId?: string | number; + + /** + * 人脸照 + */ + facePic?: string; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 上班打卡时间 + */ + onClockTime?: string; + + /** + * 下班打卡时间 + */ + offClockTime?: string; + + /** + * 打卡日期 + */ + clockDate?: string; + + /** + * 1正常,2迟到,3早退,4缺勤,5补卡 + */ + clockStatus?: string; + + /** + * 代打人员id + */ + pinchUserId?: string | number; + + /** + * 多次打卡时间记录 + */ + clockRecord?: string; + + /** + * 上下班(1上班,2下班) + */ + commuter?: string; + + /** + * 日薪 + */ + dailyWage?: number; + + /** + * 经度 + */ + lng?: string; + + /** + * 纬度 + */ + lat?: string; + + /** + * 备注 + */ + remark?: string; +} + +export interface AttendanceQuery extends PageQuery { + /** + * 人员姓名 + */ + userName?: string; + teamId?: string | number; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 打卡日期 + */ + clockDate?: string; + + /** + * 1正常,2迟到,3早退,4缺勤,5补卡 + */ + clockStatus?: string; + + /** + * 上下班(1上班,2下班) + */ + commuter?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/project/leave/index.ts b/src/api/project/leave/index.ts new file mode 100644 index 0000000..50bdc04 --- /dev/null +++ b/src/api/project/leave/index.ts @@ -0,0 +1,76 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { LeaveVO, LeaveForm, LeaveQuery } from '@/api/project/leave/types'; +import { AuditReissueCardForm } from '../reissueCard/types'; + +/** + * 查询施工人员请假申请列表 + * @param query + * @returns {*} + */ + +export const listLeave = (query?: LeaveQuery): AxiosPromise => { + return request({ + url: '/project/leave/list', + method: 'get', + params: query + }); +}; + +/** + * 查询施工人员请假申请详细 + * @param id + */ +export const getLeave = (id: string | number): AxiosPromise => { + return request({ + url: '/project/leave/' + id, + method: 'get' + }); +}; + +/** + * 新增施工人员请假申请 + * @param data + */ +export const addLeave = (data: LeaveForm) => { + return request({ + url: '/project/leave', + method: 'post', + data: data + }); +}; + +/** + * 修改施工人员请假申请 + * @param data + */ +export const updateLeave = (data: LeaveForm) => { + return request({ + url: '/project/leave', + method: 'put', + data: data + }); +}; + +/** + * 删除施工人员请假申请 + * @param id + */ +export const delLeave = (id: string | number | Array) => { + return request({ + url: '/project/leave/' + id, + method: 'delete' + }); +}; + +/** + * 管理员审核施工人员请假申请 + * @param data + */ +export const AuditReissueCard = (data: AuditReissueCardForm) => { + return request({ + url: '/project/leave/review/manager', + method: 'put', + data: data + }); +}; diff --git a/src/api/project/leave/types.ts b/src/api/project/leave/types.ts new file mode 100644 index 0000000..c4a0331 --- /dev/null +++ b/src/api/project/leave/types.ts @@ -0,0 +1,206 @@ +export interface LeaveVO { + /** + * 申请人名字 + */ + userName: string; + id?: string | number; + /** + * 申请请假说明 + */ + userExplain: string; + status?: string; + /** + * 请假申请时间 + */ + userTime: string; + + /** + * 请假类型(1事假 2病假) + */ + leaveType: string; + + /** + * 请假开始时间 + */ + startTime: string; + + /** + * 请假结束时间 + */ + endTime: string; + + /** + * 班组长名字 + */ + gangerName: string; + + /** + * 班组长意见(1未读 2同意 3拒绝) + */ + gangerOpinion: string; + + /** + * 班组长说明 + */ + gangerExplain: string; + + /** + * 班组长操作时间 + */ + gangerTime: string; + + /** + * 管理员意见(1未读 2同意 3拒绝) + */ + managerOpinion: string; + + /** + * 管理员说明 + */ + managerExplain: string; + + /** + * 管理员操作时间 + */ + managerTime: string; + + /** + * 备注 + */ + remark: string; + managerName?: string; +} + +export interface LeaveForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 申请人id + */ + userId?: string | number; + + /** + * 申请人名字 + */ + userName?: string; + + /** + * 申请请假说明 + */ + userExplain?: string; + + /** + * 请假申请时间 + */ + userTime?: string; + + /** + * 请假类型(1事假 2病假) + */ + leaveType?: string; + + /** + * 请假开始时间 + */ + startTime?: string; + + /** + * 请假结束时间 + */ + endTime?: string; + + /** + * 班组长 + */ + gangerId?: string | number; + + /** + * 班组长名字 + */ + gangerName?: string; + + /** + * 班组长意见(1未读 2同意 3拒绝) + */ + gangerOpinion?: string; + + /** + * 班组长说明 + */ + gangerExplain?: string; + + /** + * 班组长操作时间 + */ + gangerTime?: string; + + /** + * 管理员意见(1未读 2同意 3拒绝) + */ + managerOpinion?: string; + + /** + * 管理员说明 + */ + managerExplain?: string; + + /** + * 管理员操作时间 + */ + managerTime?: string; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 班组id + */ + teamId?: string | number; + + /** + * 备注 + */ + remark?: string; +} + +export interface LeaveQuery extends PageQuery { + /** + * 申请人名字 + */ + userName?: string; + + /** + * 请假类型(1事假 2病假) + */ + leaveType?: string; + + /** + * 班组长意见(1未读 2同意 3拒绝) + */ + gangerOpinion?: string; + + /** + * 管理员意见(1未读 2同意 3拒绝) + */ + managerOpinion?: string; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 班组id + */ + teamId?: string | number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/project/reissueCard/index.ts b/src/api/project/reissueCard/index.ts new file mode 100644 index 0000000..4709a89 --- /dev/null +++ b/src/api/project/reissueCard/index.ts @@ -0,0 +1,75 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ReissueCardVO, ReissueCardForm, ReissueCardQuery, AuditReissueCardForm } from '@/api/project/reissueCard/types'; + +/** + * 查询施工人员补卡申请列表 + * @param query + * @returns {*} + */ + +export const listReissueCard = (query?: ReissueCardQuery): AxiosPromise => { + return request({ + url: '/project/reissueCard/list', + method: 'get', + params: query + }); +}; + +/** + * 查询施工人员补卡申请详细 + * @param id + */ +export const getReissueCard = (id: string | number): AxiosPromise => { + return request({ + url: '/project/reissueCard/' + id, + method: 'get' + }); +}; + +/** + * 新增施工人员补卡申请 + * @param data + */ +export const addReissueCard = (data: ReissueCardForm) => { + return request({ + url: '/project/reissueCard', + method: 'post', + data: data + }); +}; + +/** + * 修改施工人员补卡申请 + * @param data + */ +export const updateReissueCard = (data: ReissueCardForm) => { + return request({ + url: '/project/reissueCard', + method: 'put', + data: data + }); +}; + +/** + * 删除施工人员补卡申请 + * @param id + */ +export const delReissueCard = (id: string | number | Array) => { + return request({ + url: '/project/reissueCard/' + id, + method: 'delete' + }); +}; + +/** + * 管理员审核施工人员补卡申请 + * @param data + */ +export const AuditReissueCard = (data: AuditReissueCardForm) => { + return request({ + url: '/project/reissueCard/review/manager', + method: 'put', + data: data + }); +}; diff --git a/src/api/project/reissueCard/types.ts b/src/api/project/reissueCard/types.ts new file mode 100644 index 0000000..3937951 --- /dev/null +++ b/src/api/project/reissueCard/types.ts @@ -0,0 +1,173 @@ +export interface ReissueCardVO { + /** + * 申请人名字 + */ + userName: string; + id?: string | number; + status?: string; + managerName?: string; + /** + * 申请补卡说明 + */ + userExplain: string; + + /** + * 补卡申请时间 + */ + userTime: string; + + /** + * 班组长名字 + */ + gangerName: string; + + /** + * 班组长意见(1未读 2同意 3拒绝) + */ + gangerOpinion: string; + + /** + * 班组长说明 + */ + gangerExplain: string; + + /** + * 班组长操作时间 + */ + gangerTime: string; + + /** + * 管理员意见(1未读 2同意 3拒绝) + */ + managerOpinion: string; + + /** + * 管理员说明 + */ + managerExplain: string; + + /** + * 管理员操作时间 + */ + managerTime: string; + + /** + * 备注 + */ + remark: string; +} +export interface AuditReissueCardForm { + /** + * 主键id + */ + id?: string | number; + + /** + * 管理员意见 + */ + managerOpinion?: string; + + /** + * 管理员说明 + */ + managerExplain?: string; + + /** + * 备注 + */ + remark?: string; +} + +export interface ReissueCardForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 申请人id + */ + userId?: string | number; + + /** + * 申请补卡说明 + */ + userExplain?: string; + + /** + * 班组长 + */ + gangerId?: string | number; + + /** + * 班组长意见(1未读 2同意 3拒绝) + */ + gangerOpinion?: string; + + /** + * 班组长说明 + */ + gangerExplain?: string; + + /** + * 管理员意见(1未读 2同意 3拒绝) + */ + managerOpinion?: string; + + /** + * 管理员说明 + */ + managerExplain?: string; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 考勤表主键id + */ + attendanceId?: string | number; + + /** + * 备注 + */ + remark?: string; +} + +export interface ReissueCardQuery extends PageQuery { + /** + * 申请人名字 + */ + userName?: string; + + /** + * 班组长意见(1未读 2同意 3拒绝) + */ + gangerOpinion?: string; + + /** + * 管理员意见(1未读 2同意 3拒绝) + */ + managerOpinion?: string; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 班组id + */ + teamId?: string | number; + + /** + * 补卡类型(1上班 2下班) + */ + reissueCardType?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/views/project/attendance/index.vue b/src/views/project/attendance/index.vue index 953d48e..c412586 100644 --- a/src/views/project/attendance/index.vue +++ b/src/views/project/attendance/index.vue @@ -90,7 +90,7 @@ - + @@ -293,7 +293,7 @@ const workTime = computed(() => (date) => { //下班时间 const workFromTime = computed(() => (date) => { - return calendarList.value[playCardIdx.value(date)].attendanceList[1].clockTime?.slice(10); + return calendarList.value[playCardIdx.value(date)].attendanceList[1]?.clockTime?.slice(10); }); //考勤状态 @@ -403,7 +403,7 @@ const incrementMonth = (dateStr: string, monthsToAdd: number) => { /** 详情按钮操作 */ const handleDetails = async (row?: AttendanceVO) => { - const res = await listAttendanceMonth({ id: row?.id }); + const res = await listAttendanceMonth({ userId: row?.id }); calendarList.value = res.data; dialog.details = true; dialog.id = row?.id; diff --git a/src/views/project/attendanceRecords/index.vue b/src/views/project/attendanceRecords/index.vue new file mode 100644 index 0000000..647e0b8 --- /dev/null +++ b/src/views/project/attendanceRecords/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/views/project/leave/index.vue b/src/views/project/leave/index.vue new file mode 100644 index 0000000..8d0c213 --- /dev/null +++ b/src/views/project/leave/index.vue @@ -0,0 +1,394 @@ + + + diff --git a/src/views/project/reissueCard/index.vue b/src/views/project/reissueCard/index.vue new file mode 100644 index 0000000..0eec5d5 --- /dev/null +++ b/src/views/project/reissueCard/index.vue @@ -0,0 +1,350 @@ + + +