<template>
  <div class="app-container enterprise_contatiner">
    <div class="title_wrap">
      <div class="enterprise_title">
        查城投平台
      </div>
    </div>
    <div class="content">
      <div class="content_item">
        <div class="content_right item_ckquery_list">
          <el-input class="ename_input" placeholder="请输入企业名称关键字" clearable v-model="keys">
            <div slot="append" class="btn-search" @click="search()">搜索</div>
          </el-input>

        </div>
      </div>

      <div class="content_item">
        <div class="label">企业地区</div>
        <div class="content_right item_ckquery_list">
          <div class="select-popper">
            <span :class="{color_text:jskBidQueryDto.provinceIds.length ||jskBidQueryDto.cityIds.length ||jskBidQueryDto.areaIds.length,}">
              注册地区{{jskBidQueryDto.provinceIds.length ||jskBidQueryDto.cityIds.length ||jskBidQueryDto.areaIds.length? jskBidQueryDto.provinceIds.length + jskBidQueryDto.cityIds.length +jskBidQueryDto.areaIds.length +"项": ""}}
              <i class="el-icon-caret-bottom"></i>
            </span>
            <el-cascader ref="address" class="cascader-region" v-model="addressType" :options="addressList" :props="props" @change="domicileChange"
              collapse-tags clearable></el-cascader>
          </div>
          <div class="checkbox">
            <div class="checkbox-titel">行政等级</div>
            <div class="checkbox-content">
              <div class="checkbox-content-qx">
                <el-checkbox v-model="checkuipExecutive" @change="checkuipExecutivebtn">全部</el-checkbox>
              </div>
              <el-checkbox-group v-model="uipExecutiveText" @change="uipExecutiveLevelbtn">
                <el-checkbox v-for="item in uipExecutiveLevel" :label="item" :key="item">{{item}}</el-checkbox>
              </el-checkbox-group>
            </div>
          </div>

        </div>
      </div>
      <div class="content_item">
        <div class="label">城投业务类型</div>
        <div class="content_right ">
          <div class="checkbox">
            <div class="checkbox-content">
              <div class="checkbox-content-qx">
                <el-checkbox v-model="checkuipBusiness" @change="checkuipBusinessbtn">全部</el-checkbox>
              </div>
              <el-checkbox-group v-model="uipBusinessText" @change="uipBusinessTypebtn">
                <el-checkbox v-for="item in uipBusinessType" :label="item" :key="item">{{item}}</el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
        </div>
      </div>
      <div class="content_item">
        <div class="label">主体评级</div>
        <div class="content_right ">
          <div class="checkbox">
            <div class="checkbox-content">
              <div class="checkbox-content-qx">
                <el-checkbox v-model="checkbratingSubject" @change="checkbratingSubjectbtn">全部</el-checkbox>
              </div>
              <el-checkbox-group v-model="bratingSubjectText" @change="bratingSubjectLevelbtn">
                <el-checkbox v-for="item in bratingSubjectLevel" :label="item" :key="item">{{item}}</el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
        </div>
      </div>
      <div class="content_item content_item1">
        <div class="label">股东背景</div>
        <div class="content_right ">
          <div class="checkbox">
            <div class="checkbox-content">
              <!-- <el-checkbox-group v-model="shareholderText" @change="shareholderBgbtn"> -->
              <el-checkbox v-model="checkshareholder" @change="checkshareholderbtn">全部</el-checkbox>

              <el-checkbox @change="shareholderBgbtn" v-for="(item,index) in shareholderBg" v-model="item.checked"
                :key="index">{{item.value}}</el-checkbox>
            </div>
          </div>
        </div>
      </div>
      <div class="content_item" style="padding:0;">
        <div class="label">股权关系</div>
        <div class="content_right ">
          <div class="checkbox">
            <div class="checkbox-content">
              <div class="checkbox-content-qx">
                <el-checkbox v-model="checkequityRelationship" @change="checkequityRelationshipbtn">全部</el-checkbox>
              </div>
              <el-checkbox-group v-model="equityRelationshipText" @change="equityRelationshipbtn">
                <el-checkbox v-for="item in equityRelationship" :label="item" :key="item">{{item}}</el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
        </div>
      </div>
      <div class="content_item">
      </div>
    </div>
    <div class="bottomlist">
      <div class="bottomlist-title">
        <div class="bottomlist-title-left">
          <p class="title-left">
            <span style="margin-right:4;color:rgba(35, 35, 35, 0.40);font-size: 18px;position: relative;top:2px;">·</span>共有{{total}}条
          </p>
          <el-popover v-model="fieldshow" placement="bottom-start" trigger="click" popper-class="viewlist-el-popover">
            <ul class="pup_list">
              <li v-for="(itme,i) in fieldOptions" :class="itme.status?'active':''" @click="handsequencingList(i)" :key="i">
                {{itme.value}}
              </li>
            </ul>
            <span slot="reference" class="toolbar-right-download">
              {{fieldText}}<i class="el-icon-arrow-down" :style="{transform:fieldshow?'rotate(180deg)':''}"></i>
            </span>
          </el-popover>
        </div>

        <div class="title-right">
          <p>
            <img src="@/assets/images/EXCEL.png" alt="">
            <span class="excel" @click="clickDialog">导出EXCEL</span>
          </p>
        </div>

      </div>
      <div class="table-item-jf table-item-jf1" v-if="tableData.length==0&& !isSkeleton">
        <img class="item-jf-img" src="@/assets/images/kong.png" alt="">
        <div class="item-jf-titel">抱歉，没找到相关数据！</div>
        <div class="item-jf-text">建议调整关键词或筛选条件，重新搜索！</div>
      </div>
      <skeleton style="margin-left:16px;" v-if="isSkeleton"></skeleton>

      <div class=" table-item-jf table-item " v-if="!isSkeleton&&tableData.length>0">
        <el-table :data="tableData" :header-cell-style="{ background:'#f0f3fa',color: 'rgba(35,35,35,0.8)'}" v-horizontal-scroll="'hover'"
          class="table-item1 fixed-table" border highlight-current-row>
          <el-table-column type="index" label="序号" fixed width="60">
            <template slot-scope="scope">
              <span>{{(pageNum - 1) *pageSize + scope.$index + 1}}</span>
            </template>
          </el-table-column>
          <el-table-column label="公司名称" fixed width="380">
            <template slot-scope="scope">
              <div class="renling">
                <router-link :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" class="list-titel-a"
                  v-html="scope.row.companyName"></router-link>
                <!--<div class="renling-btn" @click="claimbtn(scope.row)">-->
                  <!--<p v-if="scope.row.claimStatus==0" class="renling-img-true">-->

                  <!--</p>-->
                  <!--<p v-else class="renling-img-false">-->

                  <!--</p>-->
                  <!--&lt;!&ndash;<span v-if="scope.row.claimStatus==0" @click="cancelClaim(scope.row.companyName,scope.$index)" class="renling-hui">&ndash;&gt;-->
                    <!--&lt;!&ndash;已认领&ndash;&gt;-->
                  <!--&lt;!&ndash;</span>&ndash;&gt;-->
                  <!--&lt;!&ndash;<span v-else class="renling-hei">&ndash;&gt;-->
                    <!--&lt;!&ndash;认领&ndash;&gt;-->
                  <!--&lt;!&ndash;</span>&ndash;&gt;-->
                <!--</div>-->
              </div>

            </template>

          </el-table-column>
          <el-table-column label="区域" width="160">
            <template slot-scope="scope">
              {{scope.row.province}}
              <template v-if="scope.row.city">
                -
              </template>
              {{scope.row.city}}
              <template v-if="scope.row.area">
                -
              </template>
              {{scope.row.area}}
            </template>

          </el-table-column>
          <el-table-column label="招标数量" width="73">
            <template slot-scope="scope">
              {{scope.row.biddingCount||"--"}}
            </template>

          </el-table-column>
          <el-table-column label="城投拿地" width="73">
            <template slot-scope="scope">
              {{scope.row.landInfoCount||"--"}}
            </template>
          </el-table-column>

          <el-table-column label="供应商" width="73">
            <template slot-scope="scope">
              {{scope.row.supplierCount||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="主体评级" width="73">
            <template slot-scope="scope">
              {{scope.row.bratingSubjectLevel||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="债券余额（亿元）" width="124">
            <template slot-scope="scope">
              {{scope.row.bondBalance||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="行政级别" width="73">
            <template slot-scope="scope">
              {{scope.row.uipExecutiveLevel||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="股东背景" width="84">
            <template slot-scope="scope">
              {{scope.row.shareholderBg||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="股权关系" width="84">
            <template slot-scope="scope">
              {{scope.row.equityRelationship||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="平台重要性" width="85">
            <template slot-scope="scope">
              {{scope.row.platformImportance||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="城投业务类型" width="97">
            <template slot-scope="scope">
              {{scope.row.uipBusinessType||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="实控人" width="290">
            <template slot-scope="scope">
              <!-- <router-link v-if="scope.row.actualController"  :to="'/radar/bxprozbgg/details/'+ 1" tag="a" class="list-titel-a"  >
												  {{scope.row.actualController}}
										  </router-link> -->
              <template>
                {{scope.row.actualController||"--"}}
              </template>
            </template>
          </el-table-column>
          <el-table-column label="最新报告期" width="92">
            <template slot-scope="scope">
              {{scope.row.latestReportPeriod||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="总资产（亿元）" width="112">
            <template slot-scope="scope">
              {{scope.row.totalAssets||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="归母净资产（亿元）" width="133">
            <template slot-scope="scope">
              {{scope.row.belongNetAssets||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="货币资金（亿元）" width="121">
            <template slot-scope="scope">
              {{scope.row.monetaryFunds||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="土地资产（亿元）" width="121">
            <template slot-scope="scope">
              {{scope.row.landAssets||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="受限资产（亿元）" width="121">
            <template slot-scope="scope">
              {{scope.row.restrictedAssets||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="应收账款（亿元）" width="121">
            <template slot-scope="scope">
              {{scope.row.accountsReceivable||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="其他应收款（亿元）" width="133">
            <template slot-scope="scope">
              {{scope.row.otherReceivable||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="公益性&准公益性主营占比（%）" width="200">
            <template slot-scope="scope">
              {{scope.row.econData_001||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="政府补助（亿元）" width="121">
            <template slot-scope="scope">
              {{scope.row.govSubsidy||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="专项应付款（亿元）" width="133">
            <template slot-scope="scope">
              {{scope.row.specialPayable||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="营业收入（亿元）" width="121">
            <template slot-scope="scope">
              {{scope.row.operatingIncome||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="归母净利润（亿元）" width="133">
            <template slot-scope="scope">
              {{scope.row.belongNetProfit||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="净资产收益率（%）" width="136">
            <template slot-scope="scope">
              {{scope.row.roe||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="经营现金流量净额（亿元）" width="169">
            <template slot-scope="scope">
              {{scope.row.netOperatingCashFlow||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="筹资现金流量净额（亿元）" width="169">
            <template slot-scope="scope">
              {{scope.row.netFinancingCashFlow||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="投资现金流量净额（亿元）" width="169">
            <template slot-scope="scope">
              {{scope.row.netInvestmentCashFlow||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="总负债 （亿元）" width="113">
            <template slot-scope="scope">
              {{scope.row.totalLiabilities||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="有息债务 （亿元）" width="125">
            <template slot-scope="scope">
              {{scope.row.uipInterestBearingDebt||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="有息债务/总负债（%）" width="147">
            <template slot-scope="scope">
              {{scope.row.econData_002||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="综合融资成本（%）" width="132">
            <template slot-scope="scope">
              {{scope.row.ofcb||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="现金比率（%）" width="108">
            <template slot-scope="scope">
              {{scope.row.cashRatio||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="现金流量比率（%）" width="132">
            <template slot-scope="scope">
              {{scope.row.cashFlowRatio||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="现金到期债务比（%）" width="144">
            <template slot-scope="scope">
              {{scope.row.cashDebtRatio||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="授信余额（亿元）" width="125">
            <template slot-scope="scope">
              {{scope.row.creditBalance||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="授信余额/全部债务（%）" width="159">
            <template slot-scope="scope">
              {{scope.row.econData_003||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="EBITDA保障倍数" width="117">
            <template slot-scope="scope">
              {{scope.row.ebitdaIcr||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="私募债余额占比（%）" width="144">
            <template slot-scope="scope">
              {{scope.row.ppnBalanceProp||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="一年内到期债权占比（%）" width="168">
            <template slot-scope="scope">
              {{scope.row.econData_004||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="债券余额/有息债务（%）" width="159">
            <template slot-scope="scope">
              {{scope.row.econData_005||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="借款余额（亿元）" width="124">
            <template slot-scope="scope">
              {{scope.row.loan||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="借款/有息债务（%）" width="135">
            <template slot-scope="scope">
              {{scope.row.econData_006||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="非标余额（亿元）" width="124">
            <template slot-scope="scope">
              {{scope.row.nonStandardBalance||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="非标余额/有息债务（%）" width="159">
            <template slot-scope="scope">
              {{scope.row.nonStandardRatio||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="对外担保金额（亿元）" width="145">
            <template slot-scope="scope">
              {{scope.row.guaranteeAmount||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="对外担保比例（%）" width="132">
            <template slot-scope="scope">
              {{scope.row.guaranteeRatio||"--"}}
            </template>
          </el-table-column>
          <el-table-column label="所属开发区" width="85">
            <template slot-scope="scope">
              {{scope.row.developmentZone||"--"}}
            </template>
          </el-table-column>

        </el-table>
      </div>
      <div class="pagination clearfix" v-show="total>0">
        <el-pagination background :page-size="pageSize" :current-page="pageNum" @current-change="handleCurrentChange" layout="prev, pager, next"
          :total="total">
        </el-pagination>
      </div>

    </div>
    <el-dialog title="" :visible.sync="dialogVisible" :modal="false" custom-class='dialog-renlin' :show-close="false" width="244px">
      <span>认领成功，是否完善客户信息？</span>
      <div slot="footer" class="dialog-footer">
        <span class="dialog-footer-btn1" type="primary" @click="claimopen(companyId,customerId)">
          立即完善
        </span>
        <span class="dialog-footer-btn2" @click="search(pageNum, pageSize)">稍后</span>
      </div>
    </el-dialog>
    <el-dialog title="取消认领" :visible.sync="dialogVisible1" :modal="false" custom-class='dialog-renlin' :show-close="false" width="344px">
      <span>是否取消认领客户？客户信息将放入“历史客户”。</span>
      <div slot="footer" class="dialog-footer">
        <span class="dialog-footer-btn1" type="primary" @click="confirm()">
          确认
        </span>
        <span class="dialog-footer-btn2" @click="dialogVisible1 = false">关闭</span>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisible2" custom-class='dialog-renlin' title="重新认领" width="260px" :show-close="false">
      <div>再次认领将会恢复客户数据</div>
      <div slot="footer" class="dialog-footer">
        <span class="dialog-footer-btn1" type="primary" @click="handleHistoryClaim()">确认</span>
        <span class="dialog-footer-btn2" @click="dialogVisible2 = false">关闭</span>
      </div>
    </el-dialog>

    <ExportDialog :data="exportData" v-if="exportData.dialogExportVisible" @clickEXCEL="clickEXCEL"></ExportDialog>
  </div>
</template>

  <script>
import { encodeStr } from "@/assets/js/common.js";
import jsk_data from '../../../../../public/jsk.json';
import skeleton from '@/views/project/projectList/component/skeleton';
import api from '@/api/enterpriseData/enterpriseData.js';
import ExportDialog from "../../../component/export-dialog"
import "@/assets/styles/public.scss";
export default {
  name: 'Owner',
  components: { skeleton,ExportDialog },
  data() {
    return {
      encodeStr,
      isSkeleton: true,
      keys: '',
      addressList: [],
      addressType: [],
      props: {
        multiple: true,
        expandTrigger: "hover",
        value: "id",
      },
      dialogVisible2: false,
      jskBidQueryDto: {
        provinceIds: [],
        cityIds: [],
        areaIds: []
      },
      domicile: [],
      // 行政等级
      uipExecutiveLevel: [],
      uipExecutiveText: [],
      checkuipExecutive: true,
      // 城投业务类型
      uipBusinessType: [],
      uipBusinessText: [],
      checkuipBusiness: true,
      // 主体信用等级
      bratingSubjectLevel: [],
      bratingSubjectText: [],
      checkbratingSubject: true,
      // 股东背景
      shareholderBg: [],
      shareholderText: [],
      checkshareholder: true,
      // 股权关系
      equityRelationship: [],
      equityRelationshipText: [],
      checkequityRelationship: true,

      pageFlag: true,
      conditionsArr: [],

      fieldshow: false,
      fieldText: '默认排序',
      sort: '3', //查询结果排序方式
      fieldOptions: [
        {
          key: "3",
          value: "默认排序",
          status: true,
        },
        {
          key: "5",
          value: "招标数量从多到少",
          status: false,
        },
        {
          key: "7",
          value: "土地数量从多到少",
          status: false,
        },
      ],
      companyId: '',
      companyName: '',
      cancelIndex: '',
      customerId: '',
      dialogVisible: false,
      dialogVisible1: false,
      tableData: [],
      total: 0,
      pageNum: 1,
      pageSize: 50,
      dataEXCEL:{},
      exportData:{
        title:'查城投平台',
        dialogExportVisible:false,
        forData: [
          {label: '公司名称', prop: 'companyName',slot: true,minWidth: '140'},
          {label: '区域', prop: 'province', slot: true,minWidth: '160'},
          {label: '招标数量', prop: 'biddingCount',slot: true,minWidth: '80'},
          {label: '城投拿地', prop: 'landInfoCount', slot: true,minWidth: '80'},
          {label: '供应商', prop: 'supplierCount',slot: true,minWidth: '100'},
          {label: '债券余额（亿元）', prop: 'bondBalance',minWidth: '130'},
          {label: '主体评级', prop: 'bratingSubjectLevel',minWidth: '80'},
          {label: '行政级别', prop: 'uipExecutiveLevel',minWidth: '80'},
          {label: '股东背景', prop: 'shareholderBg', slot: true,minWidth: '100'},
          {label: '股权关系', prop: 'equityRelationship', slot: true,minWidth: '100'},
          {label: '平台重要性', prop: 'platformImportance', slot: true,minWidth: '130'},
          {label: '城投业务类型', prop: 'uipBusinessType', slot: true,minWidth: '130'},
          {label: '实控人', prop: 'actualController', slot: true,minWidth: '140'},
          {label: '最新报告期', prop: 'latestReportPeriod', slot: true,minWidth: '120'},
          {label: '总资产（亿元）', prop: 'totalAssets', slot: true,minWidth: '120'},
          {label: '归母净资产（亿元）', prop: 'belongNetAssets', slot: true,minWidth: '140'},
        ],
        exportTableData:[
          {
            companyName:'xxx有限公司',
            province:'重庆-重庆市-永川区',
            biddingCount:'64',
            landInfoCount:'4',
            supplierCount:'456',
            bondBalance:'73',
            bratingSubjectLevel:'AAA',
            uipExecutiveLevel:'区县级',
            shareholderBg:'城建',
            equityRelationship:'直接控股',
            platformImportance:'主要平台',
            uipBusinessType:'综合性平台',
            actualController:'xxx监督管理委员会',
            latestReportPeriod:'2022-12-21',
            totalAssets:'55.47',
            belongNetAssets:'21.74',
          },
          {
            companyName:'xxx有限公司',
            province:'北京-北京市-大兴区',
            biddingCount:'25',
            landInfoCount:'2',
            supplierCount:'465',
            bondBalance:'61',
            bratingSubjectLevel:'AAA',
            uipExecutiveLevel:'区县级',
            shareholderBg:'政府',
            equityRelationship:'间接控股',
            platformImportance:'一般平台',
            uipBusinessType:'土地开发整理',
            actualController:'xxx监督管理委员会',
            latestReportPeriod:'2022-12-21',
            totalAssets:'764.74',
            belongNetAssets:'62.13',
          },
        ],
        exportEXCEL:{}
      },
    };
  },
  computed: {
    checkJskBidQueryDto() {
      let arr = [];
      let flag = false;
      let data = {};
      if (this.domicile.length > 0) {
        data = {
          title: "行政区划:",
          keyid: "domicile",
          value: this.domicile.join(","),
          key: "domicile"
        };
        flag = true;
        arr.push(data);
      }
      this.conditionsArr = arr;
      return flag;
    },
  },
  created() {
    api.uipGroupData().then(res => {
      if (res.code == 200) {
        // 行政等级
        this.uipExecutiveLevel = res.data.uipExecutiveLevel,
          // 城投业务类型
          this.uipBusinessType = res.data.uipBusinessType,
          // 主体信用等级
          this.bratingSubjectLevel = res.data.bratingSubjectLevel,
          // 股东背景
          this.shareholderBg = res.data.shareholderBg,
          // 股权关系
          this.equityRelationship = res.data.equityRelationship;
        if (this.shareholderBg.length > 0) {
          let arr = [];
          this.shareholderBg.map(item => {
            arr.push({
              value: item,
              checked: false
            });
          });
          this.shareholderBg = arr;
        }
      }
    }).catch(error => {

    });
  },
  mounted() {
    this.init();
  },
  methods: {
    domicileChange() {
      let arr = this.$refs.address.getCheckedNodes();
      let provinceIds = [],
        cityIds = [],
        areaIds = [];
      this.domicile = [];
      for (var i in arr) {
        if (arr[i].parent) {
          if (!arr[i].parent.checked) {
            arr[i].hasChildren && cityIds.push(arr[i].value);
            arr[i].hasChildren && this.domicile.push(arr[i].label);
            !arr[i].hasChildren && areaIds.push(arr[i].value);
            !arr[i].hasChildren && this.domicile.push(arr[i].label);
          }
        } else {
          provinceIds.push(arr[i].value);
          this.domicile.push(arr[i].label);
        }
      }
      var obj = JSON.parse(JSON.stringify(this.jskBidQueryDto));
      obj.provinceIds = provinceIds;
      obj.cityIds = cityIds;
      obj.areaIds = areaIds;
      this.jskBidQueryDto = obj;
      this.search();
    },
    addressListfn() {
      var str = [];
      for (let x = 0; x < 3; x++) {
        for (let i = 0; i < jsk_data.length; i++) {
          if (jsk_data[i].regionLevel == x + 1 && x + 1 == 1) {
            str.push({
              id: jsk_data[i].id,
              label: jsk_data[i].regionName,
              short: jsk_data[i].short,
              value: jsk_data[i].parentId,
              children: jsk_data[i].id == 900000 ? undefined : [],
            });
          } else if (jsk_data[i].regionLevel == x + 1 && x + 1 == 2 && str) {
            for (let j = 0; j < str.length; j++) {
              if (str[j].id == jsk_data[i].parentId) {
                str[j].children.push({
                  id: jsk_data[i].id,
                  label: jsk_data[i].regionName,
                  short: jsk_data[i].short,
                  value: jsk_data[i].parentId,
                  children: [],
                });
              }
            }
          } else if (jsk_data[i].regionLevel == x + 1 && x + 1 == 3) {
            for (let j = 0; j < str.length; j++) {
              if (str[j].children) {
                for (let k = 0; k < str[j].children.length; k++) {
                  if (str[j].children[k].id == jsk_data[i].parentId) {
                    str[j].children[k].children.push({
                      id: jsk_data[i].id,
                      label: jsk_data[i].regionName,
                      short: jsk_data[i].short,
                      value: jsk_data[i].parentId,
                    });
                  }
                }
              }
            }
          }
        }
      }
      this.addressList = str;
    },
    reset() {
      Object.assign(this.$data, this.$options.data.call(this)); //重置data
      this.init();
    },
    init() {
      this.search();
      this.addressListfn();
    },
    checkuipExecutivebtn(val) {
      this.uipExecutiveText = [];
      this.checkuipExecutive = true;
      this.search();

    },
    uipExecutiveLevelbtn(val) {
      if (val.length > 0) {
        this.checkuipExecutive = false;
      } else if (val.length == 0) {
        this.checkuipExecutive = true;
      }
      this.search();

    },
    checkuipBusinessbtn(val) {
      this.uipBusinessText = [];
      this.checkuipBusiness = true;
      this.search();
    },
    uipBusinessTypebtn(val) {
      if (val.length > 0) {
        this.checkuipBusiness = false;
      } else if (val.length == 0) {
        this.checkuipBusiness = true;
      }
      this.search();
    },
    checkbratingSubjectbtn(val) {
      this.bratingSubjectText = [];
      this.search();
      this.checkbratingSubject = true;
    },
    bratingSubjectLevelbtn(val) {
      if (val.length > 0) {
        this.checkbratingSubject = false;
      } else if (val.length == 0) {
        this.checkbratingSubject = true;
      }
      this.search();
    },
    checkshareholderbtn(val) {
      this.shareholderText = [];
      for (var i in this.shareholderBg) {
        this.shareholderBg[i].checked = false;
      }
      this.checkshareholder = true;
      this.search();
    },
    shareholderBgbtn(val) {
      let flag = false;
      this.shareholderText = [];
      for (var i in this.shareholderBg) {
        if (this.shareholderBg[i].checked) {
          if (this.shareholderText.indexOf(this.shareholderBg[i].value) == -1) {
            this.shareholderText.push(this.shareholderBg[i].value);
          }
          flag = true;
        }
      }
      if (flag) {
        this.checkshareholder = false;
      } else {
        this.checkshareholder = true;
      }
      this.search();
    },
    checkequityRelationshipbtn(val) {
      this.equityRelationshipText = [];
      this.checkequityRelationship = true;
      this.search();
    },
    equityRelationshipbtn(val) {
      if (val.length > 0) {
        this.checkequityRelationship = false;
      } else if (val.length == 0) {
        this.checkequityRelationship = true;
      }
      this.search();
    },
    handsequencingList(index) {
      this.fieldshow = false;
      this.sort = this.fieldOptions[index].key;
      for (let i = 0; i < this.fieldOptions.length; i++) {
        this.fieldOptions[i].status = false;
      }
      this.fieldText = this.fieldOptions[index].value;
      this.fieldOptions[index].status = true;
      this.search();
    },
    handleCurrentChange(pageNum) {
      this.pageNum = pageNum;
      this.search(pageNum, this.pageSize);
    },
    handleSizeChange(pageSize) {
      this.pageSize = pageSize;
      this.search(this.pageNum, pageSize);
    },
    reloadPage() {
      this.pageFlag = false;
      this.$nextTick(() => {
        this.pageFlag = true;
      });
    },
    async handleHistoryClaim() {
      let res = await api.historyClaim(this.companyName);
      if (res.code == 200) {
        this.dialogVisible2 = false;
        this.search();
      } else {
        this.$message.error(res.msg);
      }
    },
    claimbtn(item) {
      if (item.claimStatus == 1) {
        return this.dialogVisible2 = true;
      }
      this.companyId = item.companyId;
      var info = {};
      api.infoHeader({ companyId: this.companyId }).then(res => {
        // console.log(res)
        info = res.data;
        let params = {
          companyId: item.companyId,
          uipId: item.uipId,
          companyName: item.companyName.replace(/<font color='red'>/g, '').replace(/<\/font>/g, ''),
          creditLevel: info.bratingSubjectLevel,
          legalPerson: info.corporatePerson,
          registerCapital: info.registeredCapital,
          provinceId: info.provinceId,
          cityId: info.cityId,
          districtId: info.districtCode,
          registerAddress: info.provinceName + '-' + info.cityName + '-' + info.districtName,
          creditCode: info.creditCode,
        };
        api.claim(params).then(res1 => {
          if (res1.code == 200) {
            this.dialogVisible = true;
            this.customerId = res1.data.customerId;
          }
        }).catch(error => {

        });
      }).catch(error => {

      });

    },
    cancelClaim(companyName, index) {
      this.dialogVisible1 = true;
      this.companyName = companyName;
      this.cancelIndex = index;
    },
    confirm() {
      api.cancelClaim(this.companyName).then(res => {
        if (res.code == 200) {
          this.dialogVisible1 = false;
          this.tableData[this.cancelIndex].claimStatus = 1;
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    claimopen(companyId, customerId) {
      this.$router.push({
        path: '/enterprise/' + encodeStr(companyId),
        query: {
          'customerId': customerId,
          'path': 'business'
        },
      });
      this.dialogVisible = false;
      this.search();

    },
    search(pageNum, pageSize, exportFlag) {
      this.dialogVisible = false;
      if (!pageNum) {
        this.pageNum = 1;
      }
      if (!pageSize) {
        this.pageSize = 50;
      }
      if (!pageNum && !pageSize) {
        this.reloadPage();
      }
      let params = {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        sort: this.sort,
      };
      var data = JSON.parse(JSON.stringify(this.jskBidQueryDto));
      if (this.keys) {
        params['keys'] = this.keys.split(' ');
      } else {
        delete params.keys;
      }

      if (data.provinceIds.length > 0) {
        params['provinceIds'] = data.provinceIds;
      } else {
        delete params.provinceIds;
      }
      if (data.cityIds.length > 0) {
        params['cityIds'] = data.cityIds;
      } else {
        delete params.cityIds;
      }
      if (data.areaIds.length > 0) {
        params['areaIds'] = data.areaIds;
      } else {
        delete params.areaIds;
      }
      if (this.uipExecutiveText.length > 0) {
        params['uipExecutiveLevel'] = this.uipExecutiveText;
      } else {
        delete params.uipExecutiveLevel;
      }
      if (this.uipBusinessText.length > 0) {
        params['uipBusinessType'] = this.uipBusinessText;
      } else {
        delete params.uipBusinessType;
      }
      if (this.bratingSubjectText.length > 0) {
        params['bratingSubjectLevel'] = this.bratingSubjectText;
      } else {
        delete params.bratingSubjectLevel;
      }
      if (this.shareholderText.length > 0) {
        params['shareholderBg'] = this.shareholderText;
      } else {
        delete params.shareholderBg;
      }
      if (this.equityRelationshipText.length > 0) {
        params['equityRelationship'] = this.equityRelationshipText;
      } else {
        delete params.equityRelationship;
      }
      this.isSkeleton = true;
      this.dataEXCEL=JSON.parse(JSON.stringify(params));
      api.uipSerach(params).then(res => {
        this.isSkeleton = false;
        this.tableData = res.rows;
        this.total = res.total;
      }).catch(error => {
      });

    },
    renlin() {
      this.dialogVisible = false;
      // this.$router.push({path:'/home',query: {id:'1'}})
      // 跳转地址
    },
    clickDialog(){
      this.exportData.dialogExportVisible=true;
    },
    clickEXCEL(value,title) {
      if(this.tableData.length === 0){
        this.$message.error('当前信息列表数据为空，请重新筛选数据');
        return
      }
      if(value > 2000){
        return
      }
      this.dataEXCEL.exportExeclName=title;
      if(value){
        this.dataEXCEL.pageSize=value
      }else {
        this.dataEXCEL.pageSize=2000;
      }
      api.uipSerachExport(this.dataEXCEL).then(res => {
        if(res.code === 200){
          this.exportData.exportEXCEL=true;
        }else {
          this.$message.error(res.msg);
        }
      })
    },
    cancel(){
      this.exportData.dialogExportVisible=false;
      this.exportData.exportEXCEL={}
    },


  },
};
  </script>
  <style lang="scss" scoped>
::v-deep .dialog-renlin {
  margin-top: 40vh !important;
  .el-dialog__body {
    padding: 0;
    text-align: center;
    padding-bottom: 24px;
  }
  .el-dialog__footer {
    padding: 0px;
    padding-bottom: 24px;
    .dialog-footer {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      .dialog-footer-btn1 {
        cursor: pointer;
        width: 72px;
        height: 28px;
        background: #0081ff;
        border-radius: 2px 2px 2px 2px;
        font-size: 12px;
        font-weight: 400;
        color: #ffffff;
        line-height: 28px;
        text-align: center;
        margin-right: 8px;
        &:hover {
          background: #006ad1;
        }
      }
      .dialog-footer-btn2 {
        cursor: pointer;
        width: 72px;
        height: 28px;
        border-radius: 2px 2px 2px 2px;
        border: 1px solid #cccccc;
        line-height: 28px;
        text-align: center;
        font-size: 12px;
        font-weight: 400;
        color: rgba(35, 35, 35, 0.8);
        &:hover {
          background: #f3f4f5;
        }
      }
    }
  }
}
.content {
  padding: 0px 16px;
  border-radius: 4px 4px 4px 4px;
  background: #ffffff;
  .content_item {
    padding-top: 20px;
    display: -webkit-box;
    align-items: flex-start;
    .label {
      width: 84px;
      font-size: 14px;
      font-weight: 400;
      color: rgba(35, 35, 35, 0.8);
      margin-right: 28px;
    }
    .content_right {
      width: calc(100% - 112px);
      .ename_input {
        width: 640px;
        margin-right: 20px;
      }
      .land_ipt_470 {
        width: 640px;
      }
    }
    .item_ckquery_list {
      display: flex;
      align-items: center;
      .qualifications-tab {
        margin-right: 4px;
        border: 1px solid #e0e0e0;
        padding: 2px 3px;
        border-radius: 2px;
        height: 34px;
        margin-top: 1px;
        span {
          background: #fff;
          display: inline-block;
          cursor: pointer;
          float: left;
          border-radius: 2px;
          padding: 3px 8px;
          margin-top: 0.5px;
        }
        .action {
          color: #ffffff;
          background: #0081ff;
        }
      }
      .ckquery_list_right {
        width: 670px;
      }
    }

    .item_ckquery_list .el-input__icon {
      position: relative;
      top: 1px;
    }
    .ckquery_list_right {
      width: 640px;
    }
    .register_count_ipt {
      margin-left: 0px;
    }
    .register_count_ipt .el-input__inner {
      width: 174px;
    }
    ::v-deep .el-input-group__prepend {
      padding: 0 8px;
    }
    .content-projecttype {
      display: flex;
      align-items: center;
      justify-content: center;
      .projecttype {
        font-weight: 400;
        color: #232323;
        padding: 1px 5px;
        margin-right: 4px;
        cursor: pointer;
        border-radius: 3px 3px 3px 3px;
        font-size: 14px;
      }
      .projecttype:first-child {
        padding-left: 0px;
      }
      .projecttype:hover {
        background: #f3f4f5;
        padding: 1px 5px;
      }
      .activetype {
        background: #f3f4f5;
        padding: 1px 5px !important;
      }
    }
  }
  .content_item1 {
    .checkbox-content {
      display: block;
      .el-checkbox {
        margin-bottom: 20px;
      }
    }
  }

  .content_item_padding0 {
    padding: 0;
  }
}
.bottomlist {
  width: 100%;
  background-color: #ffffff;

  border-radius: 4px 4px 4px 4px;
  .bottomlist-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 16px;

    .title-right {
      display: flex;
      align-items: center;
      p:last-child {
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: 400;
        color: rgba(35, 35, 35, 0.8);
      }
      img {
        width: 18px;
        height: 18px;
      }
      .excel {
        cursor: pointer;
      }
    }
  }
  .bottomlist-title-left {
    display: inline-flex;
    align-items: center;
    .title-left {
      height: 16px;
      line-height: 16px;
      font-size: 12px;
      font-weight: 400;
      color: #3d3d3d;
    }
  }
  .bottomlist-content {
    padding-bottom: 0px;
  }

  .table-item-jf {
    padding: 0px 16px;
    .list-titel-a {
      color: #0081ff;
    }
    ::v-deep .el-table--border .el-table__cell:first-child .cell {
      padding: 0px 8px;
      padding-left: 12px;
      font-size: 12px;
      font-weight: 400;
    }
    ::v-deep .el-table th.el-table__cell > .cell {
      padding: 0px 8px;
      padding-left: 12px;
      font-size: 12px;
      font-weight: 400;
    }
    ::v-deep .el-table th.el-table__cell.is-leaf,
    ::v-deep .el-table td.el-table__cell {
      border-bottom: 1px solid #e6eaf1;
    }
    ::v-deep .el-table--border .el-table__cell {
      border-right: 1px solid #e6eaf1;
    }
    ::v-deep.el-table__fixed::before {
      height: 0;
    }
    .renling {
      display: flex;
      align-items: center;
      .list-titel-a {
        width: 264px;
        margin-right: 12px;
      }
      .renling-btn {
        display: flex;
        align-items: center;
        cursor: pointer;
        opacity: 0;
        transition: opacity 0.3s;
        .renling-img-true {
          width: 16px;
          height: 16px;
          margin-right: 8px;
          background-image: url("../../../../assets/images/owner/renling1.png");
          background-size: 100% 100%;
          background-repeat: no-repeat;
        }
        .renling-img-false {
          width: 16px;
          height: 16px;
          margin-right: 8px;
          background-image: url("../../../../assets/images/owner/renling2.png");
          background-size: 100% 100%;
          background-repeat: no-repeat;
        }

        .renling-hui {
          font-size: 13px;
          font-weight: 400;
          color: rgba(35, 35, 35, 0.4);
        }
        .renling-hei {
          font-size: 13px;
          font-weight: 400;
          color: #3d3d3d;
        }
      }

      .renling-btn:hover {
        .renling-hei {
          color: #0081ff;
        }
      }
    }

    .el-table {
      th,
      td {
        .cell {
          font-size: 12px;
        }
      }

      .hover-row {
        .cell {
          .renling-btn {
            opacity: 1;
          }
        }
      }
    }
  }
  .table-item1 {
    ::v-deep .el-table__body-wrapper {
      color: #232323;
    }
  }
  .fixed-table {
    overflow: initial;

    ::v-deep .el-table__header-wrapper {
      position: sticky;
      top: 56px;
      z-index: 9;
    }
    ::v-deep .el-table__fixed-header-wrapper {
      position: sticky;
      z-index: 9;
      top: 56px;
    }
    ::v-deep .el-table__fixed {
      overflow-x: clip;
      overflow-y: clip;
    }
  }
  .table-item-jf1 {
    border-top: 1px solid #efefef;
  }
  .pagination {
    padding: 14px;
    .el-pagination {
      float: right;
    }
  }
}
</style>
