<template>
  <div class="page-com">
    <!-- <block-header :title="title"></block-header> -->
    <el-table
        border
        size="mini"
        :highlight-current-row="true"
        :header-row-class-name="headerStyle"
        :data="data"
        stripe
        style="width: 100%;">
      <el-table-column prop="contractName" align="center" label="合同类型"></el-table-column>
      <el-table-column prop="contractUrl" align="center" label="下载">
        <template slot-scope="scope">
          <a :href="scope.row.contractUrl" target="_blank" class="buttonText">合同下载</a>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'RiskInfo',
  props: {
    title: {
      type: String,
      required: false,
    },
    params: {
      type: Object,
      required: true
    },
  },
  data() {
    return {
      form: {
        current: 1,
        size: 1000,
        riskType: "",
        certNo: "",
        endDate: "",
        startDate: ""
      },
      data: []
    }
  },
  async created() {
    const {loanNo} = this.params;
    await this.init(loanNo)
  },
  methods: {
    headerStyle() {
      return "tableHeaderStyle";
    },
    async init(loanNo) {
      const res = await this.$$get('/loan/contract?loanNo=' + loanNo);
      const {success, result} = res.data;
      if (success && result !== null) {
        this.data = result.result;
      }
    },
    handleClose() {
      this.$emit("handleClose");
    }
  }
}
</script>

<style>

</style>
