<template>
  <div class="corePersonnel">
    <head-form
      title="被执行人"
      :form-data="formData"
      :query-params="queryParams"
      :total="tableDataTotal"
      :isExcel="false"
      @handle-search="handleSearch"
    />
    <skeleton v-if="isSkeleton" style="padding: 16px"></skeleton>
    <tables
      v-if="!isSkeleton"
      :tableData="tableData"
      :forData="forData"
      :tableDataTotal="tableDataTotal"
      :queryParams="queryParams"
      @handle-current-change="handleCurrentChange"
    />

  </div>
</template>

<script>
import {
  executedPersonsPage
} from '@/api/detail/party-a/riskInformation'
import mixin from '../mixins/mixin'
import skeleton from '../component/skeleton'
export default {
  name: 'IfThePerson',
  mixins: [mixin],
  components: {
    skeleton
  },
  props: ['companyId'],
  data() {
    return {
      queryParams: {
        cid: this.companyId,//194738907
        pageNum: 1,
        pageSize: 20
      },
      forData: [
        {label: '执行标的（元）', prop: 'amount', width: '140'},
        {label: '案号', prop: 'caseNumber', width: '320'},
        {label: '执行法院', prop: 'court'},
        {label: '立案日期', prop: 'caseDate', width: '95'}
      ],
      formData: [
        { type: 2, fieldName: 'time', value: '', placeholder: '执行时间',startTime: 'dateFrom',endTime: 'dateTo', options: []}
      ],
      //列表
      tableLoading:false,
      tableData:[],
      tableDataTotal:0,
      isSkeleton:true
    }
  },
  created() {
    this.handleQuery()
  },
  computed: {

  },
  methods: {
    handleQuery(params) {
      let data = params ? params : this.queryParams
      this.isSkeleton = true
      executedPersonsPage(data).then(res => {
        this.tableData = res.rows
        this.tableDataTotal = res.total
        this.isSkeleton = false
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.corePersonnel{
  background: #ffffff;
  border-radius: 4px;
  padding: 16px;
  .query-box{
    margin: 10px 0 20px;
  }
}
</style>
