<template>
  <div class="app-container">

<!--
    <el-table v-loading="loading" :data="companyList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="公司ID" align="center" prop="companyId" />
      <el-table-column label="租户代码" align="center" prop="tenantCode" />
      <el-table-column label="公司名称" align="center" prop="companyName" />
      <el-table-column label="开户名称" align="center" prop="accountName" />
      <el-table-column label="开户银行" align="center" prop="accountBank" />
      <el-table-column label="银行地址" align="center" prop="bankAddress" />
      <el-table-column label="开户许可证照片" align="center" prop="annex" />
      <el-table-column label="银行账号" align="center" prop="bankAccount" />
      <el-table-column label="银行行号" align="center" prop="bankNo" />
      <el-table-column label="银行电话" align="center" prop="bankPhone" />
      <el-table-column label="授权委托人" align="center" prop="trueName" />
      <el-table-column label="职位" align="center" prop="position" />
      <el-table-column label="性别" align="center" prop="sex" />
      <el-table-column label="身份证照片" align="center" prop="idPhpto" />
      <el-table-column label="身份证号" align="center" prop="idNumber" />
      <el-table-column label="生日" align="center" prop="birthday" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="开始日期" align="center" prop="idCardStart" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.idCardStart, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束日期" align="center" prop="idCardEnd" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.idCardEnd, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="最大进度" align="center" prop="maxProgress" />
      <el-table-column label="企业ID" align="center" prop="businessId" />
      <el-table-column label="电话号码" align="center" prop="phoneNumber" />
      <el-table-column label="统一社会信用代码" align="center" prop="socialCode" />
      <el-table-column label="公司性质" align="center" prop="nature" />
      <el-table-column label="登记机关" align="center" prop="authority" />
      <el-table-column label="开始时间" align="center" prop="startTime" />
      <el-table-column label="公司邮箱" align="center" prop="email" />
      <el-table-column label="营业执照" align="center" prop="businessLicense" />
      <el-table-column label="法定代表人" align="center" prop="legalRepresentative" />
      <el-table-column label="注册资本" align="center" prop="registeredCapital" />
      <el-table-column label="地址" align="center" prop="address" />
      <el-table-column label="完整地址" align="center" prop="fullAddress" />
      <el-table-column label="注册时间" align="center" prop="registeredTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.registeredTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="经营开始时间" align="center" prop="businessStart" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.businessStart, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="经营结束时间" align="center" prop="businessEnd" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.businessEnd, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="经营范围" align="center" prop="businessScope" />
      <el-table-column label="企业基础代码" align="center" prop="companyBasicId" />
      <el-table-column label="企业大小" align="center" prop="enterpriseSize" />
      <el-table-column label="行业" align="center" prop="industry" />
      <el-table-column label="网站" align="center" prop="website" />
      <el-table-column label="公司联系电话" align="center" prop="contactPhone" />
      <el-table-column label="邮政编码" align="center" prop="postcode" />
      <el-table-column label="传真" align="center" prop="fax" />
      <el-table-column label="安全许可证" align="center" prop="securityLicense" />
      <el-table-column label="安全许可证开始时间" align="center" prop="securityStart" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.securityStart, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="安全许可证结束时间" align="center" prop="securityEnd" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.securityEnd, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结构" align="center" prop="structure" />
      <el-table-column label="公司简介" align="center" prop="companyProfile" />
      <el-table-column label="描述" align="center" prop="softPowerText" />
      <el-table-column label="图片" align="center" prop="softPowerImg" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['bid:company:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['bid:company:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
-->

<!--    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />-->

    <el-form ref="form" :model="form" :rules="rules" label-width="80px" style="padding: 20px">

      <div class="gs-title">
        公司信息
      </div>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="公司名称" prop="companyName">
            <el-input v-model="form.companyName" placeholder="请输入公司名称" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="所属行业" prop="industry">
            <el-input v-model="form.industry" placeholder="请输入所属行业" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="网站" prop="website">
            <el-input v-model="form.website" placeholder="请输入网站" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="统一社会信用代码" prop="socialCode" label-width="130px">
            <el-input v-model="form.socialCode" placeholder="请输入统一社会信用代码" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="租户代码" prop="tenantCode">
            <el-input v-model="form.tenantCode" placeholder="请输入租户代码" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="公司性质" prop="nature">
            <el-input v-model="form.nature" placeholder="请输入公司性质" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="注册资本" prop="registeredCapital">
            <el-input v-model="form.registeredCapital" placeholder="请输入注册资本" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="注册时间" prop="registeredTime">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.registeredTime"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择注册时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="公司邮箱" prop="email">
            <el-input v-model="form.email" placeholder="请输入公司邮箱" />
          </el-form-item>
        </el-col>

      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="联系电话" prop="contactPhone">
            <el-input v-model="form.contactPhone" placeholder="请输入联系电话" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="传真" prop="fax">
            <el-input v-model="form.fax" placeholder="请输入传真" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="邮政编码" prop="postcode">
            <el-input v-model="form.postcode" placeholder="请输入邮政编码" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="公司地址" prop="address">
            <el-input v-model="form.address" placeholder="请输入公司地址" />
          </el-form-item>
        </el-col>

      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="经营开始时间" prop="businessStart" label-width="100px">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.businessStart"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择经营开始时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="经营结束时间" prop="businessEnd" label-width="100px">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.businessEnd"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择经营结束时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="登记机关" prop="authority">
            <el-input v-model="form.authority" placeholder="请输入登记机关" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="经营范围" prop="businessScope">
            <el-input v-model="form.businessScope" placeholder="请输入经营范围" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="企业基础代码" prop="companyBasicId" label-width="100px">
            <el-input v-model="form.companyBasicId" placeholder="请输入企业基础代码" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="企业大小" prop="enterpriseSize">
            <el-input v-model="form.enterpriseSize" placeholder="请输入企业大小" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="结构" prop="structure">
            <el-input v-model="form.structure" placeholder="请输入结构" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="电话号码" prop="phoneNumber">
            <el-input v-model="form.phoneNumber" placeholder="请输入电话号码" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="开始时间" prop="startTime">
            <el-input v-model="form.startTime" placeholder="请输入开始时间" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="最大进度" prop="maxProgress">
            <el-input v-model="form.maxProgress" placeholder="请输入最大进度" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="营业执照" prop="businessLicense">
            <image-upload v-model="form.businessLicense" placeholder="请输入营业执照" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="安全许可证" prop="securityLicense" label-width="100px">
            <image-upload v-model="form.securityLicense" placeholder="请输入安全许可证" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="安全许可证开始时间" prop="securityStart" label-width="140px">
            <el-date-picker clearable
                            v-model="form.securityStart"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择安全许可证开始时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="安全许可证结束时间" prop="securityEnd" label-width="140px">
            <el-date-picker clearable
                            v-model="form.securityEnd"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择安全许可证结束时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="8"></el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="完整地址" prop="fullAddress">
            <el-input v-model="form.fullAddress" placeholder="请输入完整地址" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="公司简介" prop="companyProfile">
            <el-input v-model="form.companyProfile" placeholder="请输入公司简介" type="textarea"/>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="描述" prop="softPowerText">
            <el-input v-model="form.softPowerText" placeholder="请输入描述" type="textarea"/>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="图片" prop="softPowerImg">
            <image-upload v-model="form.softPowerImg" placeholder="请输入图片" />
          </el-form-item>
        </el-col>
      </el-row>

      <div class="gs-title">
        法人信息
      </div>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="身份证照片" prop="idPhpto" label-width="100px">
            <image-upload v-model="form.idPhpto" type="textarea" placeholder="请输入内容" :limit="2"/>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="6">
          <el-form-item label="法定代表人" prop="legalRepresentative" label-width="100px">
            <el-input v-model="form.legalRepresentative" placeholder="请输入法定代表人" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="身份证号" prop="idNumber">
            <el-input v-model="form.idNumber" placeholder="请输入身份证号" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="性别" prop="sex">
            <el-select v-model="form.sex" placeholder="请选择性别" style="width: 100%;">
              <el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="出生日期" prop="birthday">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.birthday"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择出生日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">

        <el-col :span="6">
          <el-form-item label="身份证开始日期" prop="idCardStart" label-width="110px">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.idCardStart"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择开始日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="身份证结束日期" prop="idCardEnd" label-width="110px">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.idCardEnd"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择结束日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="职位" prop="position">
            <el-input v-model="form.position" placeholder="请输入职位" />
          </el-form-item>
        </el-col>
      </el-row>


      <div class="gs-title">
        授权委托人信息
      </div>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="身份证照片" prop="idPhpto1" label-width="100px">
            <image-upload v-model="form.idPhpto1" type="textarea" :limit="2"/>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="6">
          <el-form-item label="授权委托人" prop="trueName" label-width="100px">
            <el-input v-model="form.trueName" placeholder="请输入授权委托人" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="身份证号" prop="idNumber1">
            <el-input v-model="form.idNumber1" placeholder="请输入身份证号" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="性别" prop="sex1">
            <el-select v-model="form.sex1" placeholder="请选择性别" style="width: 100%;">
              <el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="出生日期" prop="birthday1">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.birthday1"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择出生日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">

        <el-col :span="6">
          <el-form-item label="身份证开始日期" prop="idCardStart1" label-width="110px">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.idCardStart1"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择开始日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="身份证结束日期" prop="idCardEnd1" label-width="110px">
            <el-date-picker clearable style="width: 100%;"
                            v-model="form.idCardEnd1"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择结束日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="职位" prop="position1">
            <el-input v-model="form.position1" placeholder="请输入职位" />
          </el-form-item>
        </el-col>
      </el-row>

      <div class="gs-title">
        开户行信息
      </div>

      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="开户许可证照片" prop="annex" label-width="110px">
            <image-upload v-model="form.annex" type="textarea" placeholder="请输入内容" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="开户名称" prop="accountName">
            <el-input v-model="form.accountName" placeholder="请输入开户名称" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="银行账号" prop="bankAccount">
            <el-input v-model="form.bankAccount" placeholder="请输入银行账号" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="开户银行" prop="accountBank">
            <el-input v-model="form.accountBank" placeholder="请输入开户银行" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="10">
        <el-col :span="8">
          <el-form-item label="银行地址" prop="bankAddress">
            <el-input v-model="form.bankAddress" placeholder="请输入银行地址" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="银行行号" prop="bankNo">
            <el-input v-model="form.bankNo" placeholder="请输入银行行号" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="银行电话" prop="bankPhone">
            <el-input v-model="form.bankPhone" placeholder="请输入银行电话" />
          </el-form-item>
        </el-col>
      </el-row>

    </el-form>

    <div slot="footer" class="dialog-footer" style="margin-bottom: 100px; text-align: center ">
      <el-button type="primary" @click="submitForm">确 定</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div>

    <!-- 添加或修改公司信息对话框 -->
<!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="公司ID" prop="companyId">
          <el-input v-model="form.companyId" placeholder="请输入公司ID" />
        </el-form-item>
        <el-form-item label="租户代码" prop="tenantCode">
          <el-input v-model="form.tenantCode" placeholder="请输入租户代码" />
        </el-form-item>
        <el-form-item label="公司名称" prop="companyName">
          <el-input v-model="form.companyName" placeholder="请输入公司名称" />
        </el-form-item>
        <el-form-item label="开户名称" prop="accountName">
          <el-input v-model="form.accountName" placeholder="请输入开户名称" />
        </el-form-item>
        <el-form-item label="开户银行" prop="accountBank">
          <el-input v-model="form.accountBank" placeholder="请输入开户银行" />
        </el-form-item>
        <el-form-item label="银行地址" prop="bankAddress">
          <el-input v-model="form.bankAddress" placeholder="请输入银行地址" />
        </el-form-item>
        <el-form-item label="开户许可证照片" prop="annex">
          <el-input v-model="form.annex" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="银行账号" prop="bankAccount">
          <el-input v-model="form.bankAccount" placeholder="请输入银行账号" />
        </el-form-item>
        <el-form-item label="银行行号" prop="bankNo">
          <el-input v-model="form.bankNo" placeholder="请输入银行行号" />
        </el-form-item>
        <el-form-item label="银行电话" prop="bankPhone">
          <el-input v-model="form.bankPhone" placeholder="请输入银行电话" />
        </el-form-item>
        <el-form-item label="授权委托人" prop="trueName">
          <el-input v-model="form.trueName" placeholder="请输入授权委托人" />
        </el-form-item>
        <el-form-item label="职位" prop="position">
          <el-input v-model="form.position" placeholder="请输入职位" />
        </el-form-item>
        <el-form-item label="身份证照片" prop="idPhpto">
          <el-input v-model="form.idPhpto" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="身份证号" prop="idNumber">
          <el-input v-model="form.idNumber" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="生日" prop="birthday">
          <el-date-picker clearable
            v-model="form.birthday"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择生日">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="开始日期" prop="idCardStart">
          <el-date-picker clearable
            v-model="form.idCardStart"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择开始日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束日期" prop="idCardEnd">
          <el-date-picker clearable
            v-model="form.idCardEnd"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择结束日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="最大进度" prop="maxProgress">
          <el-input v-model="form.maxProgress" placeholder="请输入最大进度" />
        </el-form-item>
        <el-form-item label="企业ID" prop="businessId">
          <el-input v-model="form.businessId" placeholder="请输入企业ID" />
        </el-form-item>
        <el-form-item label="电话号码" prop="phoneNumber">
          <el-input v-model="form.phoneNumber" placeholder="请输入电话号码" />
        </el-form-item>
        <el-form-item label="统一社会信用代码" prop="socialCode">
          <el-input v-model="form.socialCode" placeholder="请输入统一社会信用代码" />
        </el-form-item>
        <el-form-item label="公司性质" prop="nature">
          <el-input v-model="form.nature" placeholder="请输入公司性质" />
        </el-form-item>
        <el-form-item label="登记机关" prop="authority">
          <el-input v-model="form.authority" placeholder="请输入登记机关" />
        </el-form-item>
        <el-form-item label="开始时间" prop="startTime">
          <el-input v-model="form.startTime" placeholder="请输入开始时间" />
        </el-form-item>
        <el-form-item label="公司邮箱" prop="email">
          <el-input v-model="form.email" placeholder="请输入公司邮箱" />
        </el-form-item>
        <el-form-item label="营业执照" prop="businessLicense">
          <el-input v-model="form.businessLicense" placeholder="请输入营业执照" />
        </el-form-item>
        <el-form-item label="法定代表人" prop="legalRepresentative">
          <el-input v-model="form.legalRepresentative" placeholder="请输入法定代表人" />
        </el-form-item>
        <el-form-item label="注册资本" prop="registeredCapital">
          <el-input v-model="form.registeredCapital" placeholder="请输入注册资本" />
        </el-form-item>
        <el-form-item label="地址" prop="address">
          <el-input v-model="form.address" placeholder="请输入地址" />
        </el-form-item>
        <el-form-item label="完整地址" prop="fullAddress">
          <el-input v-model="form.fullAddress" placeholder="请输入完整地址" />
        </el-form-item>
        <el-form-item label="注册时间" prop="registeredTime">
          <el-date-picker clearable
            v-model="form.registeredTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择注册时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="经营开始时间" prop="businessStart">
          <el-date-picker clearable
            v-model="form.businessStart"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择经营开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="经营结束时间" prop="businessEnd">
          <el-date-picker clearable
            v-model="form.businessEnd"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择经营结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="经营范围" prop="businessScope">
          <el-input v-model="form.businessScope" placeholder="请输入经营范围" />
        </el-form-item>
        <el-form-item label="企业基础代码" prop="companyBasicId">
          <el-input v-model="form.companyBasicId" placeholder="请输入企业基础代码" />
        </el-form-item>
        <el-form-item label="企业大小" prop="enterpriseSize">
          <el-input v-model="form.enterpriseSize" placeholder="请输入企业大小" />
        </el-form-item>
        <el-form-item label="行业" prop="industry">
          <el-input v-model="form.industry" placeholder="请输入行业" />
        </el-form-item>
        <el-form-item label="网站" prop="website">
          <el-input v-model="form.website" placeholder="请输入网站" />
        </el-form-item>
        <el-form-item label="公司联系电话" prop="contactPhone">
          <el-input v-model="form.contactPhone" placeholder="请输入公司联系电话" />
        </el-form-item>
        <el-form-item label="邮政编码" prop="postcode">
          <el-input v-model="form.postcode" placeholder="请输入邮政编码" />
        </el-form-item>
        <el-form-item label="传真" prop="fax">
          <el-input v-model="form.fax" placeholder="请输入传真" />
        </el-form-item>
        <el-form-item label="安全许可证" prop="securityLicense">
          <el-input v-model="form.securityLicense" placeholder="请输入安全许可证" />
        </el-form-item>
        <el-form-item label="安全许可证开始时间" prop="securityStart">
          <el-date-picker clearable
            v-model="form.securityStart"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择安全许可证开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="安全许可证结束时间" prop="securityEnd">
          <el-date-picker clearable
            v-model="form.securityEnd"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择安全许可证结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结构" prop="structure">
          <el-input v-model="form.structure" placeholder="请输入结构" />
        </el-form-item>
        <el-form-item label="公司简介" prop="companyProfile">
          <file-upload v-model="form.companyProfile"/>
        </el-form-item>
        <el-form-item label="描述" prop="softPowerText">
          <el-input v-model="form.softPowerText" placeholder="请输入描述" />
        </el-form-item>
        <el-form-item label="图片" prop="softPowerImg">
          <el-input v-model="form.softPowerImg" placeholder="请输入图片" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>-->
  </div>
</template>

<script>
import { listCompany, getCompany, delCompany, addCompany, updateCompany } from "@/api/bid/company"

export default {
  name: "Company",
  dicts: ['sys_user_sex'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 公司信息表格数据
      companyList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        companyId: null,
        tenantCode: null,
        companyName: null,
        accountName: null,
        accountBank: null,
        bankAddress: null,
        annex: null,
        bankAccount: null,
        bankNo: null,
        bankPhone: null,
        trueName: null,
        position: null,
        sex: null,
        idPhpto: null,
        idNumber: null,
        birthday: null,
        idCardStart: null,
        idCardEnd: null,
        maxProgress: null,
        businessId: null,
        phoneNumber: null,
        socialCode: null,
        nature: null,
        authority: null,
        startTime: null,
        email: null,
        businessLicense: null,
        legalRepresentative: null,
        registeredCapital: null,
        address: null,
        fullAddress: null,
        registeredTime: null,
        businessStart: null,
        businessEnd: null,
        businessScope: null,
        companyBasicId: null,
        enterpriseSize: null,
        industry: null,
        website: null,
        contactPhone: null,
        postcode: null,
        fax: null,
        securityLicense: null,
        securityStart: null,
        securityEnd: null,
        structure: null,
        companyProfile: null,
        softPowerText: null,
        softPowerImg: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        companyName: [
          { required: true, message: "公司名称不能为空", trigger: "blur" }
        ],
        idPhpto: [
          { required: true, message: "身份证照片不能为空", trigger: "blur" }
        ],
        legalRepresentative: [
          { required: true, message: "法定代表人不能为空", trigger: "blur" }
        ],
        idNumber: [
          { required: true, message: "身份证号不能为空", trigger: "blur" }
        ],
        sex: [
          { required: true, message: "性别不能为空", trigger: "blur" }
        ],
        annex: [
          { required: true, message: "开户许可证照片不能为空", trigger: "blur" }
        ],
        accountName: [
          { required: true, message: "开户名称不能为空", trigger: "blur" }
        ],
        bankAccount: [
          { required: true, message: "银行账号不能为空", trigger: "blur" }
        ],
        accountBank: [
          { required: true, message: "开户银行不能为空", trigger: "blur" }
        ],
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询公司信息列表 */
    getList() {
      this.loading = true
      listCompany(this.queryParams).then(response => {
        this.companyList = response.rows;

        if(response.rows.length>0){
          this.form=response.rows[0]
        }else {
          this.reset()
        }
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        companyId: null,
        tenantCode: null,
        companyName: null,
        accountName: null,
        accountBank: null,
        bankAddress: null,
        annex: null,
        bankAccount: null,
        bankNo: null,
        bankPhone: null,
        trueName: null,
        position: null,
        sex: null,
        idPhpto: null,
        idNumber: null,
        birthday: null,
        idCardStart: null,
        idCardEnd: null,
        maxProgress: null,
        businessId: null,
        phoneNumber: null,
        socialCode: null,
        nature: null,
        authority: null,
        startTime: null,
        email: null,
        businessLicense: null,
        legalRepresentative: null,
        registeredCapital: null,
        address: null,
        fullAddress: null,
        registeredTime: null,
        businessStart: null,
        businessEnd: null,
        businessScope: null,
        companyBasicId: null,
        enterpriseSize: null,
        industry: null,
        website: null,
        contactPhone: null,
        postcode: null,
        fax: null,
        securityLicense: null,
        securityStart: null,
        securityEnd: null,
        structure: null,
        companyProfile: null,
        softPowerText: null,
        softPowerImg: null
      }
      this.resetForm("form")
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm")
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = "添加公司信息"
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const id = row.id || this.ids
      getCompany(id).then(response => {
        this.form = response.data
        this.open = true
        this.title = "修改公司信息"
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateCompany(this.form).then(response => {
              this.$modal.msgSuccess("修改成功")
              this.open = false
              this.getList()
            })
          } else {
            addCompany(this.form).then(response => {
              this.$modal.msgSuccess("新增成功")
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids
      this.$modal.confirm('是否确认删除公司信息编号为"' + ids + '"的数据项？').then(function() {
        return delCompany(ids)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("删除成功")
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('bid/company/export', {
        ...this.queryParams
      }, `company_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>

<style scoped lang="scss">
.gs-title{
  padding-left: 10px;
  border-left: 8px solid #1638a3;
  margin-bottom: 30px;
}
</style>
