<!--  -->
<template>
  <div class="main-content cancelList m20">
    <!--头部-查询-->
    <!--    <div class="content-header">-->
    <!--      <searchHeader title="查询" />-->
    <!--      <div class="body search-body">-->
    <!--        <el-row class="mb10">-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_1">投诉人证件号码/统一码：</label>-->
    <!--            <div class="search-input-box_1">-->
    <!--              <el-input v-model="searchForm.paramMap.complainerCertNo" size="small" clearable type="text" class="search-input" placeholder="请输入投诉人证件号码/统一码" @keyup.enter.native="search" />-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_2">投诉人企业名称：</label>-->
    <!--            <div class="search-input-box_2">-->
    <!--              <el-input v-model="searchForm.paramMap.complainerEntName" size="small" clearable type="text" class="search-input" placeholder="请输入主体名称" @keyup.enter.native="search" />-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--        </el-row>-->
    <!--        <el-row v-if="showMore" class="mb10">-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_2">投诉人自然人名称：</label>-->
    <!--            <div class="search-input-box_2">-->
    <!--              <el-input v-model="searchForm.likeParamMap.complainerName" size="small" clearable type="text" class="search-input" placeholder="请输入主体名称" @keyup.enter.native="search" />-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_2" style="width: 220px">处理决定：</label>-->
    <!--            <div class="search-input-box_3">-->
    <!--              <el-input v-model="searchForm.paramMap.handleResult" size="small" clearable type="text" class="search-input" placeholder="请输入处理决定" @keyup.enter.native="search" />-->
    <!--            </div>-->
    <!--          </el-col>-->

    <!--        </el-row>-->
    <!--        <el-row v-if="showMore" class="mb10">-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_1">处理原因：</label>-->
    <!--            <div class="search-input-box_1">-->
    <!--              <el-select-->
    <!--                v-model="searchForm.paramMap.handleRea"-->
    <!--                placeholder="请选择"-->
    <!--                clearable-->
    <!--                style="width: 100%"-->
    <!--              >-->
    <!--                <el-option-->
    <!--                  v-for="item in handleReaList"-->
    <!--                  :key="item.value"-->
    <!--                  :label="item.label"-->
    <!--                  :value="item.value"-->
    <!--                />-->
    <!--              </el-select>-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_2">作出决定机关：</label>-->
    <!--            <div class="search-input-box_2">-->
    <!--              <el-select-->
    <!--                v-model="searchForm.paramMap.judAuth"-->
    <!--                placeholder="请选择"-->
    <!--                clearable-->
    <!--                style="width: 100%"-->
    <!--              >-->
    <!--                <el-option-->
    <!--                  v-for="item in judAuthList"-->
    <!--                  :key="item.value"-->
    <!--                  :label="item.label"-->
    <!--                  :value="item.value"-->
    <!--                />-->
    <!--              </el-select>-->
    <!--            </div>-->
    <!--          </el-col>-->

    <!--        </el-row>-->
    <!--        <el-row v-if="showMore" class="mb10">-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_2">投诉日期：</label>-->
    <!--            <div class="search-input-box_2">-->
    <!--              <el-date-picker-->
    <!--                v-model="searchForm.customParamMap.createTime"-->
    <!--                style="width:100%"-->
    <!--                size="small"-->
    <!--                type="daterange"-->
    <!--                range-separator="至"-->
    <!--                start-placeholder="开始日期"-->
    <!--                end-placeholder="结束日期"-->
    <!--                value-format="yyyy-MM-dd"-->
    <!--              />-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--          <el-col :span="12">-->
    <!--            <label class="label-name_2">作出决定日期：</label>-->
    <!--            <div class="search-input-box_2">-->
    <!--              <el-date-picker-->
    <!--                v-model="searchForm.customParamMap.judDate"-->
    <!--                style="width:100%"-->
    <!--                size="small"-->
    <!--                type="daterange"-->
    <!--                range-separator="至"-->
    <!--                start-placeholder="开始日期"-->
    <!--                end-placeholder="结束日期"-->
    <!--                value-format="yyyy-MM-dd"-->
    <!--              />-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--        </el-row>-->
    <!--        <el-row>-->
    <!--          <el-col :span="12" :offset="1">-->
    <!--            <div class="btn-box">-->
    <!--              <span v-if="!showMore" style="margin-right:20px;color:#409EFF;cursor:pointer;font-size: 16px;" @click="showMoreCriteria">-->
    <!--                展开<i class="el-icon-d-arrow-right" />-->
    <!--              </span>-->
    <!--              <span v-if="showMore" style="margin-right:20px;color:#409EFF;cursor:pointer;font-size: 16px;" @click="showMoreCriteria">-->
    <!--                <i class="el-icon-d-arrow-left" />隐藏-->
    <!--              </span>-->
    <!--              <el-button type="primary" size="mini" @click="search">查询</el-button>-->
    <!--              <el-button size="mini" @click="resetSearchForm">重置</el-button>-->
    <!--            </div>-->
    <!--          </el-col>-->
    <!--        </el-row>-->
    <!--      </div>-->
    <!--    </div>-->
    <!--     <div style="margin: 0px 0px 20px 38px;"><el-button type="primary" size="mini" @click="toShowInsertForm">新增撤销业务</el-button></div>-->
    <!--    &lt;!&ndash;body-查询结果&ndash;&gt;-->
    <!--    <div class="content-body">-->
    <!--      <div class="body">-->
    <!--        <el-table-->
    <!--          ref="multipleTable"-->
    <!--          v-loading="loading"-->
    <!--          :data="tableData"-->
    <!--          tooltip-effect="dark"-->
    <!--          class="table-style"-->
    <!--          :fit="true"-->
    <!--          :row-class-name="tableRowClassName"-->
    <!--          :header-cell-style="{background:'#8cc3fb',color:'#fff'}"-->
    <!--          @sort-change="sortChange"-->
    <!--        >-->
    <!--          &lt;!&ndash; <el-table-column class="no" type="selection" width="30" /> &ndash;&gt;-->
    <!--          <el-table-column prop="index" label="序号" min-width="50" align="center" />-->
    <!--          <el-table-column prop="uniScId" label="统一社会信用代码/注册号" min-width="150" align="left" />-->
    <!--          <el-table-column prop="entName" :show-overflow-tooltip="true" label="主体名称" min-width="200" align="left" />-->
    <!--          <el-table-column prop="regItem" :show-overflow-tooltip="true" label="冒名登记事项" min-width="100" align="left" />-->
    <!--          <el-table-column prop="name" :show-overflow-tooltip="true" label="投诉人名称" min-width="100" align="left">-->
    <!--            <template slot-scope="scope">-->
    <!--              {{ scope.row.complainerEntName || scope.row.complainerName }}-->
    <!--            </template>-->
    <!--          </el-table-column>-->
    <!--          <el-table-column prop="regTime" :show-overflow-tooltip="true" sortable="custom" label="冒名登记时间" min-width="100" align="left" />-->
    <!--          <el-table-column prop="createTime" :show-overflow-tooltip="true" label="投诉时间" min-width="100" align="left" />-->
    <!--          <el-table-column prop="judDate" :show-overflow-tooltip="true" sortable="custom" label="作出决定时间" min-width="100" align="left" />-->
    <!--          <el-table-column prop="judAuthCn" :show-overflow-tooltip="true" label="作出决定机关" min-width="100" align="left" />-->
    <!--          <el-table-column label="操作" min-width="180" align="center">-->
    <!--            <template slot-scope="scope">-->
    <!--              &lt;!&ndash; <el-button type="primary" size="mini" @click="todo(scope.row)">办理</el-button> &ndash;&gt;-->
    <!--              &lt;!&ndash; <el-button type="primary" size="mini" @click="update(scope.row)">编辑</el-button> &ndash;&gt;-->
    <!--              <el-button type="primary" size="mini" @click="showResult(scope.row)">查看</el-button>-->
    <!--            </template>-->
    <!--          </el-table-column>-->
    <!--        </el-table>-->
    <!--        <div class="page-box">-->
    <!--          <el-row>-->
    <!--            <el-col :span="6">-->
    <!--              &lt;!&ndash; <el-button @click="selectAll">全选</el-button>-->
    <!--                    <el-button @click="$util.toggleSelect($refs.multipleTable)">反选</el-button> &ndash;&gt;-->
    <!--              &lt;!&ndash; <el-button type="primary" size="mini" @click="toShowInsertForm">新增</el-button> &ndash;&gt;-->
    <!--            </el-col>-->
    <!--            <el-col :span="18">-->
    <!--              <el-pagination-->
    <!--                :disabled="loading"-->
    <!--                :page-size="pageParam.pageSize"-->
    <!--                :total="pageParam.total"-->
    <!--                :page-sizes="[10, 20, 30, 40,50,100,200]"-->
    <!--                layout="slot,total, sizes, prev, pager, next, jumper"-->
    <!--                @size-change="pageSizeChange"-->
    <!--                @current-change="pageIndexChange"-->
    <!--              >-->
    <!--                <span>-->
    <!--                  第 {{ pageParam.curPage }} 页 /-->
    <!--                  共 {{ (pageParam.total !== 0 ? parseInt((pageParam.total + pageParam.pageSize - 1)/pageParam.pageSize) : 1) }} 页-->
    <!--                </span>-->
    <!--              </el-pagination>-->
    <!--            </el-col>-->
    <!--          </el-row>-->
    <!--        </div>-->
    <!--      </div>-->
    <!--    </div>-->
    <!--    <el-dialog width="80vw" :close-on-click-modal="false" :visible.sync="showInsertForm" size="mid" :title="dialogTitle">-->
    <div class="tab">
      <div class="tab-title" style="margin-top: 0;margin-bottom: 5px">
        <label style="font-size: 22px;margin-left: 7px">新增撤销业务</label>
      </div>
    </div>
    <div class="dialog_content">
      <el-form id="insertForm" ref="insertForm" :model="insertForm" :label-position="labelPosition" label-width="250px" style="width: 100%;" :rules="formRules">
        <el-row style="border: 0;">
          <el-col :span="12" style="border: 1px solid #8CC3FB;">
            <el-form-item prop="complainerType" label-width="250px" label="投诉人类型：">
              <el-select v-model="insertForm.complainerType" style="width: 100%;" @change="insertForm.complainerCertType=''">
                <el-option value="0" label="自然人" />
                <el-option value="1" label="市场主体" />
                <el-option value="2" label="政府单位(国有企业)/其他" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <!--          <div class="tab">-->
        <!--            <div class="tab-title" style="margin-top: 0;">-->
        <!--              <label>投诉人信息</label>-->
        <!--            </div>-->
        <!--          </div>-->
        <div v-if="insertForm.complainerType === '0'" style="height:141px">
          <!-- <el-col style="height:100%;background: #E9E9E9;border-right: 1px solid white " :span="1">
              <div style="padding:5px;height:100%">虚假登记投诉人信息</div>
            </el-col> -->
          <div class="tab">
            <div class="tab-title" style="margin-top: 0;">
              <label>投诉人信息</label>
            </div>
          </div>
          <el-col :span="12" style="border: 1px solid #8CC3FB;">
            <el-row>

              <el-form-item prop="complainerName" label-width="250px" label="投诉人姓名：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerName }}</span>
                <el-input v-else v-model="insertForm.complainerName" />
              </el-form-item>

            </el-row>
            <el-row class="last_row">
              <el-form-item prop="complainerCertType" label-width="250px" label="投诉人证件类型：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerCertType }}</span>
                <el-select v-else v-model="insertForm.complainerCertType" clearable class="custom">
                  <el-option
                    v-for="item in certypeList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-row>
          </el-col>
          <el-col :span="12">
            <el-row>
              <el-form-item prop="contactsPhone" label-width="249px" label="投诉人联系电话：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.contactsPhone }}</span>
                <el-input v-else v-model="insertForm.contactsPhone" type="text" />
              </el-form-item>
            </el-row>
            <el-row class="last_row">
              <el-form-item prop="complainerCertNo" label-width="249px" label="投诉人证件号码：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerCertNo }}</span>
                <el-input v-else v-model="insertForm.complainerCertNo" type="text" />
              </el-form-item>
            </el-row>
          </el-col>
        </div>
        <div v-if="insertForm.complainerType === '1'">
          <el-row>
            <el-col :span="12">
              <el-form-item class="flex-content" prop="complainerCertNo" label-width="250px" label="统一社会信用代码：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerCertNo }}</span>
                <el-input v-else v-model="insertForm.complainerCertNo" />
                <el-button v-if="dialogTitle !== '详情'" :disabled="!insertForm.complainerCertNo" type="primary" @click="queryComplainerCertNo">查询</el-button>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item class="flex-content" prop="complainerEntName" label-width="249px" label="主体名称：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerEntName }}</span>
                <el-input v-else v-model="insertForm.complainerEntName"  />
                <el-button v-if="dialogTitle !== '详情'" :disabled="!insertForm.complainerEntName" type="primary" @click="queryComplainerCertNo">查询</el-button>
              </el-form-item>
            </el-col>

          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item prop="complainerCertType" label-width="250px" label="主体类型：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerCertType }}</span>
                <el-select v-else v-model="insertForm.complainerCertType" clearable class="custom">
                  <el-option
                    v-for="item in certypeList2"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >{{ item.label }}</el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item prop="contacts" label-width="250px" label="联系人：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.contacts }}</span>
                <el-input v-else v-model="insertForm.contacts" />
              </el-form-item>
            </el-col>
