<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'
import {getList} from "@/api/detail/party-a/overview";
export default {
  name: 'Businfo',
  props: ['companyId'],
  components: {
    InfoTable
  },
  mixins: [mixin],
  data() {
    return {
      activeName: 'first',
      queryParams: {
        cid: this.companyId,
        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.handleQuery()
  },
  methods: {
    handleClick(){
      this.handleQuery()
    },
    handleQuery() {
      console.log('索引：',this.activeName)
      this.tableLoading = true
      getList(this.queryParams).then((res) => {
        this.tableLoading = false
        this.tableData = [
          {
            projectId: '1',
            tag: '在业',
            projectName:'滨州医学院口腔医学大楼铝合金门窗供货及安装',
            use:'城镇住宅用地',
            type:'房地产业',
            way:'挂牌出让',
            state:'重庆',
            money:'11234万元',
            scale:'222平米',
            unit:'江苏省住房和城乡建设厅',
            date:'2015-08-06',
          }
        ]
        this.tableDataTotal = 100
      })
    }
  }
}
</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>
