<template>
  <div class="page-com">
    <!-- <block-header :title="title"></block-header> -->
    <table class="table">
      <tr>
        <td>申请日期:</td>
        <td>{{ loanModel.gmtCreated | dateFilter }}</td>
        <td>放款日期:</td>
        <td>{{ loanModel.raiseDate | dateFilter }}</td>
        <td>项目名称:</td>
        <td>{{ loanModel.productNameStr }}</td>
        <!-- <el-table-column align="center" prop="productName" label="产品名称" :formatter="productNameFormat"></el-table-column> -->
      </tr>
      <tr>
        <td>总应还金额:</td>
        <td>{{ loanModel.loanAmt }}</td>
        <td>申请期数:</td>
        <td>{{ loanModel.loanLimit }}</td>
        <td>
          <span v-if="loanModel.cardBankAccount">放款银行卡（所属银行）:</span>
          <span v-else>放款银行卡（所属银行）</span>
        </td>
        <td>
            <span v-if="loanModel.cardBankAccount">{{ loanModel.cardBankAccount }}（{{
                loanModel.cardBankCodeStr
              }}）</span>
          <span v-else>{{ loanModel.bankAccount }}</span>
        </td>
      </tr>
      <tr>
        <td>本金:</td>
        <td>{{ loanModel.raiseAmt }}</td>
        <td>总服务费:</td>
        <td>{{ loanModel.serviceAmt }}</td>
        <td>总利息:</td>
        <td>{{ loanModel.rateAmt }}</td>
      </tr>
      <tr>
        <td>总手续费:</td>
        <td colspan="5">{{ loanModel.accountAmt }}</td>
      </tr>
    </table>
  </div>
</template>

<script>
import * as moment from "moment";

export default {
  name: 'AddUserServiceDialog',
  props: {
    title: {
      type: String,
      required: false,
    },
    params: {
      type: Object,
      required: true
    },
  },
  data() {
    return {
      loanModel: {}
    }
  },
  filters: {
    dateFilter: function (row) {
      const exp = row;
      if (!exp || typeof (exp) === undefined || typeof (exp) === null) {
        return ''
      }
      return moment(exp).format("YYYY-MM-DD")
    },
  },
  async created() {
    if(this.params){
      const {applyVo} = this.params;
      this.loanModel = applyVo;
      this.productNameFormat(this.loanModel.productName);
    }
  },

  methods: {
    headerStyle() {
      return "tableHeaderStyle";
    },
     //产品名称
   productNameFormat: function (row) {
     if(this.loanModel!=null){
       this.loanModel.productName=this.$enumUtils.toMsg('BusinessType', row)
     }

    },
  }
}
</script>

<style>

</style>
