Browse Source

任务详情增加进度显示

yanshichao 1 year ago
parent
commit
db5f74ed38

+ 0 - 3
src/views/task/components/taskAudit.vue

@@ -1,9 +1,6 @@
 <template>
   <div>
     <task-detail :detail-form="detailForm"></task-detail>
-    <div>
-
-    </div>
     <el-form ref="form" :model="form" :rules="auditRules" size="mini" label-width="100px">
       <el-row>
         <el-col :span="12">

+ 7 - 1
src/views/task/components/taskDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="task-detail">
-    <el-descriptions class="margin-top" :column="5" direction="vertical">
+    <el-descriptions class="margin-top" :column="7" direction="vertical">
       <el-descriptions-item label="负责人">
         <div class="desc-item-content">{{ form.executorName }}</div>
       </el-descriptions-item>
@@ -9,6 +9,12 @@
           {{ statusMap[form.status].name }}
         </el-tag>
       </el-descriptions-item>
+      <el-descriptions-item label="进度" :span="2">
+        <div style="padding: 0 30px 0 0">
+          <el-progress :percentage="form.progressValue" :text-inside="true" :stroke-width="15"
+                       :color="cellColorMap[form.status]"></el-progress>
+        </div>
+      </el-descriptions-item>
       <el-descriptions-item label="优先级">
         <el-tag :color="priorityColorMap[form.priority]" effect="dark" :hit="false">
           {{ getTaskPriority(form.priority) }}

+ 7 - 1
src/views/task/components/taskSplit.vue

@@ -3,7 +3,7 @@
     <div class="header">
       <div class="task-name">{{ form.taskName }}</div>
     </div>
-    <el-descriptions class="margin-top" :column="5" direction="vertical">
+    <el-descriptions class="margin-top" :column="7" direction="vertical">
       <el-descriptions-item label="负责人">
         <div class="desc-item-content">{{ form.executorName }}</div>
       </el-descriptions-item>
@@ -12,6 +12,12 @@
           {{ statusMap[form.status].name }}
         </el-tag>
       </el-descriptions-item>
+      <el-descriptions-item label="进度" :span="2">
+        <div style="padding: 0 30px 0 0">
+          <el-progress :percentage="form.progressValue" :text-inside="true" :stroke-width="15"
+                       :color="cellColorMap[form.status]"></el-progress>
+        </div>
+      </el-descriptions-item>
       <el-descriptions-item label="优先级">
         <el-tag :color="priorityColorMap[form.priority]" effect="dark" :hit="false">
           {{ getTaskPriority(form.priority) }}

+ 1 - 1
src/views/task/projectView.vue

@@ -133,7 +133,7 @@
         <el-table-column width="60" property="userName" label="反馈人"></el-table-column>
         <el-table-column width="55" label="完成度">
           <template slot-scope="temp">
-            <div>{{ temp.row.feedbackType === '4' ? '' : temp.row.value + '%' }}</div>
+            <div>{{ !temp.row.value ? '' : temp.row.value + '%' }}</div>
           </template>
         </el-table-column>
         <el-table-column width="60" prop="hours" label="工时(h)"></el-table-column>

+ 11 - 3
src/views/task/task.vue

@@ -40,8 +40,11 @@
                   v-for="dict in dict.type.task_status"
                   :key="dict.value"
                   :label="dict.label"
-                  :value="dict.value"
-                />
+                  :value="dict.value">
+                  <el-tag :type="statusMap[dict.value].type">
+                    {{ dict.label }}
+                  </el-tag>
+                </el-option>
               </el-select>
             </el-form-item>
             <el-form-item prop="priority">
@@ -272,7 +275,8 @@
     </el-dialog>
 
     <!-- 审核任务对话框 -->
-    <el-dialog :title="detailForm.taskName" :visible.sync="auditOpen" width="900px" class="add-dialog" append-to-body @close="auditCancel">
+    <el-dialog :title="detailForm.taskName" :visible.sync="auditOpen" width="900px" class="add-dialog" append-to-body
+               @close="auditCancel">
       <task-audit :detail-form="detailForm" :audit-form="auditForm" @auditCancel="auditCancel"></task-audit>
     </el-dialog>
 
@@ -606,6 +610,10 @@ export default {
     },
     /** 分解按钮操作 */
     handleSplit(row) {
+      if (row.status === '4' || row.status === '5') {
+        this.$message.info("任务已完成/终止,请勿再分解")
+        return
+      }
       getTask(row.id).then(res => {
         this.splitForm = res.data
         this.splitForm['parentId'] = row.id