GuLiMmo
2024-01-04 0ee82baedf5e7611b978040f7285ddfbc436bc34
src/views/evaluate/evaluateTask.vue
@@ -5,7 +5,8 @@
      :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate"
      @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">
      @refresh-change="refreshChange" >
      <!-- @on-load="onLoad" -->
      <template #candidateCutoffTimeEnd="{ row }">
        {{ row.candidateCutoffTimeStart || '开始时间未完善' }}
        <div style="text-align: center;">-</div>
@@ -17,30 +18,21 @@
        {{ row.candidateCutoffTimeEnd || '结束时间未完善' }}
      </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> -->
        <!-- v-if="row.candidateState === 2 && row.evaluateState === 0" -->
        <el-button type="primary" text plain icon="el-icon-position" @click="taskPublicHandler(row)"
          >发布</el-button>
        <!-- <el-button type="primary" text plain icon="el-icon-download">导出</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" />
    <!-- 新增个人评优任务弹窗 -->
    <addIndividualTask :params="addIndividualParams" @refreshTable="this.onLoad" />
    <addSectionTask :params="addSectionParams" @refreshTable="this.onLoad" />
    <!-- 预览 -->
    <viewEvaluateDetail :params="viewEvaluateDetailParams" />
    <!-- 发布 -->
    <taskPublic :params="taskPublicParams"></taskPublic>
  </basic-container>
</template>
@@ -54,17 +46,15 @@
import { dateNow } from '@/utils/date';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import addDialog from './components/addDialog.vue';;
import addIndividualTask from './components/addIndividualTask.vue';
import addSectionTask from './components/addSectionTask.vue';
import viewEvaluateDetail from './components/viewEvaluateDetail.vue';
import taskSetting from './components/taskSetting.vue';
import taskPublic from './components/taskPublic.vue';
export default {
  components: {
    addDialog,
    taskSetting,
    viewEvaluateDetail,
    taskPublic
    addIndividualTask,
    addSectionTask,
    viewEvaluateDetail
  },
  data() {
    return {
@@ -81,8 +71,8 @@
      selectionList: [],
      option: option,
      data: [],
      isAddDialogVisible: false,
      addParams: {},
      addIndividualParams: {},
      addSectionParams: {},
      viewParams: {},
      depts: [],
      // 考核结果参数
@@ -99,12 +89,8 @@
          },
        ],
      },
      // 任务设置参数
      taskSettingParams: {},
      // 信息预览弹窗
      viewEvaluateDetailParams: {},
      // 发布
      taskPublicParams: {},
    };
  },
  watch: {
@@ -118,7 +104,7 @@
        // 更改option
        !n ? (this.option = option) : (this.option = sectionOption)
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        // this.onLoad(this.page, params);
      },
      immediate: true,
    },
@@ -143,13 +129,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(
@@ -166,17 +156,6 @@
          window.console.log(error);
        }
      );
    },
    editDialog(row) {
      this.addParams = {
        visible: true,
        title: '编辑',
        isEdit: true,
        type: this.defaultTaskType,
        addForm: {
          ...row,
        },
      };
    },
    viewDateilDialog(row) {
      this.viewEvaluateDetailParams = {
@@ -325,19 +304,6 @@
    },
    tabChange(value) {
      this.defaultTaskType = value.prop;
    },
    taskSettingDialog(row) {
      this.taskSettingParams = {
        visible: true,
        type: this.defaultTaskType,
        task: row
      }
    },
    taskPublicHandler(row) {
      this.taskPublicParams = {
        visible: true,
        data: row
      }
    }
  },
  provide() {