请假、外出、出差、报销增加再提交功能;出差审核状态常量名称规范;
5 files modified
165 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceLeaveRepository.java 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue 89 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue 20 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue 22 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/projectReimburse/index.vue 24 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceLeaveRepository.java
@@ -32,13 +32,11 @@
public interface AttendanceLeaveRepository extends JpaRepository<AttendanceLeave, Long>, JpaSpecificationExecutor<AttendanceLeave> {
    //添加时查询请假时间是否冲突
    @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND ((leave_start_time > ?1 and leave_start_time < ?2) OR \n" +
            "(leave_start_time < ?1 and leave_end_time > ?2) OR (leave_end_time > ?1 and leave_end_time < ?2) OR (leave_start_time > ?1 and leave_end_time < ?2))", nativeQuery = true)
    @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND leave_start_time <= ?2 AND leave_end_time >= ?1", nativeQuery = true)
    List<AttendanceLeave> checkCreateLeaveTime(String startTime, String endTime, Long userId);
    //修改时查询请假时间是否冲突
    @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND id NOT IN ?4 AND ((leave_start_time > ?1 and leave_start_time < ?2) OR \n" +
            "(leave_start_time < ?1 and leave_end_time > ?2) OR (leave_end_time > ?1 and leave_end_time < ?2) OR (leave_start_time > ?1 and leave_end_time < ?2))", nativeQuery = true)
    @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND id NOT IN ?4 AND leave_start_time <= ?2 AND leave_end_time >= ?1", nativeQuery = true)
    List<AttendanceLeave> checkUpdateForLeaveTime(String startTime, String endTime, Long userId, Set<Long> ids);
    //查询今年已使用的年假时长
@@ -47,11 +45,11 @@
    Double getSurplusYearTime(Long userId,String startTime,String endTime);
    //查询请假记录
    @Query(value = "SELECT * from attendance_leave where user_id = ?1 and leave_start_time < ?3 and leave_end_time > ?2 and approval_status IN  ('approval_status_passed')", nativeQuery = true)
    @Query(value = "SELECT * from attendance_leave where user_id = ?1 and leave_start_time <= ?3 and leave_end_time >= ?2 and approval_status IN  ('approval_status_passed')", nativeQuery = true)
    List<AttendanceLeave> findByUserIdAndDate(Long userId, LocalDateTime startDate, LocalDateTime endDate);
    //查询请假记录(根据请假类型)
    @Query(value = "SELECT * from attendance_leave where user_id = ?1 and leave_start_time < ?3 and leave_end_time > ?2 and approval_status IN  ('approval_status_passed') and leave_type = ?4", nativeQuery = true)
    @Query(value = "SELECT * from attendance_leave where user_id = ?1 and leave_start_time <= ?3 and leave_end_time >= ?2 and approval_status IN  ('approval_status_passed') and leave_type = ?4", nativeQuery = true)
    List<AttendanceLeave> findByUserIdAndDateAndLeaveType(Long userId, LocalDateTime startDate, LocalDateTime endDate,String LeaveType);
    @Query(value = "SELECT SUM(leave_duration) from attendance_leave where user_id = ?1 and approval_status IN  ('approval_status_passed') and leave_type = ?2", nativeQuery = true)
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -110,7 +110,7 @@
          :disabled="
            crud.selections.length < 1 ||
              !crud.selections.every(
                selection => selection.approvalStatus === dictGoOutAppRev
                selection => selection.approvalStatus === dictBussinessAppRev
              )
          "
          style="margin-left: 4px !important;"
@@ -127,7 +127,7 @@
          :disabled="
            crud.selections.length < 1 ||
              !crud.selections.every(
                selection => selection.approvalStatus === dictGoOutAppRev
                selection => selection.approvalStatus === dictBussinessAppRev
              )
          "
          style="margin-left: 4px !important;"
@@ -176,7 +176,7 @@
              clearable
              placeholder="请选择"
              style="width: 340px;"
              :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn || form.wecomSpNo !== null"
              :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null"
            >
              <el-option
                v-for="item in users"
@@ -192,7 +192,7 @@
              clearable
              placeholder="请选择"
              style="width: 340px;"
              :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn || form.wecomSpNo !== null"
              :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null"
            >
              <el-option
                v-for="item in approvalUsers"
@@ -216,7 +216,7 @@
                }
              }"
              :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'"
              :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn || form.wecomSpNo !== null"
              :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null"
              @change="checkTime"
            />
          </el-form-item>
