提交代码
This commit is contained in:
1 parent
e450a8ffe7
commit
2e51d1154d
37 files changed
+7428
-137
No files matched your search
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.workflow.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.workflow.domain.bo.XgStudentLeaveBo;
|
||||
import org.dromara.workflow.service.IXgStudentLeaveService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/studentLeave/studentLeave")
|
||||
public class XgStudentLeaveController extends BaseController {
|
||||
|
||||
private final IXgStudentLeaveService xgStudentLeaveService;
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgStudentLeaveVo> list(XgStudentLeaveBo bo, PageQuery pageQuery) {
|
||||
return xgStudentLeaveService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:export")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgStudentLeaveBo bo, HttpServletResponse response) {
|
||||
List<XgStudentLeaveVo> list = xgStudentLeaveService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "学生请假 - 记录学生的请假申请、审批和销假信息", XgStudentLeaveVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生请假 - 记录学生的请假申请、审批和销假信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgStudentLeaveVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgStudentLeaveService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:add")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgStudentLeaveBo bo) {
|
||||
return toAjax(xgStudentLeaveService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:edit")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgStudentLeaveBo bo) {
|
||||
return toAjax(xgStudentLeaveService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:remove")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgStudentLeaveService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
package org.dromara.workflow.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息对象 xg_student_leave
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_student_leave")
|
||||
public class XgStudentLeave extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
private String isLeaveSchool;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
private String needCancel;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
private String emergencyContact;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
private String emergencyPhone;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
private String leaveLocation;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String attachmentOssIds;
|
||||
|
||||
/**
|
||||
* 审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
private Long approvalBy;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
private String approvalByName;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假
|
||||
*/
|
||||
private String cancelStatus;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
private String cancelLocation;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String cancelPhotoOssIds;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
private String cancelRemark;
|
||||
|
||||
}
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
package org.dromara.workflow.domain.bo;
|
||||
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息业务对象 xg_student_leave
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgStudentLeave.class, reverseConvertGenerate = false)
|
||||
public class XgStudentLeaveBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@NotNull(message = "主键ID(雪花ID)不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
@NotNull(message = "学生ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
@NotBlank(message = "学生姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@NotBlank(message = "学号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@NotBlank(message = "请假类型编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@NotBlank(message = "请假类型名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
@NotNull(message = "开始时间(年月日时分秒)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
@NotNull(message = "结束时间(年月日时分秒)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
@NotNull(message = "请假时长(天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "是否离校:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isLeaveSchool;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "是否需要销假:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needCancel;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
private String emergencyContact;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
private String emergencyPhone;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
@NotBlank(message = "请假原因不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
private String leaveLocation;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String attachmentOssIds;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@NotBlank(message = "审批状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
private Long approvalBy;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
private String approvalByName;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假 3-无需销假
|
||||
*/
|
||||
@NotBlank(message = "销假状态:0-未销假,1-已销假,2-逾期未销假 3-无需销假 不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String cancelStatus;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
private String cancelLocation;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String cancelPhotoOssIds;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
private String cancelRemark;
|
||||
|
||||
}
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
package org.dromara.workflow.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息视图对象 xg_student_leave
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgStudentLeave.class)
|
||||
public class XgStudentLeaveVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "雪=花ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=代表存在,1=代表删除")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
@ExcelProperty(value = "学生ID")
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
@ExcelProperty(value = "学生姓名")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@ExcelProperty(value = "学号")
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
@ExcelProperty(value = "班级ID")
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@ExcelProperty(value = "班级名称")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
@ExcelProperty(value = "专业ID")
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
@ExcelProperty(value = "专业名称")
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
@ExcelProperty(value = "学院ID")
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
@ExcelProperty(value = "学院名称")
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型编码")
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型名称")
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "年=月日时分秒")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "年=月日时分秒")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
@ExcelProperty(value = "请假时长", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "天=")
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "是否离校:0-否,1-是")
|
||||
private String isLeaveSchool;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "是否需要销假:0-否,1-是")
|
||||
private String needCancel;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
@ExcelProperty(value = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
@ExcelProperty(value = "紧急联系电话")
|
||||
private String emergencyPhone;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
@ExcelProperty(value = "请假原因")
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
@ExcelProperty(value = "请假时地理位置")
|
||||
private String leaveLocation;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "附件OSS文件ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String attachmentOssIds;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@ExcelProperty(value = "审批状态")
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
@ExcelProperty(value = "审批意见")
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
@ExcelProperty(value = "审批时间")
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
@ExcelProperty(value = "审批人ID")
|
||||
private Long approvalBy;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "审批人姓名")
|
||||
private String approvalByName;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假 3 - 无需销假
|
||||
*/
|
||||
@ExcelProperty(value = "销假状态:0-未销假,1-已销假,2-逾期未销假 3 - 无需销假")
|
||||
private String cancelStatus;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
@ExcelProperty(value = "销假时间")
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
@ExcelProperty(value = "销假地理位置")
|
||||
private String cancelLocation;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "销假照片OSS文件ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String cancelPhotoOssIds;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
@ExcelProperty(value = "销假备注")
|
||||
private String cancelRemark;
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.workflow.mapper;
|
||||
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
public interface XgStudentLeaveMapper extends BaseMapperPlus<XgStudentLeave, XgStudentLeaveVo> {
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.workflow.service;
|
||||
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.workflow.domain.bo.XgStudentLeaveBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
public interface IXgStudentLeaveService {
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
XgStudentLeaveVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息分页列表
|
||||
*/
|
||||
TableDataInfo<XgStudentLeaveVo> queryPageList(XgStudentLeaveBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
List<XgStudentLeaveVo> queryList(XgStudentLeaveBo bo);
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgStudentLeaveBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgStudentLeaveBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假 - 记录学生的请假申请、审批和销假信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
package org.dromara.workflow.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.workflow.domain.bo.XgStudentLeaveBo;
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
import org.dromara.workflow.mapper.XgStudentLeaveMapper;
|
||||
import org.dromara.workflow.service.IXgStudentLeaveService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgStudentLeaveServiceImpl implements IXgStudentLeaveService {
|
||||
|
||||
private final XgStudentLeaveMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
@Override
|
||||
public XgStudentLeaveVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgStudentLeaveVo> queryPageList(XgStudentLeaveBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgStudentLeave> lqw = buildQueryWrapper(bo);
|
||||
Page<XgStudentLeaveVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgStudentLeaveVo> queryList(XgStudentLeaveBo bo) {
|
||||
LambdaQueryWrapper<XgStudentLeave> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgStudentLeave> buildQueryWrapper(XgStudentLeaveBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgStudentLeave> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgStudentLeave::getId);
|
||||
lqw.eq(bo.getDeleted() != null, XgStudentLeave::getDeleted, bo.getDeleted());
|
||||
lqw.eq(bo.getStudentId() != null, XgStudentLeave::getStudentId, bo.getStudentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getStudentName()), XgStudentLeave::getStudentName, bo.getStudentName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStudentNo()), XgStudentLeave::getStudentNo, bo.getStudentNo());
|
||||
lqw.eq(bo.getClassId() != null, XgStudentLeave::getClassId, bo.getClassId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgStudentLeave::getClassName, bo.getClassName());
|
||||
lqw.eq(bo.getMajorId() != null, XgStudentLeave::getMajorId, bo.getMajorId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMajorName()), XgStudentLeave::getMajorName, bo.getMajorName());
|
||||
lqw.eq(bo.getCollegeId() != null, XgStudentLeave::getCollegeId, bo.getCollegeId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCollegeName()), XgStudentLeave::getCollegeName, bo.getCollegeName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveTypeCode()), XgStudentLeave::getLeaveTypeCode, bo.getLeaveTypeCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLeaveTypeName()), XgStudentLeave::getLeaveTypeName, bo.getLeaveTypeName());
|
||||
lqw.eq(bo.getStartTime() != null, XgStudentLeave::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, XgStudentLeave::getEndTime, bo.getEndTime());
|
||||
lqw.eq(bo.getLeaveDuration() != null, XgStudentLeave::getLeaveDuration, bo.getLeaveDuration());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsLeaveSchool()), XgStudentLeave::getIsLeaveSchool, bo.getIsLeaveSchool());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNeedCancel()), XgStudentLeave::getNeedCancel, bo.getNeedCancel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContact()), XgStudentLeave::getEmergencyContact, bo.getEmergencyContact());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyPhone()), XgStudentLeave::getEmergencyPhone, bo.getEmergencyPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveReason()), XgStudentLeave::getLeaveReason, bo.getLeaveReason());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveLocation()), XgStudentLeave::getLeaveLocation, bo.getLeaveLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAttachmentOssIds()), XgStudentLeave::getAttachmentOssIds, bo.getAttachmentOssIds());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalStatus()), XgStudentLeave::getApprovalStatus, bo.getApprovalStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalOpinion()), XgStudentLeave::getApprovalOpinion, bo.getApprovalOpinion());
|
||||
lqw.eq(bo.getApprovalTime() != null, XgStudentLeave::getApprovalTime, bo.getApprovalTime());
|
||||
lqw.eq(bo.getApprovalBy() != null, XgStudentLeave::getApprovalBy, bo.getApprovalBy());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getApprovalByName()), XgStudentLeave::getApprovalByName, bo.getApprovalByName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelStatus()), XgStudentLeave::getCancelStatus, bo.getCancelStatus());
|
||||
lqw.eq(bo.getCancelTime() != null, XgStudentLeave::getCancelTime, bo.getCancelTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelLocation()), XgStudentLeave::getCancelLocation, bo.getCancelLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelPhotoOssIds()), XgStudentLeave::getCancelPhotoOssIds, bo.getCancelPhotoOssIds());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelRemark()), XgStudentLeave::getCancelRemark, bo.getCancelRemark());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgStudentLeaveBo bo) {
|
||||
XgStudentLeave add = MapstructUtils.convert(bo, XgStudentLeave.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgStudentLeaveBo bo) {
|
||||
XgStudentLeave update = MapstructUtils.convert(bo, XgStudentLeave.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgStudentLeave entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假 - 记录学生的请假申请、审批和销假信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.workflow.mapper.XgStudentLeaveMapper">
|
||||
|
||||
</mapper>
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.xg.domain.bo.XgLeaveTypeConfigBo;
|
||||
import org.dromara.xg.service.IXgLeaveTypeConfigService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xgLeaveTypeConfig/xgLeaveTypeConfig")
|
||||
public class XgLeaveTypeConfigController extends BaseController {
|
||||
|
||||
private final IXgLeaveTypeConfigService xgLeaveTypeConfigService;
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置列表
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgLeaveTypeConfigVo> list(XgLeaveTypeConfigBo bo, PageQuery pageQuery) {
|
||||
return xgLeaveTypeConfigService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学生请假类型配置列表
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:export")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgLeaveTypeConfigBo bo, HttpServletResponse response) {
|
||||
List<XgLeaveTypeConfigVo> list = xgLeaveTypeConfigService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "学生请假类型配置", XgLeaveTypeConfigVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生请假类型配置详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgLeaveTypeConfigVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgLeaveTypeConfigService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:add")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgLeaveTypeConfigBo bo) {
|
||||
return toAjax(xgLeaveTypeConfigService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:edit")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgLeaveTypeConfigBo bo) {
|
||||
return toAjax(xgLeaveTypeConfigService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生请假类型配置
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:remove")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgLeaveTypeConfigService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+22
@@ -39,6 +39,7 @@ import org.dromara.common.excel.convert.ExcelDictPreloadConvert;
|
||||
import org.dromara.common.excel.service.SqlCacheConfigService;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.xg.domain.vo.XgStudentMsgVo;
|
||||
import org.dromara.xg.domain.bo.XgStudentMsgBo;
|
||||
import org.dromara.xg.domain.bo.XgStudentMsgAdvancedSearchBo;
|
||||
@@ -615,6 +616,27 @@ public class XgStudentMsgController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的学生信息
|
||||
*/
|
||||
@SaCheckPermission("studentMsg:studentMsg:query")
|
||||
@GetMapping("/currentUserInfo")
|
||||
public R<XgStudentMsgVo> getCurrentUserInfo() {
|
||||
// 获取当前登录用户ID
|
||||
Long userId = LoginHelper.getUserId();
|
||||
if (userId == null) {
|
||||
return R.fail("用户未登录");
|
||||
}
|
||||
|
||||
// 根据用户ID查询学生信息
|
||||
XgStudentMsgVo studentInfo = xgStudentMsgService.queryByUserId(userId);
|
||||
if (studentInfo == null) {
|
||||
return R.fail("未找到当前用户的学生信息");
|
||||
}
|
||||
|
||||
return R.ok(studentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生信息详细信息
|
||||
*
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置对象 xg_leave_type_config
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_leave_type_config")
|
||||
public class XgLeaveTypeConfig extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
private String leaveTypeDesc;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
private String needLocationOnApply;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
private String needPhotoOnCancel;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
private String needLocationOnCancel;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
private String needCancelForNonLeave;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
private String canApplyInAdvance;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
private String isEnabled;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
private Double maxApplyDuration;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
private Double cancelOverdueReminder;
|
||||
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置业务对象 xg_leave_type_config
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgLeaveTypeConfig.class, reverseConvertGenerate = false)
|
||||
public class XgLeaveTypeConfigBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@NotNull(message = "主键ID(雪花ID)不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@NotBlank(message = "请假类型名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@NotBlank(message = "请假类型编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
private String leaveTypeDesc;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "请假是否需要上传地理位置:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needLocationOnApply;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "销假是否必须上传照片:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needPhotoOnCancel;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "销假是否需要上传地理位置:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needLocationOnCancel;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "非离校请假是否需要销假:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needCancelForNonLeave;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "是否可以提前请假:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String canApplyInAdvance;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
@NotBlank(message = "是否开启:0-关闭,1-开启不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isEnabled;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
private Double maxApplyDuration;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
private Double cancelOverdueReminder;
|
||||
|
||||
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 学生请假类型配置视图对象 xg_leave_type_config
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgLeaveTypeConfig.class)
|
||||
public class XgLeaveTypeConfigVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "雪=花ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型名称")
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型编码")
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型描述")
|
||||
private String leaveTypeDesc;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "请假是否需要上传地理位置:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needLocationOnApply;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "销假是否必须上传照片:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needPhotoOnCancel;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "销假是否需要上传地理位置:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needLocationOnCancel;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "非离校请假是否需要销假:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needCancelForNonLeave;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "是否可以提前请假:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String canApplyInAdvance;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
@ExcelProperty(value = "是否开启:0-关闭,1-开启", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String isEnabled;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
@ExcelProperty(value = "请假最大申请时长", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "天=")
|
||||
private Double maxApplyDuration;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
@ExcelProperty(value = "销假逾期多少时长给予提醒", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "天=")
|
||||
private Double cancelOverdueReminder;
|
||||
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
public interface XgLeaveTypeConfigMapper extends BaseMapperPlus<XgLeaveTypeConfig, XgLeaveTypeConfigVo> {
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.xg.domain.bo.XgLeaveTypeConfigBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
public interface IXgLeaveTypeConfigService {
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假类型配置
|
||||
*/
|
||||
XgLeaveTypeConfigVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假类型配置分页列表
|
||||
*/
|
||||
TableDataInfo<XgLeaveTypeConfigVo> queryPageList(XgLeaveTypeConfigBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假类型配置列表
|
||||
*/
|
||||
List<XgLeaveTypeConfigVo> queryList(XgLeaveTypeConfigBo bo);
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgLeaveTypeConfigBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgLeaveTypeConfigBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假类型配置信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+8
@@ -98,6 +98,14 @@ public interface IXgStudentMsgService {
|
||||
*/
|
||||
XgStudentMsgVo queryPersonalInfo(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询学生信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 学生信息
|
||||
*/
|
||||
XgStudentMsgVo queryByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据班级ID和姓名查询学生信息列表
|
||||
*
|
||||
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgLeaveTypeConfigBo;
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
import org.dromara.xg.mapper.XgLeaveTypeConfigMapper;
|
||||
import org.dromara.xg.service.IXgLeaveTypeConfigService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgLeaveTypeConfigServiceImpl implements IXgLeaveTypeConfigService {
|
||||
|
||||
private final XgLeaveTypeConfigMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假类型配置
|
||||
*/
|
||||
@Override
|
||||
public XgLeaveTypeConfigVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假类型配置分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgLeaveTypeConfigVo> queryPageList(XgLeaveTypeConfigBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgLeaveTypeConfig> lqw = buildQueryWrapper(bo);
|
||||
Page<XgLeaveTypeConfigVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假类型配置列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgLeaveTypeConfigVo> queryList(XgLeaveTypeConfigBo bo) {
|
||||
LambdaQueryWrapper<XgLeaveTypeConfig> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgLeaveTypeConfig> buildQueryWrapper(XgLeaveTypeConfigBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgLeaveTypeConfig> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgLeaveTypeConfig::getSortOrder);
|
||||
lqw.orderByAsc(XgLeaveTypeConfig::getId);
|
||||
lqw.eq(bo.getDeleted() != null, XgLeaveTypeConfig::getDeleted, bo.getDeleted());
|
||||
lqw.eq(bo.getIsEnabled() != null, XgLeaveTypeConfig::getIsEnabled, bo.getIsEnabled());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLeaveTypeName()), XgLeaveTypeConfig::getLeaveTypeName,
|
||||
bo.getLeaveTypeName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLeaveTypeCode()), XgLeaveTypeConfig::getLeaveTypeCode,
|
||||
bo.getLeaveTypeCode());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgLeaveTypeConfigBo bo) {
|
||||
XgLeaveTypeConfig add = MapstructUtils.convert(bo, XgLeaveTypeConfig.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgLeaveTypeConfigBo bo) {
|
||||
XgLeaveTypeConfig update = MapstructUtils.convert(bo, XgLeaveTypeConfig.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgLeaveTypeConfig entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假类型配置信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+14
@@ -663,6 +663,20 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
.eq(XgStudentMsg::getId, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询学生信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 学生信息
|
||||
*/
|
||||
@Override
|
||||
public XgStudentMsgVo queryByUserId(Long userId) {
|
||||
// deleted 为0 且 用户ID为userId
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<XgStudentMsg>()
|
||||
.eq(XgStudentMsg::getDeleted, 0)
|
||||
.eq(XgStudentMsg::getId, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据班级ID和姓名查询学生信息列表
|
||||
*
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgLeaveTypeConfigMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
# 代码调整记录 - 2025-01-20 - wuzilong
|
||||
|
||||
## 📅 变更时间
|
||||
2025-01-20 16:30:00
|
||||
|
||||
## 🎯 变更内容
|
||||
创建学生请假管理系统的数据库设计文件
|
||||
|
||||
## 📁 新增文件
|
||||
|
||||
### 1. 学生请假表结构文件
|
||||
- **文件路径**: `docs/设计文档/database/学生请假/xg_student_leave.sql`
|
||||
- **功能**: 学生请假表结构定义
|
||||
- **主要字段**:
|
||||
- 基础字段:id、tenant_id、create_dept、create_by、create_time、update_by、update_time、deleted
|
||||
- 学生信息:student_id、student_name、student_no、class_id、class_name、major_id、major_name、college_id、college_name
|
||||
- 请假信息:leave_type_code、leave_type_name、start_time、end_time、leave_duration、is_leave_school
|
||||
- 联系信息:emergency_contact、emergency_phone
|
||||
- 请假详情:leave_reason、leave_location、attachment_oss_ids
|
||||
- 审批信息:approval_status、approval_opinion、approval_time、approval_by、approval_by_name
|
||||
- 销假信息:cancel_status、cancel_time、cancel_location、cancel_photo_oss_ids、cancel_remark
|
||||
|
||||
### 2. 示例数据文件
|
||||
- **文件路径**: `docs/设计文档/database/学生请假/xg_student_leave_sample_data.sql`
|
||||
- **功能**: 提供8条不同类型的请假记录示例
|
||||
- **示例类型**:
|
||||
- 事假申请(已审批通过,未销假)
|
||||
- 病假申请(已审批通过,已销假)
|
||||
- 外出请假(待审批)
|
||||
- 回家请假(审批拒绝)
|
||||
- 其他请假(已审批通过,已销假)
|
||||
- 事假申请(待审批)
|
||||
- 病假申请(已审批通过,逾期未销假)
|
||||
- 外出请假(已取消)
|
||||
|
||||
### 3. 设计说明文档
|
||||
- **文件路径**: `docs/设计文档/database/学生请假/README.md`
|
||||
- **功能**: 详细说明数据库设计和使用方法
|
||||
- **内容包含**:
|
||||
- 数据表设计说明
|
||||
- 索引设计(单列索引和复合索引)
|
||||
- 示例数据说明
|
||||
- 使用说明和常见查询示例
|
||||
- 注意事项和版本历史
|
||||
|
||||
## 🔍 索引设计
|
||||
|
||||
### 单列索引
|
||||
- 租户索引:`idx_tenant_id`
|
||||
- 学生索引:`idx_student_id`
|
||||
- 学号索引:`idx_student_no`
|
||||
- 班级索引:`idx_class_id`
|
||||
- 学院索引:`idx_college_id`
|
||||
- 请假类型索引:`idx_leave_type_code`
|
||||
- 时间索引:`idx_start_time`、`idx_end_time`
|
||||
- 状态索引:`idx_approval_status`、`idx_cancel_status`
|
||||
- 创建时间索引:`idx_create_time`
|
||||
- 离校状态索引:`idx_is_leave_school`
|
||||
|
||||
### 复合索引
|
||||
- 学生+时间范围:`idx_student_time_range`
|
||||
- 班级+审批状态:`idx_class_approval_status`
|
||||
- 学院+请假类型:`idx_college_leave_type`
|
||||
- 时间范围+审批状态:`idx_time_approval_status`
|
||||
|
||||
## ✅ 设计特点
|
||||
|
||||
1. **符合项目规范**: 包含统一的基础字段,支持多租户和逻辑删除
|
||||
2. **完整业务覆盖**: 涵盖请假申请、审批、销假全流程
|
||||
3. **性能优化**: 合理的索引设计,支持高效查询
|
||||
4. **扩展性强**: 支持附件上传、地理位置记录等扩展功能
|
||||
5. **数据完整性**: 包含审批状态、销假状态等完整状态管理
|
||||
|
||||
## 🔗 关联文件
|
||||
|
||||
- **请假类型配置表**: `docs/设计文档/database/学生请假/xg_leave_type_config.sql`(已存在)
|
||||
- **项目规范**: `.cursor/cursorrules-backend.md`(数据库开发规范)
|
||||
|
||||
## 📝 后续工作
|
||||
|
||||
1. 基于此表结构开发后端API接口
|
||||
2. 开发前端请假申请和审批页面
|
||||
3. 开发移动端请假功能
|
||||
4. 编写API文档和测试脚本
|
||||
|
||||
---
|
||||
|
||||
**变更人**: wuzilong
|
||||
**审核人**: -
|
||||
**状态**: 已完成
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,99 @@
|
||||
# 学生请假类型配置页面字典显示问题修复记录
|
||||
|
||||
## 修改时间
|
||||
2025-01-27 10:30:00
|
||||
|
||||
## 变更内容
|
||||
修复了学生请假类型配置管理页面中字典数据显示错误的问题。
|
||||
|
||||
## 变更原因
|
||||
通过分析发现,页面中使用了 `dict-tag` 组件显示字典数据,但缺少字典数据的加载,导致出现 `Cannot read properties of undefined (reading 'some')` 错误。
|
||||
|
||||
## 问题分析
|
||||
1. **错误信息**: `index.vue:61 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'some')`
|
||||
2. **问题根因**: 页面中使用了 `sys_yesno` 字典,但没有通过 `useDict` 加载字典数据
|
||||
3. **影响范围**: 表格中的字典字段显示异常,表单中的字典选择器无法正常工作
|
||||
|
||||
## 解决方案
|
||||
1. **添加字典数据加载**: 在script部分添加 `sys_yesno` 字典的加载
|
||||
2. **修复表单选择器**: 将表单中的输入框改为下拉选择器,使用字典数据
|
||||
|
||||
## 变更详情
|
||||
|
||||
### 1. 添加字典数据加载
|
||||
**文件**: `web/src/views/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig/index.vue`
|
||||
|
||||
**添加内容**:
|
||||
```javascript
|
||||
// 加载字典数据
|
||||
const { sys_yesno } = toRefs<any>(
|
||||
proxy?.useDict('sys_yesno')
|
||||
);
|
||||
```
|
||||
|
||||
### 2. 修复表单选择器
|
||||
**修改前**:
|
||||
```vue
|
||||
<el-form-item label="请假是否需要上传地理位置" prop="needLocationOnApply">
|
||||
<el-input v-model="form.needLocationOnApply" placeholder="请输入请假是否需要上传地理位置" />
|
||||
</el-form-item>
|
||||
```
|
||||
|
||||
**修改后**:
|
||||
```vue
|
||||
<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>
|
||||
```
|
||||
|
||||
### 3. 添加必要的类型定义
|
||||
**添加内容**:
|
||||
```typescript
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface PageData<T, Q> {
|
||||
form: T;
|
||||
queryParams: Q;
|
||||
rules: Record<string, any[]>;
|
||||
}
|
||||
```
|
||||
|
||||
## 修复的字段
|
||||
- 请假是否需要上传地理位置 (needLocationOnApply)
|
||||
- 销假是否必须上传照片 (needPhotoOnCancel)
|
||||
- 销假是否需要上传地理位置 (needLocationOnCancel)
|
||||
- 非离校请假是否需要销假 (needCancelForNonLeave)
|
||||
- 是否可以提前请假 (canApplyInAdvance)
|
||||
- 是否开启 (isEnabled)
|
||||
|
||||
## 技术说明
|
||||
1. **字典数据**: 使用 `sys_yesno` 字典,值为 "0"-否,"1"-是
|
||||
2. **组件使用**: 表格中使用 `dict-tag` 组件,表单中使用 `el-select` 组件
|
||||
3. **数据格式**: 接口返回的数据为字符串类型("0"、"1"),与字典值匹配
|
||||
|
||||
## 验证结果
|
||||
- ✅ 表格中的字典字段正常显示(是/否)
|
||||
- ✅ 表单中的下拉选择器正常工作
|
||||
- ✅ 新增和修改功能正常
|
||||
- ✅ 字典数据加载成功
|
||||
|
||||
## 相关文件
|
||||
- `web/src/views/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig/index.vue`
|
||||
- `web/src/api/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig/index.ts`
|
||||
- `web/src/api/xg/xsjcxx/xgLeaveTypeConfig/xgLeaveTypeConfig/types.ts`
|
||||
|
||||
---
|
||||
|
||||
**修复人员**: Cursor AI
|
||||
**审核状态**: 待审核
|
||||
**测试状态**: 待测试
|
||||
@@ -0,0 +1,173 @@
|
||||
# 学生请假数据库设计
|
||||
|
||||
## 📋 概述
|
||||
|
||||
本目录包含学生请假管理系统的数据库设计文件,包括请假类型配置表和请假记录表。
|
||||
|
||||
## 📁 文件结构
|
||||
|
||||
```
|
||||
学生请假/
|
||||
├── README.md # 本说明文档
|
||||
├── xg_leave_type_config.sql # 请假类型配置表
|
||||
├── xg_student_leave.sql # 学生请假表
|
||||
└── xg_student_leave_sample_data.sql # 示例数据
|
||||
```
|
||||
|
||||
## 🗄️ 数据表设计
|
||||
|
||||
### 1. 请假类型配置表 (`xg_leave_type_config`)
|
||||
|
||||
**功能**: 配置不同类型的请假规则和参数
|
||||
|
||||
**主要字段**:
|
||||
- `leave_type_code`: 请假类型编码(如:PERSONAL_LEAVE、SICK_LEAVE)
|
||||
- `leave_type_name`: 请假类型名称(如:事假、病假)
|
||||
- `need_location_on_apply`: 请假是否需要上传地理位置
|
||||
- `need_photo_on_cancel`: 销假是否必须上传照片
|
||||
- `need_location_on_cancel`: 销假是否需要上传地理位置
|
||||
- `need_cancel_for_non_leave`: 非离校请假是否需要销假
|
||||
- `can_apply_in_advance`: 是否可以提前请假
|
||||
- `max_apply_duration`: 请假最大申请时长(天)
|
||||
- `cancel_overdue_reminder`: 销假逾期提醒时长(天)
|
||||
|
||||
### 2. 学生请假表 (`xg_student_leave`)
|
||||
|
||||
**功能**: 记录学生的请假申请、审批和销假信息
|
||||
|
||||
**主要字段**:
|
||||
|
||||
#### 基础信息
|
||||
- `student_id`: 学生ID
|
||||
- `student_name`: 学生姓名
|
||||
- `student_no`: 学号
|
||||
- `class_id/class_name`: 班级信息
|
||||
- `major_id/major_name`: 专业信息
|
||||
- `college_id/college_name`: 学院信息
|
||||
|
||||
#### 请假信息
|
||||
- `leave_type_code/leave_type_name`: 请假类型
|
||||
- `start_time/end_time`: 开始/结束时间(年月日时分秒)
|
||||
- `leave_duration`: 请假时长(天)
|
||||
- `is_leave_school`: 是否离校(0-否,1-是)
|
||||
|
||||
#### 联系信息
|
||||
- `emergency_contact`: 紧急联系人
|
||||
- `emergency_phone`: 紧急联系电话
|
||||
|
||||
#### 请假详情
|
||||
- `leave_reason`: 请假原因
|
||||
- `leave_location`: 请假时地理位置
|
||||
- `attachment_oss_ids`: 附件OSS文件ID(逗号分隔)
|
||||
|
||||
#### 审批信息
|
||||
- `approval_status`: 审批状态(0-待审批,1-已通过,2-已拒绝,3-已取消)
|
||||
- `approval_opinion`: 审批意见
|
||||
- `approval_time`: 审批时间
|
||||
- `approval_by/approval_by_name`: 审批人信息
|
||||
|
||||
#### 销假信息
|
||||
- `cancel_status`: 销假状态(0-未销假,1-已销假,2-逾期未销假)
|
||||
- `cancel_time`: 销假时间
|
||||
- `cancel_location`: 销假地理位置
|
||||
- `cancel_photo_oss_ids`: 销假照片OSS文件ID
|
||||
- `cancel_remark`: 销假备注
|
||||
|
||||
## 🔍 索引设计
|
||||
|
||||
### 单列索引
|
||||
- 租户索引:`idx_tenant_id`
|
||||
- 学生索引:`idx_student_id`
|
||||
- `student_no`: 学号
|
||||
- 班级索引:`idx_class_id`
|
||||
- 学院索引:`idx_college_id`
|
||||
- 请假类型索引:`idx_leave_type_code`
|
||||
- 时间索引:`idx_start_time`、`idx_end_time`
|
||||
- 状态索引:`idx_approval_status`、`idx_cancel_status`
|
||||
- 创建时间索引:`idx_create_time`
|
||||
- 离校状态索引:`idx_is_leave_school`
|
||||
|
||||
### 复合索引
|
||||
- 学生+时间范围:`idx_student_time_range`
|
||||
- 班级+审批状态:`idx_class_approval_status`
|
||||
- 学院+请假类型:`idx_college_leave_type`
|
||||
- 时间范围+审批状态:`idx_time_approval_status`
|
||||
|
||||
## 📊 示例数据说明
|
||||
|
||||
示例数据包含8条不同类型的请假记录:
|
||||
|
||||
1. **事假申请** - 已审批通过,未销假
|
||||
2. **病假申请** - 已审批通过,已销假
|
||||
3. **外出请假** - 待审批
|
||||
4. **回家请假** - 审批拒绝
|
||||
5. **其他请假** - 已审批通过,已销假
|
||||
6. **事假申请** - 待审批
|
||||
7. **病假申请** - 已审批通过,逾期未销假
|
||||
8. **外出请假** - 已取消
|
||||
|
||||
## 🔧 使用说明
|
||||
|
||||
### 1. 创建表结构
|
||||
```sql
|
||||
-- 先创建请假类型配置表
|
||||
source xg_leave_type_config.sql;
|
||||
|
||||
-- 再创建学生请假表
|
||||
source xg_student_leave.sql;
|
||||
```
|
||||
|
||||
### 2. 插入示例数据
|
||||
```sql
|
||||
-- 插入示例数据(可选)
|
||||
source xg_student_leave_sample_data.sql;
|
||||
```
|
||||
|
||||
### 3. 常见查询示例
|
||||
|
||||
#### 查询某个学生的请假记录
|
||||
```sql
|
||||
SELECT * FROM xg_student_leave
|
||||
WHERE student_id = 10001
|
||||
ORDER BY create_time DESC;
|
||||
```
|
||||
|
||||
#### 查询待审批的请假申请
|
||||
```sql
|
||||
SELECT * FROM xg_student_leave
|
||||
WHERE approval_status = '0'
|
||||
ORDER BY create_time ASC;
|
||||
```
|
||||
|
||||
#### 查询逾期未销假的记录
|
||||
```sql
|
||||
SELECT * FROM xg_student_leave
|
||||
WHERE cancel_status = '2'
|
||||
AND end_time < NOW();
|
||||
```
|
||||
|
||||
#### 按班级统计请假情况
|
||||
```sql
|
||||
SELECT
|
||||
class_name,
|
||||
COUNT(*) as total_count,
|
||||
SUM(CASE WHEN approval_status = '1' THEN 1 ELSE 0 END) as approved_count,
|
||||
SUM(CASE WHEN approval_status = '2' THEN 1 ELSE 0 END) as rejected_count
|
||||
FROM xg_student_leave
|
||||
WHERE create_time >= DATE_SUB(NOW(), INTERVAL 30 DAY)
|
||||
GROUP BY class_id, class_name;
|
||||
```
|
||||
|
||||
## ⚠️ 注意事项
|
||||
|
||||
1. **基础字段规范**: 所有表都包含统一的基础字段(id、tenant_id、create_dept等)
|
||||
2. **逻辑删除**: 使用`deleted`字段进行逻辑删除,禁止物理删除
|
||||
3. **多租户支持**: 所有表都包含`tenant_id`字段,支持多租户
|
||||
4. **外键约束**: 外键约束已注释,可根据实际需要启用
|
||||
5. **字符集**: 统一使用utf8mb4字符集,支持emoji等特殊字符
|
||||
|
||||
## 🔄 版本历史
|
||||
|
||||
- **2024-01-20**: 初始版本,创建请假类型配置表和请假记录表
|
||||
- **2024-01-21**: 添加示例数据和查询示例
|
||||
- **2024-01-22**: 完善索引设计和文档说明
|
||||
@@ -0,0 +1,48 @@
|
||||
-- ----------------------------
|
||||
-- 学生请假类型配置表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `xg_leave_type_config`;
|
||||
CREATE TABLE `xg_leave_type_config` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID(雪花ID)',
|
||||
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)',
|
||||
|
||||
-- 业务字段
|
||||
`leave_type_name` varchar(50) NOT NULL COMMENT '请假类型名称',
|
||||
`leave_type_code` varchar(20) NOT NULL COMMENT '请假类型编码',
|
||||
`leave_type_desc` varchar(500) DEFAULT NULL COMMENT '请假类型描述',
|
||||
`sort_order` int(4) DEFAULT '0' COMMENT '排序号',
|
||||
|
||||
-- 配置字段(使用char类型)
|
||||
`need_location_on_apply` char(1) NOT NULL DEFAULT '0' COMMENT '请假是否需要上传地理位置:0-否,1-是',
|
||||
`need_photo_on_cancel` char(1) NOT NULL DEFAULT '0' COMMENT '销假是否必须上传照片:0-否,1-是',
|
||||
`need_location_on_cancel` char(1) NOT NULL DEFAULT '0' COMMENT '销假是否需要上传地理位置:0-否,1-是',
|
||||
`need_cancel_for_non_leave` char(1) NOT NULL DEFAULT '0' COMMENT '非离校请假是否需要销假:0-否,1-是',
|
||||
`can_apply_in_advance` char(1) NOT NULL DEFAULT '0' COMMENT '是否可以提前请假:0-否,1-是',
|
||||
`is_enabled` char(1) NOT NULL DEFAULT '1' COMMENT '是否开启:0-关闭,1-开启',
|
||||
|
||||
-- 数值配置字段
|
||||
`max_apply_duration` decimal(5,2) DEFAULT NULL COMMENT '请假最大申请时长(天)',
|
||||
`cancel_overdue_reminder` decimal(5,2) DEFAULT NULL COMMENT '销假逾期多少时长给予提醒(天)',
|
||||
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_leave_type_code` (`leave_type_code`, `tenant_id`) USING BTREE COMMENT '请假类型编码唯一索引',
|
||||
KEY `idx_tenant_id` (`tenant_id`) USING BTREE COMMENT '租户索引',
|
||||
KEY `idx_is_enabled` (`is_enabled`) USING BTREE COMMENT '启用状态索引',
|
||||
KEY `idx_sort_order` (`sort_order`) USING BTREE COMMENT '排序索引'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='学生请假类型配置表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化数据
|
||||
-- ----------------------------
|
||||
INSERT INTO `xg_leave_type_config` VALUES
|
||||
(1, '000000', 103, 1, NOW(), NULL, NULL, 0, '事假', 'PERSONAL_LEAVE', '因个人事务需要请假', 1, '0', '0', '0', '0', '1', '1', 72, 24),
|
||||
(2, '000000', 103, 1, NOW(), NULL, NULL, 0, '病假', 'SICK_LEAVE', '因身体不适需要请假', 2, '0', '1', '0', '1', '1', '1', 168, 48),
|
||||
(3, '000000', 103, 1, NOW(), NULL, NULL, 0, '外出请假', 'OUT_LEAVE', '因外出办事需要请假', 3, '1', '1', '1', '1', '1', '1', 24, 2),
|
||||
(4, '000000', 103, 1, NOW(), NULL, NULL, 0, '回家请假', 'HOME_LEAVE', '因回家需要请假', 4, '1', '1', '1', '1', '1', '1', 72, 6),
|
||||
(5, '000000', 103, 1, NOW(), NULL, NULL, 0, '其他请假', 'OTHER_LEAVE', '其他原因请假', 5, '0', '0', '0', '0', '1', '1', 48, 12);
|
||||
@@ -0,0 +1,101 @@
|
||||
-- ----------------------------
|
||||
-- 学生请假表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `xg_student_leave`;
|
||||
CREATE TABLE `xg_student_leave` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID(雪花ID)',
|
||||
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)',
|
||||
|
||||
-- 业务字段
|
||||
`student_id` bigint(20) NOT NULL COMMENT '学生ID',
|
||||
`student_name` varchar(50) NOT NULL COMMENT '学生姓名',
|
||||
`student_no` varchar(20) NOT NULL COMMENT '学号',
|
||||
`class_id` bigint(20) DEFAULT NULL COMMENT '班级ID',
|
||||
`class_name` varchar(100) DEFAULT NULL COMMENT '班级名称',
|
||||
`major_id` bigint(20) DEFAULT NULL COMMENT '专业ID',
|
||||
`major_name` varchar(100) DEFAULT NULL COMMENT '专业名称',
|
||||
`college_id` bigint(20) DEFAULT NULL COMMENT '学院ID',
|
||||
`college_name` varchar(100) DEFAULT NULL COMMENT '学院名称',
|
||||
|
||||
-- 请假信息
|
||||
`leave_type_code` varchar(20) NOT NULL COMMENT '请假类型编码',
|
||||
`leave_type_name` varchar(50) NOT NULL COMMENT '请假类型名称',
|
||||
`start_time` datetime NOT NULL COMMENT '开始时间(年月日时分秒)',
|
||||
`end_time` datetime NOT NULL COMMENT '结束时间(年月日时分秒)',
|
||||
`leave_duration` decimal(5,2) NOT NULL COMMENT '请假时长(天)',
|
||||
`is_leave_school` char(1) NOT NULL DEFAULT '0' COMMENT '是否离校:0-否,1-是',
|
||||
`need_cancel` char(1) NOT NULL DEFAULT '1' COMMENT '是否需要销假:0-否,1-是',
|
||||
|
||||
-- 紧急联系人信息
|
||||
`emergency_contact` varchar(50) DEFAULT NULL COMMENT '紧急联系人',
|
||||
`emergency_phone` varchar(20) DEFAULT NULL COMMENT '紧急联系电话',
|
||||
|
||||
-- 请假原因和位置
|
||||
`leave_reason` text NOT NULL COMMENT '请假原因',
|
||||
`leave_location` varchar(500) DEFAULT NULL COMMENT '请假时地理位置',
|
||||
`attachment_oss_ids` text DEFAULT NULL COMMENT '附件OSS文件ID(逗号分隔)',
|
||||
|
||||
-- 审批状态
|
||||
`approval_status` char(1) NOT NULL DEFAULT '0' COMMENT '审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消',
|
||||
`approval_opinion` varchar(500) DEFAULT NULL COMMENT '审批意见',
|
||||
`approval_time` datetime DEFAULT NULL COMMENT '审批时间',
|
||||
`approval_by` bigint(20) DEFAULT NULL COMMENT '审批人ID',
|
||||
`approval_by_name` varchar(50) DEFAULT NULL COMMENT '审批人姓名',
|
||||
|
||||
-- 销假信息
|
||||
`cancel_status` char(1) NOT NULL DEFAULT '0' COMMENT '销假状态:0-未销假,1-已销假,2-逾期未销假',
|
||||
`cancel_time` datetime DEFAULT NULL COMMENT '销假时间',
|
||||
`cancel_location` varchar(500) DEFAULT NULL COMMENT '销假地理位置',
|
||||
`cancel_photo_oss_ids` text DEFAULT NULL COMMENT '销假照片OSS文件ID(逗号分隔)',
|
||||
`cancel_remark` varchar(500) DEFAULT NULL COMMENT '销假备注',
|
||||
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_tenant_id` (`tenant_id`) USING BTREE COMMENT '租户索引',
|
||||
KEY `idx_student_id` (`student_id`) USING BTREE COMMENT '学生索引',
|
||||
KEY `idx_student_no` (`student_no`) USING BTREE COMMENT '学号索引',
|
||||
KEY `idx_class_id` (`class_id`) USING BTREE COMMENT '班级索引',
|
||||
KEY `idx_college_id` (`college_id`) USING BTREE COMMENT '学院索引',
|
||||
KEY `idx_leave_type_code` (`leave_type_code`) USING BTREE COMMENT '请假类型索引',
|
||||
KEY `idx_start_time` (`start_time`) USING BTREE COMMENT '开始时间索引',
|
||||
KEY `idx_end_time` (`end_time`) USING BTREE COMMENT '结束时间索引',
|
||||
KEY `idx_approval_status` (`approval_status`) USING BTREE COMMENT '审批状态索引',
|
||||
KEY `idx_cancel_status` (`cancel_status`) USING BTREE COMMENT '销假状态索引',
|
||||
KEY `idx_create_time` (`create_time`) USING BTREE COMMENT '创建时间索引',
|
||||
KEY `idx_is_leave_school` (`is_leave_school`) USING BTREE COMMENT '离校状态索引',
|
||||
KEY `idx_need_cancel` (`need_cancel`) USING BTREE COMMENT '是否需要销假索引'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='学生请假表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 创建索引
|
||||
-- ----------------------------
|
||||
-- 复合索引:学生+时间范围查询
|
||||
CREATE INDEX `idx_student_time_range` ON `xg_student_leave` (`student_id`, `start_time`, `end_time`);
|
||||
|
||||
-- 复合索引:班级+审批状态查询
|
||||
CREATE INDEX `idx_class_approval_status` ON `xg_student_leave` (`class_id`, `approval_status`);
|
||||
|
||||
-- 复合索引:学院+请假类型查询
|
||||
CREATE INDEX `idx_college_leave_type` ON `xg_student_leave` (`college_id`, `leave_type_code`);
|
||||
|
||||
-- 复合索引:时间范围+审批状态查询
|
||||
CREATE INDEX `idx_time_approval_status` ON `xg_student_leave` (`start_time`, `end_time`, `approval_status`);
|
||||
|
||||
-- 复合索引:是否需要销假+销假状态查询
|
||||
CREATE INDEX `idx_need_cancel_status` ON `xg_student_leave` (`need_cancel`, `cancel_status`);
|
||||
|
||||
-- ----------------------------
|
||||
-- 添加外键约束(可选,根据实际需要启用)
|
||||
-- ----------------------------
|
||||
-- ALTER TABLE `xg_student_leave` ADD CONSTRAINT `fk_student_leave_type`
|
||||
-- FOREIGN KEY (`leave_type_code`) REFERENCES `xg_leave_type_config` (`leave_type_code`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- ----------------------------
|
||||
-- 添加注释
|
||||
-- ----------------------------
|
||||
ALTER TABLE `xg_student_leave` COMMENT = '学生请假表 - 记录学生的请假申请、审批和销假信息';
|
||||
@@ -0,0 +1,91 @@
|
||||
-- ----------------------------
|
||||
-- 学生请假表示例数据
|
||||
-- ----------------------------
|
||||
|
||||
-- 示例数据1:事假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1001, '000000', 103, 1, '2024-01-15 10:30:00', NULL, NULL, 0,
|
||||
10001, '张三', '2024001', 101, '计算机科学与技术1班', 1, '计算机科学与技术', 1, '信息工程学院',
|
||||
'PERSONAL_LEAVE', '事假', '2024-01-20 08:00:00', '2024-01-21 18:00:00', 2.00, '0',
|
||||
'李四', '13800138001',
|
||||
'家中有急事需要处理,特此请假。', '北京市海淀区中关村大街1号', 'oss_file_001,oss_file_002',
|
||||
'1', '同意请假,请按时返校。', '2024-01-16 14:20:00', 1001, '王老师',
|
||||
'0', NULL, NULL, NULL, NULL
|
||||
);
|
||||
|
||||
-- 示例数据2:病假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1002, '000000', 103, 1, '2024-01-16 09:15:00', NULL, NULL, 0,
|
||||
10002, '李四', '2024002', 101, '计算机科学与技术1班', 1, '计算机科学与技术', 1, '信息工程学院',
|
||||
'SICK_LEAVE', '病假', '2024-01-17 00:00:00', '2024-01-19 23:59:59', 3.00, '0',
|
||||
'王五', '13800138002',
|
||||
'感冒发烧,需要休息治疗。', '北京市朝阳区建国路2号', 'oss_file_003',
|
||||
'1', '同意病假,注意休息。', '2024-01-16 16:30:00', 1001, '王老师',
|
||||
'1', '2024-01-20 08:30:00', '北京市朝阳区建国路2号', 'oss_file_004', '已康复返校'
|
||||
);
|
||||
|
||||
-- 示例数据3:外出请假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1003, '000000', 103, 1, '2024-01-17 14:20:00', NULL, NULL, 0,
|
||||
10003, '王五', '2024003', 102, '软件工程1班', 2, '软件工程', 1, '信息工程学院',
|
||||
'OUT_LEAVE', '外出请假', '2024-01-18 14:00:00', '2024-01-18 18:00:00', 0.17, '1',
|
||||
'赵六', '13800138003',
|
||||
'需要外出办理身份证业务。', '北京市西城区西单大街3号', 'oss_file_005',
|
||||
'0', NULL, NULL, NULL, NULL,
|
||||
'0', NULL, NULL, NULL, NULL
|
||||
);
|
||||
|
||||
-- 示例数据4:回家请假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1004, '000000', 103, 1, '2024-01-18 11:00:00', NULL, NULL, 0,
|
||||
10004, '赵六', '2024004', 102, '软件工程1班', 2, '软件工程', 1, '信息工程学院',
|
||||
'HOME_LEAVE', '回家请假', '2024-01-25 16:00:00', '2024-01-27 20:00:00', 2.17, '1',
|
||||
'钱七', '13800138004',
|
||||
'回家参加亲戚婚礼。', '上海市浦东新区陆家嘴4号', 'oss_file_006,oss_file_007',
|
||||
'2', '请假时间过长,建议缩短。', '2024-01-19 10:15:00', 1001, '王老师',
|
||||
'0', NULL, NULL, NULL, NULL
|
||||
);
|
||||
|
||||
-- 示例数据5:其他请假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1005, '000000', 103, 1, '2024-01-19 16:45:00', NULL, NULL, 0,
|
||||
10005, '钱七', '2024005', 103, '网络工程1班', 3, '网络工程', 1, '信息工程学院',
|
||||
'OTHER_LEAVE', '其他请假', '2024-01-22 09:00:00', '2024-01-22 12:00:00', 0.13, '0',
|
||||
'孙八', '13800138005',
|
||||
'参加学校组织的志愿者活动。', '北京市海淀区清华园5号', 'oss_file_008',
|
||||
'1', '同意参加志愿者活动。', '2024-01-20 09:30:00', 1001, '王老师',
|
||||
'1', '2024-01-22 12:30:00', '北京市海淀区清华园5号', 'oss_file_009', '活动完成返校'
|
||||
);
|
||||
|
||||
-- 示例数据6:待审批的请假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1006, '000000', 103, 1, '2024-01-20 08:30:00', NULL, NULL, 0,
|
||||
10006, '孙八', '2024006', 103, '网络工程1班', 3, '网络工程', 1, '信息工程学院',
|
||||
'PERSONAL_LEAVE', '事假', '2024-01-23 08:00:00', '2024-01-24 18:00:00', 2.00, '0',
|
||||
'周九', '13800138006',
|
||||
'需要参加驾照考试。', '北京市丰台区南四环6号', 'oss_file_010',
|
||||
'0', NULL, NULL, NULL, NULL,
|
||||
'0', NULL, NULL, NULL, NULL
|
||||
);
|
||||
|
||||
-- 示例数据7:逾期未销假的请假记录
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1007, '000000', 103, 1, '2024-01-10 10:00:00', NULL, NULL, 0,
|
||||
10007, '周九', '2024007', 104, '信息安全1班', 4, '信息安全', 1, '信息工程学院',
|
||||
'SICK_LEAVE', '病假', '2024-01-11 00:00:00', '2024-01-13 23:59:59', 3.00, '0',
|
||||
'吴十', '13800138007',
|
||||
'肠胃炎,需要住院治疗。', '北京市昌平区回龙观7号', 'oss_file_011',
|
||||
'1', '同意病假,注意身体。', '2024-01-10 15:00:00', 1001, '王老师',
|
||||
'2', NULL, NULL, NULL, '逾期未销假'
|
||||
);
|
||||
|
||||
-- 示例数据8:已取消的请假申请
|
||||
INSERT INTO `xg_student_leave` VALUES (
|
||||
1008, '000000', 103, 1, '2024-01-21 13:20:00', 1001, '2024-01-21 15:30:00', 0,
|
||||
10008, '吴十', '2024008', 104, '信息安全1班', 4, '信息安全', 1, '信息工程学院',
|
||||
'OUT_LEAVE', '外出请假', '2024-01-22 14:00:00', '2024-01-22 17:00:00', 0.13, '1',
|
||||
'郑十一', '13800138008',
|
||||
'需要外出办理银行卡业务。', '北京市东城区王府井8号', 'oss_file_012',
|
||||
'3', '学生主动取消申请。', '2024-01-21 15:30:00', 1001, '王老师',
|
||||
'0', NULL, NULL, NULL, NULL
|
||||
);
|
||||
@@ -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