| | |
| | | @ApiModelProperty(value = "到达城市") |
| | | private String arrivalCity; |
| | | |
| | | @Column(name = "`category`")
|
| | | @ApiModelProperty(value = "出差类别")
|
| | | private String category;
|
| | |
|
| | | @Column(name = "`approval_status`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "审批状态") |
| | |
| | | List<AttendanceBusinessTravel> findByUserAndSEDate(Long userId, LocalDateTime startDate, LocalDateTime endDate); |
| | | |
| | | // 查询出差天数 |
| | | @Query(value = "SELECT SUM(travel_duration) from attendance_business_travel where user_id = ?1 and travel_start_time >= ?2 and travel_end_time < ?3 and approval_status in ('business_approve_status_agree')", nativeQuery = true) |
| | | Integer findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate); |
| | | @Query(value = "SELECT * from attendance_business_travel where user_id = ?1 and travel_start_time >= ?2 and travel_end_time < ?3 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
|
| | | List<AttendanceBusinessTravel> findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate);
|
| | | } |
| | |
| | | /** 到达城市 */ |
| | | private String arrivalCity; |
| | | |
| | | /** 出差类别 */
|
| | | private String category;
|
| | |
|
| | | /** 审批状态 */ |
| | | private String approvalStatus; |
| | | |
| | |
| | | //获取年假剩余(新)
|
| | | Double surplusYearTime = new Double(0.00);
|
| | |
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndApprovalStatus(userId, Constant.OVERTIME_PASS);
|
| | | if (attendanceOvertimeList.size() > 0) {
|
| | | LocalDate localDateStart = LocalDate.now().withDayOfMonth(1).minusMonths(2);
|
| | | LocalDate localDateEnd = LocalDate.now().plusDays(1);
|
| | |
|
| | |
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndDate(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay());
|
| | | if (!attendanceOvertimeList.isEmpty()) {
|
| | | surplusYearTime = attendanceOvertimeList.stream()
|
| | | .filter(attendanceOvertime -> !attendanceOvertime.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS))
|
| | | .map(attendanceOvertime -> attendanceOvertime.getOvertimeDuration()).reduce(0.0, (o1, o2) -> o1 + o2);
|
| | | Double usedTime = attendanceLeaveRepository.sumLeaveDurationByUserIdAndLeaveType(userId, Constant.LEAVE_TYPE_REPLACE);
|
| | | if (usedTime != null) {
|
| | | Double usedTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay(), Constant.LEAVE_TYPE_REPLACE).stream().mapToDouble(AttendanceLeave::getLeaveDuration).sum();
|
| | | if (usedTime > 0) {
|
| | | surplusYearTime = surplusYearTime - usedTime;
|
| | | }
|
| | | }
|
| | | return surplusYearTime;
|
| | | if (surplusYearTime <= 0.0) {
|
| | | return 0.0;
|
| | | }
|
| | | return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户调休假结算时长
|
| | | */
|
| | | @Override
|
| | | public Double getOverTimeCloseLength(Long userId) {
|
| | | //获取年假剩余(新)
|
| | | Double surplusYearTime = new Double(0.00);
|
| | |
|
| | | LocalDate localDateStart = LocalDate.now().withDayOfMonth(1).minusMonths(3);
|
| | | LocalDate localDateEnd = LocalDate.now().plusDays(1);
|
| | |
|
| | |
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndDate(userId, localDateStart.atStartOfDay(), localDateStart.plusMonths(1).withDayOfMonth(1).atStartOfDay());
|
| | | if (!attendanceOvertimeList.isEmpty()) {
|
| | | surplusYearTime = attendanceOvertimeList.stream()
|
| | | .filter(attendanceOvertime -> !attendanceOvertime.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS))
|
| | | .map(attendanceOvertime -> attendanceOvertime.getOvertimeDuration()).reduce(0.0, (o1, o2) -> o1 + o2);
|
| | | Double usedTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay(), Constant.LEAVE_TYPE_REPLACE).stream().mapToDouble(AttendanceLeave::getLeaveDuration).sum();
|
| | | if (usedTime > 0) {
|
| | | surplusYearTime = surplusYearTime - usedTime;
|
| | | }
|
| | | }
|
| | | if (surplusYearTime <= 0.0) {
|
| | | return 0.0;
|
| | | }
|
| | | return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | Long result = resultParts.stream()
|
| | | .mapToLong(calculate -> ChronoUnit.MINUTES.between(calculate.getStart(), calculate.getEnd()))
|
| | | .sum();
|
| | | // .reduce(new BigDecimal(0),
|
| | | // (total, current) -> total.add(BigDecimal.valueOf(current)),
|
| | | // (o1, o2) -> null).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP
|
| | | // )
|
| | | // result = result.setScale(1, RoundingMode.FLOOR);
|
| | | // if (result < 30) {
|
| | | // System.out.println("localDate : " + localDate + " hours : " + 0);
|
| | | // return BigDecimal.valueOf(0.0);
|
| | | // } else {
|
| | | // result = result - 30;
|
| | | // }
|
| | | System.out.println("localDate : " + localDate + " hours : " + result);
|
| | | return BigDecimal.valueOf(result).divide(BigDecimal.valueOf(60), 1, RoundingMode.HALF_DOWN);
|
| | | long halfHour = result / 30;
|
| | | return BigDecimal.valueOf(halfHour).multiply(BigDecimal.valueOf(0.5));
|
| | | }).reduce(BigDecimal::add).get().doubleValue();
|
| | | }
|
| | |
|
| | |
| | | public static final String EXPENSE_TYPE_TRAVEL_SUBSIDIES = "expense_type_travel_subsidies"; |
| | | // 费用类型:客户关系 |
| | | public static final String EXPENSE_TYPE_CUSTOMER_RELATIONSHIP = "expense_type_customer_relationship"; |
| | |
|
| | | public static final String ATTENDANCE_BUSINESS_TRAVEL_CATEGORY = "attendance_business_travel_category";
|
| | | public static final String ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL = "attendance_business_travel_category_travel";
|
| | | public static final String ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE = "attendance_business_travel_category_same_place";
|
| | | } |
| | |
| | | if (ObjectUtils.isNotEmpty(user.getDingding())) {
|
| | | // 考勤记录:根据用户和日期查询
|
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), strAttendDate);
|
| | | Boolean isHoliday = false;
|
| | | if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)) {
|
| | | isHoliday = true;
|
| | | }
|
| | | // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(oapiDingTalkRecordResultList为空的情况下)
|
| | | if (ObjectUtils.isNotEmpty(attendance) && (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS))) {
|
| | | // 开始打卡结果
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getStartClockResults(),attendance.getActualWorkStartTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 1)));
|
| | | } else {
|
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setStartLocationResults(flag == true ? attendance.getStartLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getEndClockResults(),attendance.getActualWorkEndTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 2)));
|
| | | } else {
|
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setEndLocationResults(flag == true ? attendance.getEndLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | | if (ObjectUtils.isNotEmpty(user.getDingding())) {
|
| | | // 考勤记录:根据用户和日期查询
|
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), strAttendDate);
|
| | | Boolean isHoliday = false;
|
| | | if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)) {
|
| | | isHoliday = true;
|
| | | }
|
| | | // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(oapiDingTalkRecordResultList为空的情况下)
|
| | | if (ObjectUtils.isNotEmpty(attendance) && (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS))) {
|
| | | // 开始打卡结果
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getStartClockResults(),attendance.getActualWorkStartTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 1)));
|
| | | } else {
|
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setStartLocationResults(flag == true ? attendance.getStartLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getEndClockResults(),attendance.getActualWorkEndTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 2)));
|
| | | } else {
|
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setEndLocationResults(flag == true ? attendance.getEndLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | |
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import me.zhengjie.exception.BadRequestException;
|
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceLeaveRepository;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceOvertimeRepository;
|
| | | import me.zhengjie.modules.attendance.service.AttendanceService;
|
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceQueryCriteria;
|
| | | import me.zhengjie.modules.constant.Constant;
|
| | |
| | | private final SysConfigHolidayRepository sysConfigHolidayRepository;
|
| | | private final RoleService roleService;
|
| | | private final DictDetailRepository dictDetailRepository;
|
| | | private final AttendanceOvertimeRepository attendanceOvertimeRepository;
|
| | | private final AttendanceLeaveRepository attendanceLeaveRepository;
|
| | | // ==================== 以下为定时生成工资记录主要依赖 ====================
|
| | | private final UserService userService;
|
| | | private final UserLevelWageService userLevelWageService;
|
| | |
| | | criteria.setUserId(userId);
|
| | | criteria.setTargetYearMonth(targetYearMonth);
|
| | | UserLevelWageDto userLevelWageDto = userLevelWageService.queryTargetYearMonth(criteria);
|
| | |
|
| | | // 换休转补助
|
| | | LocalDateTime startLocalDateTime = LocalDateTime.parse(targetYearMonth + "-01 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
| | | LocalDateTime startLocalDateTime3MonthsPrevious = startLocalDateTime.minusMonths(3).withDayOfMonth(1);
|
| | | LocalDateTime endLocalDateTime3MonthsPrevious = startLocalDateTime3MonthsPrevious.plusMonths(1).withDayOfMonth(1);
|
| | | LocalDateTime endLocalDateTime = startLocalDateTime.plusMonths(1).withDayOfMonth(1);
|
| | |
|
| | | Double approvedTime = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, startLocalDateTime3MonthsPrevious, endLocalDateTime3MonthsPrevious);
|
| | | Double leaveTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(
|
| | | userId, startLocalDateTime3MonthsPrevious, endLocalDateTime, Constant.LEAVE_TYPE_REPLACE).stream()
|
| | | .map(AttendanceLeave::getLeaveDuration).mapToDouble(Double::doubleValue).sum();
|
| | | if (approvedTime.compareTo(leaveTime) > 0) {
|
| | | attendanceHours = attendanceHours + approvedTime - leaveTime;
|
| | | System.out.println("换休转补助:" + (approvedTime - leaveTime));
|
| | | }
|
| | |
|
| | | // 平日加班费
|
| | | if (userLevelWageDto.getOverTimeWage() != null) {
|
| | | // System.out.println("用户" + userId + "的级别工资中平日加班时间" + attendanceHours + "小时,配置加班费用为:" + userLevelWageDto.getOverTimeWage() + "元/小时!");
|
| | |
| | | for (Attendance attendance : attendanceList) {
|
| | | CalendarVo onDuty = new CalendarVo();
|
| | | onDuty.setDate(df.format(attendance.getAttendanceDate()));
|
| | | onDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getStartClockResults()).get("msg")) ? "上班打卡时间:" + attendance.getActualWorkStartTime().toString() : "上班:" + formateResult(attendance.getStartClockResults()).get("msg"));
|
| | | onDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getStartClockResults()).get("msg")) ? "上班打卡时间:" + (attendance.getActualWorkStartTime() == null ? "" : attendance.getActualWorkStartTime().toString()) : "上班:" + formateResult(attendance.getStartClockResults()).get("msg"));
|
| | | onDuty.setIsOk((Boolean) formateResult(attendance.getStartClockResults()).get("status"));
|
| | | onDuty.setType(1);
|
| | | CalendarVo offDuty = new CalendarVo();
|
| | | offDuty.setDate(df.format(attendance.getAttendanceDate()));
|
| | | offDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getEndClockResults()).get("msg")) ? "下班打卡时间:" + attendance.getActualWorkEndTime().toString() : "下班:" + formateResult(attendance.getEndClockResults()).get("msg"));
|
| | | offDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getEndClockResults()).get("msg")) ? "下班打卡时间:" + (attendance.getActualWorkEndTime() == null ? "" : attendance.getActualWorkEndTime().toString()) : "下班:" + formateResult(attendance.getEndClockResults()).get("msg"));
|
| | | offDuty.setIsOk((Boolean) formateResult(attendance.getEndClockResults()).get("status"));
|
| | | offDuty.setType(1);
|
| | | calendarInfo.add(onDuty);
|
| | |
| | | import me.zhengjie.modules.attendance.domain.AttendanceOvertime;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceBusinessTravelRepository;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceOvertimeRepository;
|
| | | import me.zhengjie.modules.constant.Constant;
|
| | | import me.zhengjie.modules.system.domain.SysConfigProportion;
|
| | | import me.zhengjie.modules.system.domain.User;
|
| | | import me.zhengjie.modules.system.repository.SysConfigProportionRepository;
|
| | |
| | | import java.time.format.DateTimeFormatter;
|
| | | import java.util.*;
|
| | | import java.util.function.Function;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | /**
|
| | | * @author 姚增春
|
| | |
| | | LocalDateTime firstDayOfNextMonth = firstDayOfMonth.plusMonths(1);
|
| | |
|
| | | // 查询出差表的记录
|
| | | Integer bussSameMonthDays = attendanceBusinessTravelRepository.findByUserIdAndYearMonth(criteria.getUserId(), firstDayOfMonth, firstDayOfNextMonth);
|
| | | // 查询配置表
|
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("出差补助金额");
|
| | | List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.findByUserIdAndYearMonth(criteria.getUserId(), firstDayOfMonth, firstDayOfNextMonth);
|
| | | Map<String, Double> attendanceBusinessTravelMap = attendanceBusinessTravelList.stream().collect(Collectors.groupingBy(AttendanceBusinessTravel::getCategory, Collectors.summingDouble(AttendanceBusinessTravel::getTravelDuration)));
|
| | |
|
| | | BigDecimal travelSubsidy = new BigDecimal(0.0);
|
| | | // 出差补助金
|
| | | Double travelSubsidy = (bussSameMonthDays == null ? 0 : bussSameMonthDays) * sysConfigProportion.getProportion();
|
| | |
|
| | | return travelSubsidy;
|
| | | attendanceBusinessTravelMap.forEach((key, value) -> {
|
| | | if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL)) {
|
| | | // 出差补助金
|
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("出差补助金额");
|
| | | travelSubsidy.add(BigDecimal.valueOf(value * sysConfigProportion.getProportion()));
|
| | | } else if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE)) {
|
| | | // 客户现场补助金
|
| | | // SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("客户现场补助金额");
|
| | | travelSubsidy.add(BigDecimal.valueOf(value * 30)); // 按30元/天计算 TODO 待调整
|
| | | }
|
| | | });
|
| | | return travelSubsidy.doubleValue();
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | List<Map<String, Object>> list = new ArrayList<>();
|
| | | for (UserLevelWageDto userLevelWage : all) {
|
| | | // 将实体类转换成DTO
|
| | | User user = userRepository.findById(userLevelWage.getUserId()).orElseGet(User::new);;
|
| | | User user = userRepository.findById(userLevelWage.getUserId()).orElseGet(User::new);
|
| | |
|
| | | Map<String, Object> map = new LinkedHashMap<>();
|
| | | map.put("员工姓名", user.getNickName());
|
| | |
| | | // 加班审批状态:已退回 |
| | | export const OVERTIME_RETURN = 'overtime_return' |
| | | |
| | | export const BUSINESS_TRAVEL_CATEGORY = 'business_travel_category' |
| | | |
| | | export default { |
| | | ROLE_LEVEL_SUPER, |
| | | ROLE_LEVEL_GENERAL, |
| | |
| | | OVERTIME_STATUS, |
| | | OVERTIME_APPROVAL, |
| | | OVERTIME_PASS, |
| | | OVERTIME_RETURN |
| | | OVERTIME_RETURN, |
| | | BUSINESS_TRAVEL_CATEGORY |
| | | } |
| | |
| | | " |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="出差分类" prop="category"> |
| | | <el-select |
| | | v-model="form.category" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择" |
| | | style="width: 340px;" |
| | | :disabled=" |
| | | form.approvalStatus == dictGoOutAgree || |
| | | form.approvalStatus == dictGoOutReturn |
| | | " |
| | | > |
| | | <el-option |
| | | v-for="item in dict[dictBusinessTravelCategory]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input |
| | | v-model="form.approvalDescription" |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import constant from '../../../utils/constant' |
| | | import { relativeTimeThreshold } from 'moment/moment' |
| | | |
| | | const defaultForm = { |
| | | id: null, |
| | |
| | | travelReason: null, |
| | | departureCity: null, |
| | | arrivalCity: null, |
| | | category: null, |
| | | approvalStatus: null, |
| | | approvalDescription: null, |
| | | remarks: null, |
| | |
| | | }) |
| | | }, |
| | | // 数据字典constant |
| | | dicts: [constant.BUSSINESS_APPROVE_STATUS, constant.LEAVE_TIME_TYPE], |
| | | dicts: [constant.BUSSINESS_APPROVE_STATUS, constant.LEAVE_TIME_TYPE, constant.BUSINESS_TRAVEL_CATEGORY], |
| | | data() { |
| | | return { |
| | | permission: { |
| | |
| | | dictGoOutReturn: constant.BUSSINESS_APPROVE_STATUS_REFUSE, |
| | | dictLeaveTimeTypeDay: constant.LEAVE_TIME_TYPE_DAY, |
| | | dictLeaveTimeType: constant.LEAVE_TIME_TYPE, |
| | | dictBusinessTravelCategory: constant.BUSINESS_TRAVEL_CATEGORY, |
| | | makeUpCardVisible: false, |
| | | successLoading: false, |
| | | userRolesLevelMin: null, |
| | |
| | | this.form.travelEndTime = data.travelEndTime |
| | | this.form.departureCity = data.departureCity |
| | | this.form.arrivalCity = data.arrivalCity |
| | | this.form.cagtegory = data.category |
| | | this.form.travelDuration = data.travelDuration |
| | | this.form.durationUnit = data.durationUnit |
| | | this.form.approvalStatus = data.approvalStatus |