<template>
  <div v-loading="loading" class="main-content market m20">
    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="基本信息" name="basicInfo">
        <div v-if="activeName === 'basicInfo'" class="tab-pane">
          <table class="apply-table" wdith="100%">
            <tr>
              <th width="40%">企业名称</th>
              <td>{{ entInfo.entname }}</td>
            </tr>
            <tr>
              <th>统一社会信用代码</th>
              <td>
                {{ entInfo.uniscid && entInfo.uniscid.length > 0 ? entInfo.uniscid : '' }}
              </td>
            </tr>
            <tr>
              <th>注册号</th>
              <td>
                {{ entInfo.regno && entInfo.regno.length > 0 ? entInfo.regno : '' }}
              </td>
            </tr>
            <tr>
              <th>登记住所</th>
              <td>
                {{ entInfo.dom }}
              </td>
            </tr>
            <tr>
              <th>法定代表人</th>
              <td>
                {{ entInfo.name }}
              </td>
            </tr>
            <tr>
              <th>出资总额</th>
              <td>
                {{ entInfo.regcap }}
              </td>
            </tr>
            <tr>
              <th>商事主体类型</th>
              <td>
                {{ entInfo.enttypeCn }}
              </td>
            </tr>
            <tr>
              <th>经营范围</th>
              <td>
                {{ entInfo.opscope }}
              </td>
            </tr>
            <!-- <tr>
            <th>实际经营项目：</th>
            <td>
              广州天河科技股份有限公司
            </td>
          </tr> -->
            <tr>
              <th>主营项目类别</th>
              <td>
                {{ entInfo.opscotype }}
              </td>
            </tr>
            <tr>
              <th>经营期限</th>
              <td>
                {{ entInfo.opfrom ? entInfo.opfrom + ' - ' + (entInfo.opto ? entInfo.opto : '长期') : '长期' }}
              </td>
            </tr>
            <tr>
              <th>成立日期</th>
              <td>
                {{ entInfo.estdate }}
              </td>
            </tr>
            <tr>
              <th>登记机关</th>
              <td>
                {{ entInfo.regorgCn }}
              </td>
            </tr>
            <tr>
              <th>监管机关</th>
              <td>
                {{ entInfo.suporgCn }}
              </td>
            </tr>
            <!-- <tr>
            <th>管理类别：</th>
            <td>
              广州天河科技股份有限公司
            </td>
          </tr> -->
            <!--            <tr>-->
            <!--              <th>联系电话</th>-->
            <!--              <td>-->
            <!--                {{ entInfo.phone }}-->
            <!--              </td>-->
            <!--            </tr>-->
            <!-- <tr>
            <th>手机号码：</th>
            <td>
              广州天河科技股份有限公司
            </td>
          </tr> -->
            <!-- <tr>
            <th>邮政编码：</th>
            <td>
              广州天河科技股份有限公司
            </td>
          </tr> -->
            <tr>
              <th>最新年度报告时间</th>
              <td>
                {{ entInfo.reportYear }}
              </td>
            </tr>
            <tr>
              <th>企业状态</th>
              <td>
                {{ entInfo.regstateCn }}
              </td>
            </tr>
            <!-- <tr>
              <th>检查间隔</th>
              <td>
                {{ entInfo.a }}
              </td>
            </tr> -->
            <tr>
              <th>核准时间</th>
              <td>
                {{ entInfo.apprdate }}
              </td>
            </tr>
            <!-- <tr>
              <th>最后检查时间</th>
              <td>
                {{ entInfo.a }}
              </td>
            </tr>
            <tr>
              <th>最后检查结果</th>
              <td>
                {{ entInfo.a }}
              </td>
            </tr> -->
          </table>
        </div>
      </el-tab-pane>
      <!-- <el-tab-pane label="信用信息" name="second" /> -->
      <el-tab-pane label="检查信息" name="third">
        <div>
          <CommonTitle label="投诉处理" />
          <div style="margin:10px 0px">
            <el-table
              v-if="sueInspectList.length > 0 "
              v-loading="loading"
              :data="sueInspectList"
              :row-class-name="tableRowClassName"
              :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
              @row-click="entLockRowClick"
            >
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="主体名称" prop="entName" min-width="100" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-link type="primary" @click="dailySupervisionEvent(scope)">{{ scope.row.entName }}</el-link>
                </template>
              </el-table-column>
              <el-table-column label="检查结果" prop="inspectResultStr" min-width="150" show-overflow-tooltip />
              <el-table-column label="检查日期" prop="inspectDate" show-overflow-tooltip />
              <el-table-column label="检查方式" prop="inspectTypeStr" show-overflow-tooltip />
              <el-table-column label="检查实施机关" prop="inspectOrgName" show-overflow-tooltip />
            </el-table>
            <span v-if="sueInspectList.length === 0" class="header-label">暂无检查记录</span>
          </div>
        </div>

        <div>
          <CommonTitle label="现场核查" />
          <div style="margin:10px 0px">
            <el-table
              v-if="usualInspectList.length > 0 "
              v-loading="loading"
              :data="usualInspectList"
              :row-class-name="tableRowClassName"
              :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
              @row-click="entLockRowClick"
            >
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="主体名称" prop="entName" min-width="100" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-link type="primary" @click="dynamicSupervisionEvent1(scope)">{{ scope.row.entName }}</el-link>
                </template>
              </el-table-column>
              <el-table-column label="检查结果" prop="inspectResultStr" min-width="150" show-overflow-tooltip />
              <el-table-column label="检查内容" prop="inspectContent" show-overflow-tooltip />
              <el-table-column label="检查日期" prop="inspectDate" show-overflow-tooltip />
              <el-table-column label="检查机关" prop="inspectOrgName" show-overflow-tooltip />
            </el-table>
            <span v-if="usualInspectList.length === 0" class="header-label">暂无检查记录</span>
          </div>
        </div>

        <!-- <el-tabs v-model="subActiveName" @tab-click="handleSubClick">
          <el-tab-pane label="投诉处理" name="first">
            <el-table
              v-if="sueInspectList.length > 0 "
              v-loading="loading"
              :data="sueInspectList"
              :row-class-name="tableRowClassName"
              :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
              @row-click="entLockRowClick"
            >
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="主体名称" prop="entName" min-width="100" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-link type="primary" @click="dailySupervisionEvent(scope)">{{ scope.row.entName }}</el-link>
                </template>
              </el-table-column>
              <el-table-column label="检查结果" prop="inspectResultStr" min-width="150" show-overflow-tooltip />
              <el-table-column label="检查日期" prop="inspectDate" show-overflow-tooltip />
              <el-table-column label="检查方式" prop="inspectTypeStr" show-overflow-tooltip />
              <el-table-column label="检查实施机关" prop="inspectOrgName" show-overflow-tooltip />
            </el-table>
            <span v-if="sueInspectList.length === 0" class="header-label">暂无检查记录</span>
          </el-tab-pane>
          <el-tab-pane label="现场核查" name="second">
            <el-table
              v-if="usualInspectList.length > 0 "
              v-loading="loading"
              :data="usualInspectList"
              :row-class-name="tableRowClassName"
              :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
              @row-click="entLockRowClick"
            >
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="主体名称" prop="entName" min-width="100" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-link type="primary" @click="dynamicSupervisionEvent1(scope)">{{ scope.row.entName }}</el-link>
                </template>
              </el-table-column>
              <el-table-column label="检查结果" prop="inspectResultStr" min-width="150" show-overflow-tooltip />
              <el-table-column label="检查内容" prop="inspectContent" show-overflow-tooltip />
              <el-table-column label="检查日期" prop="inspectDate" show-overflow-tooltip />
              <el-table-column label="检查机关" prop="inspectOrgName" show-overflow-tooltip />
            </el-table>
            <span v-if="usualInspectList.length === 0" class="header-label">暂无检查记录</span>
          </el-tab-pane>
        </el-tabs> -->
      </el-tab-pane>
      <!-- <el-tab-pane label="锁定解锁" name="lock">
        <div v-if="activeName === 'lock'" class="tab-pane">
          <el-table
            v-if="entLockList.length !== 0 && isEntLockDetails === false"
            v-loading="loading"
            :data="entLockList"
            :row-class-name="tableRowClassName"
            :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
            @row-click="entLockRowClick"
          >
            <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
            <el-table-column label="锁定原因" prop="lockreason" min-width="150" show-overflow-tooltip />
            <el-table-column label="锁定人员姓名" prop="lockusername" show-overflow-tooltip />
            <el-table-column label="锁定时间" prop="lockTime" show-overflow-tooltip />
            <el-table-column label="惩戒来源" prop="punishFrom" show-overflow-tooltip />
          </el-table>
          <table v-if="isEntLockDetails === true" class="apply-table" wdith="100%">
            <el-button type="text" style="font-size: 15px;" @click="isEntLockDetails = false">返回列表</el-button>
            <tr>
              <th width="40%">企业名称</th>
              <td>{{ entLock.entname }}</td>
            </tr>
            <tr>
              <th>注册号/统一社会信用代码</th>
              <td>
                {{ entLock.uniscid && entLock.uniscid.length > 0 ? entLock.uniscid : entLock.regno }}
              </td>
            </tr>
            <tr>
              <th>锁定原因</th>
              <td>
                {{ entLock.lockreason }}
              </td>
            </tr>
            <tr>
              <th>锁定人员姓名</th>
              <td>
                {{ entLock.lockusername }}
              </td>
            </tr>
            <tr>
              <th>惩戒来源</th>
              <td>
                {{ entLock.punishFrom }}
              </td>
            </tr>
            <tr>
              <th>锁定时间</th>
              <td>
                {{ entLock.lockTime }}
              </td>
            </tr>
            <tr>
              <th>锁定类型</th>
              <td>
                {{ entLock.locktype }}
              </td>
            </tr>
            <tr>
              <th>锁定状态</th>
              <td>
                {{ entLock.lockstate }}
              </td>
            </tr>
            <tr>
              <th>解锁时间</th>
              <td>
                {{ entLock.unlockTime }}
              </td>
            </tr>
            <tr>
              <th>锁定开始日期</th>
              <td>
                {{ entLock.lockstartdate }}
              </td>
            </tr>
            <tr>
              <th>锁定结束日期</th>
              <td>
                {{ entLock.lockenddate }}
              </td>
            </tr>
            <tr>
              <th>解锁原因</th>
              <td>
                {{ entLock.unlockreason }}
              </td>
            </tr>
            <tr>
              <th>解锁操作日期</th>
              <td>
                {{ entLock.unldate }}
              </td>
            </tr>
          </table>
          <span v-if="entLockList.length === 0" class="header-label">该企业暂没有锁定解锁信息</span>
        </div>
      </el-tab-pane> -->
      <el-tab-pane label="行政处罚" name="administrativeSanction">
        <div v-if="activeName === 'administrativeSanction'" class="tab-pane">
          <table v-if="isEOtCaseDetails === true" class="apply-table" wdith="100%">
            <el-button type="text" style="font-size: 15px;" @click="isEOtCaseDetails = false">返回列表</el-button>
            <tr>
              <th width="40%">企业名称</th>
              <td>{{ eOtCase.entname }}</td>
            </tr>
            <tr>
              <th>注册号/统一社会信用代码</th>
              <td>
                {{ eOtCase.uniscid && eOtCase.uniscid.length > 0 ? eOtCase.uniscid : eOtCase.regno }}
              </td>
            </tr>
            <tr>
              <th>处罚决定书文号</th>
              <td>
                {{ eOtCase.pendecno }}
              </td>
            </tr>
            <tr>
              <th>处罚种类</th>
              <td>
                {{ eOtCase.pentypeCn }}
              </td>
            </tr>
            <tr>
              <th>罚款金额</th>
              <td>
                {{ eOtCase.penam }}
              </td>
            </tr>
            <tr>
              <th>没收金额</th>
              <td>
                {{ eOtCase.forfam }}
              </td>
            </tr>
            <tr>
              <th>处罚内容</th>
              <td>
                {{ eOtCase.pencontent }}
              </td>
            </tr>
            <tr>
              <th>作出行政处罚决定机关名称</th>
              <td>
                {{ eOtCase.judauth }}
              </td>
            </tr>
            <tr>
              <th>移出经营异常名录原因</th>
              <td>
                {{ eOtCase.remexcpresCn }}
              </td>
            </tr>
            <tr>
              <th>作出处罚决定书日期</th>
              <td>
                {{ eOtCase.pendecissdate }}
              </td>
            </tr>
            <tr>
              <th>备注</th>
              <td>
                {{ eOtCase.remark }}
              </td>
            </tr>
            <tr>
              <th>公示日期</th>
              <td>
                {{ eOtCase.publicDate }}
              </td>
            </tr>
            <tr>
              <th>数据上报省/市</th>
              <td>
                {{ eOtCase.uploadprov }}
              </td>
            </tr>
            <tr>
              <th>数据目标省/市</th>
              <td>
                {{ eOtCase.targetprov }}
              </td>
            </tr>
            <tr>
              <th>操作标识</th>
              <td>
                {{ eOtCase.opflag }}
              </td>
            </tr>
          </table>
          <el-table v-if="eOtCaseList.length !== 0 && isEOtCaseDetails === false" v-loading="loading" :data="eOtCaseList" @row-click="eOtCaseRowClick">
            <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
            <el-table-column label="违法行为类型" prop="illegacttype" min-width="150" show-overflow-tooltip />
            <el-table-column label="处罚种类" prop="pentypeCn" show-overflow-tooltip />
            <el-table-column label="作出处罚决定书日期" prop="pendecissdate" show-overflow-tooltip />
            <el-table-column label="公示日期" prop="publicDate" show-overflow-tooltip />
          </el-table>
          <span v-if="eOtCaseList.length === 0" class="header-label">该企业暂没有行政处罚信息</span>
        </div>
      </el-tab-pane>
      <!-- <el-tab-pane label="行政许可" name="administrativeLicensing">
        <div v-if="activeName === 'administrativeLicensing'" class="tab-pane">
          <table v-if="iseOtPermitDetails === true" class="apply-table" wdith="100%">
            <el-button type="text" style="font-size: 15px;" @click="iseOtPermitDetails = false">返回列表</el-button>
            <tr>
              <th width="40%">企业名称</th>
              <td>{{ eOtPermit.entname }}</td>
            </tr>
            <tr>
              <th>注册号/统一社会信用代码</th>
              <td>
                {{ eOtPermit.uniscid && eOtPermit.uniscid.length > 0 ? eOtPermit.uniscid : eOtPermit.regno }}
              </td>
            </tr>
            <tr>
              <th>许可文件编号</th>
              <td>
                {{ eOtPermit.licno }}
              </td>
            </tr>
            <tr>
              <th>许可文件名称</th>
              <td>
                {{ eOtPermit.licnameCn }}
              </td>
            </tr>
            <tr>
              <th>有效期自</th>
              <td>
                {{ eOtPermit.valfrom }}
              </td>
            </tr>
            <tr>
              <th>有效期至</th>
              <td>
                {{ eOtPermit.valto }}
              </td>
            </tr>
            <tr>
              <th>许可机关</th>
              <td>
                {{ eOtPermit.licanth }}
              </td>
            </tr>
            <tr>
              <th>许可内容</th>
              <td>
                {{ eOtPermit.licitem }}
              </td>
            </tr>
            <tr>
              <th>状态</th>
              <td>
                {{ eOtPermit.type }}
              </td>
            </tr>
            <tr>
              <th>注销日期</th>
              <td>
                {{ eOtPermit.candate }}
              </td>
            </tr>
            <tr>
              <th>注销原因</th>
              <td>
                {{ eOtPermit.equplecanrea }}
              </td>
            </tr>
            <tr>
              <th>其它无效日期</th>
              <td>
                {{ eOtPermit.invaliddate }}
              </td>
            </tr>
            <tr>
              <th>其它无效原因</th>
              <td>
                {{ eOtPermit.invalidrea }}
              </td>
            </tr>
            <tr>
              <th>数据来源单位</th>
              <td>
                {{ eOtPermit.datadept }}
              </td>
            </tr>
            <tr>
              <th>数据上报省/市</th>
              <td>
                {{ eOtPermit.uploadprov }}
              </td>
            </tr>
            <tr>
              <th>数据目标省/市</th>
              <td>
                {{ eOtPermit.targetprov }}
              </td>
            </tr>
            <tr>
              <th>操作标识</th>
              <td>
                {{ eOtPermit.opflag }}
              </td>
            </tr>
          </table>
          <el-table v-if="eOtPermitList.length !== 0 && iseOtPermitDetails === false" v-loading="loading" :data="eOtPermitList" @row-click="eOtPermitRowClick">
            <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
            <el-table-column label="许可文件编号" prop="licno" min-width="150" show-overflow-tooltip />
            <el-table-column label="许可文件名称" prop="licnameCn" show-overflow-tooltip />
            <el-table-column label="许可机关" prop="licanth" show-overflow-tooltip />
            <el-table-column label="有效期至" prop="valto" show-overflow-tooltip />
          </el-table>
          <span v-if="eOtPermitList.length === 0" class="header-label">该企业暂没有行政许可信息</span>
        </div>
      </el-tab-pane> -->
      <el-tab-pane label="年度报告信息" name="fourth">
        <iframe v-if="activeName === 'fourth'" style="width: 100%;height: calc(100vh - 250px);" :src="iframeURL" frameborder="0" />
      </el-tab-pane>
      <el-tab-pane label="异常经营目录" name="abnormal">
        <div v-if="activeName === 'abnormal'" class="tab-pane">
          <table v-if="isAbnListDetails === true" class="apply-table" wdith="100%">
            <el-button type="text" style="font-size: 15px;" @click="isAbnListDetails = false">返回列表</el-button>
            <tr>
              <th width="40%">企业名称</th>
              <td>{{ tsAbnListDetails.entname }}</td>
            </tr>
            <tr>
              <th>注册号/统一社会信用代码</th>
              <td>
                {{ tsAbnListDetails.uniscid && tsAbnListDetails.uniscid.length > 0 ? tsAbnListDetails.uniscid : tsAbnListDetails.regno }}
              </td>
            </tr>
            <tr>
              <th>列入经营异常名录原因</th>
              <td>
                {{ tsAbnListDetails.spereasons }}
              </td>
            </tr>
            <tr>
              <th>列入日期</th>
              <td>
                {{ tsAbnListDetails.abntime }}
              </td>
            </tr>
            <tr>
              <th>列入主办人</th>
              <td>
                {{ tsAbnListDetails.intoSponsor }}
              </td>
            </tr>
            <tr>
              <th>列入决定机关</th>
              <td>
                {{ tsAbnListDetails.intoDecorg }}
              </td>
            </tr>
            <tr>
              <th>列入文书号</th>
              <td>
                {{ tsAbnListDetails.intowritno }}
              </td>
            </tr>
            <tr>
              <th>列入备注</th>
              <td>
                {{ tsAbnListDetails.intoRemark }}
              </td>
            </tr>
            <!-- <tr>
              <th>列出日期</th>
              <td>
                {{ tsAbnListDetails.endabntime }}
              </td>
            </tr> -->
            <tr>
              <th>移出经营异常名录原因</th>
              <td>
                {{ tsAbnListDetails.remexcpresCn }}
              </td>
            </tr>
            <tr>
              <th>移出日期</th>
              <td>
                {{ tsAbnListDetails.remdate }}
              </td>
            </tr>
            <tr>
              <th>移出作出决定机关</th>
              <td>
                {{ tsAbnListDetails.reDecorg }}
              </td>
            </tr>
            <tr>
              <th>移出文书号</th>
              <td>
                {{ tsAbnListDetails.remwritidno }}
              </td>
            </tr>
            <!-- <tr>
              <th>地区代码</th>
              <td>
                {{ tsAbnListDetails.areaCode }}
              </td>
            </tr> -->
            <tr>
              <th>异常状态</th>
              <td>
                {{ tsAbnListDetails.operatestatus }}
              </td>
            </tr>
            <!-- <tr>
              <th>行政复议机关</th>
              <td>
                {{ tsAbnListDetails.ReconsiderationOrg }}
              </td>
            </tr>
            <tr>
              <th>人民政府</th>
              <td>
                {{ tsAbnListDetails.GovernmentOrg }}
              </td>
            </tr>
            <tr>
              <th>诉讼机关</th>
              <td>
                {{ tsAbnListDetails.LitiOrg }}
              </td>
            </tr> -->
            <tr>
              <th>移出主办人</th>
              <td>
                {{ tsAbnListDetails.remSponsor }}
              </td>
            </tr>
            <tr>
              <th>移出备注</th>
              <td>
                {{ tsAbnListDetails.remRemark }}
              </td>
            </tr>
          </table>
          <el-table v-if="tsAbnList.length !== 0 && isAbnListDetails === false" v-loading="loading" :data="tsAbnList" :cell-style="cellStyle" @row-click="abnListRowClick">
            <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>
        </div>
      </el-tab-pane>
      <el-tab-pane label="严重违法失信" name="bizSerIllegalRem">
        <div v-if="activeName === 'bizSerIllegalRem'" class="tab-pane">
          <table v-if="istsSerIllegalDetail === true" class="apply-table" wdith="100%">
            <el-button type="text" style="font-size: 15px;" @click="istsSerIllegalDetail = false">返回列表</el-button>
            <tr>
              <th width="40%">企业名称</th>
              <td>{{ tsSerIllegal.entname }}</td>
            </tr>
            <tr>
              <th>注册号/统一社会信用代码</th>
              <td>
                {{ tsSerIllegal.uniscid && tsSerIllegal.uniscid.length > 0 ? tsSerIllegal.uniscid : tsSerIllegal.regno }}
              </td>
            </tr>
            <tr>
              <th>列入严重违法企业名单原因</th>
              <td>
                {{ tsSerIllegal.serillreaString }}
              </td>
            </tr>
            <tr>
              <th>列入事实和法律依据</th>
              <td>
                {{ tsSerIllegal.lostcreditexplain }}
              </td>
            </tr>
            <tr>
              <th>列入日期</th>
              <td>
                {{ tsSerIllegal.abntime }}
              </td>
            </tr>
            <tr>
              <th>列入主办人</th>
              <td>
                {{ tsSerIllegal.intoSponsorIllegal }}
              </td>
            </tr>
            <tr>
              <th>列入决定机关</th>
              <td>
                {{ tsSerIllegal.decorgCn }}
              </td>
            </tr>
            <tr>
              <th>列入文书号</th>
              <td>
                {{ tsSerIllegal.intowritno }}
              </td>
            </tr>
            <tr>
              <th>移出严重违法企业名单原因</th>
              <td>
                {{ tsSerIllegal.remexcpresString }}
              </td>
            </tr>
            <tr>
              <th>移出事实和法律依据</th>
              <td>
                {{ tsSerIllegal.lostcreditexplainrem }}
              </td>
            </tr>
            <tr>
              <th>移出日期</th>
              <td>
                {{ tsSerIllegal.remdate }}
              </td>
            </tr>
            <tr>
              <th>移出主办人</th>
              <td>
                {{ tsSerIllegal.remSponsorIllegal }}
              </td>
            </tr>
            <tr>
              <th>移出决定机关</th>
              <td>
                {{ tsSerIllegal.remdecorgCn }}
              </td>
            </tr>
            <tr>
              <th>移出文书号</th>
              <td>
                {{ tsSerIllegal.remwritidno }}
              </td>
            </tr>
          <!-- <tr>
            <th>许可机关</th>
            <td>
              {{ tsSerIllegal.licanth }}
            </td>
          </tr> -->

          <!-- <tr>
            <th>行政复议机关</th>
            <td>
              {{ tsSerIllegal.reconsiderationOrg }}
            </td>
          </tr>
          <tr>
            <th>人民政府</th>
            <td>
              {{ tsSerIllegal.governmentOrg }}
            </td>
          </tr>
          <tr>
            <th>诉讼机关</th>
            <td>
              {{ tsSerIllegal.litiOrg }}
            </td>
          </tr> -->

          </table>
          <el-table v-if="tsSerIllegalList.length !== 0 && istsSerIllegalDetail === false" v-loading="loading" :cell-style="cellStyle" :data="tsSerIllegalList" @row-click="tsSerIllegalRowClick">
            <el-table-column label="序号" type="index" width="60" />
            <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
            <el-table-column label="列入严重违法企业名单原因" prop="lostcreditexplain" min-width="150" show-overflow-tooltip />
            <el-table-column label="列入日期" prop="abntime" show-overflow-tooltip />
            <el-table-column label="列入决定机关" prop="decorgCn" show-overflow-tooltip />
            <el-table-column label="异常状态" prop="operationStatus" show-overflow-tooltip />
            <el-table-column label="移出日期" prop="remdate" show-overflow-tooltip />
            <el-table-column label="移出决定机关" prop="remdecorgCn" show-overflow-tooltip />
          <!-- <el-table-column label="受理号" prop="acceptno" show-overflow-tooltip /> -->
          </el-table>
          <span v-if="tsSerIllegalList.length === 0" class="header-label">该企业暂没有严重违法信息</span>
        </div>
      </el-tab-pane>
      <el-tab-pane label="批量吊销" name="revoke">
        <el-table
          v-if="revokeList.length > 0 "
          v-loading="loading"
          :data="revokeList"
          :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
          @row-click="entLockRowClick"
        >
          <el-table-column label="序号" type="index" width="60" />
          <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
          <el-table-column label="吊销依据" prop="revokeReaCn" min-width="150" show-overflow-tooltip />
          <el-table-column label="吊销日期" prop="revokedate" show-overflow-tooltip />
          <el-table-column label="经办人" prop="intosponsorname" show-overflow-tooltip />
          <el-table-column label="状态" prop="statusCn" show-overflow-tooltip />
          <!-- <el-table-column label="受理号" prop="acceptno" show-overflow-tooltip /> -->
        </el-table>
        <span v-if="revokeList.length === 0" class="header-label">该企业暂没有批量吊销信息</span>
      </el-tab-pane>
      <el-tab-pane label="片区认领记录" name="assign">
        <el-table v-if="assignLogList.length !== 0 " v-loading="loading" :data="assignLogList">
          <el-table-column label="序号" type="index" width="60" />
          <el-table-column label="操作类型" prop="assignType" min-width="100" show-overflow-tooltip />
          <el-table-column label="片区名称" prop="sliceName" min-width="150" show-overflow-tooltip />
          <el-table-column label="操作时间" prop="operateTime" show-overflow-tooltip />
          <el-table-column label="操作人" prop="operator" show-overflow-tooltip />
          <!-- <el-table-column label="受理号" prop="acceptno" show-overflow-tooltip /> -->
        </el-table>
        <span v-if="assignLogList.length === 0" class="header-label">该企业暂没有片区认领记录</span>
      </el-tab-pane>
      <el-tab-pane label="变更信息" name="alterInfo">
        <el-table v-if="eAlterRecoder.length !== 0 " v-loading="loading" :data="eAlterRecoder">
          <el-table-column label="序号" type="index" width="60" />
          <el-table-column label="主体名称" prop="entname" min-width="100" show-overflow-tooltip />
          <el-table-column label="变更事项" prop="altitemCn" show-overflow-tooltip />
          <el-table-column label="变更前内容" prop="altbe" 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>
      </el-tab-pane>
      <el-tab-pane v-if="showTab1" label="联系方式" name="contactInfoa">
        <div style="display: flex; align-items: center; margin-bottom: 10px;">
          <el-button style="margin-left: 0px" size="mini" type="primary" @click="showPone">查看号码</el-button>
          <span style="color: red; margin-left: 10px; font-size: 25px;">注意：点击按钮查看联系电话</span>
        </div>
        <el-table v-if="contactList.length !== 0 " v-loading="loading" :data="contactList">
          <el-table-column label="序号" type="index" width="60" />
          <el-table-column label="职务" prop="position" min-width="100" show-overflow-tooltip />
          <el-table-column label="姓名" prop="name" show-overflow-tooltip />
          <el-table-column label="固定电话" show-overflow-tooltip />
          <el-table-column label="移动电话" show-overflow-tooltip />
          <el-table-column label="联系电话" show-overflow-tooltip />
        </el-table>
        <span v-if="contactList.length === 0" class="header-label">该企业暂没有联系方式信息</span>
      </el-tab-pane>
      <el-tab-pane v-if="showTab2" label="联系方式" name="contactInfo">
        <el-table v-if="contactList.length !== 0 " v-loading="loading" :data="contactList">
          <el-table-column label="序号" type="index" width="60" />
          <el-table-column label="职务" prop="position" min-width="100" show-overflow-tooltip />
          <el-table-column label="姓名" prop="name" show-overflow-tooltip />
          <el-table-column label="固定电话" prop="landline" show-overflow-tooltip />
          <el-table-column label="移动电话" prop="mobile" show-overflow-tooltip />
          <el-table-column label="联系电话" prop="contactNumber" show-overflow-tooltip />
        </el-table>
        <span v-if="contactList.length === 0" class="header-label">该企业暂没有联系方式信息</span>
      </el-tab-pane>
    </el-tabs>

    <el-dialog
      :visible.sync="inputDialog.visible"
      title="检查情况"
      width="80vw"
      :append-to-body="true"
      :modal-append-to-body="true"
    >
      <EasyForm
        ref="inputDialog"
        v-model="inputDialog.formData"
        v-loading="inputDialog.loading"
        :fields="dynamicSupervisionFields"
        :form-config="inputDialog.config"
        :buttons="inputDialog.buttons"
      >
        <div slot="actualScope" slot-scope="scope" style="display: flex;">
          <el-input v-model="scope.formData.actualScope" disabled style="margin-right: 10px" />
          <el-button type="primary">选择</el-button>
        </div>
        <div slot="opinion" slot-scope="scope">
          <el-input
            v-model="scope.formData.opinion"
            type="textarea"
            :rows="2"
          />
        </div>
      </EasyForm>
    </el-dialog>

    <el-dialog
      :visible.sync="dailySupervisionInputDialog.visible"
      title="检查情况"
      width="80vw"
      :append-to-body="true"
      :modal-append-to-body="true"
    >
      <EasyForm
        ref="inputDialog"
        v-model="dailySupervisionInputDialog.formData"
        v-loading="dailySupervisionInputDialog.loading"
        :fields="dailySupervisionFields"
        :form-config="dailySupervisionInputDialog.config"
        :buttons="dailySupervisionInputDialog.buttons"
      />
    </el-dialog>

    <div style="text-align: right;margin: 20px;">
      <el-button type="primary" @click="close">返回</el-button>
    </div>
    <el-main class="main content" />
  </div>
