<template>
  <div class="acceptance-adjust-review">
    <div style="min-height: auto; padding: 0px 20px ">
      <cy-info-title>审批结论</cy-info-title>
      <el-form ref="ruleForm" :model="ruleForm" label-width="150px" label-position="top" class="rule-form-orange">
        <el-form-item label="审批结论：" prop="approvalConclusion">
          <el-radio-group v-model="ruleForm.approvalConclusion">
            <el-radio label="pass" disabled>通过</el-radio>
            <el-radio label="back" disabled>退回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          label="审批意见："
          style="width: 100%;"
          class="textarea-content"
          prop="approvalComment"
          :rules="[
            { required: ruleForm.approvalConclusion === 'back' || ruleForm.approvalConclusion === 'veto', message: '请输入审批意见', trigger: 'blur' }
          ]"
        >
          <el-input v-model="ruleForm.approvalComment" type="textarea" style="width: 100%;" rows="3" disabled></el-input>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script >
export default {
  name: 'AcceptanceAdjustReview',
  props: {
    detailsInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ruleForm: {
        approvalConclusion: '',
        approvalComment: ''
      }
    }
  },
  watch: {
    detailsInfo: {
      handler(newV) {
        if (newV && Object.keys(newV).length) {
          const {
            approvalConclusion,
            approvalComment
          } = JSON.parse(JSON.stringify(newV))

          this.ruleForm = { approvalConclusion, approvalComment }
        }
      },
      immediate: true,
      deep: true
    }
  }
}
</script>

  <style lang="scss" scoped>
    /* .template-examine .submit-btn {
      position: absolute;
      bottom: 40px;
      right: 40px;
    } */
  </style>
