赵士淞
2023-01-03 46bdc5491c579bd169d1b36937f90fb4f764f804
任务日报
3 files modified
46 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/utils/constant.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskDaliy/index.vue 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java
@@ -60,7 +60,7 @@
    @Override
    public Map<String,Object> queryAll(TaskQueryCriteria criteria, Pageable pageable){
        // 判断检索条件
        if (criteria.getProjectId() == null && criteria.getName() == null && criteria.getPriority() == null && criteria.getTaskClassification() == null) {
        if (criteria.getName() == null) {
            // 检索条件
            criteria.setPidIsNull(true);
        }
eladmin-web-master/src/utils/constant.js
@@ -1,3 +1,10 @@
// 角色级别:超级管理员
export const ROLE_LEVEL_SUPER = 1
// 角色级别:系统管理员
export const ROLE_LEVEL_SYSTEM = 2
// 角色级别:普通用户
export const ROLE_LEVEL_ORDINARY = 3
// 比例配置:基本工资比例
export const CONFIG_PROPORTION_BASIC_WAGE = '基本工资比例'
// 比例配置:绩效工资比例
@@ -197,6 +204,9 @@
export const TASK_STATUS_COMPLETED = 'task_status_completed'
export default {
  ROLE_LEVEL_SUPER,
  ROLE_LEVEL_SYSTEM,
  ROLE_LEVEL_ORDINARY,
  CONFIG_PROPORTION_BASIC_WAGE,
  CONFIG_PROPORTION_MERIT_WAGE,
  CONFIG_PROPORTION_ACHIEVEMENT_WAGE,
eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -39,7 +39,7 @@
            <el-date-picker v-model="form.fillDate" type="date" style="width: 340px;" />
          </el-form-item>
          <el-form-item label="所属用户" prop="userId">
            <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formUserChange">
            <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" @change="formUserChange">
              <el-option
                v-for="item in users"
                :key="item.id"
@@ -83,7 +83,7 @@
              <template slot="append">%</template>
            </el-input>
          </el-form-item>
          <el-form-item label="结算状态" prop="settlementStatus">
          <el-form-item v-if="(userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelSystem) && crud.status.edit == crudStatusPrepared" label="结算状态" prop="settlementStatus">
            <el-select v-model="form.settlementStatus" filterable placeholder="请选择" style="width: 340px;">
              <el-option
                v-for="item in dict[settlementStatus]"
@@ -147,6 +147,7 @@
        <el-table-column v-if="checkPer(['admin','taskDaliy:edit','taskDaliy:del'])" label="操作" width="150px" align="center" fixed="right">
          <template slot-scope="scope">
            <udOperation
              v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelSystem || scope.row.userId == user.id"
              :data="scope.row"
              :permission="permission"
            />
@@ -166,12 +167,13 @@
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'
import constant from '../../../utils/constant'
import crudUser from '@/api/system/user'
import crudProject from '@/api/project/project'
import crudTask from '@/api/task/task'
const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, taskProgress: null, settlementStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'TaskDaliy',
  components: { pagination, crudOperation, rrOperation, udOperation },
@@ -243,6 +245,16 @@
      standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT,
      // 字典:结算状态
      settlementStatus: constant.SETTLEMENT_STATUS,
      // 角色级别:超级管理员
      roleLevelSuper: constant.ROLE_LEVEL_SUPER,
      // 角色级别:系统管理员
      roleLevelSystem: constant.ROLE_LEVEL_SYSTEM,
      // 角色级别:普通用户
      roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY,
      // CRUD状态
      crudStatusPrepared: CRUD.STATUS.PREPARED,
      // 用户最大角色级别
      userRolesLevelMin: null,
      // 用户列表
      users: [],
      // 检索项目列表
@@ -255,9 +267,18 @@
      formTasks: []
    }
  },
  computed: {
    ...mapGetters([
      'user'
    ])
  },
  methods: {
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      // 用户角色级别数组
      const userRolesLevel = this.user.roles.map(({ level }) => level)
      // 用户最大角色级别
      this.userRolesLevelMin = Math.min(...userRolesLevel)
      // 获取用户
      this.getUser()
      // 获取检索项目
@@ -300,6 +321,13 @@
    [CRUD.HOOK.beforeToAdd]() {
      // 表单赋值
      this.form.consumedWorkloadUnit = null
      // 判断用户最大角色级别是否是角色级别:普通用户
      if (this.userRolesLevelMin === this.roleLevelOrdinary) {
        // 表单赋值
        this.form.userId = this.user.id
        // 表单用户变更
        this.formUserChange()
      }
    },
    // 钩子:编辑 - 之前
    [CRUD.HOOK.beforeToEdit]() {