recordLending.vue 4.63 KB
<template>
  <div>
    <a-card title="放款记录" :bordered="false">
      <a-table ref="table" size="middle" bordered :columns="columns" :rowKey="record => record.id" :dataSource="dataList" :pagination="false" :loading="loading" :scroll="{x:1400}" style="padding-bottom:30px;">
        <!-- 字符串超长截取省略号显示-->
        <span slot="esContent" slot-scope="text">
          <j-ellipsis :value="text" :length="10" />
        </span>
        <span slot="action" slot-scope="text, record">
          <a-button
            type="link"
            size="small"
            @click="handleDetailLook(record)"
            icon="search"
            style="font-size: 12px"
            >查看</a-button
          >
        </span>
      </a-table>
    </a-card>
    <record-lending-detail-modal ref="recordLendingDetailModal"></record-lending-detail-modal>
  </div>
</template>

<script>
import { queryRemitRecordList, personalQueryApplyInfo, enterpriseQueryApplyInfo, legalQueryApplyInfo, remitRecord } from '@/api/makeLoan'
import recordLendingDetailModal from './recordLendingDetailModal';
export default {
  name: 'recordLending',
  props: {
    orderNo: {
      type: String,
      default: null
    },
    userType: {
      type: Number,
      default: null
    }
  },
  components: {
    recordLendingDetailModal
  },
  data () {
    return {
      dataList: [],
      loading: false,
      dbPaymentWay: JSON.parse(sessionStorage.getItem('DB_PAYMENT_WAY')), // 放款方式
      dbRemitApplyStatus: JSON.parse(sessionStorage.getItem('DB_REMIT_APPLY_STATUS')), // 放款状态
      dbFund: JSON.parse(sessionStorage.getItem('DBFUND')), // 资金方
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '借款订单号',
          align: 'center',
          dataIndex: 'orderNo'
        },
        {
          title: '放款时间',
          align: 'center',
          dataIndex: 'paymentSuccessTime'
        },
        {
          title: '放款方式',
          align: 'center',
          dataIndex: 'paymentWay',
          customRender: (t, r, index) => {
            for (var i = 0; i < this.dbPaymentWay.length; i++) {
              if (t === Number(this.dbPaymentWay[i].name)) {
                return this.dbPaymentWay[i].title
              }
            }
          }
        },
        {
          title: '放款金额(元)',
          align: 'center',
          dataIndex: 'remitPrincipal'
        },
        {
          title: '放款编号(流水号)',
          align: 'center',
          dataIndex: 'remitNo'
        },
        {
          title: '放款状态',
          align: 'center',
          dataIndex: 'status',
          customRender: (t, r, index) => {
            for (var i = 0; i < this.dbRemitApplyStatus.length; i++) {
              if (t === Number(this.dbRemitApplyStatus[i].name)) {
                return this.dbRemitApplyStatus[i].title
              }
            }
          }
        },
        {
          title: '资金方',
          align: 'center',
          dataIndex: 'fundNo',
          customRender: (t, r, index) => {
            for (var i = 0; i < this.dbFund.length; i++) {
              if (t === this.dbFund[i].name) {
                return this.dbFund[i].title
              }
            }
          }
        },
        {
          title: '操作人',
          align: 'center',
          dataIndex: 'updateUser'
        },
        {
          title: '账单编号',
          align: 'center',
          dataIndex: 'billNo'
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: 'center',
          width: 120,
          fixed: 'right'
        }
      ],
    }
  },
  created () {
    console.log(this.userType)
  },
  methods: {
    loadData () {
      let _p = { "orderNo": this.orderNo }
      queryRemitRecordList(_p).then(res => {
        if (res.status.statusCode == 0) {
          this.dataList = res.result
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
    },
    handleDetailLook (record) {
      let _p = { "remitNo": record.remitNo }
      remitRecord(_p).then(res => {
        if (res.status.statusCode == 0) {
          this.$refs.recordLendingDetailModal.edit(res.result)
          this.$refs.recordLendingDetailModal.disableSubmit = true
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
    }
  }
}
</script>
<style>
</style>