@@ -234,7 +234,7 @@
                }
              }"
              :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'"
              :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn || form.wecomSpNo !== null"
              :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null"
              @change="checkTime"
            />
          </el-form-item>
@@ -256,8 +256,8 @@
              rows="3"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                form.approvalStatus == dictBussinessAppAgree ||
                  form.approvalStatus == dictBussinessAppReturn ||
                  form.wecomSpNo !== null
              "
            />
@@ -267,8 +267,8 @@
              v-model="form.departureCity"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                form.approvalStatus == dictBussinessAppAgree ||
                  form.approvalStatus == dictBussinessAppReturn ||
                  form.wecomSpNo !== null
              "
            />
@@ -278,8 +278,8 @@
              v-model="form.arrivalCity"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                form.approvalStatus == dictBussinessAppAgree ||
                  form.approvalStatus == dictBussinessAppReturn ||
                  form.wecomSpNo !== null
              "
            />
@@ -292,8 +292,8 @@
              placeholder="请选择"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn
                form.approvalStatus == dictBussinessAppAgree ||
                  form.approvalStatus == dictBussinessAppReturn
              "
            >
              <el-option
@@ -312,8 +312,8 @@
              placeholder="请选择"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                form.approvalStatus == dictBussinessAppAgree ||
                  form.approvalStatus == dictBussinessAppReturn ||
                  form.wecomSpNo !== null
              "
            >
@@ -341,8 +341,8 @@
              rows="3"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                form.approvalStatus == dictBussinessAppAgree ||
                  form.approvalStatus == dictBussinessAppReturn ||
                  form.wecomSpNo !== null
              "
            />
@@ -399,7 +399,7 @@
            {{ form.travelReason }}
          </el-form-item>
          <el-form-item
            v-if="form.approvalStatus === dictGoOutReturn"
            v-if="form.approvalStatus === dictBussinessAppReturn"
            label="退回原因"
            prop="approvalDescription"
          >
@@ -421,7 +421,7 @@
            @click="approveFunction(1, form)"
          >审核退回</el-button>
          <el-button
            v-if="form.approvalStatus !== dictGoOutReturn"
            v-if="form.approvalStatus !== dictBussinessAppReturn"
            :loading="successLoading"
            type="success"
            @click="approveFunction(2, form)"
