<template>
  <div class="realAuthentication">
    <template v-if="!isShowInfo">
      <div class="head-title">
        企业认证
      </div>
      <div class="content">
        <div>
          <span style="margin-left: 10px">公司名称</span>
          <div class="searchInput" style="width:250px">
            <el-input @keyup.enter.native="msg.pageIndex = 1, getList()" @clear="msg.pageIndex = 1, getList()"
              style="display:inline-block;width:225px;height:30px" placeholder="请输入公司名称" v-model="msg.CompanyName"
              size="small" clearable>
            </el-input>
            <span @click="msg.pageIndex = 1, getList()" class="el-icon-search"
              style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
          </div>
          <span style="margin-left: 10px">认证用户</span>
          <el-select size="small" v-model="msg.CreateBy" :filter-method="ChangeListName" filterable
            @change="(msg.pageIndex = 1), getList()" placeholder="请选择" clearable
            @clear="(msg.pageIndex = 1), getList()">
            <el-option label="不限" :value="0"></el-option>
            <el-option v-for="item in userList" :key="item.Id" :label="item.Name" :value="item.Id">
            </el-option>
          </el-select>
        </div>
        <el-table :data="tableData" v-loading="loading" border style="width: 100%;margin:20px 0">
          <el-table-column prop="CompanyId" label="公司id" width="100">
          </el-table-column>
          <el-table-column prop="CompanyName" label="企业名称">
          </el-table-column>
          <el-table-column prop="FirstShopType" label="认证类型">
            <template slot-scope="scope">
              <template v-if="scope.row.FirstShopType==1">
                消费品牌
              </template>
              <template v-if="scope.row.FirstShopType==2">
                商业载体
              </template>
              <template v-if="scope.row.FirstShopType==3">
                企业服务
              </template>
              <template v-if="scope.row.FirstShopType==4">
                活力楼宇
              </template>
            </template>
          </el-table-column>
          <el-table-column prop="BusinessLicense" width="150" label="营业执照">
            <template slot-scope="scope">
              <el-image title="点击查看大图" style="width:50px;" :src="scope.row.BusinessLicense"
                :preview-src-list="scope.row.BusinessList"></el-image>
            </template>
          </el-table-column>
          <el-table-column prop="UnifiedCode" label="统一社会信用代码">
          </el-table-column>
          <el-table-column prop="CompanyStatus" width="150" label="公司状态">
            <template slot-scope="scope">
              <span v-if="scope.row.CompanyStatus == 0" style="color:#1273bc;">待审核</span>
              <span v-if="scope.row.CompanyStatus == 1" style="color:green;">审核通过</span>
              <span v-if="scope.row.CompanyStatus == 2" style="color:#e95252;">审核拒绝</span>
            </template>
          </el-table-column>
          <el-table-column prop="Mobile" width="150" label="联系电话">
          </el-table-column>
          <el-table-column prop="LegalPerson" width="180" label="法人">
          </el-table-column>
          <el-table-column prop="UserName" label="认证用户"></el-table-column>
          <el-table-column prop="address" width="150" label="操作">
            <template slot-scope="scope">
              <el-tooltip class="item" effect="dark" content="审核" placement="top">
                <img @click="getInfo(scope.row, 1)" src="../../assets/img/userman/add_remark.png" alt="">
              </el-tooltip>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination style="text-align:right" background @current-change="handleCurrentChange"
          :page-size="msg.pageSize" :current-page.sync="msg.pageIndex" layout="total,prev, pager, next" :total="total">
        </el-pagination>
      </div>
    </template>
    <template v-else>
      <div class="head-title">
        <span @click="isShowInfo = false" style="color:rgb(64, 158, 255);cursor:pointer;">实名认证</span><span
          style="margin:0 9px;color:#C0C4CC">/</span><span>详情</span>
      </div>
      <div class="content">
        <div class="realDetailInfo">
          <div class="realDetailList">
            <div style="margin:20px 0;font-weight:bold;">
              <span class="tradeLine"></span>公司信息
            </div>
            <el-form label-width="150px">
              <el-form-item label="企业名称:">{{ listInfo.CompanyName }}</el-form-item>
              <el-form-item label="法人:">{{ listInfo.LegalPerson }}</el-form-item>
              <el-form-item label="统一社会信用代码:">{{ listInfo.UnifiedCode }}</el-form-item>
              <el-form-item label="公司状态:">
                <span v-if="listInfo.CompanyStatus == 0" style="color:#1273bc;">待审核</span>
                <span v-if="listInfo.CompanyStatus == 1" style="color:green;">审核通过</span>
                <span v-if="listInfo.CompanyStatus == 2" style="color:#e95252;">审核拒绝</span>
              </el-form-item>
              <el-form-item label="联系电话:">{{ listInfo.Mobile }}</el-form-item>
              <el-form-item label="营业执照:">
                <el-image style="width: 200px;" :src="listInfo.BusinessLicense" :preview-src-list="srcList">
                </el-image>
              </el-form-item>
              <el-form-item label="审核备注:" v-if="listInfo.CompanyStatus == 2">
                <span>
                  {{ listInfo.RejectRemark }}
                </span>
              </el-form-item>
            </el-form>
          </div>
          <div class="realDetailList" style="width:1000px;">
            <template v-if="listInfo.BrandModel">
              <div style="margin:20px 0;font-weight:bold;">
                <span class="tradeLine"></span>
                <template v-if="listInfo.FirstShopType == 1">
                  消费品牌信息
                </template>
                <template v-if="listInfo.FirstShopType == 2">
                  商业载体信息
                </template>
                <template v-if="listInfo.FirstShopType == 3">
                  企业服务信息
                </template>
                <template v-if="listInfo.FirstShopType == 4">
                  活力楼宇信息
                </template>
              </div>
              <!--消费品牌-->
              <template v-if="listInfo.FirstShopType == 1">
                <el-form label-width="120px">
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="品牌全名:">{{ listInfo.BrandModel.FullBrandName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="品牌名:">{{ listInfo.BrandModel.BrandName }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="Logo:">
                        <el-image v-if="listInfo.BrandModel.Logo != ''" style="width: 80px; height: 80px"
                          :src="listInfo.BrandModel.Logo">
                        </el-image>
                        <span v-else>无</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="介绍图:">
                        <div style="
                        position: relative;
                        margin-right: 20px;
                        display: inline-block;
                      " v-for="(item, index) in listInfo.BrandModel.BannerList" :key="index + '2'">
                          <el-image style="width: 100px; height: 100px" :src="item">
                          </el-image>
                        </div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="品牌视频:">
                        <span v-if="listInfo.BrandModel.VideoUrl == ''">无</span>
                        <a v-if="listInfo.BrandModel.VideoUrl != ''" class="blue noline"
                          :href="listInfo.BrandModel.VideoUrl" target="_blank">视频链接</a>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="品牌分类:">{{ listInfo.BrandModel.ClassName }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="品牌简介:">{{ listInfo.BrandModel.Introduce }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="店铺数量:">{{ listInfo.BrandModel.ShopNum }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="需求面积:">
                        {{ listInfo.BrandModel.AreaRequirement }}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="客群定位:">{{ listInfo.BrandModel.CustomerType }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="品牌定位:">{{ listInfo.BrandModel.BrandType }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="合作条件:">{{ listInfo.BrandModel.Cooperation }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="物业需求:">{{ listInfo.BrandModel.PropertyDemand }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="配套需求:">{{ listInfo.BrandModel.Complementary }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="联系人:">{{ listInfo.BrandModel.ContactName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="联系电话:">{{ listInfo.BrandModel.ContactPhone }}</el-form-item>
                    </el-col>
                  </el-row>
                </el-form>
              </template>
              <!--商业载体-->
              <template v-if="listInfo.FirstShopType == 2">
                <el-form label-width="160px">
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="项目名称:">{{ listInfo.CarrierModel.CarrierName }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="Logo:">
                        <el-image v-if="listInfo.CarrierModel.Logo != ''" style="width: 80px; height: 80px"
                          :src="listInfo.CarrierModel.Logo">
                        </el-image>
                        <span v-else>无</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="介绍图:">
                        <div style="
                        position: relative;
                        margin-right: 20px;
                        display: inline-block;
                      " v-for="(item, index) in listInfo.CarrierModel.BannerList" :key="index + '2'">
                          <el-image style="width: 100px; height: 100px" :src="item">
                          </el-image>
                        </div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="载体视频:">
                        <span v-if="listInfo.CarrierModel.VideoUrl == ''">无</span>
                        <a v-if="listInfo.CarrierModel.VideoUrl != ''" class="blue noline"
                          :href="listInfo.CarrierModel.VideoUrl" target="_blank">视频链接</a>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="项目位置:">{{ listInfo.CarrierModel.Address }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="开业状态:">{{ listInfo.CarrierModel.OpeningStatus==1?"已开业":"即将开业" }}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="商业体量:">{{ listInfo.CarrierModel.CarrierSize }} ㎡</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="商业层数:">{{ listInfo.CarrierModel.LayersNum }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="车位数量:">{{ listInfo.CarrierModel.CarNum }} 个</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="经营面积:">{{ listInfo.CarrierModel.BuiltUpArea }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="可租赁面积:">{{ listInfo.CarrierModel.AreaRequirement }} ㎡</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="开业时间:">{{ listInfo.CarrierModel.OpenTime }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="人流量参数:">{{ listInfo.CarrierModel.VisitorsFlowrate }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="水电气及配套:">{{ listInfo.CarrierModel.SupportingFacilities }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="管理公司及管理费:">{{ listInfo.CarrierModel.ManagementCompany }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="开发商:">{{ listInfo.CarrierModel.Developers }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="物业构成:">{{ listInfo.CarrierModel.ClassName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="资产权属:">{{ listInfo.CarrierModel.Ascription }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="业态规划:">{{ listInfo.CarrierModel.CarrierPlan }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="目标招商业态及品牌需求:">{{ listInfo.CarrierModel.BrandDemand }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="项目发展及定位:">{{ listInfo.CarrierModel.Location }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="联系人:">{{ listInfo.CarrierModel.ContactName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="联系电话:">{{ listInfo.CarrierModel.ContactPhone }}</el-form-item>
                    </el-col>
                  </el-row>
                </el-form>
              </template>
              <!--企业服务-->
              <template v-if="listInfo.FirstShopType == 3">
                <el-form label-width="160px">
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="企业名称:">{{ listInfo.EnterpriseServicesModel.Name }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="介绍图:">
                        <div style="
                        position: relative;
                        margin-right: 20px;
                        display: inline-block;
                      " v-for="(item, index) in listInfo.EnterpriseServicesModel.BannerList" :key="index + '2'">
                          <el-image style="width: 100px; height: 100px" :src="item">
                          </el-image>
                        </div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="企业简介:">{{ listInfo.EnterpriseServicesModel.Introduction }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="企业发展意向:">{{ listInfo.EnterpriseServicesModel.DevIntention }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="企业类别:">{{ listInfo.EnterpriseServicesModel.CategoryName }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="意向楼宇位置:">{{ listInfo.EnterpriseServicesModel.Address }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="投运时间:">{{ listInfo.EnterpriseServicesModel.OperationTime }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="意向楼宇等级:">{{ listInfo.EnterpriseServicesModel.ETypeName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="楼宇装修:">{{ listInfo.EnterpriseServicesModel.Renovation }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="支付方式:">{{ listInfo.EnterpriseServicesModel.Payment }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="交房日期:">{{ listInfo.EnterpriseServicesModel.HandoverDate }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="意向楼层:">
                        {{ listInfo.EnterpriseServicesModel.IntentionalFloor >0?listInfo.EnterpriseServicesModel.IntentionalFloor :"-"}}
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="电梯数:">
                        {{ listInfo.EnterpriseServicesModel.ElevatorNum>0?listInfo.EnterpriseServicesModel.ElevatorNum:"-" }}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="物业费(元):">
                        {{ listInfo.EnterpriseServicesModel.PropertyFee>0?listInfo.EnterpriseServicesModel.PropertyFee:"-" }}
                        元/㎡/月
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="月租金(元):">
                        {{ listInfo.EnterpriseServicesModel.RentFee>0?listInfo.EnterpriseServicesModel.RentFee:"-" }}
                        元/㎡/月</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="联系人名字:">{{ listInfo.EnterpriseServicesModel.ContactName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="联系人电话:">{{ listInfo.EnterpriseServicesModel.ContactPhone }}</el-form-item>
                    </el-col>
                  </el-row>
                </el-form>
              </template>
              <!--活力楼宇-->
              <template v-if="listInfo.FirstShopType == 4">
                <el-form label-width="160px">
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="楼宇名称:">{{ listInfo.buildingApplyForModel.Name }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="24">
                      <el-form-item label="介绍图:">
                        <div style="
                        position: relative;
                        margin-right: 20px;
                        display: inline-block;
                      " v-for="(item, index) in listInfo.buildingApplyForModel.BannerList" :key="index + '2'">
                          <el-image style="width: 100px; height: 100px" :src="item">
                          </el-image>
                        </div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="楼宇位置:">{{ listInfo.buildingApplyForModel.Address }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="投运时间:">{{ listInfo.buildingApplyForModel.OperationTime }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="楼宇等级:">{{ listInfo.buildingApplyForModel.CategoryName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="楼宇建筑面积:">{{ listInfo.buildingApplyForModel.Areas }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="楼栋数量:">{{ listInfo.buildingApplyForModel.BuildingNum }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="楼层量:">{{ listInfo.buildingApplyForModel.FloorNum }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="电梯数:">{{ listInfo.buildingApplyForModel.ElevatorNum }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="层高:">{{ listInfo.buildingApplyForModel.FloorHeight }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="开发商:">{{ listInfo.buildingApplyForModel.Developers }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="物业公司:">{{ listInfo.buildingApplyForModel.PropertyComp }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="销售/自持比例:">{{ listInfo.buildingApplyForModel.SaleOrSelf }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="是否统一运营:">{{ listInfo.buildingApplyForModel.IsAllOperate==1?"是":"否" }}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="建设时间:">{{ listInfo.buildingApplyForModel.ConstructionTime }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="物业费(元):">
                        {{ listInfo.buildingApplyForModel.PropertyFee>0?listInfo.buildingApplyForModel.PropertyFee:"-" }}
                        元/㎡/月
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="月租金(元):">
                        {{ listInfo.buildingApplyForModel.RentFee>0?listInfo.buildingApplyForModel.RentFee:"-" }} 元/㎡/月
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="拟主导产业方向:">{{ listInfo.buildingApplyForModel.IndustryDirection }}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="目标企业招引需求:">{{ listInfo.buildingApplyForModel.BrandDemand }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="其他需求:">{{ listInfo.buildingApplyForModel.Other }}</el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24">
                    <el-col :span="12">
                      <el-form-item label="负责人名字:">{{ listInfo.buildingApplyForModel.ContactName }}</el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="负责人电话:">{{ listInfo.buildingApplyForModel.ContactPhone }}</el-form-item>
                    </el-col>
                  </el-row>
                </el-form>
              </template>
            </template>
          </div>
        </div>
        <template v-if="listInfo.CompanyStatus == 0">
          <el-button size="small" style="margin-top:20px;padding:9px 25px;" type="primary"
            @click="audit(1), AuditRemark = ''">审核通过
          </el-button>
          <el-button size="small" style="margin-top:20px;padding:9px 25px;" type="danger" @click="auditfail()">审核失败
          </el-button>
        </template>
      </div>
    </template>
    <el-dialog title="审核拒绝" :visible.sync="resondialog2" width="600px">
      <el-form label-width="80px">
        <el-form-item label="拒绝原因" class="is-required">
          <el-input type="textarea" :rows="6" v-model="AuditRemark"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="resondialog2 = false">取 消</el-button>
        <el-button @click="audit(2)" size="small" type="primary">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        resondialog2: false,
        msg: {
          pageIndex: 1,
          pageSize: 15,
          CompanyName: '',
          CreateBy: 0,
        },
        usermsg: {
          pageIndex: 1,
          pageSize: 20,
          Name: '',
          Source: 0,
          MemberGrade: 0,
          Id: 0,
          Moblie: ''
        },
        userList: [],
        total: 0,
        loading: false,
        tableData: [], //数据列表
        isShowInfo: false,
        listInfo: {},
        srcList: [],
        colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
        AuditRemark: '',
      };
    },
    created() {
      this.getList();
      this.getuserList()
    },
    methods: {
      ChangeListName(val) {
        this.usermsg.Name = val;
        this.getuserList();
      },
      getuserList() {
        this.apipost("/api/user/GetMemberUserDropDownList", this.usermsg, res => {
          if (res.data.resultCode == 1) {
            let pageData = res.data.data.pageData;
            this.userList = pageData;
          }
        })
      },
      getList() {
        this.loading = true;
        this.apipost("/api/Trade/GetCompanyEnterprisePageList", this.msg, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.total = res.data.data.count;
            let pageData = res.data.data.pageData;
            this.tableData = pageData;
            this.tableData.forEach(x => {
              x.BusinessList = [];
              x.BusinessList.push(x.BusinessLicense);
            })
          } else {
            this.Error(res.data.message)
          }
        })
      },
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      getInfo(item) {
        this.isShowInfo = true;
        this.apipost("/api/Trade/GetCompanyEnterprise", {
          CompanyId: item.CompanyId
        }, res => {
          if (res.data.resultCode == 1) {
            this.isShowInfo = true;
            this.listInfo = res.data.data;
            this.srcList = [];
            this.srcList.push(this.listInfo.BusinessLicense);
          }
        })
      },
      //审核
      audit(type) {
        let that = this;
        let str = ''
        if (type == 1) {
          str = '确定审核通过？'
        } else {
          str = '确定审核失败？'
        }
        if (type == 1) {
          that.Confirm(str, function () {
            let msg = {
              CompanyId: that.listInfo.CompanyId,
              CompanyStatus: type,
              Remark: '',
            }
            const loading = that.$loading({
              lock: true,
              text: '审核中...',
              spinner: 'el-icon-loading',
            });
            that.apipost("/api/Trade/UpdateCompanyEnterpriseStatus", msg, res => {
              loading.close();
              if (res.data.resultCode == 1) {
                that.Success(res.data.message)
                that.isShowInfo = false;
                that.getList();
              } else {
                that.Error(res.data.message)
              }
            })
          });
        } else {
          let msg = {
            CompanyId: that.listInfo.CompanyId,
            CompanyStatus: type,
            Remark: that.AuditRemark
          }
          const loading = that.$loading({
            lock: true,
            text: '审核中...',
            spinner: 'el-icon-loading',
          });
          that.apipost("/api/Trade/UpdateCompanyStatus", msg, res => {
            loading.close();
            if (res.data.resultCode == 1) {
              that.resondialog2 = false
              that.Success(res.data.message)
              that.isShowInfo = false;
              that.getList();
            } else {
              that.Error(res.data.message)
            }
          })

        }

      },
      auditfail() { //失败理由
        this.resondialog2 = true;
        this.AuditRemark = '';
      }
    },
    mounted() {}
  };

</script>
<style>
  .realAuthentication .content .searchInput {
    border: 1px solid #DCDFE6;
    border-radius: 4px;
  }

  .realAuthentication .content .searchInput .el-input__inner {
    border: none;
    outline: none;
    height: 30px;
    line-height: 30px;
  }

  .realAuthentication .content .searchInput {
    line-height: normal;
    display: inline-table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    width: 250px;
    margin-right: 20px;
  }

  .realAuthentication .content {
    background: #fff;
    margin-top: 10px;
    padding: 20px;
    box-sizing: border-box;
  }

  .realAuthentication .tradeLine {
    display: inline-block;
    width: 3px;
    height: 10px;
    margin-right: 5px;
    background-color: #409EFF;
  }

  .realAuthentication .realDetailInfo {
    display: flex;
    justify-content: space-between;
    width: 90%;
  }

  .realAuthentication .realDetailList {
    padding-right: 100px;
  }

  .realAuthentication .brandShuxing {
    display: flex;
    justify-content: space-between;
    width: 850px;
  }

  .realAuthentication .brandShuxing_item {
    display: flex;
    justify-content: space-between;
    width: 50%;
  }

</style>
