<template>
  <div class="app-container detail-container">
    <el-tabs v-model="activeName" @tab-click="handleClick" class="detail-tab">
      <el-tab-pane label="工商信息" name="first"></el-tab-pane>
      <el-tab-pane label="工商变更" name="second"></el-tab-pane>
    </el-tabs>

    <div class="businfo-box" v-if="activeName=='first'">
      <p>
        <label class="label">企业名称</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">社会信用代码</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">法定代表人</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">登记状态</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">成立日期</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">注册资本</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">实缴资本</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">核准日期</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">组织机构代码</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">工商注册号</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">纳税人识别号</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">企业类型</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">营业期限</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">纳税人资质</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">所属地区</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">登记机关</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">人员规模</label>
        <span>{{forInfo.companyName || '--'}}</span>
        <label class="label">参保人数</label>
        <span>{{forInfo.companyName || '--'}}</span>
      </p>
      <p>
        <label class="label">经营范围</label>
        <span class="span-one">{{forInfo.companyName || '--'}}</span>
      </p>
    </div>
    <tables
      :tableLoading="tableLoading"
      :tableData="tableData"
      :forData="forData"
      :queryParams="queryParams"
      :paging="false"
      v-if="activeName=='second'"
    />
  </div>
</template>

<script>
import mixin from '../mixins/mixin'
export default {
  name: 'Businfo',
  props: ['companyId'],
  mixins: [mixin],
  data() {
    return {
      activeName: 'first',
      queryParams: {
        cid: 6034,
        pageNum: 1,
        pageSize: 10
      },
      forInfo: {},
      forData: [
        {label: '变更日期', prop: 'inReason', width: '90', slot: true},
        {label: '变更事项', prop: 'inDate'},
        {label: '变更前', prop: 'department'},
        {label: '变更后', prop: 'department'}
      ],
      //列表
      tableLoading:false,
      tableData:[]
    }
  },
  created() {
    this.handleData()
  },
  methods: {
    handleClick(){
      this.handleData()
    },
    async handleData() {
      this.tableData = [
        {id:1, inReason:'达萨法达萨法', inDate:'000',tag:'aaa'},
        {id:2, inReason:'达萨法达萨法', inDate:'111'},
        {id:3, inReason:'达萨法达萨法', inDate:'222'},
        {id:4, inReason:'达萨法达萨法', inDate:'333'}
      ] //测试
    },
    handleQuery(params) {
      console.log(params)
    }
  }
}
</script>

<style lang="scss" scoped>
.detail-container{
  margin: 0;
  padding: 16px;
  background: #FFFFFF;
  .detail-tab{
    margin: 0 0 0 -16px;
    ::v-deep .el-tabs__nav-wrap::after{
      display: none;
    }
    ::v-deep .el-tabs__item{
      font-size: 16px;
      height: 30px;
      line-height: 30px;
      padding: 0 16px;
      &.is-active{
        font-weight: bold;
      }
    }
  }
  .businfo-box {
    border-top: 1px solid #E6E9F0;
    p {
      display: flex;
      align-items: center;
      margin: 0;
      border-left: 1px solid #E6E9F0;
      border-bottom: 1px solid #E6E9F0;
      .label {
        width: 10%;
        font-weight: 400;
        line-height: 40px;
        font-size: 12px;
        height: 40px;
        background: #F0F3FA;
        padding-left: 12px;
      }
      span {
        width: 40%;
        color: #000;
        height: 40px;
        line-height: 40px;
        padding-left: 12px;
        font-size: 12px;
      }
      .span-one {
        width: 90%;
      }
    }
  }
}
</style>