<!--            <el-col :span="12">-->
<!--              <el-form-item prop="complainerName" label-width="249px" label="法定代表人：">-->
<!--                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerName }}</span>-->
<!--                <el-input v-else v-model="insertForm.complainerName" type="text" />-->
<!--              </el-form-item>-->
<!--            </el-col>-->

          </el-row>
<!--          <el-row>-->
<!--            <el-col :span="12">-->
<!--              <el-form-item prop="complainerLegalPhone" label-width="250px" label="法定代表人联系电话：">-->
<!--                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerLegalPhone }}</span>-->
<!--                <el-input v-else v-model="insertForm.complainerLegalPhone" />-->
<!--              </el-form-item>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--              <el-form-item prop="contacts" label-width="250px" label="联系人：">-->
<!--                <span v-if="dialogTitle =='详情'">{{ insertForm.contacts }}</span>-->
<!--                <el-input v-else v-model="insertForm.contacts" />-->
<!--              </el-form-item>-->
<!--            </el-col>-->
<!--          </el-row>-->
          <el-row>
            <el-col :span="12">
              <el-form-item prop="contactsPhone" label-width="250px" label="联系人电话：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.contactsPhone }}</span>
                <el-input v-else v-model="insertForm.contactsPhone" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="complainerRegOrg_cn" label-width="250px" label="登记机关：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerRegOrg_cn }}</span>
                <el-input v-else v-model="insertForm.complainerRegOrg_cn" disabled />
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <div v-if="insertForm.complainerType === '2'" style="height:95px">
          <el-col :span="12">
            <el-row>
              <el-form-item prop="complainerName" label-width="250px" label="来函单位名称：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.complainerName }}</span>
                <el-input v-else v-model="insertForm.complainerName" />
              </el-form-item>
            </el-row>
            <el-row class="last_row">
              <el-form-item prop="companyContact" label-width="250px" label="单位联系人：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.contacts }}</span>
                <el-input v-else v-model="insertForm.contacts" />
              </el-form-item>
            </el-row>
          </el-col>
          <el-col :span="12">
            <el-row>
              <el-form-item prop="contactsPhone" label-width="249px" label="单位联系电话：">
                <span v-if="dialogTitle =='详情'">{{ insertForm.contactsPhone }}</span>
                <el-input v-else v-model="insertForm.contactsPhone" type="text" />
              </el-form-item>
            </el-row>
            <el-row class="last_row">
              <el-form-item label-width="0px" />
            </el-row>
          </el-col>
        </div>

