Newer
Older
HuangJiPC / src / pages / views / performance / evaluationCG.vue
@zhangdeliang zhangdeliang on 21 Jun 52 KB update
<template>
  <!-- 常规考核 -->
  <div class="changguiPage">
    <div class="searchBoxs">
      <n-space>
        <!-- <div class="name">工程类型:</div> -->
        <n-space>
          <n-select v-model:value="selectyear" placeholder="请选择考核年份" clearable :options="yearOptions" style="width: 200px">
          </n-select>
        </n-space>
        <n-select v-model:value="searchVal2" style="width: 200px" placeholder="考核类型" :options="bkwzOptions" clearable> </n-select>
        <n-select v-model:value="searchVal3" style="width: 200px" placeholder="考核审批结果" :options="SpResultOptions" clearable>
        </n-select>
        <n-button type="primary" @click="handleClick('search')">
          <template #icon>
            <n-icon>
              <Search />
            </n-icon>
          </template>
          搜索
        </n-button>
        <n-button type="primary" @click="handleClick('add')">
          <template #icon>
            <n-icon>
              <Add />
            </n-icon>
          </template>
          新增
        </n-button>
      </n-space>
    </div>
    <!-- 表格 -->
    <div class="tableBox">
      <n-data-table
        :bordered="false"
        :max-height="700"
        striped
        :columns="columns"
        :data="tableData"
        :loading="tableLoading"
        :remote="true"
        :pagination="pagination"
      >
      </n-data-table>
    </div>
    <!-- 去考评点击弹窗 -->
    <n-modal
      :title="kaopingTitle"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '1800px' }"
      v-model:show="kaopingShow"
    >
      <div class="kaopingTable">
        <n-radio-group v-model:value="kaopingtypeValue.Type">
          <n-space>
            <!-- 项目产出绩效考核指标  项目运营维护绩效考核指标 成本效益和安全保障绩效考核指标-->
            <n-radio :value="item.id" v-for="item in radioArr" :key="item.id" @change="changeRadio">
              {{ item.name }}
            </n-radio>
          </n-space>
        </n-radio-group>
        <!-- 效果绩效考核指标有加分项 -->
        <n-button type="primary" style="margin-left: 100px" v-if="kaopingtypeValue.Type == '98'" @click="handleClick('addScore')">
          加分项
        </n-button>
        <n-divider />
        <n-data-table
          :bordered="true"
          :max-height="600"
          :single-line="false"
          :columns="kaopingcolumns"
          :data="kaopingtableData"
          :loading="tableLoadingKP"
          :remote="true"
        >
        </n-data-table>
      </div>
    </n-modal>
    <!-- 加分项弹窗 -->
    <n-modal
      title="效果-社会影响-社会影响指标加分项"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '1700px' }"
      v-model:show="addScoreShow"
    >
      <AddScore @refreshData="refreshData" v-if="addScoreShow" ref="evaluationAddScore" :mainId="oneLevelId"></AddScore>
    </n-modal>
    <!-- 加分问题数点击 -->
    <n-modal
      title="加分问题清单"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '1500px' }"
      v-model:show="addScoreModal"
    >
      <AddScoreHistory :mainId="mainId" />
    </n-modal>
    <!-- 考评发现问题点击弹窗 -->
    <n-modal
      :title="issuesTitle"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '1800px' }"
      v-model:show="findissues"
    >
      <n-form ref="deductformRef" label-align="right" require-mark-placement="left" :label-width="100" label-placement="left">
        <n-form-item>
          <n-input v-model:value="scoreStandard" type="textarea" autosize readonly="true"></n-input>
        </n-form-item>
        <n-form-item>
          <n-button type="primary" @click="handleClick('addissues')">新增常规考核问题</n-button>
        </n-form-item>
        <n-form-item>
          <n-data-table
            :bordered="true"
            :single-line="false"
            :max-height="700"
            :striped="true"
            :columns="findissuescolumns"
            :data="findissuesData"
            :pagination="pagination2"
            :loading="tableListLoading"
            :remote="true"
          >
          </n-data-table>
        </n-form-item>
      </n-form>
    </n-modal>
    <!-- 考评发现问题新增弹窗 -->
    <n-modal
      title="常规考核添加问题详情"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '1700px' }"
      v-model:show="addissueShow"
    >
      <Kpques
        :indexId="addFormValue.data.indexId"
        :codeId="addFormValue.data.codeId"
        :mainId="addFormValue.data.mainId"
        :type="addFormValue.data.type"
        :relIndexIdType="addFormValue.data.relIndexIdType"
        :indexscore="addFormValue.data.indexscore"
        :ifQuesUpdate="ifQuesUpdate"
        :updateQuesObj="updateQuesObj"
        @refreshData="refreshData"
      ></Kpques>
    </n-modal>

    <!-- 考评发现问题详情弹窗 -->
    <n-modal
      title="问题详情查看"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '600px' }"
      v-model:show="addissueDetailShow"
    >
      <KpquesDetail :quesDetailId="quesDetailId"></KpquesDetail>
    </n-modal>

    <!-- 常规问题清单 -->
    <n-modal
      title="常规问题清单"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '1800px' }"
      v-model:show="deductShow"
    >
      <n-form ref="deductformRef" label-align="right" require-mark-placement="left" :label-width="80" label-placement="left" inline>
        <n-form-item label="状态:" path="status">
          <n-select v-model:value="problemStatus" style="width: 100px" :options="deductstateOptions" clearable> </n-select>
        </n-form-item>
        <n-form-item label="项目类型:" path="codeName">
          <n-select v-model:value="problemcodeId" style="width: 300px" :options="deductypeOptions" clearable @update:value="changeSelect1">
          </n-select>
        </n-form-item>
        <n-form-item label="考核项目:" path="degist">
          <n-select
            v-model:value="problemsubProjectId"
            style="width: 300px"
            :options="subProjectOptions"
            clearable
            @update:value="changeSelect2"
          >
          </n-select>
        </n-form-item>
        <n-form-item label="指标类型:" path="degist">
          <n-select v-model:value="indexOneId" style="width: 200px" :options="indexOneOptions" clearable @update:value="changeSelect3">
          </n-select>
        </n-form-item>
        <n-form-item>
          <n-button type="primary" @click="handleClick('searchproblem')">查询</n-button>
          <n-button type="primary" style="margin-left: 10px" @click="exportQues">导出</n-button>
        </n-form-item>
      </n-form>
      <n-data-table
        :bordered="true"
        :single-line="false"
        :max-height="600"
        :striped="true"
        :columns="Listcolumns"
        :data="tableListData"
        :loading="tableLoadingQD"
        :remote="true"
        :pagination="pagination3"
      >
      </n-data-table>
    </n-modal>
    <!-- 整改弹窗 -->
    <n-modal
      :title="RectifyTitle"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '600px' }"
      v-model:show="RectifyShow"
    >
      <n-form
        ref="RectifyformRef"
        label-align="right"
        :label-width="80"
        require-mark-placement="left"
        :rules="RectifyformInfo.rules"
        :model="RectifyformInfo.data"
        label-placement="left"
      >
        <n-form-item label="整改人员:" path="dealMan">
          <n-select v-model:value="RectifyformInfo.data.dealMan" :options="userOptions" filterable> </n-select>
        </n-form-item>
        <n-form-item label="整改时间:" path="dealTime">
          <n-date-picker v-model:value="RectifyformInfo.data.dealTime" type="datetime" placeholder="请选择" style="width: 100%" />
        </n-form-item>
        <n-form-item label="处理结果:" path="dealResult">
          <n-input
            v-model:value="RectifyformInfo.data.dealResult"
            type="textarea"
            maxlength="200"
            show-count
            :autosize="{ minRows: 5, maxRows: 10 }"
          />
        </n-form-item>
        <n-form-item label="整改图片:" path="fileNo" class="uploadWarns">
          <n-upload
            v-model:file-list="uploadListZG"
            accept=".jpg,.png,.jpeg,.svg,.gif"
            :max="3"
            list-type="image-card"
            @change="changeFileZG"
          >
          </n-upload>
          <span style="margin-top: 10px">提示:格式为.jpg,.png,.jpeg,.svg,.gif,每个图片大小小于10M</span>
        </n-form-item>
        <n-form-item>
          <n-button type="primary" style="left: 90%" @click="handleClick('rectifySave')">提交</n-button>
        </n-form-item>
      </n-form>
    </n-modal>
    <!-- 核销弹窗 -->
    <n-modal :title="HXTitle" :mask-closable="false" preset="dialog" :show-icon="false" :style="{ width: '600px' }" v-model:show="HXShow">
      <n-form
        ref="HXformRef"
        label-align="right"
        :label-width="80"
        require-mark-placement="left"
        :rules="HXformInfo.rules"
        :model="HXformInfo.data"
        label-placement="left"
      >
        <n-form-item label="核销人员:" path="checkMan">
          <n-select v-model:value="HXformInfo.data.checkMan" :options="userOptions" filterable> </n-select>
        </n-form-item>
        <n-form-item label="核销时间:" path="checkTime">
          <n-date-picker v-model:value="HXformInfo.data.checkTime" type="datetime" placeholder="请选择" style="width: 100%" />
        </n-form-item>
        <n-form-item style="margin-top: 300px">
          <n-button type="primary" style="left: 90%" @click="handleClick('hexiao')">提交</n-button>
        </n-form-item>
      </n-form>
    </n-modal>
    <!-- 新增修改常规考核弹窗 -->
    <n-modal
      :title="modalTitle"
      :mask-closable="false"
      preset="dialog"
      :show-icon="false"
      :style="{ width: '500px' }"
      v-model:show="modalShow"
    >
      <n-form
        ref="formRef"
        label-align="right"
        require-mark-placement="left"
        :label-width="120"
        :rules="formInfo.rules"
        :model="formInfo.data"
        label-placement="left"
        style="height: 380px"
      >
        <n-form-item label="考核类型:" path="performType">
          <n-select v-model:value="formInfo.data.performType" :options="bkwzOptions" clearable> </n-select>
        </n-form-item>
        <n-form-item label="年份:" path="year">
          <n-date-picker v-model:value="formInfo.data.year" type="year" style="width: 100%" />
        </n-form-item>
        <n-form-item label="第一季度月份:" path="performStart">
          <n-date-picker v-model:value="formInfo.data.performStart" type="date" style="width: 100%" />
        </n-form-item>
      </n-form>
      <n-divider />
      <template #action>
        <n-space>
          <n-button type="primary" @click="handleClick('submit')">保存 </n-button>
          <n-button @click="() => (modalShow = false)">取消</n-button>
        </n-space>
      </template>
    </n-modal>
  </div>
