<template>
  <div class="basic-info">
    <cy-info-title style="margin-top: 10px;">授信基本信息</cy-info-title>
    <el-form
      :model="ruleForm"
      label-position="top"
      label-width="150px"
      class="rule-form-orange"
    >
      <el-form-item label="授信金额">
        <cy-amount-input v-model="ruleForm.creditAmount" disabled placeholder="请输入授信金额" />
      </el-form-item>
      <el-form-item label="币种">
        <el-input v-model="ruleForm.currency" disabled placeholder="请输入币种" />
      </el-form-item>
      <el-form-item label="业务类型">
        <el-input v-model="ruleForm.businessType" disabled placeholder="请输入业务类型" />
      </el-form-item>
      <el-form-item label="业务类型编号">
        <el-input v-model="ruleForm.businessTypeNo" disabled placeholder="请输入业务类型编号" />
      </el-form-item>
      <el-form-item label="授信主体">
        <el-input v-model="ruleForm.creditSubjectName" disabled placeholder="请输入授信主体" />
      </el-form-item>
      <el-form-item label="授信类型">
        <el-input v-model="ruleForm.creditType" disabled placeholder="请输入授信类型" />
      </el-form-item>
      <el-form-item label="授信生效日">
        <el-input v-model="ruleForm.creditStartDate" disabled placeholder="请输入授信生效日" />
      </el-form-item>
      <el-form-item label="授信到期日">
        <el-input v-model="ruleForm.creditEndDate" disabled placeholder="请输入授信到期日" />
      </el-form-item>
      <el-form-item label="银行利率/年">
        <cy-amount-input v-model="ruleForm.bankRate" :is-unit="true" unit-name="%" disabled placeholder="请输入银行利率/年" />
      </el-form-item>
      <el-form-item label="逾期利率/年">
        <cy-amount-input v-model="ruleForm.longbankOverdueInterestRate" :is-unit="true" unit-name="%" disabled placeholder="请输入逾期利率/年" />
      </el-form-item>
      <el-form-item label="适用产品">
        <el-input v-model="ruleForm.productName" disabled placeholder="请输入适用产品" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    detailsInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ruleForm: {
        creditAmount: '',
        currency: '',
        businessType: '',
        businessTypeNo: '',
        creditSubjectName: '',
        creditType: '',
        creditStartDate: '',
        creditEndDate: '',
        bankRate: '',
        longbankOverdueInterestRate: '',
        productName: ''
      }
    }
  },
  watch: {
    detailsInfo: {
      handler(newV) {
        if (newV && Object.keys(newV).length) {
          this.ruleForm = JSON.parse(JSON.stringify(newV))
          this.ruleForm.productName = this.ruleForm.productName.toString()
        }
      },
      immediate: true
      // deep: true
    }
  }
}
</script>

<style lang="scss" scoped>
.basic-info {

}

</style>
