yaozc
2024-05-30 9944a50bd2d84930a4cf71872ae38207788c311d
Merge branch 'wcd' of http://192.168.1.110:5678/r/pms-upgrade into wcd

# Conflicts:
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskService.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskUserMongoDto.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskUserServiceImpl.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/MeritWageServiceImpl.java
# eladmin-web-master/src/api/task/task.js
# eladmin-web-master/src/views/dashboard/PanelGroup.vue
# eladmin-web-master/src/views/home.vue
# eladmin-web-master/src/views/salary/newSalary/index.vue
# eladmin-web-master/src/views/task/taskDaliy/index.vue
# eladmin-web-master/src/views/task/taskUser/index.vue
6 files added
7 files modified
1213 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskController.java 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/repository/UserLevelWageRepository.java 4 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/attendance/attendanceLeave.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/components/Crud/crud.js 11 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/router/index.js 6 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/router/routers.js 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/store/index.js 21 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/manager.vue 255 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/manager/subgroupTurnover.vue 128 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/dashboard/chart/projectCost.vue 123 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/dashboard/index.vue 178 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/other/other.vue 224 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/userStatistics/index.vue 245 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskController.java
@@ -198,4 +198,10 @@
    public ResponseEntity<Object> getTastAll(String taskId){
        return new ResponseEntity<>(taskService.getTastAllById(taskId),HttpStatus.OK);
    }
    @GetMapping("/getTasts")
    @Log("根据任务名字查询任务")
    public ResponseEntity<Object> getTasts(String taskName){
        return new ResponseEntity<>(taskService.getTastByName(taskName),HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/repository/UserLevelWageRepository.java
@@ -59,4 +59,8 @@
    @Query(value = "SELECT * from new_user_level_wage WHERE user_id = ?1 AND `year_month` >= ?2 ORDER BY `year_month` DESC LIMIT 1",nativeQuery = true)
    UserLevelWage findByUserIdAndYesWorker(Long userId, String yearMonth);
    /** 查询今年日期最大的记录 */
    @Query(value = "SELECT * from new_user_level_wage WHERE user_id = ?1 AND `year_month` < ?2 ORDER BY `year_month` DESC LIMIT 1",nativeQuery = true)
    UserLevelWage findByUserIdAndMaxDate(Long userId, String yearMonth);
}
eladmin-web-master/src/api/attendance/attendanceLeave.js
@@ -48,6 +48,14 @@
  })
}
export function getOverTimeLength(data) {
  return request({
    url: 'api/attendanceLeave/getOverTimeLength',
    method: 'post',
    data
  })
}
export function approve(data) {
  return request({
    url: 'api/attendanceLeave/approve',
@@ -64,4 +72,4 @@
  })
}
export default { add, edit, del, getAll, calcTimeLength, getYearTimeLength, approve, updateAgree }
export default { add, edit, del, getAll, calcTimeLength, getYearTimeLength, getOverTimeLength, approve, updateAgree }
eladmin-web-master/src/components/Crud/crud.js
@@ -1,6 +1,7 @@
import { initData, download } from '@/api/data'
import { parseTime, downloadFile } from '@/utils/index'
import Vue from 'vue'
import store from '@/store/index'
/**
 * CRUD配置
@@ -773,10 +774,20 @@
    },
    created() {
      for (const k in this.$crud) {
        // if (this.$crud[k].queryOnPresenterCreated) {
        //   this.$crud[k].toQuery()
        // }
        // 首页跳转到日志带参数就不加载,直接走带参查询
        if (store.state.taskId != undefined || store.state.projectId != undefined || store.state.planTime != undefined || store.state.taskName != undefined) {
          console.log("store.state.planTime:" + store.state.planTime)
          this.queryOnPresenterCreated = false
        } else {
        if (this.$crud[k].queryOnPresenterCreated) {
          this.$crud[k].toQuery()
        }
      }
      }
    },
    destroyed() {
      for (const k in this.$crud) {
eladmin-web-master/src/router/index.js
@@ -15,6 +15,7 @@
  if (to.meta.title) {
    document.title = to.meta.title + ' - ' + Config.title
  }
  console.log('to.path : ', to.path)
  NProgress.start()
  if (getToken()) {
    // 已登录且要跳转的页面是登录页
@@ -23,6 +24,7 @@
      NProgress.done()
    } else {
      if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
        console.log('1111111111111111111111111111111111111111111111111')
        store.dispatch('GetInfo').then(() => { // 拉取user_info
          // 动态路由,拉取菜单
          loadMenus(next, to)
@@ -33,10 +35,12 @@
        })
      // 登录时未拉取 菜单,在此处拉取
      } else if (store.getters.loadMenus) {
        console.log('222222222222222222222222222222222222222222222222222')
        // 修改成false,防止死循环
        store.dispatch('updateLoadMenus')
        loadMenus(next, to)
      } else {
        console.log('33333333333333333333333333333333333333333333333333')
        next()
      }
    }
@@ -52,6 +56,7 @@
})
export const loadMenus = (next, to) => {
  console.log('44444444444444444444444444444444444444444444')
  buildMenus().then(res => {
    const sdata = JSON.parse(JSON.stringify(res))
    const rdata = JSON.parse(JSON.stringify(res))
@@ -61,6 +66,7 @@
    store.dispatch('GenerateRoutes', rewriteRoutes).then(() => { // 存储路由
      router.addRoutes(rewriteRoutes) // 动态添加可访问路由表
      console.log('to.path2 : ', to.path)
      next({ ...to, replace: true })
    })
    store.dispatch('SetSidebarRouters', sidebarRoutes)
eladmin-web-master/src/router/routers.js
@@ -57,7 +57,7 @@
        meta: { title: '个人中心' }
      }
    ]
  }
  },
]
export default new Router({
eladmin-web-master/src/store/index.js
@@ -19,7 +19,26 @@
const store = new Vuex.Store({
  modules,
  getters
  getters,
  taskId: null,
  projectId:null,
  planTime:null,
  taskName:null,
  mutations: {
    updateTaskId(state, taskId) {
      state.taskId = taskId
    },
    updateProjectId(state, projectId) {
      state.projectId = projectId
    },
    upTime(state, planTime) {
      state.planTime = planTime
    },
    upTaskName(state, taskName) {
      state.taskName = taskName
    }
  },
})
export default store
eladmin-web-master/src/views/manager.vue
New file
@@ -0,0 +1,255 @@
<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div>
        <!-- 搜索 -->
        <el-select v-model="query.projectId" value-key="id" clearable filterable placeholder="所属项目" style="width: 250px;"
          class="filter-item" @keyup.enter.native="crud.toQuery">
          <el-option v-for="item in projects" :key="item.id" :label="item.name" :value="item">
            <span style="float: left">{{ item.name }}</span>
          </el-option>
        </el-select>
        <el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;"
          class="filter-item" @keyup.enter.native="crud.toQuery">
          <el-option v-for="item in users" :key="item.id" :label="item.nickName" :value="item.id" />
        </el-select>
        <el-select v-model="query.taskStatus" filterable clearable multiple collapse-tags placeholder="任务状态"
          style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
          <el-option v-for="item in dict[taskStatus]" :key="item.id" :label="item.label" :value="item.value" />
        </el-select>
        <rrOperation :crud="crud" />
      </div>
    </div>
    <!--表格渲染-->
    <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
      @selection-change="crud.selectionChangeHandler">
      <el-table-column type="selection" width="55" />
      <el-table-column :show-overflow-tooltip="true" prop="projectName" label="项目名称" fixed="left" width="270">
        <template slot-scope="scope">
          <el-tag slot="reference">{{ scope.row.projectName }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column :show-overflow-tooltip="true" prop="name" label="名称" fixed="left" width="270">
        <template slot-scope="scope">
          <el-tag slot="reference">{{ scope.row.name }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column :show-overflow-tooltip="true" prop="taskStartDate" label="任务开始时间" width="140" />
      <el-table-column :show-overflow-tooltip="true" prop="taskEndDate" label="任务结束时间" width="140" />
      <el-table-column :show-overflow-tooltip="true" prop="taskHours" label="任务工时" width="80" />
      <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" width="100">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.userNickName">{{
            scope.row.userNickName
          }}</el-tag>
          <el-tag v-else>未指定</el-tag>
        </template>
      </el-table-column>
      <el-table-column :show-overflow-tooltip="true" prop="performanceType" label="绩效类型" width="80">
          <template slot-scope="scope">
            <el-tag>{{ dict.label[performanceType][scope.row.performanceType] }}</el-tag>
          </template>
        </el-table-column>
      <el-table-column :show-overflow-tooltip="true" prop="performanceHours" label="分配工时" width="80" />
      <el-table-column :show-overflow-tooltip="true" prop="costHours" label="消耗工时" width="80" />
      <el-table-column :show-overflow-tooltip="true" label="任务进度" width="80">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.newTaskProgress }}%</span>
        </template>
      </el-table-column>
      <el-table-column :show-overflow-tooltip="true" prop="taskStatus" label="任务状态" width="80">
        <template slot-scope="scope">
          <el-tag>{{
            dict.label[taskStatus][scope.row.taskStatus]
          }}</el-tag>
        </template>
      </el-table-column>
    </el-table>
    <!--分页组件-->
    <pagination />
  </div>
</template>
<script>
import crudTaskUser from "@/api/task/taskUser";
import crudTask from "@/api/task/task";
import crudUser from "@/api/system/user";
import CRUD, { presenter, header, form, crud } from "@crud/crud";
import rrOperation from "@crud/RR.operation";
import crudOperation from "@crud/CRUD.operation";
import udOperation from "@crud/UD.operation";
import pagination from "@crud/Pagination";
import DateRangePicker from "@/components/DateRangePicker";
import Treeselect from "@riophae/vue-treeselect";
import { mapGetters } from "vuex";
import constant from "@/utils/constant";
import UploadExcelComponent from "@/components/UploadExcel/index.vue";
import UploadExcelComponentTwo from "@/components/UploadExcel/excelIndex.vue";
const defaultForm = {
  id: null,
  name: null,
  userId: null,
  projectId: null,
  task: { id: null, name: null },
  taskStartDate: null,
  taskEndDate: null,
  taskHours: null,
  performanceHours: null,
  newTaskProgress: null,
  taskStatus: null,
  remarks: null,
  divideUserIds: [],
  is_ok: null
};
export default {
  name: "HomePage",
  components: {
    Treeselect,
    crudOperation,
    rrOperation,
    udOperation,
    pagination,
    DateRangePicker,
    UploadExcelComponent,
    UploadExcelComponentTwo
  },
  cruds() {
    return CRUD({
      title: "任务分配",
      url: "api/taskUser",
      crudMethod: { ...crudTaskUser }
    });
  },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  // 数据字典
  dicts: [
    constant.TASK_STATUS,
    constant.TAST_CLASSIFICATION,
    constant.STANDARD_WORKLOAD_UNIT,
    constant.PERFORMANCE_TYPE
  ],
  data() {
    return {
      projectId: null,
      projectDatas: [],
      taskName: "",
      selectedTaskName: "",
      planStartTime: null,
      planEndTime: null,
      taskTotal: {},
      taskDatas: [],
      taskLoading: false,
      defaultProps: { children: "nodes", label: "name", isLeaf: "leaf" },
      permission: {
        list: ["admin", "taskUser:list"],
      },
      queryTypeOptions: [
        { key: "userId", display_name: "所属员工" },
        { key: "taskStatus", display_name: "任务状态" },
        { key: "createTime", display_name: "创建时间" }
      ],
      // 字典:任务状态
      taskStatus: constant.TASK_STATUS,
      // 字典:任务分类
      taskClassification: constant.TAST_CLASSIFICATION,
      // 字典:标准工作量单位
      standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT,
      // 字典:绩效对象
      performanceType: constant.PERFORMANCE_TYPE,
      // 字典:批准状态-未承认
      approveStatusUnrecognized: constant.APPROVE_STATUS_UNRECOGNIZED,
      // CRUD状态
      crudStatusPrepared: CRUD.STATUS.PREPARED,
      Is_ok: false,
      generateForm: [],
      tableHeader: [],
      users: [],
      // 项目列表
      projects: [],
      // 检索任务列表
      queryTasks: [],
      // 表单任务列表
      formTasks: [],
      selectedTask: "",
      dialogVisible_taskUser: false,
      dialogLoading_taskUser: true,
      taskLoading_L: true,
      dialogVisible_task: false,
      dialogVisible_task_LQ: false,
      dialogLoading_task: true,
      dialogLoading_task_LQ: true,
      steps: [],
      TaskName: "",
      expectedHours: "",
      actualHours: "",
      taskUserDetail: {},
      taskDetail: {},
      taskProgress: "",
      ProgressStatus: "",
      advList: [],
      tobeOver: "first",
      tobeTasked: "任务详细",
      total: 0,
      currentPage: 1,
      pageSize: 10,
      slong: false,
      taskSo: constant.TASK_STATUS_UNRECOGNIZED,
      taskSt: constant.TASK_STATUS_COMPLETED,
      taskStatusOne: ''
    };
  },
  computed: {
    ...mapGetters(["user"])
  },
  mounted() {
    this.getAllProjectDatas();
  },
  methods: {
    getAllProjectDatas() {
      crudTask.getProjects().then(res => {
        this.projectDatas = res;
      });
    },
  }
};
</script>
<style rel="stylesheet/scss" lang="scss">
.hide-time .el-button--text {
  display: none;
}
.tree-scroll {
  height: 100%;
  width: 100%;
}
.flow-tree {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 600px;
  width: 100%;
  >>>.el-tree-node {
    >.el-tree-node__children {
      overflow-y: visible !important;
    }
    >.el-tree-node__content {
      height: 100%;
    }
  }
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
  height: 40px;
  line-height: 40px;
}
.active {
  /* 添加长亮效果的样式 */
  color: #1890ff;
}
</style>
eladmin-web-master/src/views/manager/subgroupTurnover.vue
New file
@@ -0,0 +1,128 @@
<template>
  <div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
