<template>
  <div class="app-container detail-container">
    <head-form
      title="对外投资"
      :form-data="formData"
      :query-params="queryParams"
      :total="tableDataTotal"
      :isExcel="true"
      @handle-search="handleSearch"
    />

    <tables
      :tableLoading="tableLoading"
      :tableData="tableData"
      :forData="forData"
      :tableDataTotal="tableDataTotal"
      :queryParams="queryParams"
      @handle-current-change="handleCurrentChange"
    >
      <template slot="gqzb">
        <div class="tab-header">股权占比 <el-popover
            placement="top-start"
            width="280"
            trigger="hover">
          <div>
            控股67%：绝对控制权67%，相当于100%的权力，修改公司章程/分立、合并、变更主营项目、重大决策<br />
            控股51%：相对控制权51%，控制线，绝对控制公司<br />
            控股34%：安全控制权，一票否决权</div>
            <img src="@/assets/images/detail/overview/zbph_question.png" slot="reference">
          </el-popover></div>
      </template>
      <template slot="inReason" slot-scope="scope">
        <router-link to="" tag="a" class="a-link">{{scope.row.inReason}}</router-link>
        <div class="tags" v-if="scope.row.tag">
          <span class="tag style1">{{scope.row.tag}}</span>
          <span class="tag style1">{{scope.row.tag}}</span>
        </div>
      </template>
    </tables>
  </div>
</template>

<script>
import mixin from '../mixins/mixin'
export default {
  name: 'Overseas',
  props: ['companyId'],
  mixins: [mixin],
  data() {
    return {
      queryParams: {
        cid: 6034,
        pageNum: 1,
        pageSize: 10
      },
      forData: [
        {label: '被投资企业名称', prop: 'inReason', slot: true},
        {label: '法定代表人', prop: 'inDate'},
        {label: '注册资本（万元）', prop: 'department'},
        {label: '成立日期', prop: 'department'},
        {label: '股权占比', prop: 'department', slotHeader: true, slotName: 'gqzb'},
        {label: '认缴出资额（万元）', prop: 'department'}
      ],
      formData: [
        { type: 1, fieldName: 'zbgg', value: '', placeholder: '招标公告',
          options: [
            { name: '招标公告类别1', value: '1' },
            { name: '招标公告类别2', value: '2' },
            { name: '招标公告类别3', value: '3' },
            { name: '招标公告类别4', value: '4' }
          ]
        },
        { type: 1, fieldName: 'gqzb', value: '', placeholder: '股权占比',
          options: [
            { name: '股权占比类别1', value: '1' },
            { name: '股权占比类别2', value: '2' },
            { name: '股权占比类别3', value: '3' },
            { name: '股权占比类别4', value: '4' }
          ]
        }
      ],
      //列表
      tableLoading:false,
      tableData:[],
      pageIndex:1,
      pageSize:10,
      tableDataTotal:0,
    }
  },
  created() {
    this.handleData()
  },
  methods: {
    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;
  .tab-header{
    img{
      margin-bottom: -3px;
      width: 14px;
      height: 14px;
      cursor: pointer;
    }
  }
  .tags{
    .tag{
      display: inline-block;
      border-radius: 2px;
      padding: 1px 7px;
      margin: 4px 8px 0 0;
      &.style1{
        background: #E4F3FD;
        color: #41A1FD;
      }
    }
  }
}
</style>