<!--        <div style="height:95px">-->
<!--          <el-row >-->
<!--            <el-col :span="12" style="border: 1px solid #8CC3FB;">-->
<!--              <el-form-item prop="businessType" label-width="250px" label="办理业务类型：">-->
<!--                <el-select v-model="insertForm.businessType" style="width: 100%;">-->
<!--                  <el-option value="1" label="撤销设立" />-->
<!--                  <el-option value="2" label="撤销变更" />-->
<!--                  <el-option value="3" label="撤销注销" />-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--        </div>-->

        <div class="tab">
          <div class="tab-title">
            <label>被投诉人信息</label>
          </div>
        </div>
        <el-row style="border: 1px solid #8CC3FB;">
          <el-col :span="12">
            <el-form-item class="flex-content" prop="entname" label="市场主体名称：">
              <span v-if="dialogTitle =='详情'">{{ insertForm.entname }}</span>
              <el-input v-else v-model="insertForm.entname" type="text" />
              <el-button v-if="dialogTitle !== '详情'" :disabled="!insertForm.entname" type="primary" @click="eBAseInfoByEntName">查询</el-button>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="regno" label="注册号：">
              <span v-if="dialogTitle =='详情'">{{ insertForm.regno }}</span>
              <el-input v-else v-model="insertForm.regno" type="text" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row style="border: 1px solid #8CC3FB;">
          <el-col :span="12">
            <el-form-item class="flex-content" prop="uniScId" label="统一社会信用代码：">
              <span v-if="dialogTitle === '详情'" class="info">{{ insertForm.uniScId }}</span>
              <el-input v-else v-model="insertForm.uniScId" type="text" />
              <el-button v-if="dialogTitle !== '详情'" :disabled="!insertForm.uniScId" type="primary" @click="eBAseInfo">查询</el-button>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="regorgCn" label="登记机关：">
              <span v-if="dialogTitle =='详情'">{{ insertForm.regorgCn }}</span>
              <el-input v-else v-model="insertForm.regorgCn" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="last_row" style="border: 1px solid #8CC3FB;">
          <el-col :span="12">
            <el-form-item prop="lerepname" label="法定代表人：">
              <span v-if="dialogTitle =='详情'">{{ insertForm.lerepname }}</span>
              <el-input v-else v-model="insertForm.lerepname" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="tel" label="联系方式：">
              <span v-if="dialogTitle =='详情'">{{ insertForm.tel }}</span>
              <el-input v-else v-model="insertForm.tel" disabled type="text" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="last_row" style="border: 1px solid #8CC3FB;">
          <el-col :span="12">
            <el-form-item label="经营异常情况：">
              <el-link type="primary" :underline="false" @click="openAbnList">详情</el-link>
            </el-form-item>
          </el-col>
        </el-row>

        <div v-if="insertForm.businessType === '2'">
          <div class="tab">
            <div class="tab-title">
              <label>变更信息</label>
            </div>
          </div>

          <el-table v-if="eAlterRecoder.length !== 0" :data="eAlterRecoder">
            <el-table-column label="序号" prop="index" min-width="30" />
            <el-table-column label="变更事项" prop="altitemCn" min-width="100" show-overflow-tooltip />
            <el-table-column label="变更前" prop="altbe" min-width="150" show-overflow-tooltip />
            <el-table-column label="变更后" prop="altaf" show-overflow-tooltip />
            <el-table-column label="变更日期" prop="altdate" show-overflow-tooltip />
          </el-table>
          <span v-if="eAlterRecoder.length === 0" class="header-label">该企业暂没有变更信息</span>
        </div>
      </el-form>
    </div>
    <div>
      <div class="dialog-box" style="margin: 10px;">
        <div>
          <el-button type="primary" size="mini" @click="insertAndStart">保存</el-button>
          <el-button size="mini" @click="toCloseInsertForm">取消</el-button>
        </div>
      </div>
    </div>
    <!--    </el-dialog>-->

    <!-- 被投诉人名称模糊查询企业主体列表dialog -->
    <el-dialog width="80vw" :close-on-click-modal="false" :visible.sync="showEntList" size="mid" title="企业主体列表">
      <div class="dialog_content">
        <el-table
          ref="multipleTable"
          v-loading="loading"
          :data="entDataList"
          tooltip-effect="dark"
          class="table-style"
          :fit="true"
          :row-class-name="tableRowClassName"
          :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
          @row-click="entDatalistClickEvent"
          @sort-change="sortChange"
        >
          <el-table-column prop="index" label="序号" min-width="30" align="center" />
          <el-table-column prop="uniscid" label="统一社会信用代码/注册号" min-width="120" align="left">
            <template slot-scope="scope">
              <!--              <router-link-->
              <!--                style="color: #409EFF"-->
              <!--                :to="{path:'/comprehensive/details',query:{ pripid: scope.row.pripid }}"-->
              <!--              >-->
              <!--                {{ scope.row.uniscid }}-->
              <!--              </router-link>-->
              {{ scope.row.uniscid }}
            </template>
          </el-table-column>
          <el-table-column prop="entname" :show-overflow-tooltip="true" label="主体名称" min-width="180" align="left" />
        </el-table>
        <div class="page-box">
          <el-row>
            <el-col :span="6" />
            <el-col :span="18">
              <el-pagination
                :disabled="loading"
                :page-size="pageParam1.pageSize"
                :total="pageParam1.total"
                :page-sizes="[10, 20, 30, 40,50,100,200]"
                layout="slot,total, sizes, prev, pager, next, jumper"
                @size-change="pageSizeChange1"
                @current-change="pageIndexChange1"
              >
                <span>
                  第 {{ pageParam1.curPage }} 页 /
                  共 {{ (pageParam1.total !== 0 ? parseInt((pageParam1.total + pageParam1.pageSize - 1)/pageParam1.pageSize) : 1) }} 页
                </span>
              </el-pagination>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-dialog>

    <el-dialog width="80vw" :close-on-click-modal="false" :visible.sync="showAbnList" size="mid" title="企业经营异常名录列表">
      <el-table v-if="tsAbnList.length !== 0" v-loading="loading" :data="tsAbnList">
        <el-table-column label="序号" prop="index" min-width="30" />
        <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
        <el-table-column label="列入原因" prop="spereasons" min-width="150" show-overflow-tooltip />
        <el-table-column label="列入日期" prop="abntime" show-overflow-tooltip />
        <el-table-column label="列入作出决定机关" prop="intoDecorg" show-overflow-tooltip />
        <el-table-column label="异常状态" prop="operatestatus" show-overflow-tooltip />
        <el-table-column label="移出日期" prop="remdate" show-overflow-tooltip />
        <el-table-column label="移出决定机关" prop="reDecorg" show-overflow-tooltip />
      </el-table>
      <span v-if="tsAbnList.length === 0" class="header-label">该企业暂没有列异信息</span>
    </el-dialog>
  </div>
