<template>
  <div class="detail-container">
    <head-form
      title="开标记录"
      :form-data="formData"
      :query-params="queryParams"
      :total="tableDataTotal"
      :isExcel="true"
    />

    <tables
      :indexFixed="true"
      :tableLoading="tableLoading"
      :tableData="tableData"
      :forData="forData"
      :tableDataTotal="tableDataTotal"
      :queryParams="queryParams"
      @handle-current-change="handleCurrentChange"
    >
      <template slot="customName" slot-scope="scope">
        <router-link to="" tag="a" class="a-link" v-if="scope.row.customId&&scope.row.customName">{{ scope.row.customName }}</router-link>
        <div v-else>{{ scope.row.customName || '--' }}</div>
      </template>
      <template slot="use" slot-scope="scope">
        <router-link to="" tag="a" class="a-link" v-if="scope.row.useId&&scope.row.use">{{ scope.row.use }}</router-link>
        <div v-else>{{ scope.row.use || '--' }}</div>
      </template>
    </tables>
  </div>
</template>

<script>
import mixin from '../mixins/mixin'
import { getList } from '@/api/detail/party-a/dealings'
export default {
  name: 'Bidrecords',
  props: ['companyId'],
  mixins: [mixin],
  components: {

  },
  data() {
    return {
      queryParams: {
        cid: this.companyId,
        pageNum: 1,
        pageSize: 10
      },
      forData: [
        {label: '招标代理单位名称', prop: 'customName', minWidth: '320', slot: true},
        {label: '本企业投标报价（万元）', prop: 'way', minWidth: '160'},
        {label: '发布日期', prop: 'way', minWidth: '100'},
        {label: '中标地区', prop: 'way', minWidth: '160'},
        {label: '信息来源', prop: 'use', minWidth: '280', slot: true}
      ],
      formData: [],
      //列表
      tableLoading:false,
      tableData:[],
      tableDataTotal:0
    }
  },
  computed: {
  },
  created() {
    this.handleQuery()
  },
  methods: {
    handleQuery() {
      this.tableLoading = true
      getList(this.queryParams).then((res) => {
        this.tableLoading = false
        this.tableData = [
          {
            customId: '1',
            customName:'滨州医学院口腔医学大楼铝合金门窗供货及安装',
            use:'城镇住宅用地',
            type:'房地产业',
            way:'挂牌出让',
            count:4
          }
        ]
        this.tableDataTotal = 100
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.detail-container{
  background: #ffffff;
  border-radius: 4px;
  padding: 16px;
}
</style>
