<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 { getOption, getList } from '@/api/detail/party-a/opport'
export default {
  name: 'Landtransaction',
  props: ['companyId'],
  mixins: [mixin],
  components: {
  },
  data() {
    return {
      queryParams: {
        cid: this.companyId,
        pageNum: 1,
        pageSize: 10
      },
      forData: [
        {label: '项目名称', prop: 'porjectName', minWidth: '300', slot: true},
        {label: '土地用途', prop: 'use', width: '130'},
        {label: '行业分类', prop: 'type', width: '100'},
        {label: '供地方式', prop: 'way', width: '100'},
        {label: '土地坐落', prop: 'state', width: '130'},
        {label: '成交金额（万元）', prop: 'money', sortable: 'custom', width: '140'},
        {label: '总面积（㎡）', prop: 'scale', sortable: 'custom', width: '130'},
        {label: '批准单位', prop: 'unit', width: '130'},
        {label: '签订日期', prop: 'date', width: '130'}
      ],
      formData: [
        { type: 1, fieldName: 'penalizeReasonType', value: '', placeholder: '土地用途', options: []},
        { type: 3, fieldName: 'keys', value: '', placeholder: '输入项目名称关键词查询', options: []}
      ],
      //列表
      tableLoading:false,
      tableData:[],
      tableDataTotal:0,
      showList:[],
    }
  },
  computed: {
  },
  created() {
    this.handleOption()
    this.handleQuery()
  },
  methods: {
    handleOption(){
      getOption().then((res) => {
        this.setFormData('penalizeReasonType', [
          { name: '类别1', value: '1' },
          { name: '类别2', value: '2' },
          { name: '类别3', value: '3' },
          { name: '类别4', value: '4' }
        ])
      })
    },
    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>