</template>

<script>
import { toRefs, onMounted, reactive, h, ref, nextTick } from 'vue';
import { Search, Add } from '@vicons/ionicons5';
import { NButton, NTag, NInput, NImage } from 'naive-ui';
import Kpques from './evaluationQues.vue'; //指标问题添加
import KpquesDetail from './evaluationQuesDetail.vue'; //指标问题详情查看
import AddScore from './evaluationAddScore.vue'; //加分项-社会问题
import AddScoreHistory from './evaluationAddScoreHis.vue'; //加分项-问题清单
import { downloadBlob } from '@/utils/util';
import {
  fileUpload,
  fileDelete,
  AssessSelectInfo,
  IndexsClassOne,
  AssessCGResultSave,
  AssessCGResultUpdate,
  AssessCGResultInfo,
  LSproblemList,
  CGKaopingGetData,
  AssessResultDel,
  checkConfirmCancel,
  KaopingGetProblemData,
  addProblemSave,
  AssessRectification,
  AssessCheckQuestions,
  AssessCGResultAudit,
  getSubProjectTypeByCodeId,
  getIndexsOneListBySubProjectId,
  getAllProjectType,
  AssessCheckDelete,
  allUserGet,
  normalNameList,
} from '@/services';
import { resetForm, formatDate } from '@/utils/util';
import axios from 'axios';

