| | |
| | | @PutMapping(value = "/approve") |
| | | @Log("审核/撤销功能") |
| | | @ApiOperation("审核/撤销功能") |
| | | @PreAuthorize("@el.check('attendanceBusinessTravel:approve')") |
| | | public ResponseEntity<Object> checkApprove(@Validated @RequestBody AttendanceBusinessTravel resources) throws Exception { |
| | | attendanceBusinessTravelService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | |
| | | @PutMapping(value = "/approve") |
| | | @Log("审核功能") |
| | | @ApiOperation("审核功能") |
| | | @PreAuthorize("@el.check('attendanceCardreplacement:approve')") |
| | | public ResponseEntity<Object> checkApprove(@Validated @RequestBody AttendanceCardreplacement resources){ |
| | | attendanceCardreplacementService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | |
| | | @PutMapping(value = "/revoke") |
| | | @Log("补卡撤销") |
| | | @ApiOperation("补卡撤销") |
| | | @PreAuthorize("@el.check('attendanceCardreplacement:revoke')") |
| | | public ResponseEntity<Object> checkInApplicationPass(@Validated @RequestBody AttendanceCardreplacement resources){ |
| | | attendanceCardreplacementService.cardRevoke(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | |
| | | return new ResponseEntity<>(attendanceService.queryAttendanceHours(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping(value = "/getExceptional") |
| | | @Log("获取异常") |
| | | @ApiOperation("获取异常") |
| | | public ResponseEntity<Object> getExceptional(@Validated @RequestBody String Number){ |
| | | attendanceService.getExceptional(Number); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PostMapping(value = "/getUserMakeUpCard") |
| | | @Log("补卡判断登录人") |
| | | @ApiOperation("补卡判断登录人") |
| | |
| | | } |
| | | |
| | | @PutMapping(value = "/approve") |
| | | @Log("审核功能") |
| | | @ApiOperation("审核功能") |
| | | @Log("审核/撤销功能") |
| | | @ApiOperation("审核/撤销功能") |
| | | @PreAuthorize("@el.check('attendanceGoOut:approve')") |
| | | public ResponseEntity<Object> checkApprove(@Validated @RequestBody AttendanceGoOut resources) throws Exception { |
| | | attendanceGoOutService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | |
| | | @PutMapping(value = "/approve") |
| | | @Log("审核功能") |
| | | @ApiOperation("审核功能") |
| | | @PreAuthorize("@el.check('attendanceLeave:approve')") |
| | | public ResponseEntity<Object> checkApprove(@Validated @RequestBody AttendanceLeave resources) throws Exception { |
| | | attendanceLeaveService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | |
| | | */ |
| | | Double queryAttendanceHours(AttendanceQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 获取异常信息 |
| | | * @param Number |
| | | */ |
| | | void getExceptional(String Number); |
| | | |
| | | void getUserMakeUpCard(String userId); |
| | | |
| | |
| | | String bussStartTime = df.format(resources.getTravelStartTime()); |
| | | String bussEndTime = df.format(resources.getTravelEndTime()); |
| | | // 查询其他状态的表是否有重复 |
| | | repeatValidation(bussStartTime, bussEndTime, resources.getUserId()); |
| | | repeatValidation(bussStartTime, bussEndTime, resources.getUserId() == null ? SecurityUtils.getCurrentUserId() : resources.getUserId()); |
| | | // 验证出差时间是否冲突 |
| | | List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.checkCreateTime(bussStartTime,bussEndTime, resources.getUserId()); |
| | | if(attendanceBusinessTravelList.size() > 0){ |
| | |
| | | + "已经存在出差记录,请调整时间"); |
| | | }else { |
| | | // 获取当前登陆人信息,设置为请假发起人 |
| | | User user = userRepository.getOne(resources.getUserId()); |
| | | User user = userRepository.getOne(resources.getUserId() == null ? SecurityUtils.getCurrentUserId() : resources.getUserId()); |
| | | List<String> holiday = new ArrayList<>(), isWork = new ArrayList<>(); |
| | | // 查询节假日 |
| | | List<SysConfigHoliday> sysConfigHolidayList = sysConfigHolidayRepository.findAll(); |
| | |
| | | String goStartTime = df.format(resources.getOutStartTime()); |
| | | String goEndTime = df.format(resources.getOutEndTime()); |
| | | // 查询其他状态的表是否有重复 |
| | | repeatValidation(goStartTime, goEndTime, resources.getUserId()); |
| | | repeatValidation(goStartTime, goEndTime, resources.getUserId() == null ? SecurityUtils.getCurrentUserId() : resources.getUserId()); |
| | | // 验证请假时间是否冲突 |
| | | List<AttendanceGoOut> attendanceGoOutList = attendanceGoOutRepository.checkCreateTime(goStartTime, goEndTime, resources.getUserId()); |
| | | if(attendanceGoOutList.size() > 0){ |
| | |
| | | + "已经存在外出记录,请调整时间"); |
| | | }else { |
| | | // 获取当前登陆人信息,设置为请假发起人 |
| | | User user = userRepository.getOne(resources.getUserId()); |
| | | User user = userRepository.getOne(resources.getUserId() == null ? SecurityUtils.getCurrentUserId() : resources.getUserId()); |
| | | List<String> holiday = new ArrayList<>(), isWork = new ArrayList<>(); |
| | | // 查询节假日 |
| | | List<SysConfigHoliday> sysConfigHolidayList = sysConfigHolidayRepository.findAll(); |
| | |
| | | import me.zhengjie.modules.attendance.repository.AttendanceLeaveRepository; |
| | | import me.zhengjie.modules.attendance.service.dto.*; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.project.domain.Project; |
| | | import me.zhengjie.modules.quartz.service.impl.DingTalkServiceImpl; |
| | | import me.zhengjie.modules.quartz.task.OapiDingTalkMethod; |
| | | import me.zhengjie.modules.system.domain.*; |
| | |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AttendanceDto create(Attendance resources) { |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss"); |
| | | // 查询用户 |
| | | User user = userRepository.findById(resources.getUserId()).orElseGet(User::new); |
| | | resources.setRosteringLunchStartTime(Timestamp.valueOf(df.format(resources.getAttendanceDate()) + " " + dateTimeFormatter.format(user.getSysRostering().getLunchStartTime()))); |
| | | resources.setRosteringLunchEndTime(Timestamp.valueOf(df.format(resources.getAttendanceDate()) + " " + dateTimeFormatter.format(user.getSysRostering().getLunchEndTime()))); |
| | | return attendanceMapper.toDto(attendanceRepository.save(resources)); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | attendanceRepository.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 补卡获取异常信息 |
| | | * @param Number |
| | | */ |
| | | @Override |
| | | public void getExceptional(String Number) { |
| | | if(Number.equals("1")){ |
| | | throw new BadRequestException("上班无需补卡"); |
| | | }else{ |
| | | throw new BadRequestException("下班无需补卡"); |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | export function getExceptional(data) { |
| | | return request({ |
| | | url: 'api/attendance/getExceptional', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function getUserMakeUpCard(data) { |
| | | return request({ |
| | | url: 'api/attendance/getUserMakeUpCard', |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, attendanceHours, getExceptional, getUserMakeUpCard, addAttendanceInfo } |
| | | export default { add, edit, del, getAll, attendanceHours, getUserMakeUpCard, addAttendanceInfo } |
| | |
| | | this.makeUpCardForm.cardReplacementDistinguish = this.dictCardReplacementGoOn |
| | | this.makeUpCardVisible = true |
| | | } else { |
| | | crudAttendance.getExceptional(Number).then(res => { |
| | | }) |
| | | this.crud.notify('上班无需补卡', CRUD.NOTIFICATION_TYPE.ERROR) |
| | | } |
| | | } |
| | | // 判断下班打卡状态,给提示 |
| | |
| | | this.makeUpCardForm.cardReplacementDistinguish = this.dictCardReplacementOffOn |
| | | this.makeUpCardVisible = true |
| | | } else { |
| | | crudAttendance.getExceptional(Number).then(res => { |
| | | }) |
| | | this.crud.notify('下班无需补卡', CRUD.NOTIFICATION_TYPE.ERROR) |
| | | } |
| | | } |
| | | }).catch(() => { |
| | |
| | | crudAttendanceCardreplacement.add(this.makeUpCardForm).then(res => { |
| | | this.makeUpCardVisible = false |
| | | this.makeUpCardLoading = false |
| | | this.crud.addSuccessNotify() |
| | | this.crud.notify('补卡提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | if (this.$refs['makeUpCardForm']) { |
| | | this.$refs['makeUpCardForm'].resetFields() |
| | | } |
| | | }).catch(() => { |
| | | this.makeUpCardVisible = true |
| | | this.makeUpCardLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | if (!valid) { |
| | | return |
| | | } |
| | | this.goOutVisible = true |
| | | this.goSuccessLoading = true |
| | | crudAttendanceGoOut.add(this.goOutForm).then(res => { |
| | | this.goOutVisible = false |
| | | this.goSuccessLoading = false |
| | | this.crud.addSuccessNotify() |
| | | this.crud.notify('外出提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | if (this.$refs['goOutForm']) { |
| | | this.$refs['goOutForm'].resetFields() |
| | | } |
| | | }).catch(() => { |
| | | this.goOutVisible = true |
| | | this.goSuccessLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | if (!valid) { |
| | | return |
| | | } |
| | | this.bussVisible = true |
| | | this.bussSuccessLoading = true |
| | | crudAttendanceBusinessTravel.add(this.bussForm).then(res => { |
| | | this.bussVisible = false |
| | | this.bussSuccessLoading = false |
| | | this.crud.addSuccessNotify() |
| | | this.crud.notify('出差提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | if (this.$refs['bussForm']) { |
| | | this.$refs['bussForm'].resetFields() |
| | | } |
| | | }).catch(() => { |
| | | this.bussVisible = true |
| | | this.bussSuccessLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | crudAttendance.addAttendanceInfo(data).then(res => { |
| | | this.attendVisible = false |
| | | this.attendLoading = false |
| | | this.crud.addSuccessNotify() |
| | | this.crud.notify('考勤信息提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | this.crud.toQuery() |
| | | if (this.$refs['attform']) { |
| | | this.$refs['attform'].resetFields() |
| | | } |
| | | }).catch(() => { |
| | | this.attendVisible = true |
| | | this.attendLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | <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"> |
| | | <el-form-item label="申请用户" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="userRolesLevelMin == roleLevelOrdinary"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="disabledUser(form)"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批用户" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择审批员工" style="width: 370px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择审批员工" style="width: 370px;" class="filter-item" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | return form.travelEndTime ? time.getTime() > new Date(form.travelEndTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" |
| | | @change="checkTime" |
| | | /> |
| | | </el-form-item> |
| | |
| | | return form.travelStartTime ? time.getTime() < new Date(form.travelStartTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" |
| | | @change="checkTime" |
| | | /> |
| | | </el-form-item> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="出差原因"> |
| | | <el-input v-model="form.travelReason" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.travelReason" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" /> |
| | | </el-form-item> |
| | | <el-form-item label="出发城市"> |
| | | <el-input v-model="form.departureCity" style="width: 370px;" /> |
| | | <el-input v-model="form.departureCity" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" /> |
| | | </el-form-item> |
| | | <el-form-item label="到达城市"> |
| | | <el-input v-model="form.arrivalCity" style="width: 370px;" /> |
| | | <el-input v-model="form.arrivalCity" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" /> |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | v-permission="permission.attendanceBusinessApp" |
| | | :loading="crud.status.cu === 2" |
| | | size="mini" |
| | | type="primary" |
| | |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | slot="reference" |
| | | v-permission="permission.attendanceBusinessApp" |
| | | type="danger" |
| | | icon="el-icon-edit-outline" |
| | | size="mini" |
| | |
| | | add: ['admin', 'attendanceBusinessTravel:add'], |
| | | edit: ['admin', 'attendanceBusinessTravel:edit'], |
| | | del: ['admin', 'attendanceBusinessTravel:del'], |
| | | download: ['admin', 'attendanceBusinessTravel:download'] |
| | | download: ['admin', 'attendanceBusinessTravel:download'], |
| | | attendanceBusinessApp: ['admin', 'attendanceBusinessTravel:approve'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | successLoading: false, |
| | | userRolesLevelMin: null, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY } |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // 角色级别: 总经理 |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 判断用户最大角色级别是否是角色级别:普通用户 |
| | | if (this.userRolesLevelMin === this.roleLevelOrdinary) { |
| | | // 判断用户最大角色级别是否大于总经理角色:赋值 |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | // 表单赋值 |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | return true |
| | | } |
| | | if (data.approvalStatus !== null && data.approvalStatus === this.dictGoOutAgree || data.approvalStatus === this.dictGoOutReturn) { |
| | | return true |
| | | } |
| | | }, |
| | | // 查询员工 |
| | | getUsers() { |
| | | crudUser.getAll().then(res => { |
| | |
| | | <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"> |
| | | <el-form-item label="申请用户" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="userRolesLevelMin == roleLevelOrdinary"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="disabledUser(form)"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批者" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" clearable filterable placeholder="请选择审批者" style="width: 370px;"> |
| | | <el-select v-model="form.approvalUserId" clearable filterable placeholder="请选择审批者" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | align="right" |
| | | default-time="09:00:00" |
| | | :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="补卡原因"> |
| | | <el-input v-model="form.cardReplacementReason" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.cardReplacementReason" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse" /> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.id !== null" label="审批状态" prop="approvalStatus"> |
| | | <el-select v-model="form.approvalStatus" style="width: 370px;"> |
| | | <el-select v-model="form.approvalStatus" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse"> |
| | | <el-option |
| | | v-for="item in dict[dictCardApproveStatus]" |
| | | :key="item.value" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="补卡区分" prop="cardReplacementDistinguish"> |
| | | <el-select v-model="form.cardReplacementDistinguish" style="width: 370px;"> |
| | | <el-select v-model="form.cardReplacementDistinguish" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse"> |
| | | <el-option |
| | | v-for="item in dict[dictCardReplacement]" |
| | | :key="item.value" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | v-permission="permission.attendanceCardreplacementApp" |
| | | :loading="crud.status.cu === 2" |
| | | size="mini" |
| | | type="primary" |
| | |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | slot="reference" |
| | | v-permission="permission.attendanceCardreplacemenRev" |
| | | type="danger" |
| | | icon="el-icon-edit-outline" |
| | | size="mini" |
| | |
| | | add: ['admin', 'attendanceCardreplacement:add'], |
| | | edit: ['admin', 'attendanceCardreplacement:edit'], |
| | | del: ['admin', 'attendanceCardreplacement:del'], |
| | | download: ['admin', 'attendanceCardreplacement:download'] |
| | | download: ['admin', 'attendanceCardreplacement:download'], |
| | | attendanceCardreplacementApp: ['admin', 'attendanceCardreplacement:approve'], |
| | | attendanceCardreplacemenRev: ['admin', 'attendanceCardreplacement:revoke'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | dictCardReplacement: constant.CARD_REPLACEMENT_DIFFERENTIATION, |
| | | userRolesLevelMin: null, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY } |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // 角色级别: 总经理 |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 判断用户最大角色级别是否是角色级别:普通用户 |
| | | if (this.userRolesLevelMin === this.roleLevelOrdinary) { |
| | | // 判断用户最大角色级别是否大于总经理角色:赋值 |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | // 表单赋值 |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | return true |
| | | } |
| | | if (data.approvalStatus !== null && data.approvalStatus === this.dictCardApproveStatusAgree || data.approvalStatus === this.dictCardApproveStatusRefuse) { |
| | | return true |
| | | } |
| | | }, |
| | | // 查询员工 |
| | | getUsers() { |
| | | crudUser.getAll().then(res => { |
| | |
| | | <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"> |
| | | <el-form-item label="申请用户" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="userRolesLevelMin == roleLevelOrdinary"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="disabledUser(form)"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批员工" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择审批员工" style="width: 370px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择审批员工" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" |
| | | @change="checkTime" |
| | | /> |
| | | </el-form-item> |
| | |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" |
| | | @change="checkTime" |
| | | /> |
| | | </el-form-item> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="外出类型" prop="outOfOfficeType"> |
| | | <el-select v-model="form.outOfOfficeType" filterable clearable placeholder="请选择外出类型" style="width: 370px;"> |
| | | <el-select v-model="form.outOfOfficeType" filterable clearable placeholder="请选择外出类型" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn"> |
| | | <el-option |
| | | v-for="item in dict[dictGoOutTypr]" |
| | | :key="item.value" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="外出原因"> |
| | | <el-input v-model="form.outReason" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.outReason" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" /> |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | v-permission="permission.attendanceGoOutApp" |
| | | :loading="crud.status.cu === 2" |
| | | size="mini" |
| | | type="primary" |
| | |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | slot="reference" |
| | | v-permission="permission.attendanceGoOutApp" |
| | | type="danger" |
| | | icon="el-icon-edit-outline" |
| | | size="mini" |
| | |
| | | add: ['admin', 'attendanceGoOut:add'], |
| | | edit: ['admin', 'attendanceGoOut:edit'], |
| | | del: ['admin', 'attendanceGoOut:del'], |
| | | download: ['admin', 'attendanceGoOut:download'] |
| | | download: ['admin', 'attendanceGoOut:download'], |
| | | attendanceGoOutApp: ['admin', 'attendanceGoOut:approve'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | successLoading: false, |
| | | userRolesLevelMin: null, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY } |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // 角色级别: 总经理 |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 判断用户最大角色级别是否是角色级别:普通用户 |
| | | if (this.userRolesLevelMin === this.roleLevelOrdinary) { |
| | | // 判断用户最大角色级别是否大于总经理角色:赋值 |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | // 表单赋值 |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | return true |
| | | } |
| | | if (data.approvalStatus !== null && data.approvalStatus === this.dictGoOutAgree || data.approvalStatus === this.dictGoOutReturn) { |
| | | return true |
| | | } |
| | | }, |
| | | // 查询员工 |
| | | getUsers() { |
| | | crudUser.getAll().then(res => { |
| | |
| | | <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"> |
| | | <el-form-item label="申请用户" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="userRolesLevelMin == roleLevelOrdinary" @change="checkLeaveTime"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 370px;" :disabled="disabledUser(form)" @change="checkLeaveTime"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批员工" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择审批员工" style="width: 370px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择审批员工" style="width: 370px;" class="filter-item" :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="请假类型" prop="leaveType"> |
| | | <el-select v-model="form.leaveType" filterable clearable placeholder="请选择请假类型" style="width: 370px;" @change="checkLeaveTime"> |
| | | <el-select v-model="form.leaveType" filterable clearable placeholder="请选择请假类型" style="width: 370px;" :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" @change="checkLeaveTime"> |
| | | <el-option |
| | | v-for="item in dict[dictLeaveType]" |
| | | :key="item.value" |
| | |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" |
| | | @change="checkLeaveTime" |
| | | /> |
| | | </el-form-item> |
| | |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" |
| | | @change="checkLeaveTime" |
| | | /> |
| | | </el-form-item> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="请假原因"> |
| | | <el-input v-model="form.leaveReason" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.leaveReason" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" /> |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" /> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | <el-table-column prop="approvalDescription" label="审批说明" show-overflow-tooltip /> |
| | | <el-table-column prop="remarks" label="备注" show-overflow-tooltip /> |
| | | <el-table-column prop="createTime" min-width="140" label="创建时间" show-overflow-tooltip /> |
| | | <el-table-column label="审核操作" min-width="120px" align="center"> |
| | | <el-table-column label="审核操作" min-width="200px" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | v-permission="permission.attendanceLeaveApp" |
| | | :loading="crud.status.cu === 2" |
| | | size="mini" |
| | | type="primary" |
| | |
| | | @click="toApprove(scope.row)" |
| | | >审核 |
| | | </el-button> |
| | | <el-popover |
| | | :ref="`popover_${scope.row.id}`" |
| | | width="200" |
| | | > |
| | | <p>确定撤销该记录?</p> |
| | | <div style="text-align: right; margin: 0"> |
| | | <el-button size="mini" type="primary" @click="canel(scope.row)">取消</el-button> |
| | | <el-button :loading="successLoading" type="primary" size="mini" @click="revoke(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button |
| | | v-if="scope.row.approvalUserId === $store.state.user.user.id" |
| | | slot="reference" |
| | | v-permission="permission.attendanceLeaveApp" |
| | | type="danger" |
| | | icon="el-icon-edit-outline" |
| | | size="mini" |
| | | :disabled="scope.row.approvalStatus === dictAppRovalStatusUnderAppover ? true : false" |
| | | >撤销 |
| | | </el-button> |
| | | </el-popover> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="checkPer(['admin','attendanceLeave:edit','attendanceLeave:del'])" label="操作" width="150px" align="center"> |
| | |
| | | add: ['admin', 'attendanceLeave:add'], |
| | | edit: ['admin', 'attendanceLeave:edit'], |
| | | del: ['admin', 'attendanceLeave:del'], |
| | | download: ['admin', 'attendanceLeave:download'] |
| | | download: ['admin', 'attendanceLeave:download'], |
| | | attendanceLeaveApp: ['admin', 'attendanceLeave:approve'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | |
| | | successLoading: false, |
| | | userRolesLevelMin: null, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY } |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // 角色级别: 总经理 |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 判断用户最大角色级别是否是角色级别:普通用户 |
| | | if (this.userRolesLevelMin === this.roleLevelOrdinary) { |
| | | // 判断用户最大角色级别是否大于总经理角色:赋值 |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | // 表单赋值 |
| | | this.form.userId = this.user.id |
| | | } |
| | |
| | | // [CRUD.HOOK.afterSubmit]() { |
| | | // this.getUserTimes() |
| | | // }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | | return true |
| | | } |
| | | if (data.approvalStatus !== null && data.approvalStatus === this.dictAppRovalStatusPassed || data.approvalStatus === this.dictAppRovalStatusReturn) { |
| | | return true |
| | | } |
| | | }, |
| | | // 查询员工 |
| | | getUsers() { |
| | | crudUser.getAll().then(res => { |
| | |
| | | // }) |
| | | // }, |
| | | // 审批页面赋值 |
| | | toApprove(data) { |
| | | toApprove(data, Number) { |
| | | if (Number !== '1') { |
| | | this.makeUpCardVisible = true |
| | | } |
| | | this.form.id = data.id |
| | | this.form.userId = data.userId |
| | | this.form.userName = data.userName |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 撤消功能 |
| | | revoke(data) { |
| | | this.toApprove(data, '1') |
| | | this.form.approvalStatus = this.dictAppRovalStatusUnderAppover |
| | | this.successLoading = true |
| | | crudAttendanceLeave.approve(this.form).then(res => { |
| | | this.crud.refresh() |
| | | this.successLoading = false |
| | | this.$message({ type: 'success', message: '撤销成功' }) |
| | | this.$refs[`popover_${data.id}`].showPopper = false |
| | | }).catch((error) => { |
| | | this.$message({ type: 'error', message: error.response.data.message }) |
| | | }) |
| | | if (this.$refs['form']) { |
| | | this.$refs['form'].resetFields() |
| | | } |
| | | this.crud.cancelCU() |
| | | }, |
| | | // 关闭 |
| | | closeCard() { |
| | | if (this.$refs['form']) { |
| | |
| | | } |
| | | this.crud.cancelCU() |
| | | this.makeUpCardVisible = false |
| | | }, |
| | | // 取消 |
| | | canel(data) { |
| | | this.$refs[`popover_${data.id}`].showPopper = false |
| | | } |
| | | } |
| | | } |