<template>
  <div class="detail-container">
    <head-form
      title="专项债项目"
      :form-data="formData"
      :query-params="queryParams"
      :total="tableDataTotal"
      :isExcel="true"
      @handle-search="handleSearch"
    />

    <tables
      :indexFixed="true"
      :tableLoading="tableLoading"
      :tableData="tableData"
      :forData="forData"
      :tableDataTotal="tableDataTotal"
      :queryParams="queryParams"
      @handle-current-change="handleCurrentChange"
    >
      <template slot="porjectName" slot-scope="scope">
        <router-link to="" tag="a" class="a-link">{{ scope.row.porjectName }}</router-link>
      </template>
    </tables>

  </div>
</template>

<script>
import mixin from '../mixins/mixin'
import { getList } from '@/api/detail/party-a/opport'
export default {
  name: 'Bond',
  props: ['companyId'],
  mixins: [mixin],
  components: {
  },
  data() {
    return {
      queryParams: {
        companyId: this.companyId,
        pageNum: 1,
        pageSize: 10
      },
      forData: [
        {label: '项目名称', prop: 'porjectName', minWidth: '300', slot: true},
        {label: '项目总投资（亿元）', prop: 'use', sortable: true, width: '150'},
        {label: '项目资本金（亿元）', prop: 'type', sortable: true, width: '150'},
        {label: '项目收益倍数（倍）', prop: 'way', sortable: true, width: '150'},
        {label: '专项债金额（亿元）', prop: 'state', sortable: true, width: '150'},
        {label: '专项债用作资本金（亿元）', prop: 'money', sortable: true, width: '200'}
      ],
      formData: [
        { type: 3, fieldName: 'keys', value: '', placeholder: '输入项目名称关键词查询', options: []},
      ],
      //列表
      tableLoading:false,
      tableData:[],
      tableDataTotal:0
    }
  },
  computed: {
  },
  created() {
    this.handleQuery()
  },
  methods: {
    handleQuery(params) {
      this.tableLoading = true
      let param = params?params:this.queryParams
      getList(param).then((res) => {
        this.tableLoading = false
        this.tableData = [
          {
            projectId: '1',
            porjectName:'滨州医学院口腔医学大楼铝合金门窗供货及安装',
            use:'城镇住宅用地',
            type:'房地产业',
            way:'挂牌出让',
            state:'重庆',
            money:'11234万元',
            scale:'222平米',
            unit:'江苏省住房和城乡建设厅',
            date:'2015-08-06',
          }
        ]
        this.tableDataTotal = 100
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.detail-container{
  background: #ffffff;
  border-radius: 4px;
  padding: 16px;
}
</style>