import crudProject from '@/api/project/project'
import crudTask from '@/api/task/task'
export default {
  props: {
    className: {
      type: String,
      default: 'chart'
    },
    width: {
      type: String,
      default: '100%'
    },
    height: {
      type: String,
      default: '400px'
    },
    targetYear: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      chart: null
    }
  },
  mounted() {
    this.initChart()
    this.__resizeHandler = debounce(() => {
      if (this.chart) {
        this.chart.resize()
      }
    }, 100)
    window.addEventListener('resize', this.__resizeHandler)
  },
  beforeDestroy() {
    if (!this.chart) {
      return
    }
    window.removeEventListener('resize', this.__resizeHandler)
    this.chart.dispose()
    this.chart = null
  },
  methods: {
    initChart() {
      this.chart = echarts.init(this.$el, 'macarons')
      console.log('1111111111111111 : ', this.targetYear)
      crudProject.getSubgroupTurnover({ targetYear: this.targetYear }).then(res => {
        // 图表项目区分类目
        const projectDistinguishData = []
        // 图表营业额类目
        const contractPriceData = []
        // 图表目标金额类目
        const targetAmountData = []
        // 遍历资产收入数据
        for (let i = 0; i < res.length; i++) {
          // 图表项目区分类目
          projectDistinguishData.push(res[i].projectDistinguish)
          // 图表营业额类目
          contractPriceData.push(res[i].contractPrice)
          // 图表目标金额类目
          targetAmountData.push(res[i].targetAmount)
        }
        // 绘制图表
        this.chart.setOption({
          title: {
            text: '项目区分营业额与目标金额对比',
            subtext: '',
            left: 'left'
          },
          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'shadow'
            }
          },
          legend: {
            data: ['营业额', '目标金额'],
            right: '10%'
          },
          xAxis: [
            {
              type: 'category',
              axisTick: { show: false },
              data: projectDistinguishData
            }
          ],
          yAxis: [
            {
              type: 'value'
            }
          ],
          series: [
            {
              name: '营业额',
              type: 'bar',
              barGap: 0,
              emphasis: {
                focus: 'series'
              },
              data: contractPriceData
            },
            {
              name: '目标金额',
              type: 'bar',
              emphasis: {
                focus: 'series'
              },
              data: targetAmountData
            }
          ]
        })
      })
    }
  }
}
</script>
eladmin-web-master/src/views/project/dashboard/chart/projectCost.vue
New file
@@ -0,0 +1,123 @@
<template>
  <div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
