<template>
  <div class="mainCss">
    <div class="pageLeft">
      <ul>
        <li :class="{active:isActive==0}" @click="changeMenu(0,'001')" v-if="hasStat=='211' || hasStat=='212' || hasStat=='221'"><i class="el-icon-s-fold" ></i>省级下发问题</li>
        <li :class="{active:isActive==1}" @click="changeMenu(1,'002')" v-if="hasStat=='211' || hasStat=='212' || hasStat=='221'"><i class="el-icon-s-fold" ></i>市级抽查问题</li>
        <li :class="{active:isActive==2}" @click="changeMenu(2,'003')" v-if="hasStat=='221'"><i class="el-icon-s-fold" ></i>市级自查问题</li>
        <li :class="{active:isActive==3}" @click="changeMenu(3,'004')" v-if="hasStat=='211' || hasStat=='212'"><i class="el-icon-s-fold" ></i>县级自查问题</li>
        <li :class="{active:isActive==4}" @click="changeMenu(4,'003')" v-if="hasStat=='223'"><i class="el-icon-s-fold"></i>市级整改问题</li>
        <li :class="{active:isActive==5}" @click="changeMenu(5,'002')" v-if="hasStat=='223'"><i class="el-icon-s-fold"></i>县级整改问题</li>
        <li :class="{active:isActive==6}" @click="changeMenu(6,'005')" v-if="hasStat=='222'"><i class="el-icon-s-fold"></i>省下发市整改问题</li>
        <li :class="{active:isActive==7}" @click="changeMenu(7,'006')" v-if="hasStat=='222'"><i class="el-icon-s-fold"></i>省下发县整改</li>
        <li :class="{active:isActive==8}" @click="changeMenu(8,'002')" v-if="hasStat=='222'"><i class="el-icon-s-fold"></i>市抽查县整改</li>
        <li :class="{active:isActive==9}" @click="changeMenu(9,'003')" v-if="hasStat=='222'"><i class="el-icon-s-fold"></i>市自查市整改</li>
        <li :class="{active:isActive==10}" @click="changeMenu(10,'007')" v-if="hasStat=='221' || hasStat=='222' || hasStat=='223' || hasStat=='211' || hasStat=='212'"><i class="el-icon-s-fold"></i>市级下发问题</li>
      </ul>
    </div>
    <template v-if="isShow">
      <a-tabs v-model="activatedTab" type="card" style="height: 100%;" class="pageRight">
        <a-tab-pane v-for="tab in tabsForXjdw" :key="tab.value" :tab="tab.label">
          <component :is="activatedTab" :pType="pType" style="height: 100%;" />
        </a-tab-pane>
      </a-tabs>
    </template>
    <template v-else>
      <div class="pageRight">
        <!--        <a-tabs v-model="activeName" type="card" @tabClick="handleClick" v-if="isActive==10">-->
        <!--          <a-tab-pane key="view" tab="问题查看" v-if="readOnlyRole == 'display'"></a-tab-pane>-->
        <!--          <a-tab-pane key="rectifying" tab="整改中问题" v-if="(hasStat=='211' || hasStat=='221') && readOnlyRole == 'display'"></a-tab-pane>-->
        <!--          <a-tab-pane key="approval" tab="送业务科审核" v-if="hasStat=='221' && readOnlyRole == 'display'"></a-tab-pane>-->
        <!--          <a-tab-pane key="reReviewed" tab="监督科复核" v-if="hasStat=='221' && readOnlyRole == 'display'"></a-tab-pane>-->
        <!--          <a-tab-pane key="reviewed" tab="待复核问题" v-if="hasStat=='212' && readOnlyRole == 'display'"></a-tab-pane>-->
        <!--          <a-tab-pane key="approval" tab="待审核问题" v-if="hasStat=='223' && readOnlyRole == 'display'"></a-tab-pane>-->
        <!--          <a-tab-pane key="over" tab="归档销号问题" v-if="hasStat=='222' && readOnlyRole == 'display'"></a-tab-pane>-->
        <!--        </a-tabs>-->
        <a-tabs v-model="hasStat" type="card" @tabClick="handleClick">
          <!--          <a-tab-pane key="rectify" tab="待整改问题" v-if="(hasStat=='221' && (isActive==0)) && readOnlyRole == 'display'"></a-tab-pane>-->
          <a-tab-pane key="211" tab="整改中问题"></a-tab-pane>
          <a-tab-pane key="212" tab="待复核问题"></a-tab-pane>
          <!--          <a-tab-pane key="view" tab="问题查看"></a-tab-pane>-->
        </a-tabs>
        <div class="content">
          <a-form
              v-if="isActive=='10'"
              layout="inline"
              :model="searchParam"
              class="demo-form-inline"
              style="margin-bottom: 1%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 24px;"
              ref="ruleFormRef">
            <a-form-item label="工程名称" prop="nm" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.nm" allow-clear placeholder="工程名称"></a-input>
            </a-form-item>
            <a-form-item label="业务科室" prop="dutyDept" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="searchParam.dutyDept" placeholder="业务科室" allow-clear :filter-option="filterOption" style="width: 200px;">
                <a-select-option v-for="item in ywcsListCity" :key="item" :value="item">{{ item }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item
                label="问题来源"
                prop="pblmSourceArr"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="pblmSourceArr" placeholder="问题来源" allow-clear mode="tags" :max-tag-count="1" style="width: 200px;">
                <a-select-option v-for="item in sourceListCity" :key="item" :value="item">{{ item }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item
                label="整改文件名"
                prop="zgMemo"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.zgMemo" allow-clear placeholder="整改文件名"></a-input>
            </a-form-item>
            <a-form-item
                label="整改文号"
                prop="zgWjName"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.zgWjName" allow-clear placeholder="请输入整改文号"></a-input>
            </a-form-item>

            <a-form-item
                label="问题编号"
                prop="fileNoNumber"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.fileNoNumber" allow-clear placeholder="问题编号或范围值(如:1-100)"></a-input>
            </a-form-item>
            <a-form-item label="整改状态" prop="workflowStats" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;" v-if="(hasStat=='211' || hasStat=='212' || hasStat=='221' || hasStat=='222' || hasStat=='223')  &&  activeName=='view'">
              <a-select
                  v-model="workflowStats"
                  placeholder="整改状态"
                  allow-clear
                  mode="tags"
                  :max-tag-count="1" style="width: 200px;">
                <a-select-option v-for="item in rectifyProcStatesCity" :key="item.code" :value="item.code">{{ item.name }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="行政区划" prop="adName" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.adName" allow-clear placeholder="行政区划"></a-input>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button type="primary" @click="search">查询</a-button>
            </a-form-item>
            <a-form-item v-if="hasStat == '221' && isActive=='10' && activeName=='view'" style="margin-bottom: 0;">
              <a-button type="primary" @click="downloadCityTemplate">问题台账模板下载</a-button>
            </a-form-item>
            <a-form-item v-if="hasStat == '221' && isActive=='10' && activeName=='view'" style="margin-bottom: 0;">
              <a-upload
                  name="file"
                  :multiple="false"
                  action="/modular-source/6ace62b8e2bb467d98286d260aebcef2/pdcApi/dc/insp/pblm/newImportZgList"
                  :data="{}"
                  :accept="'.xls,.xlsx'"
                  :headers="header"
                  @change="handleChange"
                  :show-upload-list="false">
                <a-button type="primary">问题台账导入</a-button>
              </a-upload>
            </a-form-item>
            <a-form-item v-if="hasStat == '211' && activeName=='rectifying' && isActive=='10'" style="margin-bottom: 0;">
              <a-button type="primary" @click="sendReCheck(1,false)">送复核</a-button>
            </a-form-item>
            <a-form-item v-if="(hasStat == '221' || hasStat == '212' || hasStat == '222' || hasStat == '223') && (activeName=='reviewed' || activeName=='approval' || activeName=='reReviewed' || activeName=='over') && isActive=='10'" style="margin-bottom: 0;">
              <a-button type="primary" @click="sendReCheck(1,true)">{{(hasStat == '222' && activeName=='over') ? '归档销号':'同意上报'}}</a-button>
            </a-form-item>
            <a-form-item v-if="(hasStat == '221' || hasStat == '212' || hasStat == '222' || hasStat == '223') && (activeName=='reviewed' || activeName=='approval' || activeName=='reReviewed' || activeName=='over') && isActive=='10'" style="margin-bottom: 0;">
              <a-button type="primary" @click="sendReCheck(0,true)">退回整改</a-button>
            </a-form-item>

            <a-modal :open="dialogFormVisible" @cancel="dialogFormVisible = false" title="自定义表头" style="height: 400%" width="70%">
              <a-form-item label="导出表头">
                <a-select
                    v-model="exelHeads"
                    placeholder="请选择需要导出的表头"
                    allow-clear
                    mode="tags"
                    :max-tag-count="1"
                    style="width:400px">
                  <a-select-option v-for="item in headsList" :key="item.value" :value="item.value">{{ item.lable }}</a-select-option>
                </a-select>
              </a-form-item>
              <template #footer>
                <a-button @click="dialogFormVisible = false">取 消</a-button>
                <a-button type="primary" @click="exportExcel">确 定</a-button>
              </template>
            </a-modal>
          </a-form>
          <a-form
              v-if="isActive!='10'"
              layout="inline"
              :model="searchParam"
              class="demo-form-inline"
              style="display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 24px;"
              ref="ruleFormRef">
            <a-form-item label="对象名称" prop="nm" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.nm" allow-clear placeholder="对象名称"></a-input>
            </a-form-item>
            <a-form-item
                label="问题来源时间"
                prop="pblmSourceTm"
                v-if="(hasStat=='211' && isActive=='0') || (hasStat=='212' && isActive=='0') ||
                (hasStat=='221' && isActive=='0' && (activeName=='rectify' || activeName=='rectifying' || activeName=='approval' || activeName=='view')) ||
                (hasStat=='222' && (isActive=='6' || isActive=='7'))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-date-picker v-model="searchParam.pblmSourceTm" mode="year" value-format="YYYY" placeholder="选择问题来源时间" allow-clear></a-date-picker>
            </a-form-item>
            <a-form-item
                label="问题归类"
                prop="ptype"
                v-if="(hasStat=='211' && isActive=='0') || (hasStat=='212' && isActive=='0') ||
                (hasStat=='221' && isActive=='0' && (activeName=='rectify' || activeName=='rectifying' || activeName=='approval' || activeName=='view')) ||
                (hasStat=='222' && (isActive=='6' || isActive=='7'))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="searchParam.ptype" placeholder="请选择问题归类" allow-clear style="width: 200px;">
                <a-select-option v-for="item in duChaTypes" :key="item.NM" :value="item.NM">{{ item.NM }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item
                label="问题来源"
                prop="pblmSourceArr"
                v-if="(hasStat == '211' && isActive == '0') || (hasStat == '212' && isActive == '0') ||
                (hasStat == '221' && isActive == '0' && (activeName == 'rectify' || activeName == 'rectifying' || activeName == 'approval' || activeName == 'view')) ||
                (hasStat == '222' && (isActive == '6' || isActive == '7'))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="pblmSourceArr" placeholder="请选择问题归类" allow-clear mode="tags" :max-tag-count="1" style="width: 200px;">
                <a-select-option v-for="item in sourceList" :key="item" :value="item">{{ item }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item
                label="整改文号"
                prop="zgWjName"
                v-if="(hasStat=='211' && isActive=='0') || (hasStat=='212' && isActive=='0') ||
                (hasStat=='221' && isActive=='0' && (activeName=='rectify' || activeName=='rectifying' || activeName=='approval' || activeName=='view')) ||
                (hasStat=='222' && (isActive=='6' || isActive=='7'))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.zgWjName" allow-clear placeholder="请输入整改文号"></a-input>
            </a-form-item>
            <a-form-item
                label="问题印发文件名"
                prop="zgMemo"
                v-if="(hasStat == '211' && isActive == '0') || (hasStat == '212' && isActive == '0') ||
                (hasStat == '221' && isActive == '0' && (activeName == 'rectify' || activeName == 'rectifying' || activeName == 'approval' || activeName == 'view')) ||
                (hasStat == '222' && (isActive == '6' || isActive == '7'))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.zgMemo" allow-clear placeholder="请输入问题印发文件名"></a-input>
            </a-form-item>
            <a-form-item
                label="问题编号"
                prop="fileNoNumber"
                v-if="(hasStat == '211' && isActive == '0') || (hasStat == '212' && isActive == '0') ||
                (hasStat == '221' && isActive == '0' && (activeName == 'rectify' || activeName == 'rectifying' || activeName == 'approval' || activeName == 'view')) ||
                (hasStat == '222' && (isActive == '6' || isActive == '7'))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-input v-model="searchParam.fileNoNumber" allow-clear placeholder="问题编号或范围值(如:1-100)"></a-input>
            </a-form-item>
            <a-form-item
                label="督查事项"
                prop="objType"
                v-if="!((hasStat == '211' && isActive == '0') || (hasStat == '212' && isActive == '0') ||
                (hasStat == '221' && isActive == '0' && (activeName == 'rectify' || activeName == 'rectifying' || activeName == 'approval' || activeName == 'view')) ||
                (hasStat == '222' && (isActive == '6' || isActive == '7')))"
                style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="searchParam.cwsCode" placeholder="督查事项" allow-clear style="width: 200px;">
                <a-select-option v-for="item in dcTypeList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="严重程度" prop="inspPblmCate" v-if="!((hasStat == '211' && isActive == '0') || (hasStat == '212' && isActive == '0') || (hasStat == '221' && isActive == '0' && (activeName == 'rectify' || activeName == 'rectifying' || activeName == 'approval' || activeName == 'view')) || (hasStat == '222' && (isActive == '6' || isActive == '7')))" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="searchParam.inspPblmCate" placeholder="严重程度" allow-clear style="width: 200px;">
                <a-select-option value="0">一般</a-select-option>
                <a-select-option value="1">较重</a-select-option>
                <a-select-option value="2">严重</a-select-option>
                <a-select-option value="3">特别严重</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="责任处室(单位)" prop="dutyDept" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select v-model="searchParam.dutyDept" placeholder="请选择责任处室(单位)" allow-clear :filter-option="filterOption" style="width: 200px;">
                <a-select-option v-for="item in ywcsList" :key="item" :value="item">{{ item }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="整改状态" prop="workflowStats" v-if="activeName=='view'" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-select
                  v-if="(hasStat == '211' || hasStat == '212') && isActive == 3 && activeName == 'view'"
                  v-model="workflowStats"
                  placeholder="请选择责任处室(单位)"
                  allow-clear
                  mode="tags"
                  :max-tag-count="1" style="width: 200px;">
                <a-select-option v-for="item in rectifyProcStates1" :key="item.code" :value="item.code">{{ item.name }}</a-select-option>
              </a-select>
              <a-select
                  v-else
                  v-model="workflowStats"
                  placeholder="请选择责任处室(单位)"
                  allow-clear
                  mode="tags"
                  :max-tag-count="1" style="width: 200px;">
                <a-select-option v-for="item in rectifyProcStates" :key="item.code" :value="item.code">{{ item.name }}</a-select-option>
              </a-select>
            </a-form-item>
            <a-form-item label="当前要求完成时限" v-if="activeName=='view'" prop="currentRange" style="white-space: nowrap; flex-shrink: 0; margin-bottom: 0;">
              <a-range-picker v-model="currentRange" format="YYYY-MM-DD" separator="至" allow-clear />
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button type="primary" @click="search">查询</a-button>
            </a-form-item>
            <a-form-item v-if="hasStat == '221' && isActive=='10'" style="margin-bottom: 0;">
              <a-button type="primary" @click="downloadCityTemplate">问题台账模板下载</a-button>
            </a-form-item>
            <a-form-item v-if="hasStat == '221' && isActive=='10'" style="margin-bottom: 0;">
              <a-upload
                  name="file"
                  :multiple="false"
                  action="/modular-source/6ace62b8e2bb467d98286d260aebcef2/pdcApi/dc/insp/pblm/newImportZgList"
                  :data="{}"
                  :accept="'.xls,.xlsx'"
                  :headers="header"
                  @change="handleChange"
                  :show-upload-list="false">
                <a-button type="primary">问题台账导入</a-button>
              </a-upload>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button type="primary" v-if="activeName=='view' && isActive!='10'" @click="dialogFormVisible = true">导出EXCEL</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==212 && activeName=='reviewed' && (isActive=='0' || isActive=='1' || isActive=='3')) ||
                  (hasStat==221 && (isActive=='0' && activeName=='approval') || (isActive=='1' && activeName=='approval')) ||
                  (hasStat==223 && activeName=='approval' && (isActive=='4' || isActive=='5')) ||
                  (hasStat==222 && activeName=='reviewed' && (isActive=='6' || isActive=='7' || isActive=='8' || isActive=='9'))"
                  @click="batchSubmit(0)">退回</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==211 && activeName=='rectifying' && (isActive=='0' || isActive=='1' || isActive=='3')) ||
                  (hasStat==212 && activeName=='reviewed' && (isActive=='0' || isActive=='1' || isActive=='3')) ||
                  (hasStat==221 && (isActive=='0' && (activeName=='rectifying' || activeName=='approval')) || (isActive=='1' && activeName=='approval') || (isActive=='2' && activeName=='rectifying')) ||
                  (hasStat==223 && activeName=='approval' && (isActive=='4' || isActive=='5')) ||
                  (hasStat==222 && activeName=='reviewed' && (isActive=='6' || isActive=='7' || isActive=='8' || isActive=='9'))"
                  @click="batchSubmit(1,$event)">提交</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==211 && activeName=='rectifying' && (isActive=='0')) ||
                  (hasStat==221 && (isActive=='0' && activeName=='rectifying') || (isActive=='2' && activeName=='rectifying'))"
                  @click="openMonthlyReportDialog(1,$event)">上报整改进度</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==211 && activeName=='rectifying' && (isActive=='0')) ||
                  (hasStat==221 && (isActive=='0' && activeName=='rectifying') || (isActive=='2' && activeName=='rectifying'))"
                  @click="downloadMonthlyReportExcelTemplate()">下载整改进度月报模板</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==221 && activeName=='rectify' && (isActive=='0' || isActive=='1'))"
                  @click="batchSubmit(1,0)">指定为本单位整改</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==221 && activeName=='rectify' && (isActive=='0' || isActive=='1'))"
                  @click="batchSubmit(1)">自动下派整改单位</a-button>
            </a-form-item>
            <a-form-item style="margin-bottom: 0;">
              <a-button
                  type="primary"
                  v-if="(hasStat==221 && activeName=='rectify' && (isActive=='0' || isActive=='1'))"
                  @click="batchSubmit(1,2)">手动下派整改单位</a-button>
            </a-form-item>

            <a-modal :open="dialogFormVisible" @cancel="dialogFormVisible = false" title="自定义表头" style="height: 400%" width="70%">
              <a-form-item label="导出表头">
                <a-select
                    v-model="exelHeads"
                    placeholder="请选择需要导出的表头"
                    allow-clear
                    mode="tags"
                    :max-tag-count="1"
                    style="width:400px">
                  <a-select-option v-for="item in headsList" :key="item.value" :value="item.value">{{ item.lable }}</a-select-option>
                </a-select>
              </a-form-item>
              <template #footer>
                <a-button @click="dialogFormVisible = false">取 消</a-button>
                <a-button type="primary" @click="exportExcel">确 定</a-button>
              </template>
            </a-modal>
          </a-form>
          <a-table
              ref="table"
              :columns="columns"
              :data-source="tableData_sum"
              :pagination="false"
              row-key="pblmId"
              style="width: 100%;height: 550px;"
              :scroll="{x: 'max-content', y: 490}"
              bordered
              :row-selection="{
              columnWidth: 50,
              selectedRowKeys: selectedRowKeys,
              onChange: handleSelection,
              getCheckboxProps: record => ({
                props: {
                  disabled: !(((hasStat=='211' && isActive==3) || (hasStat=='221' && isActive==2)) && activeName=='rectifying') ? false:(record.isInput && record.isInput == '0' ? true : false)
                }
              }),
            }">
            <template #bodyCell="{ column, record, text, index }">
              <template v-if="column.dataIndex === 'index'">

              {{ (pageNum - 1) * pageSize + (index + 1) }}
            
              </template>
              <template v-else-if="column.dataIndex === 'nm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.nm }}</span>
                </template>
                <span class="ellipsis180">{{ record.nm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'adName'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.adName }}</span>
                </template>
                <span class="ellipsis120">{{ record.adName }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'objType'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.objType }}</span>
                </template>
                <span class="ellipsis100">{{ record.objType }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgDate'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgDate }}</span>
                </template>
                <span class="ellipsis200">{{ record.zgDate }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'fileNoNumber'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.fileNoNumber }}</span>
                </template>
                <span class="ellipsis100">{{ record.fileNoNumber }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'inspPblmDesc'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.inspPblmDesc }}</span>
                </template>
                <span class="ellipsis200">{{ record.inspPblmDesc }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'pblmSource'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.pblmSource }}</span>
                </template>
                <span class="ellipsis200">{{ record.pblmSource }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'upAdName'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.upAdName }}</span>
                </template>
                <span class="ellipsis120">{{ record.upAdName }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgMemo'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgMemo }}</span>
                </template>
                <span class="ellipsis200">{{ record.zgMemo }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'pblmSourceTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.pblmSourceTm }}</span>
                </template>
                <span class="ellipsis120">{{ record.pblmSourceTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgWjName'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgWjName }}</span>
                </template>
                <span class="ellipsis120">{{ record.zgWjName }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'issuedTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.issuedTm }}</span>
                </template>
                <span class="ellipsis120">{{ record.issuedTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'isPblmDel'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.property == '0' ? '是' : '否' }}</span>
                </template>
                <span class="ellipsis120">{{ record.property == '0' ? '是' : '否' }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'pblmSggtn'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.pblmSggtn }}</span>
                </template>
                <span class="ellipsis120">{{ record.pblmSggtn }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'isPdTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.isPdTm }}</span>
                </template>
                <span class="ellipsis100">{{ record.isPdTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'firstZgTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.firstZgTm }}</span>
                </template>
                <span class="ellipsis120">{{ record.firstZgTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'isPdSche'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.isPdSche }}</span>
                </template>
                <span class="ellipsis120">{{ record.isPdSche }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'psDlyTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.psDlyTm }}</span>
                </template>
                <span class="ellipsis200">{{ record.psDlyTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'applyPdTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.applyPdTm }}</span>
                </template>
                <span class="ellipsis120">{{ record.applyPdTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'applyFfcTm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.applyFfcTm }}</span>
                </template>
                <span class="ellipsis120">{{ record.applyFfcTm }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgDevelopment'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgDevelopment }}</span>
                </template>
                <span class="ellipsis200">{{ record.zgDevelopment }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'isApplyPd'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.isApplyPd }}</span>
                </template>
                <span class="ellipsis120">{{ record.isApplyPd }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'dutyDept'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.dutyDept }}</span>
                </template>
                <span class="ellipsis180">{{ record.dutyDept }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'isDeptagePd'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.isDeptagePd }}</span>
                </template>
                <span class="ellipsis220">{{ record.isDeptagePd }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'deptagePdEln'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.deptagePdEln }}</span>
                </template>
                <span class="ellipsis250">{{ record.deptagePdEln }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgRedefineReq'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgRedefineReq }}</span>
                </template>
                <span class="ellipsis200">{{ record.zgRedefineReq }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgZgxx'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgZgxx }}</span>
                </template>
                <span class="ellipsis200">{{ record.zgZgxx }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgDelayEln'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.zgDelayEln }}</span>
                </template>
                <span class="ellipsis200">{{ record.zgDelayEln }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'informedNum'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.informedNum }}</span>
                </template>
                <span class="ellipsis200">{{ record.informedNum }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'pblmName'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.pblmName }}</span>
                </template>
                <span class="ellipsis180">{{ record.pblmName }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'checkPoint'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.checkPoint }}</span>
                </template>
                <span class="ellipsis180">{{ record.checkPoint }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'pblmDesc'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.pblmDesc }}</span>
                </template>
                <span class="ellipsis180">{{ record.pblmDesc }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'inspPblmCate'">

              <span v-if="record.inspPblmCate=='0'" style="color:#5bb7e7">一般</span>
              <span v-if="record.inspPblmCate=='1'" style="color:#d9cd1a">较重</span>
              <span v-if="record.inspPblmCate=='2'" style="color:#ff9599">严重</span>
              <span v-if="record.inspPblmCate=='3'" style="color:#f94c01">特别严重</span>
            
              </template>
              <template v-else-if="column.dataIndex === 'inspPblmDesc'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.inspPblmDesc }}</span>
                </template>
                <span class="ellipsis200">{{ record.inspPblmDesc }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'intm'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.intm ? record.intm.substring(0, 10) : '' }}</span>
                </template>
                <span class="ellipsis160">{{ record.intm ? record.intm.substring(0, 10) : '' }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'zgOrgId'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ zgOrgId(record.zgOrgId) }}</span>
                </template>
                <span class="ellipsis160">{{ zgOrgId(record.zgOrgId) }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'dutyDept'">

              <a-tooltip placement="top">
                <template #title>
                  <span>{{ record.dutyDept }}</span>
                </template>
                <span class="ellipsis180">{{ record.dutyDept }}</span>
              </a-tooltip>
            
              </template>
              <template v-else-if="column.dataIndex === 'action'">

              <a-button icon="eye" type="link" @click="showDialog(record)"></a-button>
              <a-button icon="edit" type="link" v-if="activeName=='rectifying'" @click="editDialog(record)"></a-button>
            
              </template>
              <template v-else>{{ text }}</template>
            </template>

            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            

            
            
            
            
            
            
            
            

            

          </a-table>
          <a-pagination
              show-size-changer
              v-model:pageSize="pageSize"
              :total="total"
              :show-total="total => `共${total}条`"
              @showSizeChange="handleSizeChange"
              @change="handleCurrentChange"
              style="margin-top: 10px;" />
        </div>
      </div>
      <!--问题删除-->
      <a-modal class="deleteDialog" title="问题删除描述" :open="problemDeleteVisible" @cancel="problemDeleteVisible= false" width="70%">
        <Problem-delete ref="deletePblm" :deleteProblemId="deletePblmId" @deleteSuccess="deleteSuccess"></Problem-delete>
        <template #footer>
          <a-button @click="problemDeleteVisible = false">返回</a-button>
        </template>
      </a-modal>
    </template>

    <!--问题查看和编辑-->
    <a-modal
        :title="editDialogTitle"
        :open="changeSupervisionVisible"
        @cancel="changeSupervisionVisible=false"
        width="70%"
        class="outerDialog custom_dialog"
        style="padding: 10px 20px;">
      <div class="scroll300">
        <div style="width:40%;overflow-y:auto;max-height:52vh;float:left;border:1px solid #d5d5ff;margin-right:5px;">
          <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">基本信息</p>
          <a-form :model="changeSupervision" :label-col="{span: 8}" ref="changeSupFrom" style="max-width: 100%;">
            <a-form-item label="对象名称" prop="nm">
              <span>{{ changeSupervision.nm }}</span>
            </a-form-item>
            <a-form-item label="问题类别" prop="inspPblmsName">
              <span>{{ changeSupervision.inspPblmsName }}</span>
            </a-form-item>
            <a-form-item label="检查项目" prop="checkPoint">
              <span>{{ changeSupervision.checkPoint }}</span>
            </a-form-item>
            <a-form-item label="问题描述" prop="pblmDesc">
              <span>{{ changeSupervision.pblmDesc }}</span>
            </a-form-item>
            <a-form-item label="详细描述" prop="inspPblmDesc">
              <span>{{ changeSupervision.inspPblmDesc }}</span>
            </a-form-item>
            <a-form-item label="备注" prop="note">
              <span>{{ changeSupervision.note }}</span>
            </a-form-item>
            <a-form-item label="上报人" prop="persName">
              <span>{{ changeSupervision.persName }}</span>
            </a-form-item>
            <a-form-item label="上报时间" prop="collTime">
              <span>{{ changeSupervision.collTime }}</span>
            </a-form-item>
            <a-form-item label="整改时限" prop="zgDate">
              <span>{{ changeSupervision.zgDate }}</span>
            </a-form-item>
            <a-form-item label="整改要求" prop="pblmSggtn">
              <span>{{ changeSupervision.pblmSggtn }}</span>
            </a-form-item>
          </a-form>
        </div>
        <div
            style="width: 58%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 52vh;height:500px;">
          <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
          <a-tabs style="margin:0px 5px">
            <a-tab-pane :tab="picturetabName" key="1">
              <!-- <a-row style="text-align:right;">
                <a-button :v-if="!addPicPanel?addPicPanel:addPicPanel" size="small" type="link"
                  :icon="!addPicPanel?'plus-circle':'minus-circle'" @click="addPic">
                  {{ !addPicPanel?"添加":"取消" }}
                </a-button>
              </a-row>
              <a-row v-show="addPicPanel">
                <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizType=MEND_EXTRA&bizId=`"
                  @uploadOver="removeNewSupervision">
                </upload>
              </a-row> -->
              <a-row>
                <div style="overflow-y:auto;overflow-x:hidden;max-height:30vh;padding:10px;">
                  <div class="upload-container">
                    <div v-for="(item, index) in pictureArray" :key="index" class="image-preview image-app-preview">
                      <div class="image-preview-wrapper">
                        <img :src="`${hostUrl}/${item.filePath}`">
                        <div class="image-preview-action">
                          <a-icon type="delete" @click="removeFile(item.id)" />
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </a-row>
            </a-tab-pane>
            <a-tab-pane :tab="audiotabName" key="2">
              <a-table bordered :data-source="audioArray" :columns="columns3" style="width: 100%;margin: 0 auto;">
            <template #bodyCell="{ column, record, text, index }">
              <template v-if="column.dataIndex === 'audio'">

                  <elaudio style="margin-left:15%;width:100px;height:30px;" :theUrl="`${hostUrl}/${record.filePath}`"></elaudio>
                
              </template>
              <template v-else-if="column.dataIndex === 'action'">

                  <a-button size="small" @click="removeFile(record.id, index)" type="danger"></a-button>
                
              </template>
              <template v-else>{{ text }}</template>
            </template>

                
                
              </a-table>
            </a-tab-pane>
            <a-tab-pane key="3" :tab="videotabName">
              <a-table bordered :data-source="videoArray" :columns="columns4" style="width: 100%;margin: 0 auto;">
            <template #bodyCell="{ column, record, text, index }">
              <template v-if="column.dataIndex === 'video'">

                  <video-player class="vjs-custom-skin" ref="videoPlayer" :options="text" :playsinline="true"></video-player>
                
              </template>
              <template v-else-if="column.dataIndex === 'action'">

                  <a-button size="small" @click="removeFile(record.id, index)" type="danger"></a-button>
                
              </template>
              <template v-else>{{ text }}</template>
            </template>

                
                
              </a-table>
            </a-tab-pane>
            <a-tab-pane key="4" :tab="filetabName">
              <a-table bordered :data-source="fileArray" :columns="columns5" style="width: 100%;margin: 0 auto;">
            <template #bodyCell="{ column, record, text, index }">
              <template v-if="column.dataIndex === 'txt'">

                  <a :href="`${hostUrl}/${record.filePath}`" target="_blank" rel="noopener noreferrer">
                    {{ record.fileName }}
                  </a>
                
              </template>
              <template v-else-if="column.dataIndex === 'id'">
                <a-tooltip placement="topLeft" :title="text">{{ text }}</a-tooltip>
              </template>
              <template v-else-if="column.dataIndex === 'action'">

                  <a-button size="small" @click="removeFile(record.id, index)" type="danger"></a-button>
                
              </template>
              <template v-else>{{ text }}</template>
            </template>

                
                
              </a-table>
            </a-tab-pane>
          </a-tabs>
        </div>
        <div style="padding: 10px 0px;max-width: 99%;">
          <p style="font-weight:bolder;padding:3px;">处置意见</p>
          <a-table :columns="columns6" :data-source="ApprovalHistory" :pagination="false" row-key="id" style="width: 100%;">
            <template #bodyCell="{ column, record, text, index }">
              <template v-if="column.dataIndex === 'isag'">

              <span
                  style="padding: 3px 10px;background:#00ff00;border-radius:15px;color:rgba(0,0,0,1)"
                  v-if="record.isag == 1">同意</span>
              <span
                  style="padding: 3px 10px;background:#ffcc33;border-radius:15px;color:rgba(0,0,0,1)"
                  v-if="record.isag == 0">退回</span>
            
              </template>
              <template v-else-if="column.dataIndex === 'moddate'">

              {{ record.moddate ? formatDateTime(record.moddate) : '' }}
            
              </template>
              <template v-else>{{ text }}</template>
            </template>

            
            
          </a-table>
        </div>
        <div>
          <a-textarea
              :rows="2"
              placeholder="请输入您的处置意见"
              v-model="bisInspPblmAudit.auditidea"
              allow-clear
              style="width:100%;">
          </a-textarea>
        </div>
      </div>
      <template #footer>
        <a-button type="primary" @click="ProcMoveNext(0)">退回</a-button>
        <a-button type="primary" @click="ProcMoveNext(1)">提交</a-button>
        <a-button @click="changeSupervisionVisible = false">取消</a-button>
      </template>
    </a-modal>

    <a-modal
        :open="changeInfoVisible"
        title="整改信息"
        class="outerDialog custom_dialog"
        @cancel="changeInfoVisible=false"
        width="500px"
        style="height:400px !important;"
        :footer="null">
      <a-form :label-col="{span: 8}" style="max-width: 100%;">
        <a-form-item label="整改时限" prop="changeTm">
          <a-date-picker v-model="changeTm" value-format="yyyy-MM-dd" format="yyyy-MM-dd" allow-clear placeholder="整改时限"></a-date-picker>
        </a-form-item>
        <a-form-item label="整改要求" prop="changeRequire">
          <a-textarea v-model="changeRequire" style="width: 300px !important;" :rows="2" placeholder="整改要求" allow-clear></a-textarea>
        </a-form-item>
        <a-form-item style="margin-bottom: 0;">
              <a-button type="primary" @click="submitRectification">提交</a-button>
          <a-button @click="changeInfoVisible=false">取消</a-button>
        </a-form-item>
      </a-form>
    </a-modal>

    <monthly-report-comment
        v-if="showMonthlyReportCommentDialog"
        :isAg="this.isAg"
        :activityName="this.actName"
        @saveMonthlyReportComment="saveMonthlyReportComment"
        @closeMonthlyReportCommentDialog="closeMonthlyReportCommentDialog"/>

    <a-modal
        :open="showActivityCommentDialog"
        title="操作意见"
        @cancel="closeActivityCommentDialog"
        :modal="true"
        width="40%"
        :footer="null"
        top="15vh"
        class="outerDialog custom_dialog">
      <a-form :label-col="{span: 8}" ref="activityCommentForm" :model="activityCommentForm" style="max-width: 100%;">
        <a-form-item label="意见" prop="Comment">
          <a-textarea v-model="activityCommentForm.Comment" :rows="8" :max-length="300" show-word-limit></a-textarea>
        </a-form-item>
        <a-form-item label="整改单位" prop="adCode" v-if="isPointer">
          <a-tree-select
              v-model="activityCommentForm.adCode"
              :tree-data="rectifyUnits"
              show-search
              placeholder="请选择行政区划"
              search-placeholder="请输入行政区划"
              :replaceFields="{children: 'children', label: 'label', key: 'id', value: 'id'}"
              treeNodeFilterProp="label"
              :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
              allow-clear />
        </a-form-item>
        <a-form-item style="margin-bottom: 0;">
              <a-button @click="saveActivityComment">提交</a-button>
        </a-form-item>
      </a-form>
    </a-modal>

    <a-modal
        :open="showActivityCommentDialogCity"
        title="操作意见"
        @cancel="closeActivityCommentDialogCity"
        :modal="true"
        width="40%"
        :footer="null"
        top="15vh"
        class="outerDialog custom_dialog">
      <a-form :label-col="{span: 8}" ref="activityCommentFormCity" :model="activityCommentFormCity" style="max-width: 100%;">
        <a-form-item label="意见" prop="Comment">
          <a-textarea v-model="activityCommentFormCity.auditidea" :rows="8" :max-length="300" show-word-limit></a-textarea>
        </a-form-item>
        <a-form-item style="text-align:center">
          <a-button @click="sendReCheck(0,false)">提交</a-button>
        </a-form-item>
      </a-form>
    </a-modal>

    <a-modal
        :open="showActivityCommentDialogCityAgree"
        title="操作意见"
        @cancel="closeActivityCommentDialogCityAgree"
        :modal="true"
        width="40%"
        :footer="null"
        top="15vh"
        class="outerDialog custom_dialog">
      <a-form :label-col="{span: 8}" ref="activityCommentFormCity" :model="activityCommentFormCityAgree" style="max-width: 100%;">
        <a-form-item label="意见" prop="Comment">
          <a-textarea v-model="activityCommentFormCityAgree.auditidea" :rows="8" :max-length="300" show-word-limit></a-textarea>
        </a-form-item>
        <a-form-item style="text-align:center">
          <a-button @click="sendReCheck(1,false)">提交</a-button>
        </a-form-item>
      </a-form>
    </a-modal>

    <pblm-detail
        :pblmId="currentProblemId"
        :pType="1"
        :isNew="1"
        :isProv="isProv"
        :pblmCurrentWorkflowStat="currentPblmWorkflowStat"
        :currentPblmFileNoNumber="currentPblmFileNoNumber"
        @closePblmDetailDialog="closePblmDetailDialog"
        v-if="showPblmDetail && isActive!='10'"/>

    <pblm-detail-city
        :pblmId="currentProblemId"
        :pType="1"
        :isDelete="isActive=='10' && (hasStat=='211' || hasStat=='221') && activeName=='rectifying'"
        :isNew="1"
        :isProv="isProv"
        :zgXianOrgId="zgXianOrgId"
        :pblmCurrentWorkflowStat="currentPblmWorkflowStat"
        :currentPblmFileNoNumber="currentPblmFileNoNumber"
        @closePblmDetailDialog="closePblmDetailDialog"
        v-if="showPblmDetail && isActive=='10'"/>

    <a-modal
        :open="showPblmRectifyInfo"
        title="整改信息录入"
        @cancel="closePblmRectifyInfoDialog"
        :modal="true"
        :footer="null"
        class="outerDialog custom_dialog"
        width="70%">
      <a-form :label-col="{span: 8}" ref="RectifyInfoForm" :model="RectInfo" style="max-width: 100%;">
        <a-form-item label="整改材料" prop="fileName">
          <upload ref="uploadFile" :url="`/file/insert?bizId=`" :type="2" @uploadOver="removeNewSupervision" />
        </a-form-item>
        <a-form-item label="整改描述" prop="zgZgxx">
          <a-textarea v-model="RectInfo.zgZgxx" :rows="8"/>
        </a-form-item>
        <a-form-item style="text-align:center;">
          <a-button type="primary" @click="submit">提交</a-button>
        </a-form-item>
      </a-form>
    </a-modal>
  </div>
</template>

<script>
import { deleteFileById, showDetailsXq } from '../../api/duChaAPI.js';
import { hostUrl } from '../../utils/global_variable.js';
import request from '../../utils/gw_ajax_request.js';
import { dateFormat, formatD } from '../../utils/gw_date';
import { exportModel } from '../../utils/gw_exportModel';
import elaudio from '../../widgets/elAudioShort.vue';
import upload from '../../widgets/uploadFileWithType.vue';
import {
  distinct,
  getDuChaResource,
  getDuChaResourceCity,
  getDutyDept,
  getDutyDeptCity,
  getFindListMatter,
  getObjType,
  getOrgTreeJson,
  getRectifyProcStates,
  getRectifyProcStates1,
  getRectifyProcStatesCity,
  requestUserRole,
} from '../PblmRectify/Common/rectify_api.js';
import { tabsForXjdw } from '../PblmRectify/Common/tabsForRectify';
import ActivityComment from '../PblmRectify/Components/ActivityComment.vue';
import pblmDetailCity from '../PblmRectify/Components/pblmDetailCity.vue';
import pblmDetail from '../PblmRectify/Components/pblmDetailNew.vue';
import xjdwDoubleCheck from '../PblmRectify/xjdw_DoubleCheck.vue';
import xjdwPblmView from '../PblmRectify/xjdw_pblmView.vue';
import xjdwUnderRectify from '../PblmRectify/xjdw_UnderRectify.vue';
import MonthlyReportComment from '../PblmRectifyMonthlyReport/Components/MonthlyReportComment.vue';
import ProblemDelete from './problemDelete.vue';

export default {
  data() {
    return {
      header: {
        persId: localStorage.getItem('persId'),
        accessToken: localStorage.getItem('accessToken'),
        orgId: localStorage.getItem('orgId'),
      },
      exelHeads: [
        'pblmName[问题类别]',
        'checkPoint[检查项目]',
        'pblmDesc[问题描述]',
        'inspPblmDesc[问题]',
        'pblmSource[问题来源]',
        'pblmSourceTm[问题来源时间]',
        'nm[工程名称]',
        'upAdName[设区市/直管县]',
        'adName[县（市、区）]',
        'zgWjName[问题印发文号]',
        'zgMemo[问题印发文件名]',
        'issuedTm[问题印发时间]',
        'dutyDept[责任处室]',
        'objType[问题归类]',
        'zgDate[当前要求整改完成时限]',
        'isPblmDel[问题是否已销号]',
        'isPdTm[销号时间]',
        'firstZgTm[初始整改时限]',
        'isPdSche[是否按期销号]',
        'zgDevelopment[整改工作开展情况（由各地填报，需具体描述）]',
        'isApplyPd[是否申请销号（由各地填报，仅限未销号问题）]',
        'isDeptagePd[业务处室、单位是否同意销号]',
        'deptagePdEln[业务处室、单位不同意销号原因]',
        'zgRedefineReq[重新明确整改要求（如有，由业务处室、单位填写）]',
        'pblmSggtn[整改要求]',
        'fileNoNumber[编号]',
        'zgZgxx[整改描述]',
        'note[备注]',
        'zgDelayEln[整改时限延期说明]',
        'informedNum[问题被通报次数]',
        'workflowStat[整改状态]',
        // 'zgOrgId[上报单位]'
      ],
      headsList: [
        { lable: '问题类别', value: 'pblmName[问题类别]' },
        { lable: '检查项目', value: 'checkPoint[检查项目]' },
        { lable: '问题描述', value: 'pblmDesc[问题描述]' },
        { lable: '问题', value: 'inspPblmDesc[问题]' },
        { lable: '问题来源', value: 'pblmSource[问题来源]' },
        { lable: '问题来源时间', value: 'pblmSourceTm[问题来源时间]' },
        { lable: '工程名称', value: 'nm[工程名称]' },
        { lable: '设区市/直管县', value: 'upAdName[设区市/直管县]' },
        { lable: '县（市、区）', value: 'adName[县（市、区）]' },
        { lable: '问题印发文号', value: 'zgWjName[问题印发文号]' },
        { lable: '问题印发文件名', value: 'zgMemo[问题印发文件名]' },
        { lable: '问题印发时间', value: 'issuedTm[问题印发时间]' },
        { lable: '责任处室', value: 'dutyDept[责任处室]' },
        { lable: '问题归类', value: 'objType[问题归类]' },
        {
          lable: '当前要求整改完成时限',
          value: 'zgDate[当前要求整改完成时限]',
        },
        { lable: '问题是否已销号', value: 'isPblmDel[问题是否已销号]' },
        { lable: '销号时间', value: 'isPdTm[销号时间]' },
        { lable: '初始整改时限', value: 'firstZgTm[初始整改时限]' },
        { lable: '是否按期销号', value: 'isPdSche[是否按期销号]' },
        {
          lable: '整改工作开展情况（由各地填报，需具体描述）',
          value: 'zgDevelopment[整改工作开展情况（由各地填报，需具体描述）]',
        },
        {
          lable: '是否申请销号（由各地填报，仅限未销号问题）',
          value: 'isApplyPd[是否申请销号（由各地填报，仅限未销号问题）]',
        },
        {
          lable: '业务处室、单位是否同意销号',
          value: 'isDeptagePd[业务处室、单位是否同意销号]',
        },
        {
          lable: '业务处室、单位不同意销号原因',
          value: 'deptagePdEln[业务处室、单位不同意销号原因]',
        },
        {
          lable: '重新明确整改要求（如有，由业务处室、单位填写）',
          value:
            'zgRedefineReq[重新明确整改要求（如有，由业务处室、单位填写）]',
        },
        { lable: '整改要求', value: 'pblmSggtn[整改要求]' },
        { lable: '编号', value: 'fileNoNumber[编号]' },
        { lable: '整改描述', value: 'zgZgxx[整改描述]' },
        { lable: '备注', value: 'note[备注]' },
        { lable: '整改时限延期说明', value: 'zgDelayEln[整改时限延期说明]' },
        { lable: '问题被通报次数', value: 'informedNum[问题被通报次数]' },
        { lable: '整改状态', value: 'workflowStat[整改状态]' },
        // {lable:'上报单位',value:'zgOrgId[上报单位]'}
      ],
      dialogFormVisible: false,
      loading: false,
      currentPblmWorkflowStat: '',
      currentPblmFileNoNumber: '',
      zgXianOrgId: '',
      sourceList: [],
      sourceListCity: [],
      rectifyProcStates: getRectifyProcStates1(),
      rectifyProcStatesCity: getRectifyProcStatesCity(),
      rectifyProcStates1: [
        {
          code: '22',
          name: '整改单位经办人整改中',
        },
        {
          code: '22-1',
          name: '整改单位审核人复核',
        },
        {
          code: '2103',
          name: '县级问题销号',
        },
      ],
      currentRange: [],
      workflowStats: [],
      pblmSourceArr: [],
      duChaTypes: [
        // {name:"全选", id:""},
        // {name:"堤防", id:"堤防"},
        // {name:"防汛", id:"防汛"},
        // {name:"河道疏浚沙石综合利用类", id:"河道疏浚沙石综合利用类"},
        // {name:"河湖卫士监督执法", id:"河湖卫士监督执法"},
        // {name:"农村水电", id:"农村水电"},
        // {name:"农村饮水", id:"农村饮水"},
        // {name:"水库", id:"水库"},
        // {name:"水系联通", id:"水系联通"},
        // {name:"水闸", id:"水闸"},
        // {name:"水资源管理", id:"水资源管理"},
        // {name:"项目建设提速类", id:"项目建设提速类"},
        // {name:"中小河流治理", id:"中小河流治理"},
        // {name:"重点山洪沟治理", id:"重点山洪沟治理"}
      ],
      treeData: [],
      tableData_sum: [],
      rectifyUnits: [],
      searchParam: {
        nm: '',
        objType: '',
        inspPblmCate: '',
        objAdCode: null,
        dutyDept: '',
        pblmSourceTm: '',
        ptype: '',
        zgWjName: '',
        zgMemo: '',
        fileNoNumber: '',
        cwsCode: undefined,
        adName: '',
      },
      // hasStat: this.$route.params.id,
      hasStat: '211',
      pageNum: 1,
      pageSize: 10,
      total: 0,
      isActive: 2,
      activeName: 'rectifying',
      deletePblmId: '',
      currentProblemId: '',
      editDialogTitle: '',
      changeSupervision: {},
      changeSupervisionVisible: false,
      problemDeleteVisible: false,
      pictureArray: [],
      audioArray: [],
      videoArray: [],
      fileArray: [],
      audiotabName: '',
      videotabName: '',
      picturetabName: '',
      filetabName: '',
      ApprovalHistory: [],
      bisInspPblmAudit: {},
      addPicPanel: false,
      changeTm: '',
      changeRequire: '',
      changeInfoVisible: false,
      multipleSelection: [],
      ywcsList: [],
      ywcsListCity: [],
      dcTypeList: [],
      currentNodeId: '',
      showMonthlyReportCommentDialog: false,
      isAg: 1,
      actName: '',
      showPblmDetail: false,
      showPblmRectifyInfo: false,
      RectInfo: {},
      showActivityCommentDialog: false,
      showActivityCommentDialogCity: false,
      showActivityCommentDialogCityAgree: false,
      isPointer: false,
      currentType: null,
      activityCommentForm: {},
      activityCommentFormCity: {},
      activityCommentFormCityAgree: {},
      isProv: false,
      isShow: true,
      selectedRowKeys: [],
      columns: [
        {
          title: '序号',
          dataIndex: 'index',
          slots: { customRender: 'index' },
          align: 'center',
          width: 100,
          ellipsis: true,
        },
        {
          title: '对象名称',
          dataIndex: 'nm',
          slots: { customRender: 'nm' },
          width: 180,
          align: 'center',
        },
        {
          title: '县（市、区）',
          dataIndex: 'adName',
          slots: { customRender: 'adName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题归类',
          dataIndex: 'objType',
          slots: { customRender: 'objType' },
          width: 100,
          align: 'center',
        },
        {
          title: '当前要求整改完成时限',
          dataIndex: 'zgDate',
          slots: { customRender: 'zgDate' },
          width: 200,
          align: 'center',
        },
      ],
      columns1: [
        {
          title: '序号',
          dataIndex: 'index',
          slots: { customRender: 'index' },
          align: 'center',
          width: 100,
          ellipsis: true,
        },
        {
          title: '对象名称',
          dataIndex: 'nm',
          slots: { customRender: 'nm' },
          width: 180,
          align: 'center',
        },
        {
          title: '县（市、区）',
          dataIndex: 'adName',
          slots: { customRender: 'adName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题归类',
          dataIndex: 'objType',
          slots: { customRender: 'objType' },
          width: 100,
          align: 'center',
        },
        {
          title: '当前要求整改完成时限',
          dataIndex: 'zgDate',
          slots: { customRender: 'zgDate' },
          width: 200,
          align: 'center',
        },
        {
          title: '问题编码',
          dataIndex: 'fileNoNumber',
          slots: { customRender: 'fileNoNumber' },
          width: 100,
          align: 'center',
        },
        {
          title: '问题',
          dataIndex: 'inspPblmDesc',
          slots: { customRender: 'inspPblmDesc' },
          width: 200,
          align: 'center',
        },
        {
          title: '问题来源',
          dataIndex: 'pblmSource',
          slots: { customRender: 'pblmSource' },
          width: 200,
          align: 'center',
        },
        {
          title: '设区市/直管县',
          dataIndex: 'upAdName',
          slots: { customRender: 'upAdName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题印发文件名',
          dataIndex: 'zgMemo',
          slots: { customRender: 'zgMemo' },
          width: 200,
          align: 'center',
        },
        {
          title: '问题来源时间',
          dataIndex: 'pblmSourceTm',
          slots: { customRender: 'pblmSourceTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题印发文号',
          dataIndex: 'zgWjName',
          slots: { customRender: 'zgWjName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题印发时间',
          dataIndex: 'issuedTm',
          slots: { customRender: 'issuedTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题是否已销号',
          dataIndex: 'isPblmDel',
          slots: { customRender: 'isPblmDel' },
          width: 120,
          align: 'center',
        },
        {
          title: '销号时间',
          dataIndex: 'isPdTm',
          slots: { customRender: 'isPdTm' },
          width: 100,
          align: 'center',
        },
        {
          title: '初始整改时限',
          dataIndex: 'firstZgTm',
          slots: { customRender: 'firstZgTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '是否按期销号',
          dataIndex: 'isPdSche',
          slots: { customRender: 'isPdSche' },
          width: 120,
          align: 'center',
        },
        {
          title: '上月整改工作进展情况',
          dataIndex: 'zgDevelopment',
          slots: { customRender: 'zgDevelopment' },
          width: 200,
          align: 'center',
        },
        {
          title: '是否申请销号',
          dataIndex: 'isApplyPd',
          slots: { customRender: 'isApplyPd' },
          width: 120,
          align: 'center',
        },
        {
          title: '责任处室(单位)',
          dataIndex: 'dutyDept',
          slots: { customRender: 'dutyDept' },
          width: 180,
          align: 'center',
        },
        {
          title: '责任处室（单位）是否同意销号',
          dataIndex: 'isDeptagePd',
          slots: { customRender: 'isDeptagePd' },
          width: 220,
          align: 'center',
        },
        {
          title: '责任处室（单位）不同意销号原因',
          dataIndex: 'deptagePdEln',
          slots: { customRender: 'deptagePdEln' },
          width: 250,
          align: 'center',
        },
        {
          title: '进一步明确整改要求',
          dataIndex: 'zgRedefineReq',
          slots: { customRender: 'zgRedefineReq' },
          width: 200,
          align: 'center',
        },
        {
          title: '整改描述',
          dataIndex: 'zgZgxx',
          slots: { customRender: 'zgZgxx' },
          width: 200,
          align: 'center',
        },
        {
          title: '整改时限延期说明',
          dataIndex: 'zgDelayEln',
          slots: { customRender: 'zgDelayEln' },
          width: 200,
          align: 'center',
        },
        {
          title: '问题被通报次数',
          dataIndex: 'informedNum',
          slots: { customRender: 'informedNum' },
          width: 200,
          align: 'center',
        },
        {
          title: '操作',
          dataIndex: 'action',
          slots: { customRender: 'action' },
          width: 150,
          align: 'center',
          fixed: 'right',
        },
      ],
      columnsCity: [
        {
          title: '问题编号',
          dataIndex: 'fileNoNumber',
          slots: { customRender: 'fileNoNumber' },
          width: 100,
          fixed: 'left',
          align: 'center',
        },
        {
          title: '问题',
          dataIndex: 'inspPblmDesc',
          slots: { customRender: 'inspPblmDesc' },
          width: 240,
          align: 'center',
        },
        {
          title: '问题来源',
          dataIndex: 'pblmSource',
          slots: { customRender: 'pblmSource' },
          width: 240,
          align: 'center',
        },
        {
          title: '工程名称',
          dataIndex: 'nm',
          slots: { customRender: 'nm' },
          width: 180,
          align: 'center',
        },
        {
          title: '地市',
          dataIndex: 'upAdName',
          slots: { customRender: 'upAdName' },
          width: 120,
          align: 'center',
        },
        {
          title: '区县',
          dataIndex: 'adName',
          slots: { customRender: 'adName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题印发文件名',
          dataIndex: 'zgMemo',
          slots: { customRender: 'zgMemo' },
          width: 200,
          align: 'center',
        },
        {
          title: '问题来源时间',
          dataIndex: 'pblmSourceTm',
          slots: { customRender: 'pblmSourceTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题印发文号',
          dataIndex: 'zgWjName',
          slots: { customRender: 'zgWjName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题印发时间',
          dataIndex: 'issuedTm',
          slots: { customRender: 'issuedTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '业务科室',
          dataIndex: 'dutyDept',
          slots: { customRender: 'dutyDept' },
          width: 180,
          align: 'center',
        },
        {
          title: '问题归类',
          dataIndex: 'objType',
          slots: { customRender: 'objType' },
          width: 100,
          align: 'center',
        },
        {
          title: '是否申请销号',
          dataIndex: 'isApplyPd',
          slots: { customRender: 'isApplyPd' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题是否已销号',
          dataIndex: 'isPblmDel',
          slots: { customRender: 'isPblmDel' },
          width: 120,
          align: 'center',
        },
        {
          title: '整改要求',
          dataIndex: 'pblmSggtn',
          slots: { customRender: 'pblmSggtn' },
          width: 120,
          align: 'center',
        },
        {
          title: '销号时间',
          dataIndex: 'isPdTm',
          slots: { customRender: 'isPdTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '整改时限',
          dataIndex: 'zgDate',
          slots: { customRender: 'zgDate' },
          width: 200,
          align: 'center',
        },
        {
          title: '是否按期销号',
          dataIndex: 'isPdSche',
          slots: { customRender: 'isPdSche' },
          width: 120,
          align: 'center',
        },
        {
          title: '最新申请延期月份',
          dataIndex: 'psDlyTm',
          slots: { customRender: 'psDlyTm' },
          width: 200,
          align: 'center',
        },
        {
          title: '申请销号日期',
          dataIndex: 'applyPdTm',
          slots: { customRender: 'applyPdTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '提交业务科日期',
          dataIndex: 'applyFfcTm',
          slots: { customRender: 'applyFfcTm' },
          width: 120,
          align: 'center',
        },
        {
          title: '不同意销号/延期原因',
          dataIndex: 'deptagePdEln',
          slots: { customRender: 'deptagePdEln' },
          width: 250,
          align: 'center',
        },
        {
          title: '整改/延期描述',
          dataIndex: 'zgZgxx',
          slots: { customRender: 'zgZgxx' },
          width: 200,
          align: 'center',
        },
        {
          title: '操作',
          dataIndex: 'action',
          slots: { customRender: 'action' },
          width: 150,
          align: 'center',
          fixed: 'right',
        },
      ],
      columns2: [
        {
          title: '序号',
          dataIndex: 'index',
          slots: { customRender: 'index' },
          align: 'center',
          width: 100,
          ellipsis: true,
        },
        {
          title: '对象名称',
          dataIndex: 'nm',
          slots: { customRender: 'nm' },
          width: 180,
          align: 'center',
        },
        {
          title: '县（市、区）',
          dataIndex: 'adName',
          slots: { customRender: 'adName' },
          width: 120,
          align: 'center',
        },
        {
          title: '问题归类',
          dataIndex: 'objType',
          slots: { customRender: 'objType' },
          width: 100,
          align: 'center',
        },
        {
          title: '当前要求整改完成时限',
          dataIndex: 'zgDate',
          slots: { customRender: 'zgDate' },
          width: 200,
          align: 'center',
        },
        {
          title: '问题类别',
          dataIndex: 'pblmName',
          slots: { customRender: 'pblmName' },
          width: 180,
          align: 'center',
        },
        {
          title: '检查项目',
          dataIndex: 'checkPoint',
          slots: { customRender: 'checkPoint' },
          width: 180,
          align: 'center',
        },
        {
          title: '问题描述',
          dataIndex: 'pblmDesc',
          slots: { customRender: 'pblmDesc' },
          width: 180,
          align: 'center',
        },
        {
          title: '严重程度',
          dataIndex: 'inspPblmCate',
          slots: { customRender: 'inspPblmCate' },
          width: 180,
          align: 'center',
        },
        {
          title: '详细描述',
          dataIndex: 'inspPblmDesc',
          slots: { customRender: 'inspPblmDesc' },
          width: 180,
          align: 'center',
        },
        {
          title: '上报时间',
          dataIndex: 'intm',
          slots: { customRender: 'intm' },
          width: 160,
          align: 'center',
        },
        {
          title: '上报单位',
          dataIndex: 'zgOrgId',
          slots: { customRender: 'zgOrgId' },
          width: 160,
          align: 'center',
        },
        {
          title: '责任处室(单位)',
          dataIndex: 'dutyDept',
          slots: { customRender: 'dutyDept' },
          width: 180,
          align: 'center',
        },
        {
          title: '操作',
          dataIndex: 'action',
          slots: { customRender: 'action' },
          width: 150,
          align: 'center',
          fixed: 'right',
        },
      ],
      columns3: [
        {
          title: '音频',
          dataIndex: 'audio',
          slots: { customRender: 'audio' },
          align: 'center',
        },
        {
          title: '操作',
          dataIndex: 'action',
          slots: { customRender: 'action' },
          align: 'center',
        },
      ],
      columns4: [
        {
          title: '视频',
          dataIndex: 'video',
          slots: { customRender: 'video' },
          align: 'center',
        },
        {
          title: '操作',
          dataIndex: 'action',
          slots: { customRender: 'action' },
          align: 'center',
        },
      ],
      columns5: [
        {
          title: '材料编号',
          dataIndex: 'id',
          width: 100,
          align: 'center',
          slots: { customRender: 'idTooltip' },
          customCell: () => {
            return {
              style: {
                maxWidth: '100px',
                overflow: 'hidden',
                whiteSpace: 'nowrap',
                textOverflow: 'ellipsis',
              },
            };
          },
        },
        {
          title: '文档',
          dataIndex: 'txt',
          slots: { customRender: 'txt' },
          align: 'center',
        },
        {
          title: '操作',
          dataIndex: 'action',
          slots: { customRender: 'action' },
          align: 'center',
        },
      ],
      columns6: [
        {
          title: '处理人',
          dataIndex: 'moduserid',
          // width: 60,
          align: 'center',
          ellipsis: true,
        },
        {
          title: '处理环节',
          dataIndex: 'name',
          // width: 60,
          align: 'center',
          ellipsis: true,
        },
        {
          title: '处理动作',
          dataIndex: 'isag',
          slots: { customRender: 'isag' },
          // width: 60,
          align: 'center',
          ellipsis: true,
        },
        {
          title: '处理意见',
          dataIndex: 'auditidea',
          // width: 60,
          align: 'center',
          ellipsis: true,
        },
        {
          title: '处理时间',
          dataIndex: 'moddate',
          slots: { customRender: 'moddate' },
          // width: 60,
          align: 'center',
          ellipsis: true,
        },
      ],
      tabsForXjdw: [],
      activatedTab: 'none',
      pType: 1,
      // userId: localStorage.getItem('persId'),
      readOnlyRole: localStorage.getItem('readOnlyRole'),
    };
  },
  computed: {
    userId() {
      return localStorage.getItem('persId')
        ? localStorage.getItem('persId')
        : '';
    },
    currentOrgNm() {
      return localStorage.getItem('currentOrgNm')
        ? localStorage.getItem('currentOrgNm')
        : '';
    },
    account() {
      return localStorage.getItem('account1')
        ? localStorage.getItem('account1')
        : '';
    },
    hostUrl() {
      return hostUrl;
    },
    formatD() {
      return formatD;
    },
  },
  components: {
    MonthlyReportComment: MonthlyReportComment,
    pblmDetail: pblmDetail,
    pblmDetailCity: pblmDetailCity,
    upload: upload,
    ActivityComment: ActivityComment,
    elaudio,
    ProblemDelete,
    xjdwUnderRectify,
    xjdwPblmView,
    xjdwDoubleCheck,
  },
  created() {
    console.log('create');
    this.rectifyUnits = this.getOrgTreeJson();
    this.getDutyDept();
    this.getDutyDeptCity();
    this.getObjType();
    this.getDuChaResource();
    this.getDuChaResourceCity();
    this.getDuChaTypes();
    if (
      (this.hasStat == '211' && this.isActive == '0') ||
      (this.hasStat == '212' && this.isActive == '0') ||
      (this.hasStat == '221' &&
        this.isActive == '0' &&
        (this.activeName == 'rectify' ||
          this.activeName == 'rectifying' ||
          this.activeName == 'approval' ||
          this.activeName == 'view')) ||
      (this.hasStat == '222' && (this.isActive == '6' || this.isActive == '7'))
    ) {
      this.columns = this.columns1;
    } else {
      this.columns = this.columns2;
    }
    this.getAuthenticatedTabs(this.userId, tabsForXjdw);
  },
  mounted() {
    this.pblmSourceArr = [];
    this.workflowStats = [];
    this.changeMenu(3, '004');
    // if (this.hasStat == '211' || this.hasStat == '212' || this.hasStat == '221') {
    //   this.isActive = 0
    //   if (this.hasStat == '211') {
    //     this.activeName = this.readOnlyRole == 'display' ? 'rectifying' : 'view'
    //   }
    //   if (this.hasStat == '212') {
    //     this.activeName = this.readOnlyRole == 'display' ? 'reviewed' : 'view'
    //   }
    //   if (this.hasStat == '221') {
    //     this.activeName = this.readOnlyRole == 'display' ? 'rectify' : 'view'
    //   }
    // }
    // if (this.hasStat == '223') {
    //   this.isActive = 4
    //   this.activeName = this.readOnlyRole == 'display' ? 'approval' : 'view'
    // }
    // if (this.hasStat == '222') {
    //   this.isActive = 6
    //   this.activeName = this.readOnlyRole == 'display' ? 'reviewed' : 'view'
    // }
    // this.search()
  },
  watch: {
    $route(n, o) {
      this.hasStat = '211';
      this.rectifyUnits = this.getOrgTreeJson();
      this.getDutyDept();
      this.getDutyDeptCity();
      this.getObjType();
      this.getDuChaResource();
      this.getDuChaResourceCity();
      this.getDuChaTypes();
      if (
        (this.hasStat == '211' && this.isActive == '0') ||
        (this.hasStat == '212' && this.isActive == '0') ||
        (this.hasStat == '221' &&
          this.isActive == '0' &&
          (this.activeName == 'rectify' ||
            this.activeName == 'rectifying' ||
            this.activeName == 'approval' ||
            this.activeName == 'view')) ||
        (this.hasStat == '222' &&
          (this.isActive == '6' || this.isActive == '7'))
      ) {
        this.columns = this.columns1;
      } else {
        this.columns = this.columns2;
      }
      this.getAuthenticatedTabs(this.userId, tabsForXjdw);
      this.pblmSourceArr = [];
      this.workflowStats = [];

      // if (this.hasStat == '211' || this.hasStat == '212' || this.hasStat == '221') {
      //   this.isActive = 0
      //   if (this.hasStat == '211') {
      //     this.activeName = this.readOnlyRole == 'display' ? 'rectifying' : 'view'
      //   }
      //   if (this.hasStat == '212') {
      //     this.activeName = this.readOnlyRole == 'display' ? 'reviewed' : 'view'
      //   }
      //   if (this.hasStat == '221') {
      //     this.activeName = this.readOnlyRole == 'display' ? 'rectify' : 'view'
      //   }
      // }
      // if (this.hasStat == '223') {
      //   this.isActive = 4
      //   this.activeName = this.readOnlyRole == 'display' ? 'approval' : 'view'
      // }
      // if (this.hasStat == '222') {
      //   this.isActive = 6
      //   this.activeName = this.readOnlyRole == 'display' ? 'reviewed' : 'view'
      // }
      this.search();
    },
  },
  methods: {
    sendReCheck(v, flag) {
      const list = [];
      if (this.multipleSelection.length == 0) {
        this.$message.warning('请选择需要操作的问题!');
        return;
      }
      if (flag) {
        if (v == 1) {
          this.showActivityCommentDialogCityAgree = true;
          this.activityCommentFormCityAgree.auditidea = '';
        } else {
          this.showActivityCommentDialogCity = true;
          this.activityCommentFormCity.auditidea = '';
        }
        return;
      } else {
        let auditidea = '';
        if (v === 1) {
          auditidea = this.activityCommentFormCityAgree.auditidea
            ? this.activityCommentFormCityAgree.auditidea
            : '同意';
        } else {
          if (!this.activityCommentFormCity.auditidea) {
            this.$message.warning('请填写退回意见!');
            return;
          } else {
            auditidea = this.activityCommentFormCity.auditidea;
          }
        }
        this.multipleSelection.forEach((item, index) => {
          list.push({
            flowType: '2',
            isag: v,
            auditidea: auditidea,
            ...item,
          });
        });
      }
      request.post(`/dc/insp/pblm/newAddPblmZg`, list).then((res) => {
        if (res.success) {
          if (v === 1) {
            this.showActivityCommentDialogCityAgree = false;
            this.activityCommentFormCityAgree = {};
          } else {
            this.showActivityCommentDialogCity = false;
            this.activityCommentFormCity = {};
          }
          this.multipleSelection = [];
          this.search();
        }
      });
    },
    handleChange(info) {
      if (info.file.status === 'done') {
        if (info.file.response.success) {
          this.$message.success(`${info.file.name} 导入成功!`);
          this.search();
        } else {
          this.$message.error(info.file.response.message);
        }
      } else if (info.file.status === 'error') {
        this.$message.error(`${info.file.name} 导入失败!`);
      }
    },
    filterOption(input, option) {
      return (
        option.componentOptions.children[0].text
          .toLowerCase()
          .indexOf(input.toLowerCase()) >= 0
      );
    },
    getDuChaTypes() {
      request.get('/dc/insp/pblm/getListType').then((res) => {
        if (res.success) {
          this.duChaTypes = res.data;
        }
      });
    },
    selectInit(row, index) {
      if (row.isInput && row.isInput == '0') {
        return false; // 不可勾选
      } else {
        return true; // 可勾选
      }
    },
    async exportExcel() {
      this.search();
      if (this.exelHeads.length > 0) {
        this.searchParam.list = this.exelHeads;
        const data = JSON.stringify(this.searchParam);
        const url = `/modular-source/6ace62b8e2bb467d98286d260aebcef2/pdcApi/dc/insp/pblm/zg/list/export/${this.activeName}/${this.hasStat}/${this.getCode(this.isActive)}`;
        const type = 'post';
        const exportName = '问题查看.xls';
        const result = await exportModel(type, url, exportName, data);
        this.dialogFormVisible = false;
      } else {
        this.$message.warning('请选择需要导出的表头！');
      }
    },
    async downloadCityTemplate() {
      const url =
        '/modular-source/6ace62b8e2bb467d98286d260aebcef2/pdcApi/dc/insp/pblm/newDownTemplateExcel';
      const type = 'get';
      const exportName = '问题台账模板下载.xlsx';
      const result = await exportModel(type, url, exportName, null);
    },
    getCode(v) {
      switch (v) {
        case 0:
          return '001';
        case 1:
          return '002';
        case 2:
          return '003';
        case 3:
          return '004';
        case 4:
          return '003';
        case 5:
          return '002';
        case 6:
          return '005';
        case 7:
          return '006';
        case 8:
          return '002';
        case 9:
          return '003';
      }
    },
    isNumber(val) {
      var regPos = /^[+]{0,1}(\d+)$/; // 非负浮点数
      if (regPos.test(val)) {
        return true;
      } else {
        return false;
      }
    },
    async downloadMonthlyReportExcelTemplate() {
      if (this.isActive == '0') {
        if (this.searchParam.fileNoNumber) {
          if (this.searchParam.fileNoNumber.indexOf('-') > -1) {
            var numList = this.searchParam.fileNoNumber.split('-');
            if (
              ((!numList[0] || !numList[1]) && numList.length != 2) ||
              !this.isNumber(numList[0]) ||
              !this.isNumber(numList[1])
            ) {
              this.$message.warning('请输入正确的编号范围！');
              return;
            }
          }
        }
        this.searchParam.pblmSource =
          this.pblmSourceArr.length > 0 ? this.pblmSourceArr.join(',') : '';
        this.searchParam.zgXianOrgId = this.searchParam.objAdCode;
      }
      if (this.activeName == 'view') {
        this.searchParam.workflowStats =
          this.workflowStats.length > 0 ? this.workflowStats.join(',') : '';
        this.searchParam.startTime = this.currentRange[0]
          ? this.currentRange[0] + ' 00:00:00'
          : '';
        this.searchParam.endTime = this.currentRange[1]
          ? this.currentRange[1] + ' 23:59:59'
          : '';
      }
      const datas = JSON.stringify(this.searchParam);
      const url =
        '/modular-source/6ace62b8e2bb467d98286d260aebcef2/pdcApi/dc/insp/pblm/page/rever/exportxian';
      const type = 'post';
      const exportName = '整改进度月报模板.xls';
      const result = await exportModel(type, url, exportName, datas);
    },
    SubmitMonthlyReportForSelectedPblm(
      isAg,
      activityComment,
      fileExt,
      filePath,
    ) {
      const data = {
        fileName: filePath,
        persId: this.userId,
        persName: this.account,
      };
      request.post('/dc/insp/pblm/insertXls', data).then((res) => {
        if (res.data.type) {
          this.$message.error('当前文件不存在！');
        } else {
          this.$message.success(
            '成功:' + res.data.success + '条,失败:' + res.data.false + '条',
          );
        }
      });
    },
    closeMonthlyReportCommentDialog() {
      this.showMonthlyReportCommentDialog = false;
    },
    closePblmRectifyInfoDialog() {
      this.currentProblemId = '';
      this.showPblmRectifyInfo = false;
    },
    saveMonthlyReportComment(val) {
      this.closeMonthlyReportCommentDialog();
      this.SubmitMonthlyReportForSelectedPblm(
        val.isAg,
        val.Comment,
        val.fileExt,
        val.filePath,
      );
    },
    openMonthlyReportDialog(isAg, e) {
      this.isAg = isAg;
      this.actName = e.currentTarget.innerText;
      this.showMonthlyReportCommentDialog = true;
    },
    changeMenu(index, type) {
      console.log(index, type, this.hasStat, 'change');
      this.selectedRowKeys = [];
      this.multipleSelection = [];
      if (index == 0 && type == '001') {
        this.isShow = true;
        this.isActive = index;
        this.pblmSourceArr = [];
        this.workflowStats = [];
      } else {
        this.isShow = false;
        if (index == '') {
          this.$refs.ruleFormRef?.resetFields();
        }
        this.pblmSourceArr = [];
        this.workflowStats = [];
        this.isActive = index;
        // if (this.hasStat == '211' || this.hasStat == '212' || this.hasStat == '221') {
        //   if (this.hasStat == '211') {
        //     this.activeName = this.readOnlyRole == 'display' ? 'rectifying' : 'view'
        //   }
        //   if (this.hasStat == '212') {
        //     this.activeName = this.readOnlyRole == 'display' ? 'reviewed' : 'view'
        //   }
        //   if (this.hasStat == '221') {
        //     if (index == 0) {
        //       this.activeName = this.readOnlyRole == 'display' ? 'rectify' : 'view'
        //     }
        //     if (index == 1) {
        //       this.activeName = this.readOnlyRole == 'display' ? 'approval' : 'view'
        //     }
        //     if (index == 2) {
        //       this.activeName = this.readOnlyRole == 'display' ? 'rectifying' : 'view'
        //     }
        //     if (index == 10) {
        //       this.activeName = 'view'
        //     }
        //   }
        // }
        // if (this.hasStat == '222') {
        //   this.activeName = this.readOnlyRole == 'display' ? 'over' : 'view'
        // }
        // if (this.hasStat == '223') {
        //   this.activeName = this.readOnlyRole == 'display' ? 'approval' : 'view'
        // }
        this.getObjType();
        this.search();
      }
      // if(this.isActive=='10'){
      //   this.columns = this.columnsCity;
      // }
    },
    treeNodeClickHandler: function (data, node, tree) {
      this.currentNodeId = data.id;
      this.search();
    },
    getTrees(list) {
      let highLevelLength = 99; // 预设最大节点id长度，目前最大应该为12，所以设置为99保证正常
      list.forEach((item, index) => {
        item['pidLength'] = item.pid && item.pid != '' ? item.pid.length : 0;
        if (highLevelLength > item.pidLength) {
          highLevelLength = item.pidLength;
        }
      });
      console.log(highLevelLength);
      const heightLevelNode = [];
      list.forEach((item, index) => {
        if (highLevelLength >= item.pidLength) {
          heightLevelNode.push(item);
        }
      });

      list.forEach((item, index) => {
        heightLevelNode.forEach((pItem) => {
          this.addTreeNode(pItem, item);
        });
      });
      return heightLevelNode;
    },
    addTreeNode: function (treeNode, leafNode) {
      if (!Object.hasOwn(treeNode, 'children')) {
        treeNode['children'] = [];
      }
      if (leafNode.pid == treeNode.id) {
        treeNode.children.push(leafNode);
        return;
      }
      treeNode.children.forEach((item) => {
        this.addTreeNode(item, leafNode);
      });
    },
    getLeftTreeData() {
      request
        .get('/dc/organization/base/getAllNode', {
          params: { userId: this.userId, orgType: '' },
        })
        .then((res) => {
          let data = res.data;
          data = this.getTrees(data);
          this.treeData = data;
        });
    },
    getDuChaResource() {
      getDuChaResource().then((res) => {
        this.sourceList = res.data;
      });
    },
    getDuChaResourceCity() {
      getDuChaResourceCity().then((res) => {
        this.sourceListCity = res.data;
      });
    },
    getDutyDept() {
      getDutyDept(this.getCode(this.isActive)).then((res) => {
        this.ywcsList = res.data;
      });
    },
    getDutyDeptCity() {
      getDutyDeptCity().then((res) => {
        this.ywcsListCity = res.data;
      });
    },
    getObjType() {
      // getObjType().then(res => {
      //   this.dcTypeList = res.data
      // })
      request
        .post(
          `/dc/insp/pblm/zg/getFindListMatter/${this.activeName}/${this.hasStat}/${this.getCode(this.isActive)}`,
          {},
        )
        .then((res) => {
          this.dcTypeList = res.data;
        });
    },
    getOrgTreeJson() {
      getOrgTreeJson().then((res) => {
        const jsonArray = [];
        jsonArray.push(res.data);
        this.rectifyUnits = jsonArray;
      });
    },
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.label,
        children: node.children,
      };
    },
    handleSelection(val, row) {
      this.selectedRowKeys = val;
      this.multipleSelection = row;
    },
    batchSubmit(flag, type) {
      this.currentType = type;
      this.activityCommentForm.flag = flag;
      if (this.multipleSelection.length > 0) {
        this.showActivityCommentDialog = true;
        if (type == 2) {
          this.isPointer = true;
        } else {
          this.isPointer = false;
        }
      } else {
        this.$message.warning('请选择需要操作的问题!');
      }
    },
    addSelect(val) {
      this.activityCommentForm.adCode = val.id;
      this.activityCommentForm.adName = val.label;
    },
    closeActivityCommentDialog() {
      this.showActivityCommentDialog = false;
      this.activityCommentForm = {};
    },
    closeActivityCommentDialogCity() {
      this.showActivityCommentDialogCity = false;
      this.activityCommentFormCity = {};
    },
    closeActivityCommentDialogCityAgree() {
      this.showActivityCommentDialogCityAgree = false;
      this.activityCommentFormCityAgree = {};
    },
    saveActivityComment() {
      if (this.currentType == 2) {
        if (!this.activityCommentForm.adCode) {
          this.$message.warning('请选择整改单位');
          return;
        }
      }
      this.batchSubmitRq();
    },
    saveActivityCommentCity() {
      if (!this.activityCommentForm.auditidea) {
        this.$message.warning('请填写意见');
        return;
      }
      this.batchSubmitRqCity();
    },
    submit() {
      var obj = {
        zgZgxx: this.RectInfo.zgZgxx,
        pblmId: this.currentProblemId,
      };
      let url = '';
      if (this.isActive == '10') {
        url = '/bis/insp/BisInspZgPblmCity/update';
      } else {
        url = '/bis/insp/zg/pblm';
      }
      request.post(url, obj).then((res) => {
        if (res.success) {
          this.$nextTick(() => {
            if (this.$refs.uploadFile.submitUpload(this.currentProblemId)) {
              this.removeNewSupervision();
            }
          });
          this.search();
          this.showPblmRectifyInfo = false;
          this.RectInfo = {};
          this.$message.success('操作成功');
        }
      });
    },
    batchSubmitRq() {
      var params = [];
      for (var i = 0; i < this.multipleSelection.length; i++) {
        var obj = {
          moduserid: this.userId,
          auditidea: this.activityCommentForm.Comment
            ? this.activityCommentForm.Comment
            : this.activityCommentForm.flag == 0
              ? '不同意'
              : '同意',
          pblmId: this.multipleSelection[i].pblmId,
          isag: this.activityCommentForm.flag,
          flowType: 2,
        };
        if (this.currentType == 0) {
          obj.adName = this.currentOrgNm;
          obj.adCode = this.multipleSelection[i].zgOrgId.substring(0, 4);
        }
        if (this.currentType == 2) {
          obj.adName = this.activityCommentForm.adName;
          obj.adCode = this.activityCommentForm.adCode;
        }
        params.push(obj);
      }
      this.loading = true;
      this.$confirm({
        title: '提示',
        content:
          '确定要' +
          (this.activityCommentForm.flag == 0 ? '退回' : '提交') +
          '吗？',
        okType: 'warning',
        onOk: () => {
          request.post('/dc/insp/pblm/batchApprove', params).then((res) => {
            if (res.success) {
              this.multipleSelection = [];
              // _self.$refs.myTable.clearSelection()
              this.showActivityCommentDialog = false;
              this.activityCommentForm = {};
              this.search();
              // _self.getObjType()
              this.loading = false;
              this.$message.success('操作成功');
            } else {
              this.loading = false;
              this.$message.error(res.message);
            }
          });
        },
      });
    },
    submitRectification() {
      if (!this.changeTm) {
        this.$message.warning('请选择整改时限');
        return;
      }
      if (!this.changeRequire) {
        this.$message.warning('请选择整改要求');
        return;
      }
      this.bisInspPblmAudit.zgDate = this.changeTm;
      this.bisInspPblmAudit.pblmSggtn = this.changeRequire;
      this.submit();
    },
    ProcMoveNext(flag) {
      this.bisInspPblmAudit.isag = flag;
      this.bisInspPblmAudit.userId = this.userId;
      this.bisInspPblmAudit.pblmId = this.currentProblemId;
      this.bisInspPblmAudit.flowType = '1';
      if ((this.hasStat == '111' || this.hasStat == '123') && flag == 1) {
        this.changeInfoVisible = true;
      } else {
        this.submit();
      }
    },
    /**
     * 查询问题操作
     */
    search() {
      if (this.isActive == 10) {
        this.searchCitySend();
        return false;
      }
      this.tableData_sum = [];
      this.searchParam.pageNum = this.pageNum;
      this.searchParam.pageSize = this.pageSize;
      if (this.isActive == '0') {
        if (this.searchParam.fileNoNumber) {
          if (this.searchParam.fileNoNumber.indexOf('-') > -1) {
            var numList = this.searchParam.fileNoNumber.split('-');
            if (
              ((!numList[0] || !numList[1]) && numList.length != 2) ||
              !this.isNumber(numList[0]) ||
              !this.isNumber(numList[1])
            ) {
              this.$message.warning('请输入正确的编号范围！');
              return;
            }
          }
        }
        this.searchParam.pblmSource =
          this.pblmSourceArr.length > 0 ? this.pblmSourceArr.join(',') : '';
        this.searchParam.zgXianOrgId = this.searchParam.objAdCode;
      }
      if (this.activeName == 'view') {
        this.searchParam.workflowStats =
          this.workflowStats.length > 0 ? this.workflowStats.join(',') : '';
        this.searchParam.startTime = this.currentRange[0]
          ? this.currentRange[0] + ' 00:00:00'
          : '';
        this.searchParam.endTime = this.currentRange[1]
          ? this.currentRange[1] + ' 23:59:59'
          : '';
      }
      this.searchParam.isObjType = 'Y';
      request
        .post(
          `/dc/insp/pblm/zg/list/${this.activeName}/${this.hasStat}/${this.getCode(this.isActive)}`,
          this.searchParam,
        )
        .then((res) => {
          if (res.success) {
            this.tableData_sum = res.data.list;
            this.total = res.data.total;
            // _self.$refs.myTable.doLayout()
          }
        });
    },
    searchCitySend() {
      this.tableData_sum = [];
      this.searchParam.pageNum = this.pageNum;
      this.searchParam.pageSize = this.pageSize;
      this.searchParam.pblmSource =
        this.pblmSourceArr.length > 0 ? this.pblmSourceArr.join(',') : '';
      if (this.isActive == '0') {
        if (this.searchParam.fileNoNumber) {
          if (this.searchParam.fileNoNumber.indexOf('-') > -1) {
            var numList = this.searchParam.fileNoNumber.split('-');
            if (
              ((!numList[0] || !numList[1]) && numList.length != 2) ||
              !this.isNumber(numList[0]) ||
              !this.isNumber(numList[1])
            ) {
              this.$message.warning('请输入正确的编号范围！');
              return;
            }
          }
        }
        this.searchParam.pblmSource =
          this.pblmSourceArr.length > 0 ? this.pblmSourceArr.join(',') : '';
        this.searchParam.zgXianOrgId = this.searchParam.objAdCode;
      }
      if (this.activeName == 'view') {
        this.searchParam.workflowStats =
          this.workflowStats.length > 0 ? this.workflowStats.join(',') : '';
        this.searchParam.startTime = this.currentRange[0]
          ? this.currentRange[0] + ' 00:00:00'
          : '';
        this.searchParam.endTime = this.currentRange[1]
          ? this.currentRange[1] + ' 23:59:59'
          : '';
        this.searchParam.workflowStat = '';
        this.searchParam.zgXianOrgId = '';
        if (this.hasStat == '211' || this.hasStat == '212') {
          this.searchParam.zgXianOrgId = '41';
        }
      } else {
        this.searchParam.workflowStat = '';
        this.searchParam.zgXianOrgId = '';
        if (this.hasStat == '221') {
          if (this.activeName == 'rectifying') {
            this.searchParam.workflowStat = 101;
            this.searchParam.zgXianOrgId = 40;
          }
          if (this.activeName == 'approval') {
            this.searchParam.workflowStat = 101;
            this.searchParam.zgXianOrgId = 41;
          }
          if (this.activeName == 'reviewed') {
            this.searchParam.workflowStat = 103;
          }
          if (this.activeName == 'reReviewed') {
            this.searchParam.workflowStat = 103;
          }
        }
        if (this.hasStat == '211') {
          this.searchParam.workflowStat = 105;
        }
        if (this.hasStat == '212') {
          this.searchParam.workflowStat = 106;
        }
        if (this.hasStat == '222') {
          this.searchParam.workflowStat = 104;
        }
        if (this.hasStat == '223') {
          this.searchParam.workflowStat = 102;
        }
      }
      this.searchParam.isObjType = 'Y';
      request
        .post(`/dc/insp/pblm/newListOfZg`, this.searchParam)
        .then((res) => {
          if (res.success) {
            this.tableData_sum = res.data.list;
            this.total = res.data.total;
            // _self.$refs.myTable.doLayout()
          }
        });
    },
    removeNewSupervision(arg) {
      this.$refs.uploadFile.init();
      // if (arg) {
      //     this.gwComFiles = arg;
      //     this.$refs.uploadFile.init();
      //     this.editDialog({pblmId:this.currentProblemId})
      // }
    },
    /**
     *删除上传文件
     */
    removeFile(id) {
      console.log(id, 'xxxxxxxxxx');
      this.$confirm({
        title: '提示',
        content: '此操作将永久删除该文件, 是否继续?',
        okType: 'warning',
        onOk: () => {
          console.log(1111111111111);
          deleteFileById(id, this.userId).then((res) => {
            if (res.success) {
              this.editDialog({ pblmId: this.currentProblemId });
            } else {
              this.$message.error('删除失败');
            }
          });
        },
      });
    },
    editDialog(row) {
      this.currentProblemId = row.pblmId;
      if (this.currentProblemId) {
        this.showPblmRectifyInfo = true;
      } else {
        this.$message.warning('请选择需要整改的问题!');
      }
    },
    showDialog(row) {
      if (
        this.isActive == '0' ||
        this.isActive == '6' ||
        this.isActive == '7'
      ) {
        this.isProv = true;
      } else {
        this.isProv = false;
      }
      this.showPblmDetail = true;
      this.currentProblemId = row.pblmId;
      this.currentPblmWorkflowStat = row.workflowStat;
      this.currentPblmFileNoNumber = row.fileNoNumber;
      this.zgXianOrgId = row.zgXianOrgId;
    },
    closePblmDetailDialog(id) {
      this.currentProblemId = '';
      this.currentPblmWorkflowStat = '';
      this.currentPblmFileNoNumber = '';
      this.showPblmDetail = false;
    },
    /**
     * 编辑弹窗和查看详细
     * */
    edit(row) {
      this.currentProblemId = row.pblmId;
      this.pictureArray = [];
      this.audioArray = [];
      this.videoArray = [];
      this.fileArray = [];
      showDetailsXq(row.pblmId).then((res) => {
        if (res.success) {
          this.changeSupervision = res.data;
          this.changeSupervisionVisible = true;
          res.data.gwComFiles.forEach((item) => {
            if (
              item.fileExt == 'mp3' ||
              item.fileExt == 'MP3' ||
              item.fileExt == 'm4a'
            ) {
              this.audioArray.push(item);
            } else if (
              item.fileExt == 'jpg' ||
              item.fileExt == 'JPG' ||
              item.fileExt == 'png' ||
              item.fileExt == 'PNG' ||
              item.fileExt == 'JPEG' ||
              item.fileExt == 'jpeg'
            ) {
              this.pictureArray.push(item);
            } else if (item.fileExt == 'mp4' || item.fileExt == 'MP4') {
              this.videoArray.push({
                id: item.id,
                bizId: item.bizId,
                width: '130',
                height: '130',
                autoplay: false,
                muted: true,
                language: 'en',
                playbackRates: [0.7, 1.0, 1.5, 2.0],
                sources: [
                  {
                    type: 'video/mp4',
                    src: this.hostUrl + item.filePath,
                  },
                ],
              });
            } else {
              this.fileArray.push(item);
            }
          });

          this.picturetabName = '图片资料(' + this.pictureArray.length + ')';
          this.audiotabName = '音频资料(' + this.audioArray.length + ')';
          this.videotabName = '视频资料(' + this.videoArray.length + ')';
          this.filetabName = '其它资料(' + this.fileArray.length + ')';
          this.getApprovalHistory();
        }
      });
    },
    /**
     *获取处理工作流
     * */
    getApprovalHistory() {
      request
        .get(
          '/dc/insp/pblmAudit/queryList/' +
            this.changeSupervision.pblmId +
            '/1',
        )
        .then((res) => {
          if (res.success) {
            this.ApprovalHistory = res.data;
            this.ApprovalHistory.forEach((item) => {
              if (item.auditidea == '无意见') {
                item.auditidea = '';
              }
            });
          }
        });
    },
    /**
     * 删除问题操作
     */
    deleteSuccess() {
      this.problemDeleteVisible = false;
      this.search();
    },
    deleteDialog(id) {
      this.deletePblmId = id;
      this.problemDeleteVisible = true;
    },
    handleClick(tab) {
      this.hasStat = tab;
      if (this.hasStat == '211') {
        this.activeName = 'rectifying';
      }
      if (this.hasStat == '212') {
        this.activeName = 'reviewed';
      }
      this.$nextTick(() => {
        this.$refs.ruleFormRef?.resetFields();
      });
      this.pblmSourceArr = [];
      this.workflowStats = [];
      this.pageSize = 10;
      this.pageNum = 1;
      this.multipleSelection = [];
      this.selectedRowKeys = [];
      this.search();
    },
    handleSizeChange(size, val) {
      this.pageSize = val;
      this.search();
    },
    handleCurrentChange(val) {
      this.pageNum = val;
      this.search();
    },
    timestampToTime(row, column) {
      return dateFormat(row[column.property], 'yyyy-MM-dd');
    },
    dateFormats(row, column) {
      return row[column.property] ? row[column.property].substring(0, 10) : '';
    },
    inspPblmCate(row, column) {
      if (row[column.property] == '0') {
        return '一般';
      }
      if (row[column.property] == '1') {
        return '较重';
      }
      if (row[column.property] == '2') {
        return '严重';
      }
      if (row[column.property] == '3') {
        return '特别严重';
      }
    },
    isPblmDel(row, column) {
      if (row[column.property] == '0') {
        return '否';
      }
      if (row[column.property] == '1') {
        return '是';
      }
    },
    zgOrgId(val) {
      var name = val || '';
      if (!name) {
        return '';
      }
      name = name.replace(/00/g, '');
      if (name.length == 2) {
        return '省级';
      }
      if (name.length == 4) {
        return '市级';
      }
      if (name.length == 6) {
        return '县级';
      }
    },
    handleTabClick(tab, event) {
      this.activatedTab = tab.name;
    },
    getAuthenticatedTabs(userId, tabs) {
      const currentUser = { userId: userId };
      let userRoles = [];
      requestUserRole(currentUser).then((res) => {
        if (res.data != null) {
          userRoles = res.data; // 当前用户的所有角色列表
          let authenticatedTabs = [];
          let tempTabs = [];
          var flag = false;
          userRoles.forEach((userRole) => {
            // 用户所有角色可见的标签的集合
            tempTabs = tabs.filter(
              (tab) =>
                tab.roles.indexOf(userRole.roleId) > -1 ||
                tab.roles.length === 0,
            );
            tempTabs.forEach((tab) => {
              authenticatedTabs.push(tab);
            });
            if (userRole.roleId == '66a6e697fe3e4d02b79f9f90771a4b68') {
              flag = true;
            }
          });
          if (flag) {
            authenticatedTabs = tabs;
          }
          // 去除重复的标签
          authenticatedTabs = distinct(authenticatedTabs);
          if (this.readOnlyRole == 'hide') {
            this.tabsForXjdw = [
              {
                value: 'xjdwPblmView',
                label: '问题查看',
                roles: [], // 督查处所有角色可见
              },
            ];
          } else {
            this.tabsForXjdw = authenticatedTabs;
          }
          if (authenticatedTabs.length > 0) {
            this.activatedTab = this.tabsForXjdw[0].value; // 默认显示第一个标签
          }
        }
      });
    },
  },
};
</script>

<style lang='less' scoped>
.mainCss {
  width: 100%;
  //height: calc(100% - 20px);
  display: flex;
  //margin-top: 10px;
}

.pageLeft {
  display: none;
  width: 0px;
  height:100%;
  margin-left: 10px;
  //box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
}

.pageLeft_none {
  display: none;
}

.pageLeft ul {
  width: calc(100% - 10px);
  margin-left: 5px;
  overflow: auto;
  list-style: none;
}

.pageLeft ul li {
  width: calc(100% - 5px);
  height: 35px;
  margin-top: 5px;
  background: #f0f0f8;
  font-size: 14px;
  display: flex;
  align-items: center;
  text-indent: 5px;
  cursor: pointer;

}

.active {
  border-right: 5px solid #3683e7 !important;
  color: #3683e7 !important;
  background: #bedcff !important;
}

.active .el-icon-s-fold {
  color: #3683e7 !important;
}

.el-icon-s-fold {
  font-size: 20px;
  margin-right: 10px;
  color: #909095
}

.pageRight {
  height:100%;
  width: 100%;
  margin-left: 10px;
  box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
}

.pageRight_none {
  width: calc(100% - 20px);
  margin-left: 10px;
  box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
}

.pageRight :deep(.el-tabs__header) {
  margin: 0 !important;
  background: #F5F7FA;
}

.pageRight :deep(.el-tabs__item.is-active) {
  background: white;
}

.content {
  width: 100%;
  height: calc(100% - 41px);
}

.content .el-table {
  height: calc(100% - 200px) !important;
}

.content :deep(.el-table__body-wrapper) {
  height: calc(100% - 40px);
  overflow: auto;
}

.content :deep(el-table__fixed-right) .el-table__fixed-body-wrapper {
  top: 0px !important;
}

.vue-treeselect {
  position: relative;
  width: 200px;
}

.demo-form-inline :deep(.vue-treeselect) .vue-treeselect__control {
  height: 28px;
}

.demo-form-inline :deep(.vue-treeselect) .vue-treeselect__control .vue-treeselect__single-value {
  line-height: 28px;
  font-size: 12px;
}

.demo-form-inline :deep(.vue-treeselect) .vue-treeselect__placeholder,
.vue-treeselect__single-value {
  line-height: 28px;
  font-size: 12px;
}

.mainCss :deep(.el-tree-node__label) {
  width: auto;
  margin-top: 12px;
  float: right;
  font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
  font-size: 12px;
  color: #999999;
  line-height: 25px;
  letter-spacing: 1px;
}
:deep(.ant-layout-sider),
:deep(.ant-layout-content) {
  background: #fff;
}

.skactive {
  background: #3f8eff !important;
  color: white !important;
  margin-top: 5px;
  margin-bottom: 5px;
}

.sknormal {
  background: white;
  margin-top: 5px;
  margin-bottom: 5px;
}

.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}

#dxdcListMainsk {
  overflow-y: hidden;
}
:deep(.ant-table-pagination) {
  float: left;
}
:deep(.ant-layout-sider),
:deep(.ant-layout-content) {
  background: #fff;
}
:deep(.ant-table-thead>tr>th),
:deep(.ant-table-tbody>tr>td) {
  padding: 0;
  height: 48px;
}
.ellipsis100 {
  display: block;
  width: 98px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ellipsis120 {
  display: block;
  width: 118px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ellipsis160 {
  display: block;
  width: 158px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ellipsis180 {
  display: block;
  width: 178px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.ellipsis200 {
  display: block;
  width: 198px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ellipsis220 {
  display: block;
  width: 218px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ellipsis250 {
  display: block;
  width: 248px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
:deep(.ant-table-scroll) {
  position: relative;
  z-index: 1;
}

:deep(.ant-table-fixed-left), :deep(.ant-table-fixed-right) {
  z-index: 2;
}
</style>
