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

<script>
import { handleMoney } from '@/utils'
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    selectData: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      columns: [{
        type: 'selection',
        single: false
      },
      {
        label: '序号',
        index: true
      },
      {
        label: '验收单货物编号',
        prop: 'acceptanceGoodsNumber',
        showTooltip: true
      },
      {
        label: '结算单编号',
        prop: 'settlementNumber',
        showTooltip: true
      },
      {
        label: '预计/结算日期',
        prop: 'loanDate',
        showTooltip: true
      },
      {
        label: '供应商名称',
        prop: 'supplierName',
        showTooltip: true
      },
      {
        label: '待分配金额',
        prop: 'toAssignedAmount',
        showTooltip: true,
        render: (h, row) => {
          return <span> { handleMoney(row.toAssignedAmount) }</span>
        }
      },
      {
        label: '验收状态',
        prop: 'acceptanceStatus',
        showTooltip: true
      },
      {
        label: '结算状态',
        prop: 'settlementStatus',
        showTooltip: true
      },
      {
        label: '开票状态',
        prop: 'invoiceStatus',
        showTooltip: true
      }
      ]
    }
  },

  methods: {
    getData() {
      return this.$refs.commTable.multipleSelection
    }
  }
}
</script>

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

}
</style>