</template>
<script>
import { getEntBaseByPripid } from '@/api/entBase'
import { queryEntLockDetails, listAbnormalRecord, queryEOtCaseDetails, queryEAlterByPripid, queryContactByEntNo, addContactLogByEntNo } from '@/api/comprehensive'
import { getPunishFromList } from '@/api/punishment'
import { revokeListPage } from '@/api/revoke'
import { getSueInspectList, getUsualInspectList, tSUsualInspectListFile, queryFileByHistory } from '@/api/market'
import { getAssignLogList } from '@/api/marketAssign'
import EasyForm from '@/components/EasyForm'
import dynamicSupervisionBase from '@/views/market/dynamicsupervision/index'
import dailySupervisionBase from '@/views/market/dailysupervision/index'
import { oauth } from '@/api/user'

export default {
  components: {
    EasyForm
  },
  mixins: [dynamicSupervisionBase, dailySupervisionBase],
  data() {
    return {
      isRead1: false,
      isRead2: false,
      isRead3: false,
      isRead4: false,
      isRead5: false,
      isRead6: false,
      isRead7: false,
      showTab2: false,
      showTab1: true,
      activeName: 'basicInfo',
      subActiveName: '',
      pripid: '',
      entInfo: {},
      entLock: {},
      entLockList: [],
      isEntLockDetails: false,
      tsAbnList: [],
      tsAbnListDetails: {},
      isAbnListDetails: false,
      eOtCaseList: [],
      eOtCase: {},
      isEOtCaseDetails: false,
      eOtPermit: {},
      eOtPermitList: [],
      iseOtPermitDetails: false,
      tsSerIllegal: {},
      tsSerIllegalList: [],
      istsSerIllegalDetail: false,
      operatestatusList: [{
        value: '0',
        label: '移出'
      }, {
        value: '1',
        label: '列入'
      }, {
        value: '2',
        label: '撤销'
      }, {
        value: '3',
        label: '修改'
      }, {
        value: '4',
        label: '标记严重失信'
      }],
      loading: false,
      revokeList: [],
      sueInspectList: [],
      usualInspectList: [],
      assignLogList: [],
      eAlterRecoder: [],
      contactList: [],
      inputDialog: {
        config: {
          readOnly: true
        }
      },
      dailySupervisionInputDialog: {
        config: {
          readOnly: true
        }
      },
      fromPath: '',
      iframeURL: ''
    }
  },
  mounted() {
    this.punishFromList = getPunishFromList()
    this.pripid = this.$route.query.pripid
    // 基本信息
    const p1 = getEntBaseByPripid(this.pripid).then(res => {
      if (res.code === 0) {
        this.entInfo = res.data
        if (this.entInfo.regcap) parseFloat(this.entInfo.regcap)
      }
    })
    // 惩戒信息
    // const p2 = queryEntLockDetails(this.pripid).then(res => {
    //   if (res.code === 0) {
    //     this.entLockList = res.data
    //     this.entLockList.forEach(each => {
    //       each.punishFrom = this.punishFromFormat(each.punishFrom)
    //     })
    //     // this.entLock.punishFrom = this.punishFromFormat(this.entLock.punishFrom)
    //   }
    // })
    // // 列异信息
    // const p3 = listAbnormalRecord(this.pripid).then(res => {
    //   if (res.code === 0) {
    //     const data = res.data
    //     const list = []
    //     let index = 0
    //     data.forEach(each => {
    //       each.index = ++index
    //       each.operatestatus = this.operatestatusFormat(each.operatestatus)
    //       list.push(each)
    //     })
    //     this.tsAbnList = list
    //   }
    // })
    // const p4 = queryEOtCaseDetails(this.pripid).then(res => {
    //   if (res.code === 0) {
    //     const data = res.data.tsSerIllegalList
    //     this.eOtCaseList = res.data.eOtCase
    //     this.eOtPermitList = res.data.eOtPermit
    //     const list = []
    //     data.forEach(each => {
    //       each.operationStatus = this.illeaglStatusFormat(each.operationStatus)
    //       list.push(each)
    //     })
    //     this.tsSerIllegalList = list
    //     // if (this.eOtPermit.candate !== null) {
    //     //   this.eOtPermit.candate = this.$util.formatDate.format(new Date(Date.parse(this.eOtPermit.candate)), 'yyyy-MM-dd')
    //     // }
    //   }
    // })
    // const p5 = this.getRevokeListPage()

    // // 认领记录查询
    // const p6 = getAssignLogList(this.pripid).then(res => {
    //   if (res.code === 0) {
    //     this.assignLogList = res.data
    //   }
    // })
    // 投诉处理
    // const p7 = this.getSueInspectList()

    // 现场核查
    // const p8 = this.getUsualInspectList()
    this.loading = true
    Promise.all([p1]).finally(() => { //, p2, p3, p4, p5, p6, p7, p8
      this.loading = false
    })
  },
  methods: {
    dynamicSupervisionEvent1(scope) {
      this.inputDialog.visible = true
      this.inputDialog.loading = true
      if (scope.row.id) {
        tSUsualInspectListFile({ id: scope.row.bizSeq }).then((res) => {
          const { code, data } = res
          if (code !== 0) {
            throw res
          }
          this.currentId = scope.row.id
          this.inputDialog.formData = scope.row
          this.$set(this.inputDialog.formData, 'files', data.filter((file) => {
            return file.attachtype === '2'
          }).map((item) => {
            return {
              ...item,
              name: item.filename
            }
          }))
          this.$set(this.inputDialog.formData, 'files0', data.filter((file) => {
            return file.attachtype === '1'
          }).map((item) => {
            return {
              ...item,
              name: item.filename
            }
          }))
          this.$nextTick(() => {
            if (this.$refs.inputDialog) {
              this.$refs.inputDialog.clearValidate()
            }
          })
        }).finally(() => {
          this.inputDialog.loading = false
        })
      } else {
        queryFileByHistory({ bizseq: scope.row.bizSeq }).then(res => {
          const { code, data } = res
          if (code !== 0) {
            throw res
          }
          this.inputDialog.formData = scope.row
          this.$set(this.inputDialog.formData, 'files', data.map((item) => {
            return {
              ...item,
              name: item.filename
            }
          }))
          this.$nextTick(() => {
            if (this.$refs.inputDialog) {
              this.$refs.inputDialog.clearValidate()
            }
          })
        }).finally(() => {
          this.inputDialog.loading = false
        })
      }
    },
    cellStyle({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 1) {
        // 指定列号
        return 'color:#8CC3FB'
      } else {
        return ''
      }
    },
    getUsualInspectList() {
      getUsualInspectList(this.pripid).then(res => {
        if (res.code === 0) {
          this.usualInspectList = res.data
        }
      })
    },
    getSueInspectList() {
      getSueInspectList(this.pripid).then(res => {
        if (res.code === 0) {
          this.sueInspectList = res.data
        }
      })
    },
    getRevokeListPage() {
      const param = {
        customParamMap: { pripid: this.pripid },
        curPage: 1,
        total: 0,
        pageSize: -1
      }
      revokeListPage(param).then(res => {
        if (res.code === 0 && res.data.records.length > 0) {
          const data = res.data.records
          const list = []
          data.forEach(each => {
            each.statusCn = this.revokeStatusFormat(each.state)
            list.push(each)
          })
          this.revokeList = list
        }
      })
    },

    close() {
      if (this.$route.query.shrink) {
        window.opener = null
        window.open('', '_self', '')
        window.close()
      } else {
        this.$router.back()
      }
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 1) {
        return 'warning-row'
      }
    },
    handleClick(tab, event) {
      console.log(this.activeName)
      this.loading = true
      if (this.activeName === 'fourth') {
        oauth().then((res) => {
          const { data } = res
          const path = `/annualReportService/unifiedMGT/annualReportProgress/baseInfo/detail?pripid=${this.$route.query.pripid}&yearReportMode=1`
          this.iframeURL = `${process.env.VUE_APP_AICEPS_SERVICE_URL || ''}/aiceps-service-web/#/oauthLogin?redirectUri=${encodeURIComponent(path)}&isIframe=1&encryptedData=${data}`
        })
      } else if ((this.activeName === 'administrativeSanction' || this.activeName === 'bizSerIllegalRem') &&
        !this.isRead1) {
        const p4 = queryEOtCaseDetails(this.pripid).then(res => {
          if (res.code === 0) {
            const data = res.data.tsSerIllegalList
            this.eOtCaseList = res.data.eOtCase
            this.eOtPermitList = res.data.eOtPermit
            const list = []
            data.forEach(each => {
              each.operationStatus = this.illeaglStatusFormat(each.operationStatus)
              list.push(each)
            })
            this.tsSerIllegalList = list
          // if (this.eOtPermit.candate !== null) {
          //   this.eOtPermit.candate = this.$util.formatDate.format(new Date(Date.parse(this.eOtPermit.candate)), 'yyyy-MM-dd')
          // }
          }
        })
        this.isRead1 = true
        this.loading = false
      } else if (this.activeName === 'abnormal' && !this.isRead2) {
        // 列异信息
        const p3 = listAbnormalRecord(this.pripid).then(res => {
          if (res.code === 0) {
            const data = res.data
            const list = []
            let index = 0
            data.forEach(each => {
              each.index = ++index
              each.operatestatus = this.operatestatusFormat(each.operatestatus)
              list.push(each)
            })
            this.tsAbnList = list
          }
        })
        this.isRead2 = true
        this.loading = false
      } else if (this.activeName === 'revoke' && !this.isRead3) {
        const p5 = this.getRevokeListPage()
        this.isRead3 = true
        this.loading = false
      } else if (this.activeName === 'assign' && !this.isRead4) {
        const p6 = getAssignLogList(this.pripid).then(res => {
          if (res.code === 0) {
            this.assignLogList = res.data
          }
        })
        this.isRead4 = true
        this.loading = false
      } else if (this.activeName === 'third' && !this.isRead5) {
        // 投诉处理
        const p7 = this.getSueInspectList()

        // 现场核查
        const p8 = this.getUsualInspectList()
        this.subActiveName = 'first'
        this.isRead5 = true
        this.loading = false
      } else if (this.activeName === 'basicInfo') {
        this.loading = false
      } else if (this.activeName === 'alterInfo' && !this.isRead6) {
        this.loading = true
        queryEAlterByPripid(this.pripid).then(res => {
          if (res.code === 0) {
            const list = []
            let index = 0
            res.data.forEach(each => {
              each.index = ++index
              each.entname = this.entInfo.entname
              list.push(each)
            })
            this.eAlterRecoder = list
          }
        })
        this.isRead6 = true
        this.loading = false
      } else if (this.activeName === 'contactInfo' && !this.isRead7) {
        this.loading = true
        queryContactByEntNo(this.pripid).then(res => {
          if (res.code === 0) {
            const list = []
            let index = 0
            res.data.forEach(each => {
              each.index = ++index
              list.push(each)
            })
            this.contactList = list
          }
        })
        this.isRead7 = true
        this.loading = false
      } else if (this.activeName === 'contactInfoa' && !this.isRead7) {
        this.loading = true
        queryContactByEntNo(this.pripid).then(res => {
          if (res.code === 0) {
            const list = []
            let index = 0
            res.data.forEach(each => {
              each.index = ++index
              list.push(each)
            })
            this.contactList = list
          }
        })
        this.isRead7 = true
        this.loading = false
      }
      // console.log(this.activeName + '===')
      this.loading = false
    },
    handleSubClick(tab, event) {

    },
    // 惩戒来源格式化
    punishFromFormat(punishFrom) {
      let name = ''
      this.punishFromList.forEach(each => {
        if (each.value === punishFrom) {
          name = each.label
        }
      })
      return name
    },
    // operatestatusList 异常状态格式化
    operatestatusFormat(operatestatus) {
      let name = ''
      this.operatestatusList.forEach(each => {
        if (each.value === operatestatus) {
          name = each.label
        }
      })
      return name
    },
    // 严重违法名单状态格式化
    illeaglStatusFormat(code) {
      let name = ''
      switch (code) {
        case '0':
          name = '列入'
          break
        case '1':
        case '2':
          name = '移出'
          break
        case '3':
          name = '异议移出'
          break
      }
      return name
    },
    // 严重违法名单状态格式化
    revokeStatusFormat(code) {
      let name = ''
      switch (code) {
        case '1':
          name = '吊销'
          break
        case '2':
          name = '撤销'
          break
        case '3':
          name = '复议'
          break
        case '4':
          name = '诉讼'
          break
      }
      return name
    },
    abnListRowClick(row, column, event) {
      this.tsAbnListDetails = row
      this.isAbnListDetails = true
    },
    eOtCaseRowClick(row, column, event) {
      this.eOtCase = row
      this.isEOtCaseDetails = true
    },
    eOtPermitRowClick(row, column, event) {
      this.eOtPermit = row
      this.iseOtPermitDetails = true
    },
    tsSerIllegalRowClick(row, column, event) {
      this.tsSerIllegal = row
      this.istsSerIllegalDetail = true
    },
    entLockRowClick(row, column, event) {
      this.entLock = row
      this.isEntLockDetails = true
    },
    showPone() {
      this.showTab1 = false
      this.showTab2 = true
      this.activeName = 'contactInfo'
      addContactLogByEntNo(this.pripid).then(res => {
        if (res.code === 0) {
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
  .main-content{
    padding: 0!important;
  }
  .header-label{
    font-size: 20PX;
    font-family: Microsoft YaHei, Microsoft YaHei-Bold;
    font-weight: bold;
    color: #243668;
    line-height: 32px;
  }
  .apply-table{
    width: 100%;
    border-collapse: collapse;
    padding:15px;
    font-size:18px;
    table{
      border-top: 1px solid $color-border;
      border-left: 1px solid $color-border;
    }
    tr{
      width:100%
    }
    th,td{
      border-top: 1px solid $color-border;
      border-left: 1px solid $color-border;
      border-right: 1px solid $color-border;
      border-bottom: 1px solid $color-border;
      padding:15px
    }
    th{
      color: #5e5e5e;
      font-weight: normal;
      background: $color-form-label
    }
    td{
    }
  }
</style>
