<template>
  <div class="income-plan">
    <cy-info-title>收支计划</cy-info-title>

    <cy-comm-table
      ref="commTable"
      style="margin-top: 10px; width: 100%"
      :columns="columns"
      :data="tableData"
      :count="0"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      columns: [],
      tableData: [
        {
          label: '序号',
          index: true
        },
        {
          label: '金额类型',
          render: (h, row) => {
            return (<div>{ this.getAmountType(row.type) }</div>)
          }
        },
        {
          label: '收放款类型',
          render: (h, row) => {
            return (<div>{ row.payType === 1 ? '收款' : '放款' }</div>)
          }
        },
        {
          label: '约定日期',
          prop: 'dateTime'
        },
        {
          label: '应收/付金额',
          prop: 'payBalance'
        },
        {
          label: '实收/付日期',
          prop: 'dateTime'
        },
        {
          label: '实收/付总金额',
          prop: 'dateTime'
        },
        {
          label: '宽限到期日',
          prop: 'dateTime'
        },
        {
          label: '状态',
          render: (h, row) => {
            return (<div>{ this.getAmountType(row.type) }</div>)
          }
        },
      ]
    }
  },
  methods: {
    getAmountType(type) {
      const map = {
        1: '本金',
        2: '管理费',
        3: '利息'
      }
      return type ? map[type] : ''
    }
  }
}
</script>

<style lang="scss" scoped></style>