export default {
  name: 'weihuPage',
  components: { Search, Add, NButton, Kpques, KpquesDetail, AddScore, AddScoreHistory },
  setup() {
    const allData = reactive({
      yearOptions: [],
      userOptions: [],
      searchVal1: null,
      selectyear: null,
      searchVal2: null,
      searchVal3: null,
      auditName: '',
      addScoreShow: false,
      addScoreModal: false,
      SpResultOptions: [
        //考核审批结果
        { value: 0, label: '未审批' },
        { value: 1, label: '已审批' },
      ],
      sectionOptions: [
        //考核季度选择
        { value: 0, label: '一季度' },
        { value: 1, label: '二季度' },
        { value: 2, label: '三季度' },
        { value: 3, label: '四季度' },
      ],
      scoreStandard: '', //评分标准
      problemStatus: null, //扣分问题数问题状态
      problemcodeId: null, //扣分问题数项目类型
      problemsubProjectId: null, //扣分问题数考核项目
      indexOneId: null, //扣分问题数指标类型
      mainId: null,
      oneLevelId: null,
      radioArr: [
        { id: '96', name: '项目产出绩效考核指标' },
        { id: '98', name: '项目效果绩效考核指标' },
        { id: '100', name: '项目管理绩效考核指标' },
      ],
      quesDetailId: null, //查看指标问题详情id
      ifQuesUpdate: false,
      updateQuesObj: {},
      modalTitle: '新增季度考核',
      kaopingTitle: '', //考评弹窗
      RectifyTitle: null, //整改弹窗
      checkTitle: null, //查看弹窗
      HXTitle: '', //核销弹窗
      HXId: '',
      HXShow: false,
      issuesTitle: null, //去考评发现问题查看
      modalShow: false,
      kaopingShow: false,
      findissues: false,
      deductShow: false,
      RectifyShow: false,
      addissueShow: false,
      addissueDetailShow: false,
      issuesShow: false,
      uploadList: [],
      uploadListXC: [],
      uploadListZG: [], //整改现场图片
      imageXC: [],
      imageZG: [], //整改现场图片
      rectifyid: null, //整改所需ID
      addFormValue: {
        data: {
          questDesc: null,
          fileNo: [],
          subProjectId: null,
          mainId: null,
          indexId: null,
          codeId: null,
          type: 1,
          cutScore: null,
          indexscore: null,
          relIndexIdType: null,
        },
        rules: {
          questDesc: {
            required: true,
            trigger: ['blur'],
            message: '请输入问题描述',
          },
          subProjectId: {
            type: 'number',
            required: true,
            trigger: ['change'],
            message: '请选择考核子项',
          },
          cutScore: {
            type: 'number',
            required: true,
            trigger: ['change'],
            message: '请输入',
          },
        },
      },
      kaopingtypeValue: {
        Type: 0,
      },
      formInfo: {
        data: {
          //performName: null, //考核名称
          performType: null, //考核类型
          year: null, //考核年
          //questions: null, //考核问题数
          //yearMonth: null,
          fileNo: [],
          //section: null, //考核季度
          performStart: null, //第一周期起始时间
        },
        rules: {
          performStart: {
            type: 'number',
            required: true,
            trigger: ['change', 'blur'],
            message: '请选择考核第一周期起始时间',
          },
          year: {
            type: 'number',
            required: true,
            trigger: ['change', 'blur'],
            message: '请选择考核年份',
          },
          performType: {
            type: 'number',
            required: true,
            trigger: ['change'],
            message: '请选择考核类型',
          },
        },
      },
      //问题清单
      problemlist: {
        data: {
          status: null, //问题状态
          codeName: null, //项目类型
          insOneId: null, //一级指标
          insTwoId: null, //二级指标
          projectSub: null, //考核项目
        },
      },
      //去考评发现问题查看信息
      issuesformInfo: {
        data: {
          mainName: null,
          questDesc: null,
          reportMan: null,
        },
      },
      RectifyformInfo: {
        data: {
          dealResult: null,
          dealTime: null,
          dealMan: null,
          fileNo: [],
          id: null,
        },
        rules: {
          dealMan: { required: true, trigger: ['change'], message: '请选择' },
          dealTime: { required: true, trigger: ['change'], message: '请选择', type: 'number' },
          dealResult: { required: true, trigger: ['blur'], message: '请输入处理结果' },
        },
      },
      HXformInfo: {
        data: {
          checkMan: null,
          checkTime: null,
          id: null,
        },
        rules: {
          checkMan: { required: true, trigger: ['change'], message: '请选择' },
          checkTime: { required: true, trigger: ['change'], message: '请选择', type: 'number' },
        },
      },
      checkformInfo: {
        data: {
          checkinfo: null,
        },
      },
      tableLoading: true,
      tableLoadingKP: true,
      tableListLoading: true,
      tableLoadingQD: true,
      tableData: [],
      tableListData: [],
      findissuesData: [],
      kaopingtableData: [],
      addissuesData: [],
      bkwzOptions: [
        { value: 0, label: '项目公司考核' },
        { value: 1, label: '水务局考核' },
      ],
      examineOptions: [],
      rangeOptions: [],
      deductstateOptions: [
        { value: 0, label: '待整改' },
        { value: 1, label: '已整改' },
        { value: 2, label: '已核销' },
      ],
      deductypeOptions: [],
      subProjectOptions: [],
      indexOneOptions: [],
      columns: [
        {
          title: '序号',
          align: 'center',
          width: '80',
          render(row, index) {
            return (paginationReactive.page - 1) * paginationReactive.pageSize + index + 1;
          },
        },
        { title: '考核名称', align: 'center', key: 'performName' },
        { title: '考核类型', align: 'center', key: 'performType' },
        { title: '考核周期', align: 'center', key: 'performStart', width: '180' },
        {
          title: '考核结果审批',
          align: 'center',
          key: 'checkStatus',
          render(row) {
            return row.checkStatus == 1 ? '已审核' : '未审核';
          },
        },
        { title: '季度得分', align: 'center', key: 'score' },
        {
          title: '扣分问题数',
          align: 'center',
          key: 'questions',
          render(row) {
            return h(
              NTag,
              {
                bordered: true,
                type: 'success',
                onClick: () => {
                  if (row.questions > 0) handleClick('deductNum', row);
                },
              },
              { default: () => row.questions }
            );
          },
        },
        {
          title: '加分项数',
          align: 'center',
          key: 'bonusCount ',
          render(row) {
            return h(
              NTag,
              {
                bordered: true,
                type: 'success',
                onClick: () => {
                  if (row.bonusCount > 0) handleClick('addNum', row);
                },
              },
              { default: () => row.bonusCount }
            );
          },
        },
        { title: '创建人', align: 'center', key: 'createUser' },
        { title: '创建时间', align: 'center', key: 'createTime', width: '160' },
        {
          title: '操作',
          key: 'actions',
          width: '220',
          align: 'center',
          render(row) {
            let arrBtn = [];
            if (row.checkStatus == 0) {
              arrBtn = [
                { btnType: 'primary', type: 'edit', default: '去考评' },
                // { btnType: 'primary', type: 'editName', default: '修改考核名称' },
                { btnType: 'info', type: 'audit', default: '审核' },
                { btnType: 'error', type: 'delete', default: '删除' },
              ];
            } else if (row.checkStatus == 1 && localStorage.getItem('returnBackUser') == 'gfang') {
              // 已审核,固定账号才能撤销操作(黄机客户提出的)
              arrBtn = [{ btnType: 'primary', type: 'returnBack', default: '撤销' }];
            }
            const btn = arrBtn.map((item, index) => {
              return h(
                NButton,
                {
                  text: true,
                  size: 'small',
                  style: { margin: '10px' },
                  type: item.btnType,
                  onClick: () => handleClick(item.type, row),
                },
                { default: () => item.default }
              );
            });
            return btn;
          },
        },
      ],
      kaopingcolumns: [
        {
          title: '考核项目',
          align: 'center',
          key: 'codeName',
          rowSpan: (row, index) => {
            return row.rowSpan0;
          },
          width: '120',
        },
        {
          title: '一级指标',
          align: 'center',
          key: 'insOneName',
          rowSpan: (row, index) => {
            return row.rowSpan1;
          },
          width: '120',
        },
        {
          title: '二级指标',
          align: 'center',
          key: 'insTwoName',
          rowSpan: (row, index) => {
            return row.rowSpan2;
          },
          width: '120',
        },
        {
          title: '三级指标',
          align: 'center',
          key: 'insThreeName',
          rowSpan: (row, index) => {
            return row.rowSpan3;
          },
          width: '120',
        },
        { title: '指标名称', align: 'center', key: 'indexName' },
        { title: '指标解释', align: 'center', key: 'indexExp', ellipsis: { tooltip: true } },
        { title: '评价依据', align: 'center', key: 'scoreBasis', ellipsis: { tooltip: true } },
        { title: '评分标准', align: 'center', key: 'scoreStandard', ellipsis: { tooltip: true } },
        { title: '标准分值', align: 'center', key: 'score', width: '60' },
        { title: '实际得分', align: 'center', key: 'acuScore', width: '60' },
        {
          title: '发现问题',
          align: 'center',
          key: 'questions',
          width: '60',
          render(row) {
            return h(
              NTag,
              {
                type: 'success',
                onClick: () => handleClick('findissues', row),
              },
              { default: () => row.questions }
            );
          },
        },
      ],
      Listcolumns: [
        {
          title: '序号',
          align: 'center',
          width: '60',
          render(row, index) {
            return (paginationReactive.page - 1) * paginationReactive.pageSize + index + 1;
          },
        },
        { title: '考核子项目', align: 'center', key: 'subProjectName', width: '160' },
        { title: '考核指标', align: 'center', key: 'indexName', width: '160' },
        { title: '问题原因', align: 'center', key: 'questTypeName' },
        {
          title: '问题描述',
          align: 'center',
          key: 'questDesc',
          ellipsis: {
            tooltip: true,
          },
        },
        { title: '状态', align: 'center', key: 'statusDesc', width: '80' },
        { title: '扣分', align: 'center', key: 'cutScore', width: '60' },
        { title: '上报人', align: 'center', key: 'reportMan', width: '80' },
        { title: '上报时间', align: 'center', key: 'reportTime', width: '160' },
        { title: '整改人', align: 'center', key: 'dealMan', width: '80' },
        { title: '整改时间', align: 'center', key: 'dealTime', width: '160' },
        { title: '核销人', align: 'center', key: 'checkMan', width: '80' },
        { title: '核销时间', align: 'center', key: 'checkTime', width: '160' },
        {
          title: '操作',
          key: 'operation',
          width: '220',
          align: 'center',
          render(row) {
            let arrs = [];
            if (row.status == 0) {
              arrs = [
                { btnType: 'success', type: 'rectify', default: '整改' },
                { btnType: 'primary', type: 'editQuesqd', default: '修改' },
                { btnType: 'info', type: 'qdInfo', default: '查看' },
              ];
            } else if (row.status == 1) {
              arrs = [
                { btnType: 'info', type: 'qdInfo', default: '查看' },
                { btnType: 'primary', type: 'editQuesqd', default: '修改' },
                { btnType: 'default', type: 'logout', default: '核销' },
              ];
            } else {
              arrs = [
                { btnType: 'primary', type: 'editQuesqd', default: '修改' },
                { btnType: 'info', type: 'qdInfo', default: '查看' },
              ];
            }
            let btn = arrs.map((item) => {
              return h(
                NButton,
                {
                  text: true,
                  size: 'small',
                  style: { margin: '10px' },
                  type: item.btnType,
                  onClick: () => handleClick(item.type, row),
                },
                { default: () => item.default }
              );
            });
            return btn;
          },
        },
      ],
      findissuescolumns: [
        {
          title: '序号',
          align: 'center',
          width: '60',
          render(row, index) {
            return (paginationReactive.page - 1) * paginationReactive.pageSize + index + 1;
          },
        },
        { title: '考核子项目', align: 'center', key: 'subProjectName', width: '160' },
        { title: '考核指标', align: 'center', key: 'indexName', width: '160' },
        { title: '问题原因', align: 'center', key: 'questTypeName' },
        {
          title: '问题描述',
          align: 'center',
          key: 'questDesc',
          ellipsis: {
            tooltip: true,
          },
        },
        { title: '状态', align: 'center', key: 'statusDesc', width: '80' },
        { title: '扣分', align: 'center', key: 'cutScore', width: '60' },
        { title: '上报人', align: 'center', key: 'reportMan', width: '80' },
        { title: '上报时间', align: 'center', key: 'reportTime', width: '160' },
        { title: '整改人', align: 'center', key: 'dealMan', width: '80' },
        { title: '整改时间', align: 'center', key: 'dealTime', width: '160' },
        { title: '核销人', align: 'center', key: 'checkMan', width: '80' },
        { title: '核销时间', align: 'center', key: 'checkTime', width: '160' },
        {
          title: '操作',
          key: 'operation',
          align: 'center',
          width: '180',
          render(row) {
            let arrBtn = [];
            if (row.status == 0) {
              arrBtn = [
                { btnType: 'info', type: 'quesDetail', default: '查看' },
                { btnType: 'info', type: 'quesEdit', default: '修改' },
                { btnType: 'warning', type: 'quesDelete', default: '删除' },
              ];
            } else {
              arrBtn = [
                { btnType: 'info', type: 'quesEdit', default: '修改' },
                { btnType: 'info', type: 'quesDetail', default: '查看' },
                { btnType: 'warning', type: 'quesDelete', default: '删除' },
              ];
            }
            const btn = arrBtn.map((item, index) => {
              return h(
                NButton,
                {
                  text: true,
                  size: item.size,
                  style: {
                    margin: '10px',
                  },
                  type: item.btnType,
                  onClick: () => handleClick(item.type, row),
                },
                { default: () => item.default }
              );
            });
            return btn;
          },
        },
      ],
    });
    //分页
    const paginationReactive = reactive({
      page: 1,
      pageSize: 10,
      showSizePicker: true,
      pageSizes: [10, 20, 50],
      showQuickJumper: true,
      pageCount: 0,
      itemCount: 0,
      prefix: () => {
        return '共 ' + paginationReactive.itemCount + ' 项';
      },
      onChange: (page) => {
        paginationReactive.page = page;
        getTableData();
      },
      onPageSizeChange: (pageSize) => {
        paginationReactive.pageSize = pageSize;
        paginationReactive.page = 1;
        getTableData();
      },
    });
    //获取表格数据
    const getTableData = async () => {
      allData.tableLoading = true;
      let pramas = {
        current: paginationReactive.page,
        size: paginationReactive.pageSize,
        performType: allData.searchVal2,
        year: formatDate(allData.selectyear, 'YYYY'),
        checkStatus: allData.searchVal3,
      };

      let res = await AssessCGResultInfo(pramas);
      if (res && res.code == 200) {
        if (res.data == null) return;
        allData.tableData = res.data.records;
        res.data.records.forEach((item) => {
          item.performStart = item.performStart + '-' + item.performEnd;
          if (item.performType == 0) {
            item.performType = '项目公司考核';
          } else {
            item.performType = '水务局考核';
          }
        });
        paginationReactive.pageCount = res.data.pages;
        paginationReactive.itemCount = res.data.total || 0;
      }
      allData.tableLoading = false;
    };
    // 问题数列表分页
    const paginationReactive2 = reactive({
      page: 1,
      pageSize: 10,
      showSizePicker: true,
      pageSizes: [10, 20, 50],
      showQuickJumper: true,
      pageCount: 0,
      itemCount: 0,
      prefix: () => {
        return '共 ' + paginationReactive2.itemCount + ' 项';
      },
      onChange: (page) => {
        paginationReactive2.page = page;
        getKaopingNumData();
      },
      onPageSizeChange: (pageSize) => {
        paginationReactive2.pageSize = pageSize;
        paginationReactive2.page = 1;
        getKaopingNumData();
      },
    });
    // 问题清单分页
    const paginationReactive3 = reactive({
      page: 1,
      pageSize: 10,
      showSizePicker: true,
      pageSizes: [10, 20, 50],
      showQuickJumper: true,
      pageCount: 0,
      itemCount: 0,
      prefix: () => {
        return '共 ' + paginationReactive3.itemCount + ' 项';
      },
      onChange: (page) => {
        paginationReactive3.page = page;
        getNumData();
      },
      onPageSizeChange: (pageSize) => {
        paginationReactive3.pageSize = pageSize;
        paginationReactive3.page = 1;
        getNumData();
      },
    });
    const evaluationAddScore = ref(null);
    const formRef = ref(null);
    const addProblemformRef = ref(null);
    const RectifyformRef = ref(null);
    const HXformRef = ref(null);
    const richEditor = ref(null);
    //获取工程类型
    const GetIndexClass = async () => {
      let res = await IndexsClassOne();
      let res4 = await AssessSelectInfo();
      if (res && res.code == 200) {
        let data = res.data;
        data.forEach((item) => {
          let { id, name } = item;
          allData.rangeOptions.push({ value: Number(id), label: name });
        });
      }
      if (res4 && res4.code == 200) {
        let data = res4.data;
        data.forEach((item) => {
          let { id, projectSubName } = item;
          allData.examineOptions.push({ value: Number(id), label: projectSubName });
        });
      }
    };
    //获取项目类型
    const getProjectType = async () => {
      let res1 = await getAllProjectType();
      if (res1 && res1.code == 200) {
        let data = res1.data;
        allData.deductypeOptions = data.map((item) => {
          return {
            value: item.codeId,
            label: item.codeName,
          };
        });
      }
      allData.problemcodeId = Number(allData.deductypeOptions[0].value);
      getSubProject();
    };
    //获取工程子项
    const getSubProject = async () => {
      let param = {
        codeId: allData.problemcodeId,
      };
      let res = await getSubProjectTypeByCodeId(param);
      if (res && res.code == 200) {
        let data = res.data;
        allData.subProjectOptions = data.map((item) => {
          return {
            value: item.subProjectId,
            label: item.subProjectName,
          };
        });
        allData.problemsubProjectId = Number(allData.subProjectOptions[0].value);
      }
      if (!!!allData.problemcodeId) {
        allData.problemsubProjectId = null;
      }
      getIndexsOne();
    };
    //获取指标类型
    const getIndexsOne = async () => {
      let param = {
        codeId: allData.problemcodeId,
        subProjectId: allData.problemsubProjectId,
      };
      allData.indexOneOptions = [];
      let res = await getIndexsOneListBySubProjectId(param);
      if (res && res.code == 200) {
        let data = res.data;
        allData.indexOneOptions = data.map((item) => {
          return {
            value: item.indexOne,
            label: item.indexOneName,
          };
        });
        allData.indexOneId = Number(allData.indexOneOptions[0].value);
      }
      if (!!!allData.problemcodeId || !!!allData.problemsubProjectId) {
        allData.indexOneId = null;
      }
    };
    // 问题批量保存成功之后操作
    function refreshData() {
      allData.addissueShow = false;
      getTableData(); //刷新主表格数据
      getKaopingNumData(); //刷新问题表格数据
      getKaopingData(); //刷新得分列表
      getNumData(); //刷新常规问题清单
    }
    // 点击事件
    const handleClick = async (type, row) => {
      switch (type) {
        case 'search':
          getTableData();
          break;
        case 'deductNum':
          // 扣分问题数点击
          paginationReactive3.page = 1;
          allData.deductShow = true;
          allData.mainId = row.id;
          getNumData();
          break;
        case 'addNum':
          // 加分分问题数点击
          allData.addScoreModal = true;
          allData.mainId = row.id;
          getNumData();
          break;
        case 'searchproblem':
          getNumData();
          break;
        case 'addScore':
          // 加分项点击
          allData.addScoreShow = true;
          setTimeout(() => {
            // evaluationAddScore.value.scoreStandard = row.scoreStandard;
          });
          break;
        case 'addissues':
          // 问题新增
          allData.ifQuesUpdate = false;
          allData.addissueShow = true;
          break;
        case 'quesEdit':
          // 问题修改
          allData.updateQuesObj = { ...row };
          allData.ifQuesUpdate = true;
          allData.addissueShow = true;
          break;
        case 'editQuesqd':
          // 问题清单修改 editQuesqd
          allData.updateQuesObj = { ...row };
          allData.addFormValue.data.mainId = row.mainId;
          allData.addFormValue.data.indexId = row.indexId;
          allData.addFormValue.data.codeId = row.codeId;
          allData.addFormValue.data.indexscore = row.score;
          allData.addFormValue.data.relIndexIdType = row.relIndexIdType;
          allData.ifQuesUpdate = true;
          allData.addissueShow = true;
          break;
        case 'quesDelete':
          // 问题删除
          $dialog.info({
            title: '提示',
            content: `确定删除该问题数据吗?`,
            positiveText: '确定',
            negativeText: '取消',
            onPositiveClick: async () => {
              // 确定删除
              let res = await AssessCheckDelete({ id: row.id });
              if (res && res.code == 200) {
                refreshData(); //刷新数据
              }
            },
          });
          break;
        case 'saveissues':
          addProblemformRef.value.validate((errors) => {
            if (!errors) {
              saveNewProblem();
            } else {
              $message.error('验证失败,请检查必填项');
            }
          });
          break;
        case 'findissues':
          paginationReactive2.page = 1;
          allData.findissues = true;
          allData.issuesTitle = row.codeName + '——' + row.indexName + '问题扣分项';
          allData.addFormValue.data.mainId = row.mainId;
          allData.addFormValue.data.indexId = row.relIndexId;
          allData.addFormValue.data.codeId = row.codeId;
          allData.addFormValue.data.indexscore = row.score;
          allData.addFormValue.data.relIndexIdType = row.relIndexIdType;
          allData.scoreStandard = row.scoreStandard;
          getKaopingNumData();
          break;
        case 'rectify':
          allData.RectifyTitle = row.subProjectName + '整改';
          resetForm(allData.RectifyformInfo.data);
          allData.RectifyShow = true;
          allData.rectifyid = row.id;
          allData.uploadListZG = [];
          allData.RectifyformInfo.data.fileNo = [];
          break;
        case 'audit':
          $dialog.info({
            title: '提示',
            content: `确定审批该数据吗?`,
            positiveText: '确定',
            negativeText: '取消',
            onPositiveClick: () => {
              let ids = row.id;
              AuditQuestions(ids);
            },
          });
          break;

        case 'quesDetail':
          // 问题详情查看
          allData.quesDetailId = row.id;
          allData.addissueDetailShow = true;
          break;
        case 'qdInfo':
          // 问题清单查看详情
          allData.quesDetailId = row.id;
          allData.addissueDetailShow = true;
          break;
        case 'add':
          allData.modalTitle = '新增季度考核';
          resetForm(allData.formInfo.data);
          allData.modalShow = true;
          //allData.formInfo.data.yearMonth = new Date().getTime();
          allData.uploadList = [];
          allData.formInfo.data.fileNo = [];
          break;
        case 'edit':
          allData.kaopingShow = true;
          allData.oneLevelId = row.id;
          allData.kaopingTitle = row.performName;
          allData.kaopingtypeValue.Type = allData.radioArr[0].id;
          getKaopingData();
          break;
        case 'editName':
          // 修改考核名称
          allData.auditName = row.performName;
          $dialog.info({
            title: '提示',
            positiveText: '确定',
            negativeText: '取消',
            content: () => {
              return h(NInput, {
                value: allData.auditName,
                placeholder: '请输入考核名称',
                ['onUpdate:value']: (val) => {
                  allData.auditName = val;
                },
              });
            },
            onPositiveClick: async () => {
              let res = await AssessCGResultUpdate({ performName: allData.auditName, id: row.id });
              if (res && res.code == 200) {
                getTableData();
              }
            },
            onNegativeClick: async () => {},
          });
          break;
        case 'submit':
          formRef.value.validate((errors) => {
            if (!errors) {
              submitData();
            } else {
              $message.error('验证失败,请检查必填项');
            }
          });
          break;
        case 'rectifySave': //整改提交
          RectifyformRef.value.validate((errors) => {
            if (!errors) {
              rectifyProblem();
            } else {
              $message.error('验证失败,请检查必填项');
            }
          });
          break;
        case 'logout':
          allData.HXTitle = row.subProjectName + '核销';
          resetForm(allData.HXformInfo.data);
          allData.HXId = row.id;
          allData.HXShow = true;
          // $dialog.info({
          //   title: '提示',
          //   content: `确定核销该数据吗?`,
          //   positiveText: '确定',
          //   negativeText: '取消',
          //   onPositiveClick: () => {
          //     let ids = row.id;
          //     CheckQuestions(ids);
          //   },
          // });
          break;
        case 'hexiao':
          // 核销提交
          HXformRef.value.validate((errors) => {
            if (!errors) {
              CheckQuestions(allData.HXId);
            } else {
              $message.error('验证失败,请检查必填项');
            }
          });
          break;
        case 'delete':
          $dialog.info({
            title: '提示',
            content: `确定删除该数据吗?`,
            positiveText: '确定',
            negativeText: '取消',
            onPositiveClick: () => {
              let ids = [row.id];
              dataDel(ids);
            },
          });
          break;
        case 'returnBack':
          // 撤销操作
          $dialog.info({
            title: '提示',
            content: `确定撤回该数据吗?`,
            positiveText: '确定',
            negativeText: '取消',
            onPositiveClick: () => {
              returnBackData(row.id);
            },
          });
          break;
      }
    };
    // 问题清单导出
    const token = localStorage.getItem('tokenXF');
    function exportQues() {
      if (allData.tableListData.length == 0) {
        $message.error('表格数据为空,无法导出');
        return;
      }
      axios
        .get(`/api/perform/evaluatequestions/getQuestionsExcel`, {
          headers: {
            token: token,
          },
          responseType: 'blob',
          params: {
            mainId: allData.mainId,
            status: allData.problemStatus,
            codeId: allData.problemcodeId,
            subProjectId: allData.problemsubProjectId,
            indexOne: allData.indexOneId,
          },
        })
        .then(function (res) {
          downloadBlob(res.data, decodeURIComponent(res.headers['content-disposition'].split('filename=')[1]));
        });
    }
    // 点击问题数清单查看弹窗
    async function getNumData() {
      allData.tableLoadingQD = true;
      let param = {
        current: paginationReactive3.page,
        size: paginationReactive3.pageSize,
        mainId: allData.mainId,
        status: allData.problemStatus,
        codeId: allData.problemcodeId,
        subProjectId: allData.problemsubProjectId,
        indexOne: allData.indexOneId,
      };
      let res = await LSproblemList(param);
      if (res && res.code == 200) {
        allData.tableLoadingQD = false;
        let datas = res.data || [];
        allData.tableListData = datas.records;
        paginationReactive3.pageCount = datas.pages;
        paginationReactive3.itemCount = datas.total || 0;
      }
    }
    //切换项目类型
    function changeSelect1(e) {
      allData.problemcodeId = e;
      getSubProject();
    }
    //切换考核项目
    function changeSelect2(e) {
      allData.problemsubProjectId = e;
      getIndexsOne();
    }
    //切换指标类型
    function changeSelect3(e) {
      allData.indexOneId = e;
    }
    // 问题类型点击切换
    function changeRadio(e) {
      allData.kaopingtypeValue.Type = e.target.value;
      getKaopingData();
    }
    //去考评查看弹窗内容
    async function getKaopingData() {
      allData.tableLoadingKP = true;
      let param = {
        mainId: allData.oneLevelId,
        levelOne: Number(allData.kaopingtypeValue.Type),
      };
      let res = await CGKaopingGetData(param);
      if (res && res.code == 200) {
        let datas = res.data || [];
        allData.kaopingtableData = datas;
        allData.tableLoadingKP = false;
      }
    }
    //去考评点击问题数查看详情
    async function getKaopingNumData() {
      allData.tableListLoading = true;
      let param = {
        current: paginationReactive2.page,
        size: paginationReactive2.pageSize,
        mainId: allData.addFormValue.data.mainId,
        indexId: allData.addFormValue.data.indexId,
        codeId: allData.addFormValue.data.codeId,
      };
      let res = await KaopingGetProblemData(param);
      if (res && res.code == 200) {
        allData.tableListLoading = false;
        let datas = res.data || [];
        allData.findissuesData = datas.records;
        paginationReactive2.pageCount = datas.pages;
        paginationReactive2.itemCount = datas.total || 0;
      }
    }

    // 删除数据
    async function dataDel(ids) {
      let res = await AssessResultDel({ ids: ids });
      if (res && res.code === 200) {
        $message.success('删除成功');
        getTableData();
      }
    }
    // 撤回数据
    async function returnBackData(ids) {
      let res = await checkConfirmCancel({ id: ids });
      if (res && res.code === 200) {
        $message.success('撤回成功');
        getTableData();
      }
    }
    // 提交数据
    async function submitData() {
      let params = { ...allData.formInfo.data };
      params.year = formatDate(allData.formInfo.data.year, 'YYYY');
      params.performStart = formatDate(allData.formInfo.data.performStart, 'YYYY-MM-DD');
      if (allData.modalTitle == '新增季度考核') {
        let res = await AssessCGResultSave(params);
        if (res && res.code == 200) {
          $message.success('操作成功');
          getTableData();
          allData.modalShow = false;
        }
      } else {
        let res = await AssessCGResultUpdate(params);
        if (res && res.code == 200) {
          $message.success('操作成功');
          getTableData();
          allData.modalShow = false;
        }
      }
    }
    // 提交新增问题
    async function saveNewProblem() {
      let params = { ...allData.addFormValue.data };
      let res = await addProblemSave(params);
      if (res && res.code == 200) {
        $message.success('操作成功');
        getKaopingNumData();
        allData.addissueShow = false;
      }
    }
    // 整改提交
    async function rectifyProblem() {
      let params = { ...allData.RectifyformInfo.data };
      params.dealTime = formatDate(allData.RectifyformInfo.data.dealTime, 'YYYY-MM-DD hh:mm:ss');
      params.id = allData.rectifyid;
      let res = await AssessRectification(params);
      if (res && res.code == 200) {
        $message.success('操作成功');
        getNumData();
        allData.RectifyShow = false;
      }
    }
    // 问题核销提交
    async function CheckQuestions(id) {
      let params = { ...allData.HXformInfo.data };
      params.checkTime = formatDate(allData.HXformInfo.data.checkTime, 'YYYY-MM-DD hh:mm:ss');
      params.id = id;
      let res = await AssessCheckQuestions(params);
      if (res && res.code === 200) {
        $message.success('核销成功');
        getNumData();
        allData.HXShow = false;
      }
    }
    // 问题审批
    async function AuditQuestions(id) {
      let res = await AssessCGResultAudit({ id: id });
      if (res && res.code === 200) {
        $message.success('已审核');
        getTableData();
      }
    }
    // 现场问题文件上传和删除
    const changeFileXC = async (file) => {
      $loadingBar.start();
      if (file.event) {
        // 文件上传
        let formdata = new FormData();
        formdata.append('files', file.file.file);
        let config = {
          headers: { 'Content-Type': 'multipart/form-data' },
        };
        let res = await fileUpload(formdata, config);
        if (res && res.code === 200) {
          if (res.data.length > 0) {
            let datas = res.data[0];

            allData.addFormValue.data.fileNo.push(datas.fileNo);
            let param = {
              fileNo: datas.fileNo,
              name: datas.fileOriginalName,
              url: datas.fileCloudStorageKey,
              status: 'success',
            };
            allData.imageXC.push(param);
          }
        } else {
          allData.uploadListXC = [];
          let param = {
            id: file.file.id,
            name: file.file.name,
            status: 'error',
          };
          allData.uploadListXC.push(param);
        }
        $loadingBar.finish();
      } else {
        // 文件删除,根据文件名进行匹配
        let fileIndex = null;
        allData.imageXC.map((item, index) => {
          if (file.file.name == item.name) {
            fileIndex = index;
          }
        });
        let fileNos = [];
        fileNos.push(allData.imageXC[fileIndex].fileNo);
        let res = await fileDelete(fileNos);
        if (res && res.code === 200) {
          allData.addFormValue.data.fileNo.splice(fileIndex, 1);
        }
      }
    };
    // 整改现场图片文件上传和删除
    const changeFileZG = async (file) => {
      $loadingBar.start();
      if (file.event) {
        // 文件上传大小判断
        let size = file.file.file.size / 1024 / 1024;
        if (size > 10) {
          $message.error('图片大小大于10M,请删除后重新上传');
          setTimeout(() => {
            allData.uploadListZG = [
              {
                id: file.file.id,
                name: file.file.name,
                status: 'error',
              },
            ];
          });
          return false;
        }
        // 文件上传
        let formdata = new FormData();
        formdata.append('files', file.file.file);
        let config = {
          headers: { 'Content-Type': 'multipart/form-data' },
        };
        let res = await fileUpload(formdata, config);
        if (res && res.code === 200) {
          if (res.data.length > 0) {
            let datas = res.data[0];

            allData.RectifyformInfo.data.fileNo.push(datas.fileNo);
            let param = {
              fileNo: datas.fileNo,
              name: datas.fileOriginalName,
              url: datas.fileCloudStorageKey,
              status: 'success',
            };
            allData.imageZG.push(param);
          }
        } else {
          allData.uploadListZG = [];
          let param = {
            id: file.file.id,
            name: file.file.name,
            status: 'error',
          };
          allData.uploadListZG.push(param);
        }
        $loadingBar.finish();
      } else {
        // 文件删除,根据文件名进行匹配
        let fileIndex = null;
        allData.imageZG.map((item, index) => {
          if (file.file.name == item.name) {
            fileIndex = index;
          }
        });
        let fileNos = [];
        fileNos.push(allData.imageZG[fileIndex].fileNo);
        let res = await fileDelete(fileNos);
        if (res && res.code === 200) {
          allData.RectifyformInfo.data.fileNo.splice(fileIndex, 1);
        }
      }
    };
    // 获取人员
    async function getUserList() {
      allData.userOptions = [];
      let res = await allUserGet();
      if (res && res.code === 200) {
        res.data.map((item) => {
          allData.userOptions.push({
            value: item.userAccount,
            label: item.realName,
          });
        });
      }
    }
    // 获取年份
    async function getYear() {
      allData.yearOptions = [];
      let res = await normalNameList();
      if (res && res.code === 200) {
        res.data.map((item) => {
          allData.yearOptions.push({
            value: item.year,
            label: item.performName,
          });
        });
      }
    }
    onMounted(() => {
      getYear();
      getTableData();
      GetIndexClass();
      getProjectType();
      getUserList();
    });
    return {
      ...toRefs(allData),
      pagination: paginationReactive,
      pagination2: paginationReactive2,
      pagination3: paginationReactive3,
      handleClick,
      getTableData,
      changeFileXC,
      changeFileZG,
      getKaopingNumData,
      refreshData,
      changeRadio,
      exportQues,
      formRef,
      richEditor,
      GetIndexClass,
      addProblemformRef,
      RectifyformRef,
      HXformRef,
      getProjectType,
      getIndexsOne,
      getSubProject,
      changeSelect1,
      changeSelect2,
      changeSelect3,
      evaluationAddScore,
    };
  },
};
</script>

<style lang="less">
.kaopingTable {
  tbody,
  tfoot,
  thead,
  tr,
  th,
  td {
    vertical-align: middle;
  }
}
.changguiPage {
  width: 100%;
  .name {
    height: 34px;
    line-height: 34px;
  }
  .searchBoxs {
    margin: 10px;
  }
  .maker {
    border: 1px dashed rgba(194, 194, 194, 1);
    margin-bottom: 10px;
    padding: 10px;
    width: 100%;
  }
}
</style>