<template>
  <div class="assess">
    <el-form ref="ruleForm" :model="ruleForm" label-position="top" label-width="120px" class="rule-form-orange">
      <el-form-item label="评估意见" prop="evaluationOpinions" class="one-form-item">
        <el-input v-model="ruleForm.evaluationOpinions" placeholder="请输入评估意见" />
      </el-form-item>
      <el-form-item label="是否准入" prop="admitted" class="one-form-item">
        <el-input v-model="ruleForm.admitted" placeholder="请输入是否准入" />
      </el-form-item>
      <el-form-item label="核心企业-固定额度评估得分" prop="fixedCreditScore" class="one-form-item">
        <el-input v-model="ruleForm.fixedCreditScore" placeholder="请输入核心企业-固定额度评估得分" />
      </el-form-item>
      <el-form-item label="核心企业-专项额度评估得分" prop="specialQuotaScore" class="one-form-item">
        <el-input v-model="ruleForm.specialQuotaScore" placeholder="请输入核心企业-专项额度评估得分" />
      </el-form-item>
      <el-form-item label="核心企业-固定额度" prop="fixedCredit" class="one-form-item">
        <el-input v-model="ruleForm.fixedCredit" placeholder="请输入核心企业-固定额度" />
      </el-form-item>
      <el-form-item label="核心企业-专项额度" prop="specialQuota" class="one-form-item">
        <el-input v-model="ruleForm.specialQuota" placeholder="请输入核心企业-专项额度分" />
      </el-form-item>
      <el-form-item label="授信总额度（万元）" prop="creditLimit" class="one-form-item">
        <el-input v-model="ruleForm.creditLimit" placeholder="请输入授信总额度（万元）" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    details: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ruleForm: {
        evaluationOpinions: '',
        admitted: '',
        fixedCreditScore: '',
        specialQuotaScore: '',
        fixedCredit: '',
        specialQuota: '',
        creditLimit: ''
      }
    }
  },
  watch: {
    details: {
      handler(newV) {
        if (newV && Object.keys(newV)) {
          const details = JSON.parse(JSON.stringify(newV))
          console.log(details)
          for (const k in this.ruleForm) {
            if (details[k] !== '' && details[k] !== null && details[k] !== undefined) {
              this.ruleForm[k] = details[k]
            }
          }
          console.log(this.ruleForm)
        }
      },
      immediate: true,
      deep: true
    }
  }
}
</script>

<style lang="scss" scoped>
.assess {
padding: 10px 15px;
}
</style>
