1 files added
29 files modified
| New file |
| | |
| | | package me.zhengjie.modules.attendance.domain; |
| | | |
| | | public class AgreeUpdateRequest { |
| | | |
| | | private Long num; |
| | | private Long[] ids; |
| | | |
| | | public Long getNum() { |
| | | return this.num; |
| | | } |
| | | |
| | | public void setNum(Long num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public Long[] getIds() { |
| | | return this.ids; |
| | | } |
| | | |
| | | public void setIds(Long[] ids) { |
| | | this.ids = ids; |
| | | } |
| | | |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | |
| | | attendanceBusinessTravelService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | @PreAuthorize("@el.check('attendanceBusinessTravel:updateAgree')") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request) throws Exception { |
| | | attendanceBusinessTravelService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.service.AttendanceCardreplacementService; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceCardreplacementQueryCriteria; |
| | |
| | | attendanceCardreplacementService.cardRevoke(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | @PreAuthorize("@el.check('attendanceCardreplacement:updateAgree')") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request){ |
| | | attendanceCardreplacementService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | } |
| | |
| | | @PostMapping(value = "/addAttendanceInfo") |
| | | @Log("考勤信息补充") |
| | | @ApiOperation("考勤信息补充") |
| | | @PreAuthorize("@el.check('attendance:addAttendanceInfo')") |
| | | public ResponseEntity<Object> addAttendanceInfo(@Validated @RequestBody Attendance attendance) throws Exception { |
| | | attendanceService.addAttendanceInfo(attendance); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | |
| | | attendanceGoOutService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | @PreAuthorize("@el.check('attendanceGoOut:updateAgree')") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request) throws Exception { |
| | | attendanceGoOutService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.AttendanceLeaveService; |
| | |
| | | attendanceLeaveService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | @PreAuthorize("@el.check('attendanceLeave:updateAgree')") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request) throws Exception { |
| | | attendanceLeaveService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceBusinessTravelDto; |
| | |
| | | */ |
| | | void updateApprove(AttendanceBusinessTravel resources) throws Exception; |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request) throws Exception; |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceCardreplacementDto; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceCardreplacementQueryCriteria; |
| | |
| | | * @param resources |
| | | */ |
| | | void cardRevoke(AttendanceCardreplacement resources); |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request); |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceGoOutDto; |
| | |
| | | * @param resources / |
| | | */ |
| | | void updateApprove(AttendanceGoOut resources) throws Exception; |
| | | |
| | | /** |
| | | * 批量审核(外出) |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request) throws Exception; |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceLeaveDto; |
| | |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<AttendanceLeaveDto> all, HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request) throws Exception; |
| | | } |
| | |
| | | String attendanceDate = df.format(attendanceBusinessTravel.getTravelStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate, userList); |
| | | } |
| | | |
| | | /** |
| | | * 批量审核(出差) |
| | | * @param request |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) throws Exception { |
| | | for(Long id : request.getIds()) { |
| | | AttendanceBusinessTravel attendanceBusinessTravel = attendanceBusinessTravelRepository.findById(id).orElseGet(AttendanceBusinessTravel::new); |
| | | ValidationUtil.isNull( attendanceBusinessTravel.getId(),"AttendanceBusinessTravel","id",id); |
| | | if (request.getNum().equals(Long.valueOf(1))){ |
| | | attendanceBusinessTravel.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_AGREE); |
| | | } else { |
| | | attendanceBusinessTravel.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_REFUSE); |
| | | } |
| | | attendanceBusinessTravelRepository.save(attendanceBusinessTravel); |
| | | // 调用定时任务修改考勤记录 |
| | | List<User> userList = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(attendanceBusinessTravel.getUserId())){ |
| | | User user = userRepository.findById(attendanceBusinessTravel.getUserId()).orElseGet(User::new); |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceBusinessTravel.getTravelStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.service.impl; |
| | | |
| | | import me.zhengjie.exception.BadRequestException; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.Attendance; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.repository.AttendanceRepository; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 补卡批量审核 |
| | | * @param |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) { |
| | | // 循环ID列表 |
| | | for (Long id : request.getIds()) { |
| | | AttendanceCardreplacement AttendanceCardreplacement = attendanceCardreplacementRepository.findById(id).orElseGet(AttendanceCardreplacement::new); |
| | | ValidationUtil.isNull(AttendanceCardreplacement.getId(), "AttendanceCardreplacement", "id", id); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String attDate = sdf.format(AttendanceCardreplacement.getCardReplacementTime()); |
| | | // 根据userId和日期查询考勤记录表 |
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(AttendanceCardreplacement.getUserId(), attDate.substring(0, 10)); |
| | | // 判断是上班补卡还是下班补卡 |
| | | if (AttendanceCardreplacement.getCardReplacementDistinguish().equals(Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON)) { |
| | | // 通过 |
| | | if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(1))) { |
| | | // set考勤打卡时间和打卡状态 |
| | | attendance.setActualWorkStartTime(AttendanceCardreplacement.getCardReplacementTime()); |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NORMAL); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_AGREE); |
| | | }else if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(2))){ |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NOTSIGNED); |
| | | attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NOTSIGNED); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_REFUSE); |
| | | } |
| | | } else { |
| | | // 通过 |
| | | if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(1))) { |
| | | // set考勤打卡时间和打卡状态 |
| | | attendance.setActualWorkEndTime(AttendanceCardreplacement.getCardReplacementTime()); |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NORMAL); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_AGREE); |
| | | }else if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(2))){ |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NOTSIGNED); |
| | | attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NOTSIGNED); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_REFUSE); |
| | | } |
| | | } |
| | | attendanceRepository.save(attendance); |
| | | attendanceCardreplacementRepository.save(AttendanceCardreplacement); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 补卡撤销 |
| | | * @param resources |
| | | */ |
| | |
| | | String attendanceDate = df.format(attendanceGoOut.getOutStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | |
| | | /** |
| | | * 批量审核(外出) |
| | | * @param request |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) throws Exception { |
| | | for (Long id : request.getIds()) { |
| | | AttendanceGoOut attendanceGoOut = attendanceGoOutRepository.findById(id).orElseGet(AttendanceGoOut::new); |
| | | ValidationUtil.isNull( attendanceGoOut.getId(),"AttendanceGoOut","id",id); |
| | | if (request.getNum().equals(Long.valueOf(1))){ |
| | | attendanceGoOut.setApprovalStatus(Constant.GOOUT_APPROVE_STATUS_AGREE); |
| | | } else { |
| | | attendanceGoOut.setApprovalStatus(Constant.GOOUT_APPROVE_STATUS_REFUSE); |
| | | } |
| | | attendanceGoOutRepository.save(attendanceGoOut); |
| | | // 调用定时任务修改考勤记录 |
| | | List<User> userList = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(attendanceGoOut.getUserId())){ |
| | | User user = userRepository.findById(attendanceGoOut.getUserId()).orElseGet(User::new); |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceGoOut.getOutStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param request |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) throws Exception { |
| | | // 循环ID列表 |
| | | for (Long id : request.getIds()) { |
| | | AttendanceLeave attendanceLeave = attendanceLeaveRepository.findById(id).orElseGet(AttendanceLeave::new); |
| | | ValidationUtil.isNull( attendanceLeave.getId(),"AttendanceLeave","id",id); |
| | | if (request.getNum().equals(Long.valueOf(1))) { |
| | | attendanceLeave.setApprovalStatus(Constant.APPROVAL_STATUS_PASSED); |
| | | } else { |
| | | attendanceLeave.setApprovalStatus(Constant.APPROVAL_STATUS_RETURNED); |
| | | } |
| | | attendanceLeaveRepository.save(attendanceLeave); |
| | | // 调用定时任务修改考勤记录 |
| | | List<User> userList = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(attendanceLeave.getUserId())){ |
| | | User user = userRepository.findById(attendanceLeave.getUserId()).orElseGet(User::new); |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceLeave.getLeaveStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<AttendanceLeaveDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | |
| | | // 判断循环是否结束 |
| | | if (i == sysConfigIndividualIncomeTaxDtoList.size() - 1) { |
| | | // 个人所得税 |
| | | newSalary.setIndividualIncomeTax(taxAmount); |
| | | // newSalary.setIndividualIncomeTax(taxAmount); |
| | | newSalary.setIndividualIncomeTax(new BigDecimal(0)); |
| | | // 税后金额 |
| | | newSalary.setAfterTaxAmount(taxableAmount.subtract(taxAmount).compareTo(new BigDecimal(0)) == -1 ? new BigDecimal(0) : taxableAmount.subtract(taxAmount)); |
| | | } |
| | |
| | | // 判断循环是否结束 |
| | | if (i == sysConfigIndividualIncomeTaxDtoList.size() - 1) { |
| | | // 个人所得税 |
| | | salary.setIndividualIncomeTax(taxAmount); |
| | | // salary.setIndividualIncomeTax(taxAmount); |
| | | salary.setIndividualIncomeTax(new BigDecimal(0)); |
| | | // 税后金额 |
| | | salary.setAfterTaxAmount(taxableAmount.subtract(taxAmount).compareTo(new BigDecimal(0)) == -1 ? new BigDecimal(0) : taxableAmount.subtract(taxAmount)); |
| | | } |
| | |
| | | |
| | | @Query(value = "select dept_id from sys_user where user_id = ?1",nativeQuery = true) |
| | | Long findDeptIdByUserId(Long userId); |
| | | |
| | | /** |
| | | * 查询部门 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT u.* FROM sys_user u JOIN sys_dept d ON u.dept_id = d.dept_id WHERE d.dept_id = ?;", nativeQuery = true) |
| | | List<User> findByDeptId(Long dept_id); |
| | | |
| | | /** |
| | | * 查询用户 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM sys_user WHERE user_id = ?;", nativeQuery = true) |
| | | List<User> findByUserId(Long user_id); |
| | | } |
| | |
| | | return new ResponseEntity<>(userService.getPerformanceDetail(nextMonth),HttpStatus.OK); |
| | | |
| | | } |
| | | |
| | | @GetMapping(value = "/getUserInfose") |
| | | @Log("查询用户信息") |
| | | @ApiOperation("查询用户信息") |
| | | public ResponseEntity<Object> getUserInfos() { |
| | | return new ResponseEntity<>(userService.getUserInfose(), HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | Long[] getUserPidDept(Long id); |
| | | |
| | | List<Map> getPerformanceDetail(Long nextMonth); |
| | | |
| | | /** |
| | | * 查询用户 |
| | | */ |
| | | List<User> getUserInfose(); |
| | | } |
| | |
| | | return resultList; |
| | | } |
| | | |
| | | @Override |
| | | public List<User> getUserInfose() { |
| | | List<User> userList = new ArrayList<>(); |
| | | //获取当前登入人信息 |
| | | User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); |
| | | Role role = user1.getRoles().iterator().next(); |
| | | //超管、总经理,痛苦哦经理查看全部 |
| | | if(Long.valueOf(role.getLevel()) == Constant.ROLE_LEVEL_SUPER || Long.valueOf(role.getLevel()) == Constant.ROLE_LEVEL_GENERAL){ |
| | | userList = userRepository.findAllByEnabled(true); |
| | | } else { |
| | | userList = userRepository.findByUserId(user1.getId()); |
| | | } |
| | | return userList; |
| | | } |
| | | |
| | | /* |
| | | 方法作用: |
| | | 遍历resultList 集合将集合中的元素逐个遍历,如果有元素与当前任务的任务名称相等 |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceBusinessTravel/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, revoke, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceCardreplacement/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, revoke, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceGoOut/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, calcTimeLength, getYearTimeLength, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceLeave/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, calcTimeLength, getYearTimeLength, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, get, getApprovalUsers, getUserCalendarInfo, getUserBaseInfo, getByDept, getProjectUser, getUserDept, getUserPidDept, getPerformanceDetail } |
| | | export function getUserInfose() { |
| | | return request({ |
| | | url: 'api/users/getUserInfose/', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, get, getApprovalUsers, getUserCalendarInfo, getUserBaseInfo, getByDept, getProjectUser, getUserDept, getUserPidDept, getPerformanceDetail, getUserInfose } |
| | |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.addAttendanceInfo" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="attform.userId" filterable clearable placeholder="请选择" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in users1" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | dictStartEarly: constant.ATTENDANCE_STATE_EARLY, |
| | | dictStartLate: constant.ATTENDANCE_STATE_LATE, |
| | | users: [], |
| | | users1: [], |
| | | approvalUsers: [], |
| | | makeUpCardVisible: false, |
| | | makeUpCardLoading: false, |
| | |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | this.getUsers() |
| | | this.getUsers1() |
| | | this.getApprovalUsers() |
| | | return true |
| | | }, |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询员工 |
| | | getUsers1() { |
| | | crudUser.getUserInfose().then(res => { |
| | | this.users1 = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px"> |
| | |
| | | edit: ['admin', 'attendanceBusinessTravel:edit'], |
| | | del: ['admin', 'attendanceBusinessTravel:del'], |
| | | download: ['admin', 'attendanceBusinessTravel:download'], |
| | | approve: ['admin', 'attendanceBusinessTravel:approve'] |
| | | approve: ['admin', 'attendanceBusinessTravel:approve'], |
| | | updateAgree: ['admin', 'attendanceBusinessTravel:updateAgree'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceBusinessTravel.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 撤消功能 |
| | | revoke(data) { |
| | | this.toApprove(data, '1') |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.updateAgree" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictCardApproveStatusReviewed)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.updateAgree" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictCardApproveStatusReviewed)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> |
| | |
| | | edit: ['admin', 'attendanceCardreplacement:edit'], |
| | | del: ['admin', 'attendanceCardreplacement:del'], |
| | | download: ['admin', 'attendanceCardreplacement:download'], |
| | | approve: ['admin', 'attendanceCardreplacement:approve'] |
| | | approve: ['admin', 'attendanceCardreplacement:approve'], |
| | | updateAgree: ['admin', 'attendanceCardreplacement:updateAgree'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | this.form.cardReplacementReason = data.cardReplacementReason |
| | | this.form.cardReplacementDistinguish = data.cardReplacementDistinguish |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceCardreplacement.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审核功能 |
| | | approveFunction(Number, data) { |
| | | this.form.userId = data.userId |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.updateAgree" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.updateAgree" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px"> |
| | |
| | | edit: ['admin', 'attendanceGoOut:edit'], |
| | | del: ['admin', 'attendanceGoOut:del'], |
| | | download: ['admin', 'attendanceGoOut:download'], |
| | | approve: ['admin', 'attendanceGoOut:approve'] |
| | | approve: ['admin', 'attendanceGoOut:approve'], |
| | | updateAgree: ['admin', 'attendanceGoOut:updateAgree'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | this.form.outDuration = res |
| | | }) |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceGoOut.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审批页面赋值 |
| | | toApprove(data, Number) { |
| | | if (Number !== '1') { |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.updateAgree" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictAppRovalStatusUnderAppover)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.updateAgree" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictAppRovalStatusUnderAppover)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px"> |
| | |
| | | icon="el-icon-edit-outline" |
| | | size="mini" |
| | | :disabled="scope.row.approvalStatus === dictAppRovalStatusUnderAppover ? true : false" |
| | | >撤销{{ scope.row.id }} |
| | | >撤销 |
| | | </el-button> |
| | | </el-popover> |
| | | </template> |
| | |
| | | edit: ['admin', 'attendanceLeave:edit'], |
| | | del: ['admin', 'attendanceLeave:del'], |
| | | download: ['admin', 'attendanceLeave:download'], |
| | | approve: ['admin', 'attendanceLeave:approve'] |
| | | approve: ['admin', 'attendanceLeave:approve'], |
| | | updateAgree: ['admin', 'attendanceLeave:updateAgree'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | this.form.leaveReason = data.leaveReason |
| | | this.form.remarks = data.remarks |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceLeave.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审核提交功能 |
| | | approveFunction(Number, data) { |
| | | this.form.userId = data.userId |