From 9f53be1dfd7f55ca43fa4e8229c371e8ed29a5ba Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Tue, 16 Jan 2024 09:21:12 +0800
Subject: [PATCH] 更新

---
 src/views/evaluate/evaluateTask.vue |  156 ++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 104 insertions(+), 52 deletions(-)

diff --git a/src/views/evaluate/evaluateTask.vue b/src/views/evaluate/evaluateTask.vue
index eefa465..862232b 100644
--- a/src/views/evaluate/evaluateTask.vue
+++ b/src/views/evaluate/evaluateTask.vue
@@ -6,28 +6,49 @@
       @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
       @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
       @refresh-change="refreshChange" @on-load="onLoad">
+      <template #candidateCutoffTimeEnd="{ row }">
+        <div class="time-box">
+          {{ row.candidateCutoffTimeStart }}
+          <div>-</div>
+          {{ row.candidateCutoffTimeEnd }}
+        </div>
+      </template>
+      <template #evaluateCutoffTimeEnd="{ row }">
+        <div class="time-box">
+          {{ row.evaluateCutoffTimeStart }}
+          <div>-</div>
+          {{ row.evaluateCutoffTimeEnd }}
+        </div>
+      </template>
       <template #menu-left>
-        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增评优任务</el-button>
         <el-button type="danger" icon="el-icon-delete" plain v-if="permission.evaluateTask_delete"
           @click="handleDelete">删除</el-button>
         <!-- <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导出</el-button> -->
       </template>
       <template #menu="{ size, row, index }">
-        <el-button type="primary" text plain icon="el-icon-setting" @click="taskSettingDialog(row)">任务配置</el-button>
-        <!-- <el-button type="primary" text plain icon="el-icon-view" @click="viewDateilDialog(row)">详情</el-button> -->
-        <!-- <el-button type="primary" text plain icon="el-icon-edit" @click="editDialog(row)">编辑</el-button> -->
-        <el-button type="primary" text plain icon="el-icon-position" @click="publicTimeBtn(row)"
-          v-if="row.candidateState === 2 && row.evaluateState === 0">发布</el-button>
-        <!-- <el-button type="primary" text plain icon="el-icon-download">导出</el-button> -->
+        <el-button type="primary" text plain icon="el-icon-view" @click="viewHandlerClick(row)">结果详情</el-button>
+        <el-button type="primary" text plain icon="el-icon-view"
+          @click="viewVotingDetailsHandlerClick(row)">投票详情</el-button>
+        <el-button type="primary" text plain icon="el-icon-position"
+          v-if="!row.type && row.candidateState === 2 && !row.evaluateState" @click="taskPublicDialog(row)">发布</el-button>
+        <el-button type="success" v-if="(row.candidateState === 0 && !row.type) || (row.evaluateState === 0 && row.type)" text plain icon="el-icon-edit"
+          @click="editTaskDialog(row)">编辑</el-button>
         <el-button type="danger" text plain icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
       </template>
     </avue-crud>
-    <!-- 新增编辑弹窗 -->
-    <add-dialog :params="addParams" @refreshTable="this.onLoad" />
-    <!-- 候选人添加及配置 -->
-    <task-setting :params="taskSettingParams" />
-    <!-- 预览弹窗 -->
-    <!-- <viewEvaluateDetail :params="viewEvaluateDetailParams" /> -->
+    <!-- 新增个人评优任务弹窗 -->
+    <addIndividualTask :params="addIndividualParams" @refreshTable="this.onLoad" />
+    <addSectionTask :params="addSectionParams" @refreshTable="this.onLoad" />
+    <!-- 编辑任务 -->
+    <editIndividualTask :params="editIndividualTaskParams" @refreshTable="this.onLoad" />
+    <editSectionTask :params="editSectionTaskParams" @refreshTable="this.onLoad" />
+    <!-- 发布 -->
+    <individualTaskPublic :params="taskPublicParams" @refreshTable="this.onLoad" />
+    <!-- 预览 -->
+    <viewEvaluate :params="viewEvaluateParams" />
+    <!-- 投票详情 -->
+    <votingDetails :params="votingParams" />
   </basic-container>
 </template>
 
