提交代码
This commit is contained in:
1 parent
e450a8ffe7
commit
2e51d1154d
37 files changed
+7428
-137
No files matched your search
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StudentLeaveVO, StudentLeaveForm, StudentLeaveQuery } from '@/api/workflow/studentLeave/studentLeave/types';
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listStudentLeave = (query?: StudentLeaveQuery): AxiosPromise<StudentLeaveVO[]> => {
|
||||
return request({
|
||||
url: '/studentLeave/studentLeave/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getStudentLeave = (id: string | number): AxiosPromise<StudentLeaveVO> => {
|
||||
return request({
|
||||
url: '/studentLeave/studentLeave/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @param data
|
||||
*/
|
||||
export const addStudentLeave = (data: StudentLeaveForm) => {
|
||||
return request({
|
||||
url: '/studentLeave/studentLeave',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateStudentLeave = (data: StudentLeaveForm) => {
|
||||
return request({
|
||||
url: '/studentLeave/studentLeave',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @param id
|
||||
*/
|
||||
export const delStudentLeave = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/studentLeave/studentLeave/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,511 @@
|
||||
export interface StudentLeaveVO {
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName: string;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
leaveTypeCode: string;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
leaveTypeName: string;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
leaveDuration: number;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
isLeaveSchool: string;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
needCancel: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
emergencyContact: string;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
emergencyPhone: string;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
leaveReason: string;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
leaveLocation: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
attachmentOssIds: string | number;
|
||||
|
||||
/**
|
||||
* 审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消
|
||||
*/
|
||||
approvalStatus: string;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
approvalOpinion: string;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
approvalTime: string;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
approvalBy: number;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
approvalByName: string;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假
|
||||
*/
|
||||
cancelStatus: string;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
cancelTime: string;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
cancelLocation: string;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
cancelPhotoOssIds: string | number;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
cancelRemark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentLeaveForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
leaveTypeCode?: string;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
leaveTypeName?: string;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
leaveDuration?: number;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
isLeaveSchool?: string;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
needCancel?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
emergencyContact?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
emergencyPhone?: string;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
leaveReason?: string;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
leaveLocation?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消
|
||||
*/
|
||||
approvalStatus?: string;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
approvalOpinion?: string;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
approvalTime?: string;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
approvalBy?: number;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
approvalByName?: string;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假
|
||||
*/
|
||||
cancelStatus?: string;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
cancelTime?: string;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
cancelLocation?: string;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
cancelPhotoOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
cancelRemark?: string;
|
||||
|
||||
/**
|
||||
* 操作类型:add-新增,update-修改,view-查看
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentLeaveQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
leaveTypeCode?: string;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
leaveTypeName?: string;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
leaveDuration?: number;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
isLeaveSchool?: string;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
needCancel?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
emergencyContact?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
emergencyPhone?: string;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
leaveReason?: string;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
leaveLocation?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消
|
||||
*/
|
||||
approvalStatus?: string;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
approvalOpinion?: string;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
approvalTime?: string;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
approvalBy?: number;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
approvalByName?: string;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假
|
||||
*/
|
||||
cancelStatus?: string;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
cancelTime?: string;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
cancelLocation?: string;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
cancelPhotoOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
cancelRemark?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { XgLeaveTypeConfigVO, XgLeaveTypeConfigForm, XgLeaveTypeConfigQuery } from '@/api/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig/types';
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listXgLeaveTypeConfig = (query?: XgLeaveTypeConfigQuery): AxiosPromise<XgLeaveTypeConfigVO[]> => {
|
||||
return request({
|
||||
url: '/xgLeaveTypeConfig/xgLeaveTypeConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置详细
|
||||
* @param id
|
||||
*/
|
||||
export const getXgLeaveTypeConfig = (id: string | number): AxiosPromise<XgLeaveTypeConfigVO> => {
|
||||
return request({
|
||||
url: '/xgLeaveTypeConfig/xgLeaveTypeConfig/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
* @param data
|
||||
*/
|
||||
export const addXgLeaveTypeConfig = (data: XgLeaveTypeConfigForm) => {
|
||||
return request({
|
||||
url: '/xgLeaveTypeConfig/xgLeaveTypeConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
* @param data
|
||||
*/
|
||||
export const updateXgLeaveTypeConfig = (data: XgLeaveTypeConfigForm) => {
|
||||
return request({
|
||||
url: '/xgLeaveTypeConfig/xgLeaveTypeConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除学生请假类型配置
|
||||
* @param id
|
||||
*/
|
||||
export const delXgLeaveTypeConfig = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/xgLeaveTypeConfig/xgLeaveTypeConfig/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,166 @@
|
||||
export interface XgLeaveTypeConfigVO {
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
leaveTypeName: string;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
leaveTypeCode: string;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
leaveTypeDesc: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder: number;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
needLocationOnApply: string;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
needPhotoOnCancel: string;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
needLocationOnCancel: string;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
needCancelForNonLeave: string;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
canApplyInAdvance: string;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
isEnabled: string;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
maxApplyDuration: number;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
cancelOverdueReminder: number;
|
||||
|
||||
}
|
||||
|
||||
export interface XgLeaveTypeConfigForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
leaveTypeName?: string;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
leaveTypeCode?: string;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
leaveTypeDesc?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
needLocationOnApply?: string;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
needPhotoOnCancel?: string;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
needLocationOnCancel?: string;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
needCancelForNonLeave?: string;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
canApplyInAdvance?: string;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
isEnabled?: string;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
maxApplyDuration?: number;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
cancelOverdueReminder?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface XgLeaveTypeConfigQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
leaveTypeName?: string;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
leaveTypeCode?: string;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
isEnabled?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<el-button v-if="props.id && props.status !== 'draft'" type="primary" @click="handleApprovalRecord">流程进度</el-button>
|
||||
<slot />
|
||||
</div>
|
||||
<div>
|
||||
<!-- <div>
|
||||
<el-button style="float: right" @click="goBack()">返回</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="紧急程度" align="center" prop="priorityLevel" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getPriorityTagType(scope.row.priorityLevel) as any" size="small">
|
||||
<el-tag :type="getPriorityTagType(scope.row.priorityLevel)" size="small">
|
||||
{{ getPriorityText(scope.row.priorityLevel) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
@@ -252,7 +252,7 @@
|
||||
<el-table-column label="报修人电话" align="center" prop="reporterPhone" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="工单状态" align="center" prop="orderStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusTagType(scope.row.orderStatus) as any" size="small">
|
||||
<el-tag :type="getStatusTagType(scope.row.orderStatus)" size="small">
|
||||
{{ getStatusText(scope.row.orderStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
@@ -584,7 +584,7 @@
|
||||
|
||||
<!-- 文件名称 -->
|
||||
<div class="upload-file-name" :title="file.name">
|
||||
{{ file.name }}
|
||||
{{ formatFileName(file.name) }}
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 (与预览界面样式一致) -->
|
||||
@@ -632,13 +632,13 @@
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<label>工单状态:</label>
|
||||
<el-tag :type="getStatusTagType(orderDetail.orderStatus) as 'success' | 'warning' | 'info' | 'primary' | 'danger'" size="small">
|
||||
<el-tag :type="getStatusTagType(orderDetail.orderStatus)" size="small">
|
||||
{{ getStatusText(orderDetail.orderStatus) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<label>紧急程度:</label>
|
||||
<el-tag :type="getPriorityTagType(orderDetail.priorityLevel) as 'success' | 'warning' | 'info' | 'primary' | 'danger'" size="small">
|
||||
<el-tag :type="getPriorityTagType(orderDetail.priorityLevel)" size="small">
|
||||
{{ getPriorityText(orderDetail.priorityLevel) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
@@ -846,7 +846,7 @@
|
||||
<!-- 附件信息 -->
|
||||
<div class="attachment-card-body">
|
||||
<div class="attachment-title" :title="attachment.fileName">
|
||||
{{ attachment.fileName }}
|
||||
{{ formatFileName(attachment.fileName) }}
|
||||
</div>
|
||||
<div class="attachment-meta">
|
||||
<span class="file-size">{{ formatFileSize(attachment.fileSize) }}</span>
|
||||
@@ -1160,7 +1160,7 @@
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="attachment-details">
|
||||
<div class="file-name">{{ attachment.fileName }}</div>
|
||||
<div class="file-name">{{ formatFileName(attachment.fileName) }}</div>
|
||||
<div class="file-meta">
|
||||
<span>{{ formatFileSize(attachment.fileSize) }}</span>
|
||||
<span>{{ attachment.uploaderName }}</span>
|
||||
@@ -1833,7 +1833,7 @@ const submitForm = () => {
|
||||
// todo form.attachementCount的数量等于附件栏中附件的数量
|
||||
console.log('form.value', form.value);
|
||||
console.log('attachmentList 长度:', attachmentList.value.length);
|
||||
form.value.attachmentCount=attachmentList.value.length
|
||||
form.value.attachmentCount = attachmentList.value.length;
|
||||
if (form.value.id) {
|
||||
await updateRepairOrder(form.value);
|
||||
orderId = form.value.id;
|
||||
@@ -2979,6 +2979,30 @@ const getFileExt = (fileName: string): string => {
|
||||
const idx = fileName.lastIndexOf('.');
|
||||
return idx !== -1 ? fileName.substring(idx + 1).toLowerCase() : '';
|
||||
};
|
||||
|
||||
/** 格式化文件名显示 - 长文件名用省略号缩写,保留后缀名 */
|
||||
const formatFileName = (fileName: string): string => {
|
||||
if (!fileName) return '';
|
||||
|
||||
const maxLength = 15; // 最大显示长度(包含后缀名)
|
||||
const idx = fileName.lastIndexOf('.');
|
||||
|
||||
if (idx === -1) {
|
||||
// 没有后缀名的情况
|
||||
return fileName.length > maxLength ? fileName.substring(0, maxLength - 3) + '...' : fileName;
|
||||
}
|
||||
|
||||
const name = fileName.substring(0, idx);
|
||||
const ext = fileName.substring(idx); // 包含点号的后缀名
|
||||
|
||||
// 如果文件名(不含后缀)长度超过限制
|
||||
if (name.length > maxLength - ext.length - 3) {
|
||||
const truncatedName = name.substring(0, maxLength - ext.length - 3);
|
||||
return truncatedName + '...' + ext;
|
||||
}
|
||||
|
||||
return fileName;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -0,0 +1,375 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px" :inline="true">
|
||||
<!-- <el-form-item label="删除标志" prop="deleted">
|
||||
<el-input v-model="queryParams.deleted" placeholder="请输入删除标志" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="请假类型名称" prop="leaveTypeName">
|
||||
<el-input v-model="queryParams.leaveTypeName" placeholder="请输入请假类型名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假类型编码" prop="leaveTypeCode">
|
||||
<el-input v-model="queryParams.leaveTypeCode" placeholder="请输入请假类型编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['xgLeaveTypeConfig:xgLeaveTypeConfig:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['xgLeaveTypeConfig:xgLeaveTypeConfig:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['xgLeaveTypeConfig:xgLeaveTypeConfig:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['xgLeaveTypeConfig:xgLeaveTypeConfig:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="xgLeaveTypeConfigList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="请假类型名称" align="center" prop="leaveTypeName" />
|
||||
<el-table-column label="请假类型编码" align="center" prop="leaveTypeCode" />
|
||||
<el-table-column label="请假类型描述" align="center" prop="leaveTypeDesc" />
|
||||
<el-table-column label="排序号" align="center" prop="sortOrder" />
|
||||
<el-table-column label="请假是否需要上传地理位置" align="center" prop="needLocationOnApply">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.needLocationOnApply" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销假是否必须上传照片" align="center" prop="needPhotoOnCancel">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.needPhotoOnCancel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销假是否需要上传地理位置" align="center" prop="needLocationOnCancel">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.needLocationOnCancel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="非离校请假是否需要销假" align="center" prop="needCancelForNonLeave">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.needCancelForNonLeave" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可以提前请假" align="center" prop="canApplyInAdvance">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.canApplyInAdvance" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否开启" align="center" prop="isEnabled">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.isEnabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请假最大申请时长(天)" align="center" prop="maxApplyDuration" />
|
||||
<el-table-column label="销假逾期多少时长给予提醒(天)" align="center" prop="cancelOverdueReminder" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['xgLeaveTypeConfig:xgLeaveTypeConfig:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['xgLeaveTypeConfig:xgLeaveTypeConfig:remove']"
|
||||
></el-button>
|
||||
</el-tooltip> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改学生请假类型配置对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body>
|
||||
<el-form ref="xgLeaveTypeConfigFormRef" :model="form" :rules="rules" label-position="top">
|
||||
<el-form-item label="请假类型名称" prop="leaveTypeName">
|
||||
<el-input v-model="form.leaveTypeName" placeholder="请输入请假类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假类型编码" prop="leaveTypeCode">
|
||||
<el-input v-model="form.leaveTypeCode" placeholder="请输入请假类型编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假类型描述" prop="leaveTypeDesc">
|
||||
<el-input v-model="form.leaveTypeDesc" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="sortOrder">
|
||||
<el-input v-model="form.sortOrder" placeholder="请输入排序号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假是否需要上传地理位置" prop="needLocationOnApply">
|
||||
<el-select v-model="form.needLocationOnApply" placeholder="请选择请假是否需要上传地理位置">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="销假是否必须上传照片" prop="needPhotoOnCancel">
|
||||
<el-select v-model="form.needPhotoOnCancel" placeholder="请选择销假是否必须上传照片">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="销假是否需要上传地理位置" prop="needLocationOnCancel">
|
||||
<el-select v-model="form.needLocationOnCancel" placeholder="请选择销假是否需要上传地理位置">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="非离校请假是否需要销假" prop="needCancelForNonLeave">
|
||||
<el-select v-model="form.needCancelForNonLeave" placeholder="请选择非离校请假是否需要销假">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可以提前请假" prop="canApplyInAdvance">
|
||||
<el-select v-model="form.canApplyInAdvance" placeholder="请选择是否可以提前请假">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启" prop="isEnabled">
|
||||
<el-select v-model="form.isEnabled" placeholder="请选择是否开启">
|
||||
<el-option v-for="dict in sys_yesno" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="请假最大申请时长(天)" prop="maxApplyDuration">
|
||||
<el-input v-model="form.maxApplyDuration" placeholder="请输入请假最大申请时长" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销假逾期多少时长给予提醒(天)" prop="cancelOverdueReminder">
|
||||
<el-input v-model="form.cancelOverdueReminder" placeholder="请输入销假逾期多少时长给予提醒" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="XgLeaveTypeConfig" lang="ts">
|
||||
import {
|
||||
listXgLeaveTypeConfig,
|
||||
getXgLeaveTypeConfig,
|
||||
delXgLeaveTypeConfig,
|
||||
addXgLeaveTypeConfig,
|
||||
updateXgLeaveTypeConfig
|
||||
} from '@/api/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig';
|
||||
import { XgLeaveTypeConfigVO, XgLeaveTypeConfigQuery, XgLeaveTypeConfigForm } from '@/api/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig/types';
|
||||
import { getCurrentInstance, ref, reactive, toRefs, onMounted } from 'vue';
|
||||
import type { FormInstance as ElFormInstance } from 'element-plus';
|
||||
|
||||
interface ComponentInternalInstance {
|
||||
proxy?: any;
|
||||
}
|
||||
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface PageData<T, Q> {
|
||||
form: T;
|
||||
queryParams: Q;
|
||||
rules: Record<string, any[]>;
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
// 加载字典数据
|
||||
const { sys_yesno } = toRefs<any>(proxy?.useDict('sys_yesno'));
|
||||
|
||||
const xgLeaveTypeConfigList = ref<XgLeaveTypeConfigVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const xgLeaveTypeConfigFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: XgLeaveTypeConfigForm = {
|
||||
id: undefined,
|
||||
leaveTypeName: undefined,
|
||||
leaveTypeCode: undefined,
|
||||
leaveTypeDesc: undefined,
|
||||
sortOrder: undefined,
|
||||
needLocationOnApply: '1',
|
||||
needPhotoOnCancel: '1',
|
||||
needLocationOnCancel: '1',
|
||||
needCancelForNonLeave: '1',
|
||||
canApplyInAdvance: '1',
|
||||
isEnabled: '1',
|
||||
maxApplyDuration: undefined,
|
||||
cancelOverdueReminder: undefined
|
||||
};
|
||||
const data = reactive<PageData<XgLeaveTypeConfigForm, XgLeaveTypeConfigQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deleted: undefined,
|
||||
leaveTypeName: undefined,
|
||||
leaveTypeCode: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
leaveTypeName: [{ required: true, message: '请假类型名称不能为空', trigger: 'blur' }],
|
||||
leaveTypeCode: [{ required: true, message: '请假类型编码不能为空', trigger: 'blur' }],
|
||||
needLocationOnApply: [{ required: true, message: '请假是否需要上传地理位置不能为空', trigger: 'blur' }],
|
||||
needPhotoOnCancel: [{ required: true, message: '销假是否必须上传照片不能为空', trigger: 'blur' }],
|
||||
needLocationOnCancel: [{ required: true, message: '销假是否需要上传地理位置不能为空', trigger: 'blur' }],
|
||||
needCancelForNonLeave: [{ required: true, message: '非离校请假是否需要销假不能为空', trigger: 'blur' }],
|
||||
canApplyInAdvance: [{ required: true, message: '是否可以提前请假不能为空', trigger: 'blur' }],
|
||||
isEnabled: [{ required: true, message: '是否开启不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询学生请假类型配置列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listXgLeaveTypeConfig(queryParams.value);
|
||||
xgLeaveTypeConfigList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
xgLeaveTypeConfigFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: XgLeaveTypeConfigVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加学生请假类型配置';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: XgLeaveTypeConfigVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getXgLeaveTypeConfig(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改学生请假类型配置';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
xgLeaveTypeConfigFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateXgLeaveTypeConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addXgLeaveTypeConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: XgLeaveTypeConfigVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除学生请假类型配置编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delXgLeaveTypeConfig(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'xgLeaveTypeConfig/xgLeaveTypeConfig/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`xgLeaveTypeConfig_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="search">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="请假天数" prop="startLeaveDays">
|
||||
<el-input v-model="queryParams.startLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="endLeaveDays"> 至 </el-form-item>
|
||||
<el-form-item prop="endLeaveDays">
|
||||
<el-input v-model="queryParams.endLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:leave:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:leave:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="leaveList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column v-if="false" label="主键" align="center" prop="id" />
|
||||
<el-table-column label="请假类型" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag>{{ options.find((e) => e.value === scope.row.leaveType)?.label }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startDate">
|
||||
<template #default="scope">
|
||||
<span>{{ proxy.parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endDate">
|
||||
<template #default="scope">
|
||||
<span>{{ proxy.parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请假天数" align="center" prop="leaveDays" />
|
||||
<el-table-column label="请假原因" align="center" prop="remark" />
|
||||
<el-table-column align="center" label="流程状态" min-width="70">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="162">
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['workflow:leave:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['workflow:leave:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
||||
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { delLeave, listLeave } from '@/api/workflow/leave';
|
||||
import { cancelProcessApply } from '@/api/workflow/instance';
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
const leaveList = ref<LeaveVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '事假'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '调休'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '病假'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '婚假'
|
||||
}
|
||||
];
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
startLeaveDays: undefined,
|
||||
endLeaveDays: undefined
|
||||
},
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
/** 查询请假列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listLeave(queryParams.value);
|
||||
leaveList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: LeaveVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/xg/xsjcxx/xsqj/leaveEdit/index`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/xg/xsjcxx/xsqj/leaveEdit/index`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/xg/xsjcxx/xsqj/leaveEdit/index`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: LeaveVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除请假编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delLeave(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'workflow/leave/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`leave_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
/** 撤销按钮操作 */
|
||||
const handleCancelProcessApply = async (id: string) => {
|
||||
await proxy?.$modal.confirm('是否确认撤销当前单据?');
|
||||
loading.value = true;
|
||||
const data = {
|
||||
businessId: id,
|
||||
message: '申请人撤销流程!'
|
||||
};
|
||||
await cancelProcessApply(data).finally(() => (loading.value = false));
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('撤销成功');
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
@@ -1,20 +1,143 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="search">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="请假天数" prop="startLeaveDays">
|
||||
<el-input v-model="queryParams.startLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="endLeaveDays"> 至 </el-form-item>
|
||||
<el-form-item prop="endLeaveDays">
|
||||
<el-input v-model="queryParams.endLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<!-- <el-form-item label="删除标志" prop="deleted">
|
||||
<el-input v-model="queryParams.deleted" placeholder="请输入删除标志" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生ID" prop="studentId">
|
||||
<el-input v-model="queryParams.studentId" placeholder="请输入学生ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<!-- <el-form-item label="学院ID" prop="collegeId">
|
||||
<el-input v-model="queryParams.collegeId" placeholder="请输入学院ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="学院名称" prop="collegeName">
|
||||
<el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<!-- <el-form-item label="专业ID" prop="majorId">
|
||||
<el-input v-model="queryParams.majorId" placeholder="请输入专业ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="专业名称" prop="majorName">
|
||||
<el-input v-model="queryParams.majorName" placeholder="请输入专业名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<!-- <el-form-item label="班级ID" prop="classId">
|
||||
<el-input v-model="queryParams.classId" placeholder="请输入班级ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="班级名称" prop="className">
|
||||
<el-input v-model="queryParams.className" placeholder="请输入班级名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<!-- <el-form-item label="请假类型编码" prop="leaveTypeCode">
|
||||
<el-input v-model="queryParams.leaveTypeCode" placeholder="请输入请假类型编码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="请假类型名称" prop="leaveTypeName">
|
||||
<el-input v-model="queryParams.leaveTypeName" placeholder="请输入请假类型名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="queryParams.startTime"
|
||||
type="date"
|
||||
style="width: 100%"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="queryParams.endTime"
|
||||
type="date"
|
||||
style="width: 100%"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="请假时长" prop="leaveDuration">
|
||||
<el-input v-model="queryParams.leaveDuration" placeholder="请输入请假时长" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否离校:0-否,1-是" prop="isLeaveSchool">
|
||||
<el-input v-model="queryParams.isLeaveSchool" placeholder="请输入是否离校:0-否,1-是" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否需要销假:0-否,1-是" prop="needCancel">
|
||||
<el-input v-model="queryParams.needCancel" placeholder="请输入是否需要销假:0-否,1-是" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="紧急联系人" prop="emergencyContact">
|
||||
<el-input v-model="queryParams.emergencyContact" placeholder="请输入紧急联系人" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="紧急联系电话" prop="emergencyPhone">
|
||||
<el-input v-model="queryParams.emergencyPhone" placeholder="请输入紧急联系电话" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假原因" prop="leaveReason">
|
||||
<el-input v-model="queryParams.leaveReason" placeholder="请输入请假原因" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假时地理位置" prop="leaveLocation">
|
||||
<el-input v-model="queryParams.leaveLocation" placeholder="请输入请假时地理位置" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件OSS文件ID" prop="attachmentOssIds">
|
||||
<el-input v-model="queryParams.attachmentOssIds" placeholder="请输入附件OSS文件ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见" prop="approvalOpinion">
|
||||
<el-input v-model="queryParams.approvalOpinion" placeholder="请输入审批意见" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批时间" prop="approvalTime">
|
||||
<el-date-picker clearable v-model="queryParams.approvalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择审批时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批人ID" prop="approvalBy">
|
||||
<el-input v-model="queryParams.approvalBy" placeholder="请输入审批人ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批人姓名" prop="approvalByName">
|
||||
<el-input v-model="queryParams.approvalByName" placeholder="请输入审批人姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销假时间" prop="cancelTime">
|
||||
<el-date-picker clearable v-model="queryParams.cancelTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择销假时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销假地理位置" prop="cancelLocation">
|
||||
<el-input v-model="queryParams.cancelLocation" placeholder="请输入销假地理位置" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销假照片OSS文件ID" prop="cancelPhotoOssIds">
|
||||
<el-input v-model="queryParams.cancelPhotoOssIds" placeholder="请输入销假照片OSS文件ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销假备注" prop="cancelRemark">
|
||||
<el-input v-model="queryParams.cancelRemark" placeholder="请输入销假备注" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
@@ -22,128 +145,283 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:leave:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['studentLeave:studentLeave:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:leave:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['studentLeave:studentLeave:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['studentLeave:studentLeave:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['studentLeave:studentLeave:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="leaveList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" border :data="studentLeaveList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column v-if="false" label="主键" align="center" prop="id" />
|
||||
<el-table-column label="请假类型" align="center">
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true" />
|
||||
<!-- <el-table-column label="删除标志" align="center" prop="deleted" /> -->
|
||||
<!-- <el-table-column label="学生ID" align="center" prop="studentId" /> -->
|
||||
<el-table-column label="学生姓名" align="center" prop="studentName" />
|
||||
<el-table-column label="学号" align="center" prop="studentNo" />
|
||||
<!-- <el-table-column label="班级ID" align="center" prop="classId" /> -->
|
||||
<el-table-column label="班级名称" align="center" prop="className" />
|
||||
<!-- <el-table-column label="专业ID" align="center" prop="majorId" /> -->
|
||||
<el-table-column label="专业名称" align="center" prop="majorName" />
|
||||
<!-- <el-table-column label="学院ID" align="center" prop="collegeId" /> -->
|
||||
<el-table-column label="学院名称" align="center" prop="collegeName" />
|
||||
<!-- <el-table-column label="请假类型编码" align="center" prop="leaveTypeCode" /> -->
|
||||
<el-table-column label="请假类型名称" align="center" prop="leaveTypeName" />
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||
<template #default="scope">
|
||||
<el-tag>{{ options.find((e) => e.value === scope.row.leaveType)?.label }}</el-tag>
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startDate">
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ proxy.parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endDate">
|
||||
<el-table-column label="请假时长(天)" align="center" prop="leaveDuration" />
|
||||
<el-table-column label="是否离校" align="center" prop="isLeaveSchool">
|
||||
<template #default="scope">
|
||||
<span>{{ proxy.parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.isLeaveSchool" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请假天数" align="center" prop="leaveDays" />
|
||||
<el-table-column label="请假原因" align="center" prop="remark" />
|
||||
<el-table-column align="center" label="流程状态" min-width="70">
|
||||
<el-table-column label="是否需要销假" align="center" prop="needCancel">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
|
||||
<dict-tag :options="sys_yesno" :value="scope.row.needCancel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="162">
|
||||
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
|
||||
<el-table-column label="紧急联系电话" align="center" prop="emergencyPhone" />
|
||||
<el-table-column label="请假原因" align="center" prop="leaveReason" />
|
||||
<!-- <el-table-column label="请假时地理位置" align="center" prop="leaveLocation" /> -->
|
||||
<el-table-column label="附件OSS文件ID" align="center" prop="attachmentOssIds" />
|
||||
<!-- <el-table-column label="审批状态" align="center" prop="approvalStatus" />
|
||||
<el-table-column label="审批意见" align="center" prop="approvalOpinion" />
|
||||
<el-table-column label="审批时间" align="center" prop="approvalTime" width="180">
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['workflow:leave:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button v-hasPermi="['workflow:leave:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
||||
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<span>{{ parseTime(scope.row.approvalTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="审批人ID" align="center" prop="approvalBy" />
|
||||
<el-table-column label="审批人姓名" align="center" prop="approvalByName" />
|
||||
<el-table-column label="销假状态:0-未销假,1-已销假,2-逾期未销假" align="center" prop="cancelStatus" />
|
||||
<el-table-column label="销假时间" align="center" prop="cancelTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.cancelTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销假地理位置" align="center" prop="cancelLocation" />
|
||||
<el-table-column label="销假照片OSS文件ID" align="center" prop="cancelPhotoOssIds" />
|
||||
<el-table-column label="销假备注" align="center" prop="cancelRemark" /> -->
|
||||
<el-table-column label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['studentLeave:studentLeave:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['studentLeave:studentLeave:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 学生请假对话框组件 -->
|
||||
<StudentLeaveDialog
|
||||
v-model:dialog="dialog"
|
||||
:form="form"
|
||||
:rules="rules"
|
||||
:button-loading="buttonLoading"
|
||||
:type="form.type"
|
||||
@submit="submitForm"
|
||||
@cancel="cancel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { delLeave, listLeave } from '@/api/workflow/leave';
|
||||
import { cancelProcessApply } from '@/api/workflow/instance';
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
<script setup name="StudentLeave" lang="ts">
|
||||
import { ref, reactive, toRefs, onMounted, getCurrentInstance, type ComponentInternalInstance } from 'vue';
|
||||
import { listStudentLeave, getStudentLeave, delStudentLeave, addStudentLeave, updateStudentLeave } from '@/api/workflow/studentLeave/studentLeave';
|
||||
import { StudentLeaveVO, StudentLeaveQuery, StudentLeaveForm } from '@/api/workflow/studentLeave/studentLeave/types';
|
||||
import StudentLeaveDialog from './dialog.vue';
|
||||
|
||||
// 类型定义
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface ElFormInstance {
|
||||
validate: (callback?: (valid: boolean) => void) => Promise<boolean>;
|
||||
resetFields: () => void;
|
||||
}
|
||||
|
||||
interface PageData<T, Q> {
|
||||
form: T;
|
||||
queryParams: Q;
|
||||
rules: Record<string, any>;
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
const leaveList = ref<LeaveVO[]>([]);
|
||||
|
||||
// 加载字典数据
|
||||
const { sys_yesno } = toRefs<any>(proxy?.useDict('sys_yesno'));
|
||||
|
||||
const studentLeaveList = ref<StudentLeaveVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '事假'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '调休'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '病假'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '婚假'
|
||||
}
|
||||
];
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const studentLeaveFormRef = ref<ElFormInstance>();
|
||||
|
||||
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
||||
form: {},
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: StudentLeaveForm = {
|
||||
id: undefined,
|
||||
deleted: undefined,
|
||||
studentId: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
classId: undefined,
|
||||
className: undefined,
|
||||
majorId: undefined,
|
||||
majorName: undefined,
|
||||
collegeId: undefined,
|
||||
collegeName: undefined,
|
||||
leaveTypeCode: undefined,
|
||||
leaveTypeName: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
leaveDuration: undefined,
|
||||
isLeaveSchool: undefined,
|
||||
needCancel: undefined,
|
||||
emergencyContact: undefined,
|
||||
emergencyPhone: undefined,
|
||||
leaveReason: undefined,
|
||||
leaveLocation: undefined,
|
||||
attachmentOssIds: undefined,
|
||||
approvalStatus: undefined,
|
||||
approvalOpinion: undefined,
|
||||
approvalTime: undefined,
|
||||
approvalBy: undefined,
|
||||
approvalByName: undefined,
|
||||
cancelStatus: undefined,
|
||||
cancelTime: undefined,
|
||||
cancelLocation: undefined,
|
||||
cancelPhotoOssIds: undefined,
|
||||
cancelRemark: undefined
|
||||
};
|
||||
const data = reactive<PageData<StudentLeaveForm, StudentLeaveQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
startLeaveDays: undefined,
|
||||
endLeaveDays: undefined
|
||||
deleted: undefined,
|
||||
studentId: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
classId: undefined,
|
||||
className: undefined,
|
||||
majorId: undefined,
|
||||
majorName: undefined,
|
||||
collegeId: undefined,
|
||||
collegeName: undefined,
|
||||
leaveTypeCode: undefined,
|
||||
leaveTypeName: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
leaveDuration: undefined,
|
||||
isLeaveSchool: undefined,
|
||||
needCancel: undefined,
|
||||
emergencyContact: undefined,
|
||||
emergencyPhone: undefined,
|
||||
leaveReason: undefined,
|
||||
leaveLocation: undefined,
|
||||
attachmentOssIds: undefined,
|
||||
approvalStatus: undefined,
|
||||
approvalOpinion: undefined,
|
||||
approvalTime: undefined,
|
||||
approvalBy: undefined,
|
||||
approvalByName: undefined,
|
||||
cancelStatus: undefined,
|
||||
cancelTime: undefined,
|
||||
cancelLocation: undefined,
|
||||
cancelPhotoOssIds: undefined,
|
||||
cancelRemark: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {}
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
studentId: [{ required: true, message: '学生ID不能为空', trigger: 'blur' }],
|
||||
studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }],
|
||||
studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
||||
leaveTypeCode: [{ required: true, message: '请假类型编码不能为空', trigger: 'blur' }],
|
||||
leaveTypeName: [{ required: true, message: '请假类型名称不能为空', trigger: 'blur' }],
|
||||
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
|
||||
leaveDuration: [{ required: true, message: '请假时长不能为空', trigger: 'blur' }],
|
||||
isLeaveSchool: [{ required: true, message: '是否离校:0-否,1-是不能为空', trigger: 'blur' }],
|
||||
needCancel: [{ required: true, message: '是否需要销假:0-否,1-是不能为空', trigger: 'blur' }],
|
||||
leaveReason: [{ required: true, message: '请假原因不能为空', trigger: 'blur' }],
|
||||
approvalStatus: [{ required: true, message: '审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消不能为空', trigger: 'change' }],
|
||||
cancelStatus: [{ required: true, message: '销假状态:0-未销假,1-已销假,2-逾期未销假不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询请假列表 */
|
||||
/** 查询学生请假 - 记录学生的请假申请、审批和销假信息列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listLeave(queryParams.value);
|
||||
leaveList.value = res.rows;
|
||||
const res = await listStudentLeave(queryParams.value);
|
||||
studentLeaveList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
studentLeaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@@ -157,7 +435,7 @@ const resetQuery = () => {
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: LeaveVO[]) => {
|
||||
const handleSelectionChange = (selection: StudentLeaveVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
@@ -165,44 +443,49 @@ const handleSelectionChange = (selection: LeaveVO[]) => {
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/xg/xsjcxx/xsqj/leaveEdit/index`,
|
||||
query: {
|
||||
type: 'add'
|
||||
}
|
||||
});
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加学生请假';
|
||||
// 传递type参数,标识为新增操作
|
||||
form.value.type = 'add';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/xg/xsjcxx/xsqj/leaveEdit/index`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'update'
|
||||
}
|
||||
});
|
||||
const handleUpdate = async (row?: StudentLeaveVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getStudentLeave(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
// 传递type参数,标识为修改操作
|
||||
form.value.type = 'update';
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改学生请假';
|
||||
};
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = (row?: LeaveVO) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `/xg/xsjcxx/xsqj/leaveEdit/index`,
|
||||
query: {
|
||||
id: row.id,
|
||||
type: 'view'
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
studentLeaveFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateStudentLeave(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addStudentLeave(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: LeaveVO) => {
|
||||
const handleDelete = async (row?: StudentLeaveVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除请假编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delLeave(_ids);
|
||||
await proxy?.$modal
|
||||
.confirm('是否确认删除学生请假 - 记录学生的请假申请、审批和销假信息编号为"' + _ids + '"的数据项?')
|
||||
.finally(() => (loading.value = false));
|
||||
await delStudentLeave(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
@@ -210,27 +493,33 @@ const handleDelete = async (row?: LeaveVO) => {
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'workflow/leave/export',
|
||||
'studentLeave/studentLeave/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`leave_${new Date().getTime()}.xlsx`
|
||||
`studentLeave_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
/** 撤销按钮操作 */
|
||||
const handleCancelProcessApply = async (id: string) => {
|
||||
await proxy?.$modal.confirm('是否确认撤销当前单据?');
|
||||
loading.value = true;
|
||||
const data = {
|
||||
businessId: id,
|
||||
message: '申请人撤销流程!'
|
||||
};
|
||||
await cancelProcessApply(data).finally(() => (loading.value = false));
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('撤销成功');
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-card shadow="never">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.id"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<el-card shadow="never" style="height: 78vh; overflow-y: auto">
|
||||
<el-form ref="leaveFormRef" v-loading="loading" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="请假类型" prop="leaveType">
|
||||
<el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="请假时间" required>
|
||||
<el-date-picker
|
||||
v-model="leaveTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="To"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
@change="changeLeaveTime()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请假天数" prop="leaveDays">
|
||||
<el-input v-model="form.leaveDays" disabled type="number" placeholder="请输入请假天数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假原因" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入请假原因" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<!-- 审批记录 -->
|
||||
<approvalRecord ref="approvalRecordRef" />
|
||||
<el-dialog v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose" width="500">
|
||||
<el-select v-model="flowCode" placeholder="Select" style="width: 240px">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submitFlow()"> 确认 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { addLeave, getLeave, updateLeave } from '@/api/workflow/leave';
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const leaveTime = ref<Array<string>>([]);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '事假'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '调休'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '病假'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '婚假'
|
||||
}
|
||||
];
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: 'hzdyjs-qj',
|
||||
label: '学生请假流程-杭州第一技师'
|
||||
},
|
||||
{
|
||||
value: 'leave1',
|
||||
label: '请假申请-普通'
|
||||
},
|
||||
{
|
||||
value: 'leave2',
|
||||
label: '请假申请-排他网关'
|
||||
},
|
||||
{
|
||||
value: 'leave3',
|
||||
label: '请假申请-并行网关'
|
||||
},
|
||||
{
|
||||
value: 'leave4',
|
||||
label: '请假申请-会签'
|
||||
},
|
||||
{
|
||||
value: 'leave5',
|
||||
label: '请假申请-并行会签网关'
|
||||
},
|
||||
{
|
||||
value: 'leave6',
|
||||
label: '请假申请-排他并行会签'
|
||||
}
|
||||
];
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData: LeaveForm = {
|
||||
id: undefined,
|
||||
leaveType: undefined,
|
||||
startDate: undefined,
|
||||
endDate: undefined,
|
||||
leaveDays: undefined,
|
||||
remark: undefined,
|
||||
status: undefined
|
||||
};
|
||||
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
startLeaveDays: undefined,
|
||||
endLeaveDays: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键不能为空', trigger: 'blur' }],
|
||||
leaveType: [{ required: true, message: '请假类型不能为空', trigger: 'blur' }],
|
||||
leaveTime: [{ required: true, message: '请假时间不能为空', trigger: 'blur' }],
|
||||
leaveDays: [{ required: true, message: '请假天数不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveTime.value = [];
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
const changeLeaveTime = () => {
|
||||
const startDate = new Date(leaveTime.value[0]).getTime();
|
||||
const endDate = new Date(leaveTime.value[1]).getTime();
|
||||
const diffInMilliseconds = endDate - startDate;
|
||||
form.value.leaveDays = Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24)) + 1;
|
||||
};
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await getLeave(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
console.log('res.data:', res.data);
|
||||
console.log('form.value:', form.value);
|
||||
// 为了确保 Element Plus 日期区间组件能够正确渲染,需要直接替换绑定数组引用
|
||||
// 同时将后端返回的日期统一格式化为组件要求的 "YYYY-MM-DD HH:mm:ss"
|
||||
// 后端仅返回 "YYYY-MM-DD",需要为日期补齐时间,符合 value-format="YYYY-MM-DD HH:mm:ss"
|
||||
const ensureDateTime = (dateStr: string | undefined, endFlag = false) => {
|
||||
if (!dateStr) return '';
|
||||
// 如果已包含时间段,直接返回
|
||||
if (/\d{2}:\d{2}:\d{2}$/.test(dateStr)) {
|
||||
return dateStr;
|
||||
}
|
||||
return endFlag ? `${dateStr} 23:59:59` : `${dateStr} 00:00:00`;
|
||||
};
|
||||
const start = ensureDateTime(form.value.startDate, false);
|
||||
const end = ensureDateTime(form.value.endDate, true);
|
||||
leaveTime.value = [start, end];
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status: string) => {
|
||||
if (leaveTime.value.length === 0) {
|
||||
proxy?.$modal.msgError('请假时间不能为空');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||
form.value.startDate = leaveTime.value[0];
|
||||
form.value.endDate = leaveTime.value[1];
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
let res: AxiosResponse<LeaveVO>;
|
||||
if (form.value.id) {
|
||||
res = await updateLeave(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
res = await addLeave(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
form.value = res.data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(res.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// hzdyjs-qj 使用的流程变量
|
||||
qjts: data.leaveDays,
|
||||
// leave2/6 使用的流程变量
|
||||
leaveDays: data.leaveDays,
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.id);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user