<template>
  <div class="corePersonnel">
    <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"
    />

  </div>
</template>

<script>
import {
  landTransactionPage,
  landUse
} from '@/api/detail/party-a/urbanLnvestment'
import mixin from '../mixins/mixin'
export default {
  name: 'landAcquisition',
  mixins: [mixin],
  components: {

  },
  data() {
    return {
      queryParams: {
        cid: 3068,
        sort: 3,
        pageNum: 1,
        pageSize: 10
      },
      forData: [
        {label: '项目名称', prop: 'punishReason', width: '508'},
        {label: '土地用途', prop: 'punishBegin', width: '120'},
        {label: '行业分类', prop: 'punishResult', width: '120'},
        {label: '供地方式', prop: 'fileNum', width: '120'},
        {label: '土地坐落', prop: 'cgrdm', width: '120'},
        {label: '成交金额（万元）', prop: 'office', width: '130'},
        {label: '总面积（㎡）', prop: 'dataId', width: '120'},
        {label: '批准单位', prop: 'dataId', width: '120'},
        {label: '签订日期', prop: 'dataId', width: '120'}
      ],
      formData: [
        { type: 4, fieldName: 'landUse', value: [], placeholder: '土地用途', options: []},
        { type: 3, fieldName: 'keys', value: '', placeholder: '请输入关键词', options: []},
      ],
      //列表
      tableLoading:false,
      tableData:[],
      tableDataTotal:0,
    }
  },
  created() {
    this.getList()
    this.getlandUse()
  },
  computed: {

  },
  methods: {
    getList() {
      this.tableLoading = true
      landTransactionPage(this.queryParams).then(res=>{
        this.tableData = res.data
        this.tableDataTotal = res.data.total
        this.tableLoading = false
      })
    },
    handleQuery(params) {
      console.log(params)
    },
    //土地用途
    getlandUse(){
      landUse({cid: this.queryParams.cid}).then(res=>{
        console.log(res)
        // this.formData[0].options = res.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.corePersonnel{
  background: #ffffff;
  border-radius: 4px;
  padding: 16px;
  .query-box{
    margin: 10px 0 20px;
  }
}
</style>