@@ -41,15 +62,23 @@
 import { dateNow } from '@/utils/date';
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
-import addDialog from './components/addDialog.vue';;
-import viewEvaluateDetail from './components/viewEvaluateDetail.vue';
-import taskSetting from './components/taskSetting.vue';
+import addIndividualTask from './components/addIndividualTask.vue';
+import addSectionTask from './components/addSectionTask.vue';
+import viewEvaluate from './components/viewEvaluateDetail.vue';
+import individualTaskPublic from './components/IndividualTaskPublic.vue';
+import votingDetails from './components/votingDetails.vue';
+import editIndividualTask from './components/editIndividualTask.vue'
+import editSectionTask from './components/editSectionTask.vue'
 
 export default {
   components: {
-    addDialog,
-    taskSetting,
-    viewEvaluateDetail
+    addIndividualTask,
+    addSectionTask,
+    individualTaskPublic,
+    viewEvaluate,
+    votingDetails,
+    editIndividualTask,
+    editSectionTask
   },
   data() {
     return {
@@ -66,10 +95,9 @@
       selectionList: [],
       option: option,
       data: [],
-      isAddDialogVisible: false,
-      addParams: {},
+      addIndividualParams: {},
+      addSectionParams: {},
       viewParams: {},
-      depts: [],
       // 考核结果参数
       defaultTaskType: 0,
       taskTypeList: {
@@ -84,10 +112,13 @@
           },
         ],
       },
-      // 任务设置参数
-      taskSettingParams: {},
       // 信息预览弹窗
-      viewEvaluateDetailParams: {},
+      viewEvaluateParams: {},
+      taskPublicParams: {},
+      votingParams: {},
+      // 编辑
+      editIndividualTaskParams: {},
+      editSectionTaskParams: {},
     };
   },
   watch: {
@@ -126,13 +157,17 @@
   },
   methods: {
     handleAdd() {
-      this.addParams = {
+      if (!this.defaultTaskType) {
+        this.addIndividualParams = {
+          visible: true,
+          title: '添加个人评优任务'
+        }
+        return
+      }
+      this.addSectionParams = {
         visible: true,
-        title: '添加',
-        isEdit: false,
-        type: this.defaultTaskType,
-        addForm: {},
-      };
+        title: '添加部门评优任务'
+      }
     },
     rowSave(row, done, loading) {
       add(row).then(
@@ -150,21 +185,35 @@
         }
       );
     },
-    editDialog(row) {
-      this.addParams = {
+    viewHandlerClick(row) {
+      this.viewEvaluateParams = {
         visible: true,
-        title: '编辑',
-        isEdit: true,
-        type: this.defaultTaskType,
-        addForm: {
-          ...row,
-        },
-      };
+        data: row
+      }
     },
-    viewDateilDialog(row) {
-      this.viewEvaluateDetailParams = {
+    viewVotingDetailsHandlerClick(row) {
+      this.votingParams = {
         visible: true,
-        type: this.defaultTaskType,
+        data: row
+      }
+    },
+    editTaskDialog(row) {
+      if (!this.defaultTaskType) {
+        this.editIndividualTaskParams = {
+          visible: true,
+          data: row
+        }
+      } else {
+        this.editSectionTaskParams = {
+          visible: true,
+          data: row
+        }
+      }
+
+    },
+    taskPublicDialog(row) {
+      this.taskPublicParams = {
+        visible: true,
         data: row
       }
     },
@@ -295,8 +344,7 @@
 
       let values = {
         ...this.query,
-        ...params,
-        taskName_like: taskName,
+        ...params
       };
       getList(page.currentPage, page.pageSize, values).then(res => {
         const data = res.data.data;
@@ -308,15 +356,19 @@
     },
     tabChange(value) {
       this.defaultTaskType = value.prop;
-    },
-    taskSettingDialog(row) {
-      this.taskSettingParams = {
-        visible: true,
-        task: row
-      }
     }
   },
+  provide() {
+    return {
+      type: () => this.defaultTaskType
+    }
+  }
 };
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+.time-box {
+  display: inline-block;
+  text-align: center;
+}
+</style>

--
Gitblit v1.9.3