@@ -552,19 +552,19 @@
        >
          <template slot-scope="scope">
            <el-tag
              v-if="scope.row.approvalStatus === dictGoOutAppRev"
              v-if="scope.row.approvalStatus === dictBussinessAppRev"
              type="warning"
            >{{
              dict.label[dictBussinessStatus][scope.row.approvalStatus]
            }}</el-tag>
            <el-tag
              v-if="scope.row.approvalStatus === dictGoOutAgree"
              v-if="scope.row.approvalStatus === dictBussinessAppAgree"
              type="success"
            >{{
              dict.label[dictBussinessStatus][scope.row.approvalStatus]
            }}</el-tag>
            <el-tag
              v-if="scope.row.approvalStatus === dictGoOutReturn"
              v-if="scope.row.approvalStatus === dictBussinessAppReturn"
              type="danger"
            >{{
              dict.label[dictBussinessStatus][scope.row.approvalStatus]
@@ -605,7 +605,7 @@
              type="primary"
              icon="el-icon-s-check"
              :disabled="
                scope.row.approvalStatus === dictGoOutAppRev ? false : true
                scope.row.approvalStatus === dictBussinessAppRev ? false : true
              "
              @click="toApprove(scope.row)"
            >审核
@@ -633,7 +633,7 @@
                icon="el-icon-edit-outline"
                size="mini"
                :disabled="
                  scope.row.approvalStatus === dictGoOutAppRev ? true : false
                  scope.row.approvalStatus === dictBussinessAppRev ? true : false
                "
              >撤销
              </el-button>
@@ -656,6 +656,13 @@
        >
          <template slot-scope="scope">
            <udOperation v-if="!scope.row.wecomSpNo" :data="scope.row" :permission="permission" />
            <el-button
              v-if="scope.row.wecomSpNo && user.id === scope.row.userId && scope.row.approvalStatus === dictBussinessAppReturn"
              size="mini"
              type="primary"
              icon="el-icon-refresh-right"
              @click="reAdd(scope.row)"
            />
          </template>
        </el-table-column>
      </el-table>
@@ -768,9 +775,9 @@
      // 项目列表
      projects: [],
      dictBussinessStatus: constant.BUSSINESS_APPROVE_STATUS,
      dictGoOutAppRev: constant.BUSSINESS_APPROVE_STATUS_REVIEWED,
      dictGoOutAgree: constant.BUSSINESS_APPROVE_STATUS_AGREE,
      dictGoOutReturn: constant.BUSSINESS_APPROVE_STATUS_REFUSE,
      dictBussinessAppRev: constant.BUSSINESS_APPROVE_STATUS_REVIEWED,
      dictBussinessAppAgree: constant.BUSSINESS_APPROVE_STATUS_AGREE,
      dictBussinessAppReturn: constant.BUSSINESS_APPROVE_STATUS_REFUSE,
      dictLeaveTimeTypeDay: constant.LEAVE_TIME_TYPE_DAY,
      dictLeaveTimeType: constant.LEAVE_TIME_TYPE,
      dictBusinessTravelCategory: constant.BUSINESS_TRAVEL_CATEGORY,
@@ -848,8 +855,8 @@
      }
      if (
        (data.approvalStatus !== null &&
          data.approvalStatus === this.dictGoOutAgree) ||
        data.approvalStatus === this.dictGoOutReturn
          data.approvalStatus === this.dictBussinessAppAgree) ||
        data.approvalStatus === this.dictBussinessAppReturn
      ) {
        return true
      }
@@ -926,10 +933,10 @@
        }
        // 判断通过状态
        if (Number === 2) {
          this.form.approvalStatus = this.dictGoOutAgree
          this.form.approvalStatus = this.dictBussinessAppAgree
        } else {
          // 退回改状态显示退回原因
          this.form.approvalStatus = this.dictGoOutReturn
          this.form.approvalStatus = this.dictBussinessAppReturn
          if (this.form.approvalDescription == null) {
            return
          }
@@ -993,7 +1000,7 @@
    // 撤消功能
    revoke(data) {
      this.toApprove(data, '1')
      this.form.approvalStatus = this.dictGoOutAppRev
      this.form.approvalStatus = this.dictBussinessAppRev
      this.successLoading = true
      crudAttendanceBusinessTravel
        .approve(this.form)
@@ -1025,6 +1032,22 @@
    // 取消
    canel(data) {
      this.$refs[`popover_${data.id}`].showPopper = false
    },
    // 再新增(企微)
    reAdd(data) {
      const that = this
      that.crud.toAdd()
      that.$set(that.form, 'userId', data.userId)
      that.$set(that.form, 'approvalUserId', data.approvalUserId)
      that.$set(that.form, 'travelStartTime', data.travelStartTime)
      that.$set(that.form, 'travelEndTime', data.travelEndTime)
      that.$set(that.form, 'travelDuration', data.travelDuration)
      that.$set(that.form, 'travelReason', data.travelReason)
      that.$set(that.form, 'departureCity', data.departureCity)
      that.$set(that.form, 'arrivalCity', data.arrivalCity)
      that.$set(that.form, 'projectId', data.projectId)
      that.$set(that.form, 'category', data.category)
      that.$set(that.form, 'remarks', data.remarks)
    }
  }
}
eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue
@@ -602,6 +602,13 @@
        >
          <template slot-scope="scope">
            <udOperation v-if="!scope.row.wecomSpNo" :data="scope.row" :permission="permission" />
            <el-button
              v-if="scope.row.wecomSpNo && user.id === scope.row.userId && scope.row.approvalStatus === dictGoOutReturn"
              size="mini"
              type="primary"
              icon="el-icon-refresh-right"
              @click="reAdd(scope.row)"
            />
          </template>
        </el-table-column>
      </el-table>