import crudProject from '@/api/project/project'
export default {
  props: {
    className: {
      type: String,
      default: 'chart'
    },
    width: {
      type: String,
      default: '100%'
    },
    height: {
      type: String,
      default: '600px'
    },
    targetYear: {
      type: String,
      default: null
    },
    projectType: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      chart: null
    }
  },
  mounted() {
    this.initChart()
    this.__resizeHandler = debounce(() => {
      if (this.chart) {
        this.chart.resize()
      }
    }, 100)
    window.addEventListener('resize', this.__resizeHandler)
  },
  beforeDestroy() {
    if (!this.chart) {
      return
    }
    window.removeEventListener('resize', this.__resizeHandler)
    this.chart.dispose()
    this.chart = null
  },
  methods: {
    initChart() {
      this.chart = echarts.init(this.$el)
      crudProject.getProjectCost({ targetYear: this.targetYear }).then(res => {
        let projectNames = []
        let taskHours = []
        let consumedHours = []
        res.forEach(data => {
          projectNames.push(data.projectName)
          taskHours.push(data.taskHours)
          consumedHours.push(data.consumedHours)
        })
        // 绘制图表
        this.chart.setOption({
          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'cross',
              crossStyle: {
                color: '#999'
              }
            },
            formatter: '{b} <br/>{a0} : {c0}小时<br/>{a1} : {c1}小时'
          },
          grid: {
            //调整图表位置
            show: false, //是否显示直角坐标系网格
            top: '5%', // 距离图例顶部的位置,可写百分比,可以写数字
            right: '8%',
            bottom: '30%',
            left: '8%'
          },
          legend: {
            data: ['分配工时', '消耗工时']
          },
          xAxis: {
            type: 'category',
            data: projectNames,
            axisLabel: {
                rotate: 90 // 将标签旋转45度,以便更多的文本能够显示
            }
          },
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value} 小时'
            },
          },
          series: [
            {
              name: '分配工时',
              type: 'bar',
              data: taskHours
            },
            {
              name: '消耗工时',
              type: 'bar',
              data: consumedHours
            }
          ]
        })
      })
    }
  }
}
</script>
eladmin-web-master/src/views/project/dashboard/index.vue
New file
@@ -0,0 +1,178 @@
<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <el-card class="box-card" style="margin-bottom: 5px;">
        <!-- 搜索 -->
        <el-date-picker v-model="stTargetYear" type="year" clearable placeholder="目标年度" style="width: 185px;" @change="stTargetYearChange" />
        <el-select v-model="tcpwhProjectDistinguish" filterable clearable placeholder="项目区分" style="width: 185px;" @change="tcpwhProjectDistinguishOrTargetYearChange">
          <el-option
            v-for="item in projectDistinguishList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-card>
      <el-card class="box-card">
        <ProjectCost :key="stRandom" :targetYear="stParameter" :projectType="tcpwhProjectDistinguish"></ProjectCost>
      </el-card>
      <el-card class="box-card">
        <subgroupTurnover :key="stRandom" :targetYear="stParameter"></subgroupTurnover>
      </el-card>
    </div>
  </div>
