<template>
  <div class="financing-goods">
    <cy-comm-table
      ref="commTable"
      :columns="columns"
      :data="tableData"
      :select-data="selectData"
      :count="0"
    />
  </div>
</template>

<script>
import { handleMoney } from '@/utils'
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    selectData: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      columns: [{
        type: 'selection'
      },
      {
        label: '序号',
        index: true
      },
      {
        label: '业务编号',
        prop: 'businessNumber',
        showTooltip: true
      },
      {
        label: '保理合同编号',
        prop: 'contractNo',
        showTooltip: true
      },
      {
        label: '支用批次',
        prop: 'quotaDisburseBatch',
        showTooltip: true
      },
      {
        label: '供应商名称',
        prop: 'supplierName',
        showTooltip: true
      },
      {
        label: '放款日期',
        prop: 'loanDate',
        showTooltip: true
      },
      {
        label: '放款金额',
        prop: 'loanAmount',
        showTooltip: true,
        render: (h, row) => {
          return <span> { handleMoney(row.loanAmount) }</span>
        }
      },
      {
        label: '待回款金额',
        prop: 'returnedAmount',
        showTooltip: true,
        render: (h, row) => {
          return <span> { handleMoney(row.returnedAmount) }</span>
        }
      }
      ]
    }
  },
  methods: {
    getData() {
      return this.$refs.commTable.multipleSelection
    }
  }
}
</script>

<style lang="scss" scoped>
.financing-goods {

}
</style>