@@ -965,6 +972,19 @@
    // 取消
    canel(data) {
      this.$refs[`popover_${data.id}`].showPopper = false
    },
    // 再新增(企微)
    reAdd(data) {
      const that = this
      that.crud.toAdd()
      that.$set(that.form, 'userId', data.userId)
      that.$set(that.form, 'approvalUserId', data.approvalUserId)
      that.$set(that.form, 'outOfOfficeType', data.outOfOfficeType)
      that.$set(that.form, 'outStartTime', data.outStartTime)
      that.$set(that.form, 'outEndTime', data.outEndTime)
      that.$set(that.form, 'outDuration', data.outDuration)
      that.$set(that.form, 'outReason', data.outReason)
      that.$set(that.form, 'remarks', data.remarks)
    }
  }
}
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
@@ -319,6 +319,13 @@
              :data="scope.row"
              :permission="permission"
            />
            <el-button
              v-if="scope.row.wecomSpNo && user.id === scope.row.userId && scope.row.approvalStatus === dictAppRovalStatusReturn"
              size="mini"
              type="primary"
              icon="el-icon-refresh-right"
              @click="reAdd(scope.row)"
            />
          </template>
        </el-table-column>
      </el-table>
@@ -655,6 +662,21 @@
    // 取消
    canel(data) {
      this.$refs[`popover_${data.id}`].showPopper = false
    },
    // 再新增(企微)
    reAdd(data) {
      const that = this
      that.crud.toAdd()
      that.$set(that.form, 'userId', data.userId)
      that.$set(that.form, 'approvalUserId', data.approvalUserId)
      that.$set(that.form, 'leaveType', data.leaveType)
      that.$set(that.form, 'leaveStartTime', data.leaveStartTime)
      that.$set(that.form, 'leaveEndTime', data.leaveEndTime)
      that.$set(that.form, 'leaveDuration', data.leaveDuration)
      that.$set(that.form, 'leaveReason', data.leaveReason)
      that.$set(that.form, 'remarks', data.remarks)
      // 固定操作
      that.checkLeaveTime()
    }
  }
}
eladmin-web-master/src/views/project/projectReimburse/index.vue
@@ -300,8 +300,16 @@
        <el-table-column v-if="checkPer(['admin','projectReimburse:edit','projectReimburse:del'])" label="操作" width="150px" align="center" fixed="right">
          <template slot-scope="scope">
            <udOperation
              v-if="!scope.row.wecomSpNo"
              :data="scope.row"
              :permission="permission"
            />
            <el-button
              v-if="scope.row.wecomSpNo && user.id === scope.row.userId && scope.row.approvalStatus === dictReimburseApproveStatusRefuse"
              size="mini"
              type="primary"
              icon="el-icon-refresh-right"
              @click="reAdd(scope.row)"
            />
          </template>
        </el-table-column>
@@ -699,6 +707,22 @@
          return
        }
      }
    },
    // 再新增(企微)
    reAdd(data) {
      const that = this
      that.crud.toAdd()
      that.$set(that.form, 'userId', data.userId)
      that.$set(that.form, 'approvalUserId', data.approvalUserId)
      that.$set(that.form, 'projectId', data.projectId)
      that.$set(that.form, 'reimburseTypes', data.reimburseType.split(','))
      that.$set(that.form, 'reimburseReason', data.reimburseReason)
      that.$set(that.form, 'expenseTypes', data.expenseType.split(','))
      that.$set(that.form, 'startTime', data.startTime)
      that.$set(that.form, 'endTime', data.endTime)
      that.$set(that.form, 'expenseAmount', data.expenseAmount)
      that.$set(that.form, 'expenseComment', data.expenseComment)
      that.$set(that.form, 'filePath', data.filePath)
    }
  }
}