<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>


    <info-table class="info-tab" :list="defaultList" :obj="forInfo" :labelWidth="labelWidth" v-if="activeName=='first'">

    </info-table>
    <tables
      :tableLoading="tableLoading"
      :tableData="tableData"
      :forData="forData"
      :queryParams="queryParams"
      :paging="false"
      v-if="activeName=='second'"
    />
  </div>
</template>

<script>
import mixin from '../mixins/mixin'
import InfoTable from '../component/infoTable'
export default {
  name: 'Businfo',
  props: ['companyId'],
  components: {
    InfoTable
  },
  mixins: [mixin],
  data() {
    return {
      activeName: 'first',
      queryParams: {
        cid: 6034,
        pageNum: 1,
        pageSize: 10
      },
      labelWidth: 250,
      forInfo: {projectType: 'aaa', projectPurposes: '222', projectInvestmentAmounts: '222'},
      defaultList: [
        { name: '企业名称', prop: 'projectTypes' },
        { name: '社会信用代码', prop: 'projectPurposes' },
        { name: '法定代表人', prop: 'projectInvestmentAmounts' },
        { name: '登记状态', prop: 'projectInvestmentAmounts' },
        { name: '成立日期', prop: 'projectInvestmentAmounts' },
        { name: '注册资本', prop: 'projectInvestmentAmounts' },
        { name: '实缴资本', prop: 'projectInvestmentAmounts' },
        { name: '核准日期', prop: 'projectInvestmentAmounts' },
        { name: '组织机构代码', prop: 'projectInvestmentAmounts' },
        { name: '工商注册号', prop: 'projectInvestmentAmounts' },
        { name: '纳税人识别号', prop: 'projectInvestmentAmounts' },
        { name: '企业类型', prop: 'projectInvestmentAmounts' },
        { name: '营业期限', prop: 'projectInvestmentAmounts' },
        { name: '纳税人资质', prop: 'projectInvestmentAmounts' },
        { name: '所属地区', prop: 'projectInvestmentAmounts' },
        { name: '登记机关', prop: 'projectInvestmentAmounts' },
        { name: '人员规模', prop: 'projectInvestmentAmounts' },
        { name: '参保人数', prop: 'projectInvestmentAmounts' },
        { name: '经营范围', prop: 'projectInvestmentAmounts', style: true }
      ],
      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;
  border-radius: 4px;
  .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;
      }
    }
  }
}
</style>
