<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="projectScore" class="one-form-item">
        <el-input v-model="ruleForm.projectScore" 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: {
        admitted: '',
        creditLimit: '',
        projectScore: '',
        evaluationOpinions: ''
      }
    }
  },
  watch: {
    details: {
      handler(newV) {
        if (newV && Object.keys(newV)) {
          const details = JSON.parse(JSON.stringify(newV))
          for (const k in this.ruleForm) {
            if (details[k] !== '' && details[k] !== null && details[k] !== undefined) {
              this.ruleForm[k] = details[k]
            }
          }
        }
      },
      immediate: true,
      deep: true
    }
  }
}
</script>

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