GuLiMmo
2024-01-05 901607bb65a40aebf55a246d64b09d3f3a99cd5c
src/views/evaluate/evaluateTask.vue
@@ -5,17 +5,20 @@
      :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>
        {{ row.candidateCutoffTimeEnd || '结束时间未完善' }}
        <div class="time-box">
          {{ row.candidateCutoffTimeStart }}
          <div>-</div>
          {{ row.candidateCutoffTimeEnd }}
        </div>
      </template>
      <template #evaluateCutoffTimeEnd="{ row }">
        {{ row.evaluateCutoffTimeStart || '开始时间未完善' }}
        <div style="text-align: center;">-</div>
        {{ row.candidateCutoffTimeEnd || '结束时间未完善' }}
        <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>
@@ -25,12 +28,16 @@
      </template>
      <template #menu="{ size, row, index }">
        <el-button type="primary" text plain icon="el-icon-view" @click="viewDateilDialog(row)">详情</el-button>
        <el-button type="primary" v-if="!row.type && row.candidateState === 2 && !row.evaluateState" text plain icon="el-icon-position"
          @click="taskPublicDialog(row)">发布</el-button>
        <el-button type="danger" text plain icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
      </template>
    </avue-crud>
    <!-- 新增个人评优任务弹窗 -->
    <addIndividualTask :params="addIndividualParams" @refreshTable="this.onLoad" />
    <addSectionTask :params="addSectionParams" @refreshTable="this.onLoad" />
    <!-- 发布 -->
    <individualTaskPublic :params="taskPublicParams" @refreshTable="this.onLoad" />
    <!-- 预览 -->
    <viewEvaluateDetail :params="viewEvaluateDetailParams" />
  </basic-container>
@@ -49,11 +56,13 @@
import addIndividualTask from './components/addIndividualTask.vue';
import addSectionTask from './components/addSectionTask.vue';
import viewEvaluateDetail from './components/viewEvaluateDetail.vue';
import individualTaskPublic from './components/IndividualTaskPublic.vue';
export default {
  components: {
    addIndividualTask,
    addSectionTask,
    individualTaskPublic,
    viewEvaluateDetail
  },
  data() {
@@ -74,7 +83,6 @@
      addIndividualParams: {},
      addSectionParams: {},
      viewParams: {},
      depts: [],
      // 考核结果参数
      defaultTaskType: 0,
      taskTypeList: {
@@ -91,6 +99,7 @@
      },
      // 信息预览弹窗
      viewEvaluateDetailParams: {},
      taskPublicParams: {}
    };
  },
  watch: {
@@ -104,7 +113,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,
    },
@@ -161,6 +170,12 @@
      this.viewEvaluateDetailParams = {
        visible: true,
        type: this.defaultTaskType,
        data: row
      }
    },
    taskPublicDialog(row) {
      this.taskPublicParams = {
        visible: true,
        data: row
      }
    },
@@ -291,8 +306,7 @@
      let values = {
        ...this.query,
        ...params,
        taskName_like: taskName,
        ...params
      };
      getList(page.currentPage, page.pageSize, values).then(res => {
        const data = res.data.data;
@@ -314,4 +328,9 @@
};
</script>
<style></style>
<style lang="scss" scoped>
.time-box {
  display: inline-block;
  text-align: center;
}
</style>