</template>
<script>
import constant from '../../../utils/constant'
import crudProject from '@/api/project/project'
import { getDictMap } from '@/api/system/dictDetail'
import ProjectCost from './chart/projectCost.vue'
import subgroupTurnover from '../chart/subgroupTurnover.vue'
export default {
  name: 'ProjectBoard',
  components: { ProjectCost, subgroupTurnover },
  data() {
    return {
      // 项目列表
      projectList: [],
      // 项目区分列表
      projectDistinguishList: [],
      // 分组营业额:目标年度
      stTargetYear: new Date(),
      // 分组营业额:随机数
      stRandom: 0,
      // 分组营业额:传参
      stParameter: new Date().getFullYear().toString(),
      // 项目工时:目标项目
      pwhProjectId: null,
      // 项目工时:随机数
      pwhRandom: 0,
      // 项目工时:传参
      pwhParameter: null,
      // 类型合同额、分组工时:项目区分
      tcpwhProjectDistinguish: null,
      // 类型合同额、分组工时:目标年度
      tcpwhTargetYear: new Date(),
      // 类型合同额、分组工时:随机数
      tcpwhRandom: 0,
      // 类型合同额、分组工时:传参
      tcpwhParameterProjectDistinguish: null,
      tcpwhParameterTargetYear: new Date().getFullYear().toString(),
      // 分组排名工时:项目区分
      sthProjectDistinguish: null,
      // 分组排名工时:随机数
      sthRandom: 0,
      // 分组排名工时:传参
      sthParameterProjectDistinguish: null
    }
  },
  created() {
    // // 获取项目
    // this.getProject()
    // 获取字典
    this.getDictDetail()
  },
  methods: {
    // 获取项目
    getProject() {
      crudProject.getAll({ projectStatus: constant.PROJECT_STATUS_UNDER_WAY }).then(res => {
        // 项目列表
        this.projectList = res
        // 项目工时:目标项目
        this.pwhProjectId = res[0].id
        // 项目工时:传参
        this.pwhParameter = res[0].id.toString()
        // 项目工时:随机数
        this.pwhRandom = Math.random()
      })
    },
    // 获取字典
    getDictDetail() {
      getDictMap(constant.PROJECT_DISTINGUISH).then(res => {
        // 项目区分列表
        this.projectDistinguishList = res[constant.PROJECT_DISTINGUISH]
        // 类型合同额、分组工时:目标年度
        this.tcpwhProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value
        // 类型合同额、分组工时:传参
        this.tcpwhParameterProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value.toString()
        // 类型合同额、分组工时:随机数
        this.tcpwhRandom = Math.random()
        // 分组排名工时:项目区分
        this.sthProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value
        // 分组排名工时:传参
        this.sthParameterProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value.toString()
        // 分组排名工时:随机数
        this.sthRandom = Math.random()
      })
    },
    // 分组营业额:目标年度变更
    stTargetYearChange() {
      // 分组营业额:传参
      this.stParameter = this.stTargetYear.getFullYear().toString()
      // 分组营业额:随机数
      this.stRandom = Math.random()
    },
    // 项目工时:目标项目变更
    pwhProjectIdChange() {
      // 项目工时:传参
      this.pwhParameter = this.pwhProjectId.toString()
      // 项目工时:随机数
      this.pwhRandom = Math.random()
    },
    // 类型合同额、分组工时:项目区分/目标年度变更
    tcpwhProjectDistinguishOrTargetYearChange() {
      // 类型合同额、分组工时:传参
      this.tcpwhParameterProjectDistinguish = this.tcpwhProjectDistinguish.toString()
      this.tcpwhParameterTargetYear = this.tcpwhTargetYear.getFullYear().toString()
      // 类型合同额、分组工时:随机数
      this.tcpwhRandom = Math.random()
    },
    // 分组排名工时:项目区分变更
    sthProjectDistinguishChange() {
      // 分组排名工时:传参
      this.sthParameterProjectDistinguish = this.sthProjectDistinguish.toString()
      // 分组排名工时:随机数
      this.sthRandom = Math.random()
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .dashboard-editor-container {
    padding: 32px;
    position: relative;
    .github-corner {
      position: absolute;
      top: 0;
      border: 0;
      right: 0;
    }
    .search-wrapper {
      text-align: right;
    }
    .chart-wrapper {
      background: #fff;
      padding: 16px 16px 0;
      margin-bottom: 32px;
      overflow: auto;
      .wrapper-div {
        text-align: right;
        margin: 0px 15px 15px 15px ;
      }
    }
  }
  @media (max-width:1024px) {
    .chart-wrapper {
      padding: 8px;
    }
  }
</style>
eladmin-web-master/src/views/task/other/other.vue
New file
@@ -0,0 +1,224 @@
<template>
  <div class="app-container">
    <div class="head-container">
      <div>
        <!-- 搜索 -->
        <el-date-picker
          v-model="query.fillDates"
          type="daterange"
          clearable
          class="filter-item"
          value-format="yyyy-MM-dd"
          placeholder="请选择日报日期"
          range-separator=" ~ "
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          style="width: 285px; margin-top: 6px;"
        />
        <el-cascader
          v-model="selectedValue"
          :filterable="true"
          :options="options"
          :props="props"
          clearable
          placeholder="员工"
          :show-all-levels="false"
          style="width: 200px;"
          @change="changeUserList"
        />
        <el-select v-model="query.projectId" filterable clearable placeholder="所属项目" :loading="loadingProject" style="width: 185px; margin-top: 6px;" class="filter-item" @change="queryProjectChange" @clear="clearQueryTasks">
          <el-option
            v-for="item in queryProjects"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          />
        </el-select>
        <el-select v-model="query.taskMongoId" filterable clearable placeholder="所属任务" :loading="loadingTask" style="width: 185px; margin-top: 6px;" class="filter-item">
          <el-option
            v-for="item in queryTasks"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          />
        </el-select>
        <el-input v-model="query.name" filterable clearable placeholder="任务名称" style="width: 185px; margin-top: 6px;" class="filter-item" />
        <rrOperation :crud="crud" />
      </div>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" min-width="100px">
          <template slot-scope="scope">
            {{ crud.toDate(scope.row.fillDate) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" min-width="100px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.userNickName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="projectName" label="所属项目" min-width="140px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.projectName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="taskName" label="所属任务" min-width="180px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.taskName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="taskUserMongo.name" label="分配任务" min-width="180px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.taskUserMongo.name }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" min-width="80px" />
        <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" min-width="80px">
          <template slot-scope="scope">
            {{ scope.row.taskProgress }}%
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="settlementStatus" min-width="80px" label="绩效类型">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.taskUserMongo.performanceType === "1" ? "绩效" : "非绩效" }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" min-width="140px" />
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>
<script>
import crudTaskDaliy from '@/api/task/taskDaliy'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
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 crudProject from '@/api/project/project'
import crudTask from '@/api/task/task'
import crudUser from '@/api/system/user'
const defaultForm = { id: null, projectId: null, taskId: null, taskName: null, taskMongoId: null, taskUserMongo: {}, userId: null, fillDate: null, consumedHours: null, todayFixedHours: 0, todayAttendanceHours: 0, alreadyConsumedHours: 0, taskHours: 0, consumedWorkload: null, consumedWorkloadUnit: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'OtherDaliy',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  dicts: [constant.STANDARD_WORKLOAD_UNIT, constant.SETTLEMENT_STATUS],
  cruds() {
    return CRUD({ title: '员工任务日报', url: 'api/taskDaliy/4dept', idField: 'id', sort: 'fillDate,desc', crudMethod: { ...crudTaskDaliy }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'taskDaliy:add'],
        edit: ['admin', 'taskDaliy:edit'],
        del: ['admin', 'taskDaliy:del'],
        download: ['admin', 'taskDaliy:download']
      },
      queryTypeOptions: [
        { key: 'userId', display_name: '所属员工' },
        { key: 'projectId', display_name: '所属项目' },
        { key: 'taskId', display_name: '所属任务' },
        { key: 'taskUserId', display_name: '分配任务' },
        { key: 'TaskUserName', display_name: '任务名称' },
        { key: 'taskMongoId', display_name: '任务名称' }
      ],
      // 字典:结算状态
      settlementStatus: constant.SETTLEMENT_STATUS,
      // 字典:绩效对象
      performanceType: constant.PERFORMANCE_TYPE,
      // 用户列表
      users: [],
      // 检索项目列表
      queryProjects: [],
      // 检索任务列表
      queryTasks: [],
      loadingProject: true,
      loadingTask: false,
      options: [],
      selectedValue: [],
      props: { multiple: true },
    }
  },
  computed: {
    ...mapGetters([
      'user'
    ])
  },
  mounted() {
    this.getUser();
    this.getQueryProject();
  },
  methods: {
    changeUserList(e) {
      var tempList = []
      for (let i = 0; i < e.length; i++) {
        var temp = e[i]
        tempList.push(temp[e[i].length - 1])
      }
      this.query.userIds = tempList
    },
    // 获取用户
    getUser() {
      // 获取用户
      crudUser.getAll().then(res => {
        // 用户列表
        this.users = res
      })
      crudUser.getUserDept().then(res => {
        this.options = res
      })
    },
    // 获取检索项目
    getQueryProject() {
      this.loadingProject = true
      this.queryProjects = []
      // 获取项目
      crudProject.getAll({projectStatusIn: 'project_status_not_started', projectStatusIn: 'project_status_under_way'}).then(res => {
        // 检索项目列表
        this.queryProjects = res
        this.loadingProject = false
      })
    },
    // 检索项目变更
    queryProjectChange() {
      this.queryTasks = []
      this.loadingTask = true
      // 检索赋值
      this.$set(this.query, 'taskId', null)
      // 判断检索项目是否为空
      if (this.query.projectId === null || this.query.projectId === '') {
        // 检索任务列表
        this.queryTasks = []
      } else {
        // 获取任务
        crudTask.getAll({ projectId: this.query.projectId }).then(res => {
          // 检索任务列表
          this.queryTasks = res
          this.loadingTask = false
        })
      }
    },
    clearQueryTasks() {
      this.loadingTask = false
    },
  }
}
</script>
<style scoped>
  adventTable tr:first-child {
    display: none;
  }
</style>
eladmin-web-master/src/views/task/userStatistics/index.vue
New file
@@ -0,0 +1,245 @@
<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div>
        <el-select v-model="curProject" value-key="id" filterable placeholder="所属项目" style="width: 400px;" class="filter-item">
          <el-option
            v-for="item in projects"
            :key="item.id"
            :label="item.name"
            :value="item"
          >
            <span style="float: left">{{ item.name }}</span>
          </el-option>
        </el-select>
        <el-select
          v-model="query.userId"
          filterable
          clearable
          placeholder="所属员工"
          style="width: 185px;"
          class="filter-item"
          @keyup.enter.native="crud.toQuery"
        >
          <el-option
            v-for="item in users"
            :key="item.id"
            :label="item.nickName"
            :value="item.id"
          />
        </el-select>
        <rrOperation :crud="crud" />
      </div>
      <!--表格渲染-->
      <el-table
        ref="table"
        v-loading="crud.loading"
        :data="crud.data"
        size="small"
        style="width: 100%;"
        row-key="id"
        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
        @selection-change="crud.selectionChangeHandler"
      >
        <el-table-column type="selection" width="55" />
        <el-table-column :show-overflow-tooltip="true" prop="name" label="名称" fixed="left" width="180" />
        <el-table-column :show-overflow-tooltip="true" label="计划工时" width="80">
          <template slot-scope="scope">
            {{ scope.row.sumPlanHours }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="planStartTime" label="计划开始时间" width="140" />
        <el-table-column :show-overflow-tooltip="true" prop="planEndTime" label="计划结束时间" width="140" />
        <el-table-column :show-overflow-tooltip="true" prop="taskStatus" label="任务状态" width="80">
          <template slot-scope="scope">
            <el-tag>{{ dict.label[taskStatus][scope.row.taskStatus] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" label="消耗工时" width="80">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.consumedHours > scope.row.sumPlanHours" type="info">{{ scope.row.consumedHours }}</el-tag>
            <el-tag v-else type="error">{{ scope.row.consumedHours }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="performanceType" label="绩效类型" width="80">
          <template slot-scope="scope">
            <el-tag>{{ dict.label[performanceType][scope.row.performanceType] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="tagList" label="任务分类" width="240">
          <template slot-scope="scope">
            <template>
              <el-tag v-for="tag in scope.row.tagList" :key="tag">{{ tag }}</el-tag>
            </template>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="description" label="描述" />
        <el-table-column v-if="checkPer(['admin','task:divide','task:edit','task:del']) && this.crud.query.flag === true" label="操作" width="180px" align="center" fixed="right">
          <template slot-scope="scope">
            <udOperation :data="scope.row" :permission="permission" />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>
<script>
import crudTask from '@/api/task/task'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import constant from '@/utils/constant'
import crudUser from '@/api/system/user'
import crudProject from '@/api/project/project'
import moment from 'moment'
const defaultForm = { id: null, name: null, projectId: null, userIdList: [], parent: { id: null }, priority: null, tagList: [], performanceType: null, description: null, planStartTime: null, planEndTime: null, planHours: null, pieceRate: 0, planWorkload: 0, planWorkloadUnit: null, taskStatus: null, remarks: null, version: null }
export default {
  name: 'UserStatistics',
  components: { pagination, rrOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  dicts: [constant.TASK_STATUS],
  cruds() {
    return CRUD({ title: '任务', url: 'api/taskDaliy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTask }})
  },
  data() {
    return {
      props: { multiple: true },
      queryTypeOptions: [
        { key: 'name', display_name: '名称' },
        { key: 'projectId', display_name: '所属项目' },
        { key: 'priority', display_name: '优先度' },
        { key: 'taskStatus', display_name: '任务状态' }
      ],
      // // 字典:优先度
      // priority: constant.PRIORITY,
      // // 字典:任务分类
      // taskClassification: constant.TAST_CLASSIFICATION,
      // // 字典: 绩效类型
      // performanceType: constant.PERFORMANCE_TYPE,
      // // 字典:标准工作量单位
      // standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT,
      // // 字典:任务状态
      // taskStatus: constant.TASK_STATUS,
      // // 字典:批准状态-未承认
      // approveStatusUnrecognized: constant.APPROVE_STATUS_UNRECOGNIZED,
      // // 角色级别:超级管理员
      // roleLevelSuper: constant.ROLE_LEVEL_SUPER,
      // // 角色级别:总经理
      // roleLevelGeneral: constant.ROLE_LEVEL_GENERAL,
      // CRUD状态
      crudStatusPrepared: CRUD.STATUS.PREPARED,
      // 用户最大角色级别
      userRolesLevelMin: null,
      // 项目列表
      projects: [],
      // 父级任务列表
      pidTasks: [],
      // 员工列表
      users: [],
      // 用户列表
      tags: [],
      // tag标签
      inputVisible: false,
      inputValue: null,
      containUserList: [],
      userList: [],
      options: [],
      selectedValue: [],
      queryUser: [],
      dialogVisible: false,
      taskDetailDisabled: true,
      calendarLoading: true,
      isShow: false
    }
  },
  created() {
    this.crud.optShow.reset = false
  },
  mounted() {
    // 获取项目
    this.getProject()
    // 获取员工
    this.getUser()
    this.getTags()
  },
  methods: {
    getContainUserList(e) {
      this.form.containUserList = e
    },
    getTags() {
      crudTask.getTags().then(res => {
        this.tags = res
      })
    },
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      if (!this.crud.query.projectId) {
        return false
      }
      // 用户角色级别数组
      const userRolesLevel = this.$store.state.user.user.roles.map(({ level }) => level)
      // 用户最大角色级别
      this.userRolesLevelMin = Math.min(...userRolesLevel)
      return true
    },
    // 获取用户
    getUser() {
      // 获取用户
      crudUser.getAll().then(res => {
        // 用户列表
        this.users = res
      })
      crudUser.getUserDept().then(res => {
        this.options = res
      })
    },
    // 获取项目
    getProject() {
      // 获取项目
      crudProject.getRelevant({
        'projectStatusIn': ['project_status_not_started', 'project_status_under_way'],
        'approve_status': 'approve_status_acknowledged'
      }).then(res => {
        // 项目列表
        this.projects = res
      })
    },
  }
}
</script>
<style scoped>
  .el-tag + .el-tag {
    margin-left: 10px;
  }
  .button-new-tag {
    margin-left: 10px;
    height: 32px;
    line-height: 30px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .input-new-tag {
    width: 90px;
    margin-left: 10px;
    vertical-align: bottom;
  }
  .block{
    display: inline-block;
    vertical-align: middle;
    margin: 0 3px 10px 0;
      input {
      height: 30.5px;
      line-height: 30.5px;
      }
    }
</style>