</template>

<script>
import searchHeader from '@/components/searchHeader'
import {
  getConstant,
  getAllDepts,
  saveOperregdec,
  getEFalperInfo,
  tFraudEntList,
  getEntBaseInfoByCode,
  startTask,
  solrListByEntName
} from '@/api/personate'
import { checkPhoneNumber, checkIdNum, uniSCID } from '@/utils/rules'
import { listAbnormalRecord, queryEAlterByEntNo } from '@/api/comprehensive'
export default {
  components: {
    searchHeader
  },
  data() {
    return {
      uscc: '',
      dialogTitle: '新增', // 对话框标题
      insertForm: {
        complainerType: '',
        businessType: '',
        complainerCertType: '',
        personateid: '',
        uniScId: '',
        regno: '',
        searchCode: '',
        entname: '',
        certype: '',
        handlrea: '',
        judauth: '',
        regorgCn: '',
        noticefrom: '',
        noticeto: '',
        juddate: '',
        cerno: ''
      },
      resultForm: {},
      editable: false,
      showMore: false,
      workStart: {}, // 启动待办对象
      labelPosition: 'left',
      showInsertForm: false,
      showEntList: false,
      showAbnList: false,
      certypeList: [],
      certypeList2: [
        {
          value: '企业',
          label: '企业'
        },
        {
          value: '个体户',
          label: '个体户'
        },
        {
          value: '农合',
          label: '农合'
        }
      ],
      judAuthList: [],
      handleReaList: [],
      DeptsList: [],
      eAlterRecoder: [],
      tsAbnList: [], // 经营异常名录列表
      searchForm: {
        orderField: '',
        orderingRule: '',
        paramMap: {},
        likeParamMap: {},
        customParamMap: {}
      },
      loading: false,
      tableData: [],
      pageParam: {
        curPage: 1,
        total: 0,
        pageSize: 10
      },
      entDataList: [], // 根据名称查出的企业列表
      pageParam1: {
        curPage: 1,
        total: 0,
        pageSize: 10
      },
      formRules: {
        complainerType: [
          { required: true, message: '请选择投诉人类型' }
        ],
        // businessType: [
        //   { required: true, message: '请选择业务类型' }
        // ],
        complainerName: [
          { required: true, message: '请输入投诉人姓名/法定代表人/来函单位名称', trigger: 'blur' }
        ],
        complainerCertType: [
          { required: true, message: '请选择证件类型/主体类型', trigger: 'blur' }
        ],
        // contactsPhone: [
        //   { required: true, message: '请输入联系电话', trigger: 'blur' },
        //   // { validator: (rule, value, callback) => {
        //   //   checkPhoneNumber(rule, value, callback)
        //   // }, trigger: 'blur' }
        // ],
        complainerCertNo: [
          { required: true, message: '请输入证件号码/统一社会信用代码', trigger: 'blur' },
          { validator: (rule, value, callback) => {
            if (this.insertForm.complainerCertType === '1' && this.insertForm.complainerType === '0') {
              checkIdNum(rule, value, callback)
            } else if (this.insertForm.complainerType === '1') {
              uniSCID.validator(rule, value, callback)
            } else {
              callback()
            }
          }, trigger: 'blur' }
        ],
        complainerEntName: [
          { required: true, message: '请输入主体名称', trigger: 'blur' }
        ],
        // complainerLegalPhone: [
        //   { required: true, message: '请输入法定代表人联系电话', trigger: 'blur' },
        //   { validator: (rule, value, callback) => {
        //     checkPhoneNumber(rule, value, callback)
        //   }, trigger: 'blur' }
        // ],
        contacts: [
          { required: true, message: '请输入联系人', trigger: 'blur' }
        ],
        phoneNum: [
          { required: true, message: '请输入联系电话', trigger: 'blur' },
          { validator: (rule, value, callback) => {
            checkPhoneNumber(rule, value, callback)
          }, trigger: 'blur' }
        ],
        certype: [
          { required: true, message: '请选择证件类型', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '请输入姓名', trigger: 'blur' }
        ],
        uniScId: [
          { required: true, message: '请输入统一码', trigger: 'blur' }
        ]
        // regno: [
        //   { required: true, message: '请输入注册号', trigger: 'blur' }
        // ]
      }
    }
  },
  watch: {
    dialogTitle() {
      if (this.dialogTitle === '修改') {
        this.editable = true
      } else {
        this.editable = false
      }
    }
  },
  mounted() {
    this.insertForm.noticefrom = this.$util.getDate(0)
    this.insertForm.noticeto = this.$util.getDate(45)
    // 加载处理原因
    getConstant('CD96').then(res => {
      if (res.code === 0) {
        const list = []
        res.data.forEach(each => {
          list.push({
            value: each.code,
            label: each.name
          })
        })
        this.handleReaList = list
      }
    })
    // 加载证件类型
    getConstant('CB16').then(res => {
      if (res.code === 0) {
        const list = []
        res.data.forEach(each => {
          list.push({
            value: each.code,
            label: each.name
          })
        })
        this.certypeList = list
      }
    })

    // 加载决定机关
    getAllDepts().then(res => {
      if (res.code === 0) {
        const list = []
        res.data.forEach(each => {
          list.push({
            value: each.code,
            label: each.name
          })
        })
        this.judAuthList = list
      }
    })

    // this.loadPage()
  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 1) {
        return 'warning-row'
      }
    },
    showMoreCriteria() {
      this.showMore = !this.showMore
    },
    resetSearchForm() {
      this.searchForm = {
        orderField: '',
        orderingRule: '',
        paramMap: {},
        likeParamMap: {},
        customParamMap: {}
      }
    },
    openAbnList() {
      const operateStatus = {
        '0': '移出',
        '1': '列入',
        '2': '撤销',
        '3': '修改',
        '4': '标记严重失信'
      }
      this.showAbnList = true
      if (this.insertForm.pripid) {
        // 列异信息
        listAbnormalRecord(this.insertForm.pripid).then(res => {
          if (res.code === 0) {
            const data = res.data
            const list = []
            let index = 0
            data.forEach(each => {
              each.index = ++index
              each.operatestatus = operateStatus[each.operatestatus]
              list.push(each)
            })
            this.tsAbnList = list
          }
        })
      }
    },
    // 修改
    update(row) {
      this.$set(this, 'insertForm', row)
      getEFalperInfo(row.personateid).then(res => {
        if (res.code === 0) {
          this.$set(this.insertForm, 'certype', res.data.certype)
          this.$set(this.insertForm, 'cerno', res.data.cerno)
        }
      })
      this.dialogTitle = '修改'
      this.showInsertForm = !this.showInsertForm
    },
    sortChange({ column, prop, order }) {
      this.searchForm.orderField = prop
      this.searchForm.orderingRule = order === 'ascending' ? 'asc' : 'desc'
      this.search()
    },
    // 处理结果查看
    showResult(row) {
      this.$router.push({
        path: '/cancel/resultExamine',
        query: {
          bizseq: row.bizSeq,
          workflowId: row.workflowId,
          onlyShow: 'true'
        }
      })
    },
    // 仅保存
    insert() {
      this.$confirm('是否确认保存', '提示').then(() => {
        saveOperregdec(this.insertForm).then(res => {
          if (res.data === true) {
            return this.$message.success('保存成功')
          }
        })
      })
    },
    // 保存新增并创建待办
    insertAndStart() {
      this.$refs.insertForm.validate((valid, rule) => {
        if (!valid) {
          this.$message.warning(Object.values(rule)[0][0].message)
          return
        }
        let msg = ''
        this.eBAseInfo().then((status) => {
          if (status) {
            // validBeforeCreateTask(this.insertForm.pripid).then(res => {
            //   if (res.data === true) {
            //     msg = '该主体已在冒用他人身份业务流程中，是否继续开启待办'
            //   } else {
            msg = '是否确认保存并开启待办'
            //   }
            this.$confirm(msg, '提示').then(() => {
              startTask(this.insertForm).then(res => {
                if (res.code === 0) {
                  this.$message.success('保存并开启待办成功')
                  this.showInsertForm = !this.showInsertForm
                  this.$router.push({
                    path: '/cancel/cancelTodo',
                    query: {
                      tasklistid: res.data.taskId,
                      bizseq: res.data.bizSeq,
                      pripid: res.data.pripid,
                      workflowId: res.data.workflowId
                    }
                  })
                } else {
                  this.$message.error(res.msg)
                }
              })
            })
            // })
          }
        })
      })
    },
    // 根据企业名称获取主体相关信息列表
    eBAseInfoByEntName() {
      this.loadPage1()
      this.showEntList = true
    },
    // 注册号/统一码回车获取主体相关信息
    eBAseInfo() {
      this.insertForm.searchCode = this.insertForm.uniScId || this.insertForm.regno
      return getEntBaseInfoByCode({
        code: this.insertForm.searchCode
      }).then(res => {
        if (res.code === 0) {
          this.insertForm.entname = res.data.entname
          this.insertForm.regno = res.data.regno
          this.insertForm.tel = res.data.phone || res.data.tel
          this.insertForm.lerepname = res.data.name
          this.insertForm.regorgCn = res.data.regorgCn
          this.insertForm.uniScId = res.data.uniscid
          this.insertForm.pripid = res.data.pripid
          this.insertForm.regorg = res.data.regorg
          return queryEAlterByEntNo(
            this.insertForm.pripid
          ).then(resa => {
            const data = resa.data
            const list = []
            let index = 0
            data.forEach(each => {
              each.index = ++index
              list.push(each)
            })
            this.eAlterRecoder = list
            return true
          })
        } else {
          this.$message.error('加载主体信息失败')
          return false
        }
      })
    },
    queryComplainerCertNo() {
      getEntBaseInfoByCode({
        code: this.insertForm.complainerCertNo,
        entname: this.insertForm.complainerEntName
      }).then(res => {
        if (res.code === 0) {
          this.$set(this.insertForm, 'complainerEntName', res.data.entname)
          if (res.data.enttype === '9910') {
            this.$set(this.insertForm, 'complainerCertType', '个体户')
          } else if (['9100', '9200'].includes(res.data.enttype)) {
            this.$set(this.insertForm, 'complainerCertType', '农合')
          } else {
            this.$set(this.insertForm, 'complainerCertType', '企业')
          }
          this.$set(this.insertForm, 'complainerName', res.data.lerep)
          // this.$set(this.insertForm, 'complainerLegalPhone', res.data.phone)
          this.$set(this.insertForm, 'complainerRegOrg_cn', res.data.regorgCn)
          return true
        } else {
          this.$message.error('加载主体信息失败')
          return false
        }
      })
    },
    entDatalistClickEvent(row, column, event) {
      this.$confirm('请确认是否选择“' + row.entname + '”', '提示').then(_ => {
        this.insertForm.entname = row.entname
        this.insertForm.regno = row.regno
        this.insertForm.tel = row.phone || row.tel
        this.insertForm.lerepname = row.name
        this.insertForm.regorgCn = row.acceptregorgCn
        this.insertForm.uniScId = row.uniscid
        this.insertForm.pripid = row.pripid
        this.insertForm.regorg = row.regorg
        this.showEntList = false
        return queryEAlterByEntNo(
          this.insertForm.pripid
        ).then(resa => {
          const data = resa.data
          const list = []
          let index = 0
          data.forEach(each => {
            each.index = ++index
            list.push(each)
          })
          this.eAlterRecoder = list
          return true
        })
      }).catch(_ => {})
    },
    // 搜索
    search() {
      this.pageParam.paramMap = {
        paramMap: {},
        likeParamMap: {},
        customParamMap: {}
      }
      for (const key in this.searchForm) {
        if (typeof this.searchForm[key] === 'string') {
          this.pageParam.paramMap[key] = this.searchForm[key]
        } else {
          for (const _key in this.searchForm[key]) {
            if (this.searchForm[key][_key]) {
              if (!this.pageParam.paramMap[key]) {
                this.pageParam.paramMap[key] = {}
              }
              this.pageParam.paramMap[key][_key] = this.searchForm[key][_key]
            }
          }
        }
      }
      this.pageParam.curPage = 1
      this.loadPage()
    },
    // 当前分页改变
    pageIndexChange(curPage) {
      this.pageParam.curPage = curPage
      this.loadPage()
    },
    // 分页大小改变
    pageSizeChange(pageSize) {
      this.pageParam.pageSize = pageSize
      this.loadPage()
    },
    // 加载分页
    loadPage() {
      if (this.loading) return
      this.loading = true
      const data = JSON.parse(JSON.stringify({
        ...this.pageParam,
        ...this.pageParam.paramMap
      }))
      if (data.customParamMap.createTime) {
        data.customParamMap.createTime = data.customParamMap.createTime.join(',')
      }
      if (data.customParamMap.judDate) {
        data.customParamMap.judDate = data.customParamMap.judDate.join(',')
      }
      tFraudEntList(data).then(res => {
        this.loading = false
        const list = []
        let i = 1
        const pageStart = (this.pageParam.curPage - 1) * this.pageParam.pageSize
        res.data.records.forEach(each => {
          each.index = pageStart + i++
          each.uscc = each.uniScId || each.regno
          each.regno = each.regno === 'null' ? '' : each.regno
          each.tel = each.tel === 'null' ? '' : each.tel
          list.push(each)
        })
        this.tableData = list
        this.pageParam.total = res.data.total
      })
    },
    // 当前分页改变
    pageIndexChange1(curPage) {
      this.pageParam1.curPage = curPage
      this.loadPage1()
    },
    // 分页大小改变
    pageSizeChange1(pageSize) {
      this.pageParam1.pageSize = pageSize
      this.loadPage1()
    },
    // 加载分页
    loadPage1() {
      if (this.loading) return
      this.loading = true
      const data = JSON.parse(JSON.stringify({
        ...this.pageParam1,
        paramMap: {
          entName: this.insertForm.entname
        }
      }))
      solrListByEntName(data).then(res => {
        this.loading = false
        const list = []
        let i = 1
        const pageStart = (this.pageParam1.curPage - 1) * this.pageParam1.pageSize
        res.data.records.forEach(each => {
          each.index = pageStart + i++
          list.push(each)
        })
        this.entDataList = list
        this.pageParam1.total = res.data.total
      })
    },
    // 新增信息表单
    toShowInsertForm() {
      this.dialogTitle = '新增'

      const temp = {}
      for (const key in this.insertForm) {
        this.$set(temp, key, '')
        this.insertForm = temp
      }
      this.insertForm.certype = '10'
      this.showInsertForm = !this.showInsertForm
    },
    toCloseInsertForm() {
      this.showInsertForm = !this.showInsertForm
    }
  }
}
</script>
<style lang="scss" scoped>
.search-body{
  .el-col{
    display: flex;
    align-items: baseline;
  }
}
.main-content.cancelList{
  background: #fff;
  padding: 10px;
  .content-header{
    background: white;
    .label-name_1 {
      text-align: right;
      display: inline-block;//转成行内快，才可定义宽度
      width: 220px;
      font-size: $table-content-font-size;
    }
    .search-input-box_1{
      display: inline-block;
      width: calc(100% - 220px);
    }
    .label-name_2 {
      text-align: right;
      display: inline-block;//转成行内快，才可定义宽度
      width: 220px;
      font-size: $table-content-font-size;
    }
    .search-input-box_2{
      display: inline-block;
      width: calc(100% - 220px);
    }
    .label-name_3 {
      text-align: right;
      display: inline-block;//转成行内快，才可定义宽度
      width: 220px;
      font-size: $table-content-font-size;
    }
    .label-name {
      font-size: $table-content-font-size;
    }
    .search-input-box_3{
      display: inline-block;
      width: calc(100% - 220px);
    }
    .search-input{
      cursor: pointer;
    }
    .body{
      padding: 20px 0 ;
      border-top:none;
      margin-bottom: 40PX;
    }
  }
  .content-body{
    background:white;
  }
  .header{
    /* height:50px; */
    /* padding:15PX 10PX; */
    /* border:1PX solid #eee; */
    .title{
      font-weight: 600;
      font-size: 1.2rem;
    }
  }
  .page-box{
    margin:10PX;
    .el-pagination{
      text-align: right;
    }
  }
    .el-form-item{
    margin-bottom:0;
    background: $color-form-label;
    .el-form-item__label{
        padding-left: 10px;
        border-top: 1px solid $color-border;
        border-left: 1px solid $color-border;
    }
    .el-form-item__content{
        .span{
          display: inline-block;
        }
        background: white;
        padding: 10px;
        border-top: 1px solid $color-border;
        border-right: 1px solid $color-border;
        border-left: 1px solid $color-border;
    }
  }
  .dialog_content{
    max-height: 600px;
    overflow-x: auto;
    padding-left: 5px;
    padding-top: 5px;
      .el-row{
          border-top: 1px solid $color-border;
      }
    .tab{
        .tab-title{
          margin-top: 20px;
          label{
            background: $color-primary;
            display:inline-block;
            color:$color-title-color;
            padding:10px 20px 10px 5px;
          }
        }
      }
  }
  .dialog-box{
    padding-right: 20px;
    text-align: right;
  }
  .last_row{
      border-bottom: 1px solid $color-border;
  }
  .custom{
      width: 100%;
  }
  .span-content{
    display: block;
    text-indent: 1em;
  }
}
.mb10{
  margin-bottom: 10px;
}
.content-body{
  background: #fff;
  /deep/.el-table .warning-row {
    background: #eaf4fe!important;
  }
}
.flex-content{
  /deep/ .el-form-item__content{
    display: flex;
  }
}
.content-body{
  background: #fff;
  /deep/.el-table .warning-row {
    background: #eaf4fe!important;
  }
  /deep/.el-table .sort-caret.descending{
    border-top-color:#fff!important;
  }
  /deep/.el-table .sort-caret.ascending{
    border-bottom-color:#fff!important;
  }
}
</style>
<style lang="scss">
.content-body .el-table-column--selection .cell{
  padding-right: 0px;
}
.main-content.cancelList{
    .el-form-item__label{
        padding-left: 15px;
    }
    .el-form-item__content{
        // width: calc(100% - 250px);
        line-height: 35px;
        background: white;
        padding: 5px;
        // border-top: 1px solid #979696;
        border-right: 0px solid $color-border;
        border-left: 0px solid $color-border;
        min-height: 50px;
    }
    .el-input.is-disabled .el-input__inner{
      color: black;
    }
    .handle-dialog.mid>.main-dialog {
    min-height: 300PX;
    right: 0;
}
}
</style>
