From 6a1158de0c1082abb74e9ca6788bf284bf99749d Mon Sep 17 00:00:00 2001
From: weicd <weicd@yhzhg.cn>
Date: Tue, 17 Jan 2023 09:55:56 +0000
Subject: [PATCH] 考勤

---
 eladmin-web-master/src/views/task/taskUser/index.vue |   34 +++++++++++++++++++++++++++++++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/eladmin-web-master/src/views/task/taskUser/index.vue b/eladmin-web-master/src/views/task/taskUser/index.vue
index 1e006fc..e617f95 100644
--- a/eladmin-web-master/src/views/task/taskUser/index.vue
+++ b/eladmin-web-master/src/views/task/taskUser/index.vue
@@ -130,11 +130,24 @@
         </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="taskWorkload" label="任务工作量" width="80" />
+        <el-table-column :show-overflow-tooltip="true" label="消耗 / 任务工时" width="110">
+          <template slot-scope="scope">
+            {{ scope.row.consumedHours }} / {{ scope.row.taskHours }}
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" label="消耗 / 任务工作量" width="120">
+          <template slot-scope="scope">
+            {{ scope.row.consumedWorkload }} / {{ scope.row.taskWorkload == null || scope.row.taskWorkload == '' ? 0 : scope.row.taskWorkload }}
+          </template>
+        </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="taskWorkloadUnit" label="任务工作量单位" width="110">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.taskWorkloadUnit != null && scope.row.taskWorkloadUnit != ''">{{ dict.label[standardWorkloadUnit][scope.row.taskWorkloadUnit] }}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" width="80">
+          <template slot-scope="scope">
+            {{ scope.row.taskProgress }}%
           </template>
         </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="taskStatus" label="任务状态" width="80">
@@ -275,6 +288,21 @@
   methods: {
     // 钩子:在获取表格数据之前执行,false 则代表不获取数据
     [CRUD.HOOK.beforeRefresh]() {
+      // 判断传参是否为空
+      if (this.$route.params.projectId != null && this.$route.params.projectId !== '' && this.crud.query.projectId === undefined) {
+        // 检索条件赋值
+        this.$set(this.crud.query, 'projectId', Number(this.$route.params.projectId))
+        // 获取任务列表
+        crudTask.getAll({ projectId: this.query.projectId }).then(res => {
+          // 检索任务列表
+          this.queryTasks = res
+        })
+      }
+      // 判断传参是否为空
+      if (this.$route.params.taskId != null && this.$route.params.taskId !== '' && this.crud.query.taskId === undefined) {
+        // 检索条件赋值
+        this.$set(this.crud.query, 'taskId', Number(this.$route.params.taskId))
+      }
       // 用户角色级别数组
       const userRolesLevel = this.user.roles.map(({ level }) => level)
       // 用户最大角色级别
@@ -310,7 +338,7 @@
         // 检索任务列表
         this.queryTasks = []
       } else {
-        // 获取父级任务
+        // 获取任务列表
         crudTask.getAll({ projectId: this.query.projectId }).then(res => {
           // 检索任务列表
           this.queryTasks = res

--
Gitblit v1.9.3