2 files added
6 files modified
| New file |
| | |
| | | package me.zhengjie.modules.attendance.rabbit; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.AttendanceLeaveService; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitHandler; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | @RabbitListener(queues = "attendance.attendanceLeaveApply") |
| | | public class AttendanceLeaveRabbit { |
| | | |
| | | @Autowired |
| | | private AttendanceLeaveService attendanceLeaveService; |
| | | |
| | | @RabbitHandler |
| | | public void process(Map<String, Object> message) throws Exception { |
| | | // Map 转 实体类 |
| | | AttendanceLeave attendanceLeave = JSON.parseObject(JSON.toJSONString(message), AttendanceLeave.class); |
| | | attendanceLeave.setApprovalStatus(Constant.APPROVAL_STATUS_PASSED); |
| | | // 新增考勤请假 |
| | | attendanceLeaveService.flowableCreate(attendanceLeave); |
| | | } |
| | | } |
| | |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<AttendanceLeaveDto> all, HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * 新增校验(工作流) |
| | | * @param resources |
| | | */ |
| | | void flowableCreateValidation(AttendanceLeaveDto resources, List<AttendanceLeaveDto> resourcesList); |
| | | |
| | | /** |
| | | * 新增(工作流) |
| | | * @param resources |
| | | */ |
| | | void flowableCreate(AttendanceLeave resources) throws Exception; |
| | | } |
| | |
| | | /** 审批用户名 */ |
| | | private String appUserName; |
| | | |
| | | /** 流程实例ID */ |
| | | private String processInstanceId; |
| | | |
| | | /** 审批状态 */ |
| | | private String approve; |
| | | |
| | | } |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.api.Api; |
| | | import me.zhengjie.modules.attendance.service.AttendanceLeaveFlowableService; |
| | | import me.zhengjie.modules.attendance.service.AttendanceLeaveService; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceLeaveDto; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.system.domain.Role; |
| | |
| | | private final UserRepository userRepository; |
| | | private final RoleRepository roleRepository; |
| | | private final RoleService roleService; |
| | | private final AttendanceLeaveService attendanceLeaveService; |
| | | |
| | | /** |
| | | * 我发起的 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(AttendanceLeaveDto resources) throws Exception { |
| | | // 新增校验(工作流) |
| | | attendanceLeaveService.flowableCreateValidation(resources, reportAppoint(resources.getUserId())); |
| | | // 获取用户最大角色等级 |
| | | List<Integer> levels = roleService.findByUsersId(resources.getUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList()); |
| | | int min = Collections.min(levels); |
| | | // 请假时长 |
| | | Integer leaveDuration = 0; |
| | | // 判断请假时长单位 |
| | | if (Constant.LEAVE_TIME_TYPE_HOUR.equals(resources.getLeaveDurationUnit())) { |
| | | Double tempLeaveDuration = Math.ceil(resources.getLeaveDuration() / 8); |
| | | Double tempLeaveDuration = Math.floor(resources.getLeaveDuration() / 8); |
| | | // 请假时长 |
| | | leaveDuration = tempLeaveDuration.intValue(); |
| | | } else { |
| | | // 请假时长 |
| | | leaveDuration = resources.getLeaveDuration().intValue(); |
| | | } |
| | | // 一级审批人 |
| | | String approver1 = findUserByRoleLevel(Constant.ROLE_LEVEL_LEADER); |
| | | String approver1 = ""; |
| | | // 二级审批人 |
| | | String approver2 = findUserByRoleLevel(Constant.ROLE_LEVEL_MANAGER); |
| | | String approver2 = ""; |
| | | // 三级审批人 |
| | | String approver3 = findUserByRoleLevel(Constant.ROLE_LEVEL_GENERAL); |
| | | String approver3 = ""; |
| | | // 判断用户最大角色等级 |
| | | if (min == Constant.ROLE_LEVEL_ORDINARY) { |
| | | // 一级审批人 |
| | | approver1 = resources.getApprovalUserId().toString(); |
| | | // 二级审批人 |
| | | approver2 = findUserByRoleLevel(Constant.ROLE_LEVEL_MANAGER); |
| | | // 三级审批人 |
| | | approver3 = findUserByRoleLevel(Constant.ROLE_LEVEL_GENERAL); |
| | | } else if (min == Constant.ROLE_LEVEL_LEADER) { |
| | | // 二级审批人 |
| | | approver2 = resources.getApprovalUserId().toString(); |
| | | // 三级审批人 |
| | | approver3 = findUserByRoleLevel(Constant.ROLE_LEVEL_GENERAL); |
| | | } else if (min == Constant.ROLE_LEVEL_MANAGER) { |
| | | // 三级审批人 |
| | | approver3 = resources.getApprovalUserId().toString(); |
| | | } else { |
| | | |
| | | } |
| | | // 参数 |
| | | Map<String, Object> params = ObjectUtil.toObjectMap(resources); |
| | | params.put("role", min); |
| | |
| | | // 发起通信 |
| | | api.post(flowableUrl + "/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | } |
| | | |
| | | /** |
| | | * 我发起的(指定用户) |
| | | * @return |
| | | */ |
| | | private List<AttendanceLeaveDto> reportAppoint(Long userId) { |
| | | // 发起通信 |
| | | Object returnObject = api.post(flowableUrl + "/api/common/report?key=" + "attendanceLeaveApply" + "&userId=" + userId, new HashMap<>()); |
| | | // 通信结果转DTO |
| | | List<AttendanceLeaveDto> attendanceLeaveDtoList = ((JSONArray) returnObject).toJavaList(AttendanceLeaveDto.class); |
| | | return attendanceLeaveDtoList; |
| | | } |
| | | } |
| | |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | |
| | | /** |
| | | * 新增校验(工作流) |
| | | * @param resources |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void flowableCreateValidation(AttendanceLeaveDto resources, List<AttendanceLeaveDto> resourcesList) { |
| | | // 日期格式化 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // 请假开始时间 |
| | | String leaveStartTime = sdf.format(resources.getLeaveStartTime()); |
| | | // 请假结束时间 |
| | | String leaveEndTime = sdf.format(resources.getLeaveEndTime()); |
| | | // 判断请假时长单位是否是“天” |
| | | if(resources.getLeaveDurationUnit().equals(Constant.LEAVE_TIME_TYPE_DAY)){ |
| | | // 查询用户的排班时间 |
| | | User user = userRepository.getById(resources.getUserId()); |
| | | // 请假开始时间 |
| | | leaveStartTime = leaveStartTime.substring(0,10) + " " + user.getSysRostering().getWorkStartTime().toString() + ":00"; |
| | | // 请假结束时间 |
| | | leaveEndTime = leaveEndTime.substring(0,10) + " " + user.getSysRostering().getWorkEndTime().toString() + ":00"; |
| | | } |
| | | // 查询其他表是否存在重叠时间(工作流) |
| | | flowableOtherTableValidation(leaveStartTime, leaveEndTime, resources.getUserId()); |
| | | // 查询本表是否存在重叠时间(工作流) |
| | | flowableThisTableValidation(leaveStartTime, leaveEndTime, resources.getUserId()); |
| | | // 查询流表是否存在重叠时间(工作流) |
| | | flowableTableValidation(leaveStartTime, leaveEndTime, resourcesList); |
| | | } |
| | | |
| | | /** |
| | | * 查询其他表是否存在重叠时间(工作流) |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param userId |
| | | */ |
| | | private void flowableOtherTableValidation(String startTime, String endTime, Long userId) { |
| | | // 查询外出表 |
| | | List<AttendanceGoOut> attendanceGoOutList = attendanceGoOutRepository.checkCreateTime(startTime, endTime, userId); |
| | | if (attendanceGoOutList.size() > 0) { |
| | | AttendanceGoOut errorSysAskForLeave = attendanceGoOutList.get(0); |
| | | SimpleDateFormat errorFormat = new SimpleDateFormat("yyyy年MM月dd日"); |
| | | throw new BadRequestException("外出时间冲突," + errorFormat.format(errorSysAskForLeave.getOutStartTime()) + "至" + errorFormat.format(errorSysAskForLeave.getOutEndTime()) |
| | | + "已经存在外出记录,请调整时间"); |
| | | } |
| | | // 查询出差表 |
| | | List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.checkCreateTime(startTime.substring(0,10),endTime.substring(0,10), userId); |
| | | if (attendanceBusinessTravelList.size() > 0) { |
| | | AttendanceBusinessTravel errorSysAskForLeave = attendanceBusinessTravelList.get(0); |
| | | SimpleDateFormat errorFormat = new SimpleDateFormat("yyyy年MM月dd日"); |
| | | throw new BadRequestException("出差时间冲突," + errorFormat.format(errorSysAskForLeave.getTravelStartTime()) + "至" + errorFormat.format(errorSysAskForLeave.getTravelEndTime()) |
| | | + "已经存在出差记录,请调整时间"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询本表是否存在重叠时间(工作流) |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param userId |
| | | */ |
| | | private void flowableThisTableValidation(String startTime, String endTime, Long userId) { |
| | | // 查询与请假表时间范围是否存在重复 |
| | | List<AttendanceLeave> attendanceLeaveList = attendanceLeaveRepository.checkCreateLeaveTime(startTime, endTime, userId); |
| | | // 判断请假记录数量 |
| | | if (attendanceLeaveList.size() > 0) { |
| | | // 请假记录 |
| | | AttendanceLeave attendanceLeave = attendanceLeaveList.get(0); |
| | | // 请假开始时间 |
| | | LocalDateTime startLocalDateTime = attendanceLeave.getLeaveStartTime().toLocalDateTime(); |
| | | ZonedDateTime startZonedDateTime = startLocalDateTime.atZone(ZoneId.systemDefault()); |
| | | Instant startInstant = startZonedDateTime.toInstant(); |
| | | Date startDate = Date.from(startInstant); |
| | | // 请假结束时间 |
| | | LocalDateTime endLocalDateTime = attendanceLeave.getLeaveEndTime().toLocalDateTime(); |
| | | ZonedDateTime endZonedDateTime = endLocalDateTime.atZone(ZoneId.systemDefault()); |
| | | Instant endInstant = endZonedDateTime.toInstant(); |
| | | Date endDate = Date.from(endInstant); |
| | | // 日期格式化 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // 错误信息 |
| | | throw new BadRequestException("请假时间冲突," + sdf.format(startDate) + "至" + sdf.format(endDate) + "已经存在请假记录,请调整时间"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询流表是否存在重叠时间(工作流) |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param resources |
| | | */ |
| | | private void flowableTableValidation(String startTime, String endTime, List<AttendanceLeaveDto> resources) { |
| | | // 循环结果集 |
| | | for (AttendanceLeaveDto attendanceLeaveDto : resources) { |
| | | // 判断结果是否符合 |
| | | if ( |
| | | (attendanceLeaveDto.getLeaveStartTime().getTime() >= Timestamp.valueOf(startTime).getTime() && attendanceLeaveDto.getLeaveStartTime().getTime() <= Timestamp.valueOf(endTime).getTime()) || |
| | | (attendanceLeaveDto.getLeaveStartTime().getTime() <= Timestamp.valueOf(startTime).getTime() && attendanceLeaveDto.getLeaveEndTime().getTime() >= Timestamp.valueOf(endTime).getTime()) || |
| | | (attendanceLeaveDto.getLeaveEndTime().getTime() >= Timestamp.valueOf(startTime).getTime() && attendanceLeaveDto.getLeaveEndTime().getTime() <= Timestamp.valueOf(endTime).getTime()) || |
| | | (attendanceLeaveDto.getLeaveStartTime().getTime() >= Timestamp.valueOf(startTime).getTime() && attendanceLeaveDto.getLeaveEndTime().getTime() <= Timestamp.valueOf(endTime).getTime()) |
| | | ) { |
| | | // 请假开始时间 |
| | | LocalDateTime startLocalDateTime = attendanceLeaveDto.getLeaveStartTime().toLocalDateTime(); |
| | | ZonedDateTime startZonedDateTime = startLocalDateTime.atZone(ZoneId.systemDefault()); |
| | | Instant startInstant = startZonedDateTime.toInstant(); |
| | | Date startDate = Date.from(startInstant); |
| | | // 请假结束时间 |
| | | LocalDateTime endLocalDateTime = attendanceLeaveDto.getLeaveEndTime().toLocalDateTime(); |
| | | ZonedDateTime endZonedDateTime = endLocalDateTime.atZone(ZoneId.systemDefault()); |
| | | Instant endInstant = endZonedDateTime.toInstant(); |
| | | Date endDate = Date.from(endInstant); |
| | | // 日期格式化 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // 错误信息 |
| | | throw new BadRequestException("请假时间冲突," + sdf.format(startDate) + "至" + sdf.format(endDate) + "已经存在请假记录,请调整时间"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增(工作流) |
| | | * @param resources |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void flowableCreate(AttendanceLeave resources) throws Exception { |
| | | // 日期格式化 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // 请假开始时间 |
| | | String leaveStartTime = sdf.format(resources.getLeaveStartTime()); |
| | | // 请假结束时间 |
| | | String leaveEndTime = sdf.format(resources.getLeaveEndTime()); |
| | | // 获取当前登陆人信息,设置为请假发起人 |
| | | User user = userRepository.getById(resources.getUserId()); |
| | | List<String> holiday = new ArrayList<>(), isWork = new ArrayList<>(); |
| | | // 查询节假日 |
| | | List<SysConfigHoliday> sysConfigHolidayList = sysConfigHolidayRepository.findAll(); |
| | | // 循环节假日 |
| | | for (SysConfigHoliday sysConfigHoliday : sysConfigHolidayList) { |
| | | // 判断节假日类型 |
| | | if (sysConfigHoliday.getDateType().equals(Constant.DATE_TYPE_WEEKDAY)) { |
| | | // 工作日 |
| | | isWork.add(sysConfigHoliday.getHolidayDate().toString().substring(0,10)); |
| | | } else { |
| | | // 节假日 |
| | | holiday.add(sysConfigHoliday.getHolidayDate().toString().substring(0,10)); |
| | | } |
| | | } |
| | | // 获取两个日期之间的所有日期 |
| | | List<String> dateList = getBetweenDate(resources.getLeaveStartTime().toLocalDateTime().toString(), resources.getLeaveEndTime().toLocalDateTime().toString()); |
| | | // 循环参数 |
| | | int i = 0; |
| | | // 循环所有日期 |
| | | for (String date : dateList) { |
| | | // 当前日期 |
| | | LocalDate localDate = LocalDate.parse(date); |
| | | // 是否周末 |
| | | Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY; |
| | | // 不是周末并且节假日表中不存在在创建 |
| | | if ((!isWeekend && !holiday.contains(date)) || (isWeekend && isWork.contains(date))) { |
| | | // 添加多条记录 |
| | | AttendanceLeave attendanceLeave = getAttendanceLeave(resources, date, user, i, leaveStartTime, leaveEndTime,null); |
| | | // 循环参数 |
| | | i++; |
| | | // 保存 |
| | | attendanceLeaveRepository.save(attendanceLeave); |
| | | } |
| | | } |
| | | // 发送钉钉给审批人 |
| | | List<String> sendList = new ArrayList<>(); |
| | | // 查询审批者信息 |
| | | User appUser = userRepository.getById(resources.getApprovalUserId()); |
| | | sendList.add(appUser.getDingding()); |
| | | opaiDingTalkService.sendNotice(sendList, "审批提醒", "### 审批提示 \n >" + user.getNickName() + " 提交了请假审批,请登录PMS系统处理", "card"); |
| | | } |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!--工具栏--> |
| | | <div class="head-container"> |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column prop="userName" label="申请员工" /> |
| | | <el-table-column prop="appUserName" label="审批员工" /> |
| | | <el-table-column prop="leaveType" label="请假类型"> |
| | | <template slot-scope="scope"> |
| | | {{ dict.label[leaveType][scope.row.leaveType] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="leaveStartTime" label="请假开始时间"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.leaveDurationUnit === leaveTimeTypeHour ? scope.row.leaveStartTime : crud.toDate(scope.row.leaveStartTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="leaveEndTime" label="请假结束时间"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.leaveDurationUnit === leaveTimeTypeHour ? scope.row.leaveEndTime : crud.toDate(scope.row.leaveEndTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="leaveDuration" label="请假时长"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.leaveDuration }}{{ dict.label[leaveTimeType][scope.row.leaveDurationUnit] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="leaveReason" label="请假原因" /> |
| | | <el-table-column prop="approvalStatus" label="审批状态"> |
| | | <template slot-scope="scope"> |
| | | {{ dict.label[approvalStatus][scope.row.approvalStatus] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" /> |
| | | <el-table-column v-if="checkPer(['admin','attendanceLeaveFlowable:agree','attendanceLeaveFlowable:reject'])" label="操作" width="150px" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-popover |
| | | :ref="`agree_${scope.row.processInstanceId}`" |
| | | v-permission="permission.agree" |
| | | width="200" |
| | | placement="top" |
| | | > |
| | | <p>您确定同意这条申请吗?</p> |
| | | <div style="text-align: right; margin: 0"> |
| | | <el-button size="mini" type="text" @click="canelAgree(scope.row)">取消</el-button> |
| | | <el-button size="mini" type="primary" :loading="agreeLoading" @click="toAgree(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button slot="reference" size="mini" type="success" icon="el-icon-check" /> |
| | | </el-popover> |
| | | <el-popover |
| | | :ref="`reject_${scope.row.processInstanceId}`" |
| | | v-permission="permission.reject" |
| | | width="200" |
| | | placement="top" |
| | | > |
| | | <p>您确定拒绝这条申请吗?</p> |
| | | <div style="text-align: right; margin: 0"> |
| | | <el-button size="mini" type="text" @click="canelReject(scope.row)">取消</el-button> |
| | | <el-button size="mini" type="primary" :loading="rejectLoading" @click="toReject(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button slot="reference" size="mini" type="danger" icon="el-icon-close" /> |
| | | </el-popover> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import crudAttendanceLeaveFlowable from '@/api/attendance/attendanceLeaveFlowable' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import pagination from '@crud/Pagination' |
| | | import constant from '@/utils/constant' |
| | | import { mapGetters } from 'vuex' |
| | | |
| | | const defaultForm = { id: null, userId: null, approvalUserId: null, leaveType: null, leaveStartTime: null, leaveEndTime: null, leaveDuration: null, leaveReason: null, approvalStatus: constant.APPROVAL_STATUS_UNDER_APPROVAL, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, leaveDurationUnit: constant.LEAVE_TIME_TYPE_DAY } |
| | | export default { |
| | | name: 'AttendanceLeaveReport', |
| | | components: { pagination }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.LEAVE_TYPE, constant.APPROVAL_STATUS, constant.LEAVE_TIME_TYPE], |
| | | cruds() { |
| | | return CRUD({ title: '请假记录', url: 'api/attendanceLeaveFlowable/approve', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceLeaveFlowable }}) |
| | | }, |
| | | data() { |
| | | return { |
| | | permission: { |
| | | agree: ['admin', 'attendanceLeaveFlowable:agree'], |
| | | reject: ['admin', 'attendanceLeaveFlowable:reject'] |
| | | }, |
| | | // 字典:请假状态 |
| | | leaveType: constant.LEAVE_TYPE, |
| | | // 字典:请假审批状态 |
| | | approvalStatus: constant.APPROVAL_STATUS, |
| | | // 字典:请假时间单位 |
| | | leaveTimeType: constant.LEAVE_TIME_TYPE, |
| | | // 字典:请假时间单位:小时 |
| | | leaveTimeTypeHour: constant.LEAVE_TIME_TYPE_HOUR, |
| | | // 同意按钮加载状态 |
| | | agreeLoading: false, |
| | | // 拒绝按钮加载状态 |
| | | rejectLoading: false |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'baseApi' |
| | | ]) |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | return true |
| | | }, |
| | | // 同意 |
| | | toAgree(data) { |
| | | // 同意按钮加载状态 |
| | | this.agreeLoading = true |
| | | // 同意 |
| | | crudAttendanceLeaveFlowable.agree(data.processInstanceId).then(res => { |
| | | // 关闭弹出框 |
| | | this.$refs[`agree_${data.processInstanceId}`].showPopper = false |
| | | // 查询 |
| | | this.crud.toQuery() |
| | | }).finally(() => { |
| | | // 同意按钮加载状态 |
| | | this.agreeLoading = false |
| | | }) |
| | | }, |
| | | canelAgree(data) { |
| | | // 关闭弹出框 |
| | | this.$refs[`agree_${data.processInstanceId}`].showPopper = false |
| | | }, |
| | | // 拒接 |
| | | toReject(data) { |
| | | // 拒绝按钮加载状态 |
| | | this.rejectLoading = true |
| | | // 拒绝 |
| | | crudAttendanceLeaveFlowable.reject(data.processInstanceId).then(res => { |
| | | // 关闭弹出框 |
| | | this.$refs[`reject_${data.processInstanceId}`].showPopper = false |
| | | // 查询 |
| | | this.crud.toQuery() |
| | | }).finally(() => { |
| | | // 拒绝按钮加载状态 |
| | | this.rejectLoading = false |
| | | }) |
| | | }, |
| | | canelReject(data) { |
| | | // 关闭弹出框 |
| | | this.$refs[`reject_${data.processInstanceId}`].showPopper = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="leaveReason" label="请假原因" /> |
| | | <el-table-column prop="approvalStatus" label="审批状态"> |
| | | <el-table-column prop="approve" label="审批状态"> |
| | | <template slot-scope="scope"> |
| | | {{ dict.label[approvalStatus][scope.row.approvalStatus] }} |
| | | {{ scope.row.approve == 'true' ? '同意' : scope.row.approve == 'false' ? '拒绝' : '审核中' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" /> |
| | | <el-table-column v-if="checkPer(['admin','attendanceLeaveFlowable:edit','attendanceLeaveFlowable:del'])" label="操作" width="150px" align="center"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | |
| | | import crudAttendanceLeaveFlowable from '@/api/attendance/attendanceLeaveFlowable' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import constant from '@/utils/constant' |
| | | import { mapGetters } from 'vuex' |
| | |
| | | const defaultForm = { id: null, userId: null, approvalUserId: null, leaveType: null, leaveStartTime: null, leaveEndTime: null, leaveDuration: null, leaveReason: null, approvalStatus: constant.APPROVAL_STATUS_UNDER_APPROVAL, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, leaveDurationUnit: constant.LEAVE_TIME_TYPE_DAY } |
| | | export default { |
| | | name: 'AttendanceLeaveReport', |
| | | components: { pagination, crudOperation, udOperation }, |
| | | components: { pagination, crudOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.LEAVE_TYPE, constant.APPROVAL_STATUS, constant.LEAVE_TIME_TYPE], |
| | | cruds() { |
| | |
| | | leaveTypeAnnualLeave: constant.LEAVE_TYPE_ANNUAL_LEAVE, |
| | | // 字典:请假状态:事假 |
| | | leaveTypeCompassionateLeave: constant.LEAVE_TYPE_COMPASSIONATE_LEAVE, |
| | | // 字典:请假审批状态 |
| | | approvalStatus: constant.APPROVAL_STATUS, |
| | | // 字典:请假时间单位 |
| | | leaveTimeType: constant.LEAVE_TIME_TYPE, |
| | | // 字典:请假时间单位:小时 |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" /> |
| | | <el-table-column prop="createTime" label="审批状态"> |
| | | <el-table-column prop="approve" label="审批状态"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.approve == 'true' ? '同意' : scope.row.approve == 'false' ? '拒绝' : '审核中' }} |
| | | </template> |