<template>
  <el-form :model="reviewForm" :rules="rules" ref="ruleForm" label-width="90px">
    <el-form-item label="审核结果" prop="result">
      <el-select v-model="reviewForm.result" placeholder="请选择审核结果" size="small" style="width:100%;">
        <el-option label="通过" :value="1"></el-option>
        <el-option label="不通过" :value="0"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="审核评审" prop="text">
      <el-input v-model="reviewForm.text" type="textarea" size="small" rows="4" placeholder="请输入审核评审"/>
    </el-form-item>
    <el-form-item>
      <el-button size="mini" @click="$emit('dialogClose')">取消</el-button>
      <el-button type="primary" @click="handleReviewSubmit" size="mini">提交</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
export default {
  data() {
    return {
      reviewForm: {
        result: '',
        text: ''
      },
      rules: {
        result: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
        text: [{ required: true, message: '请输入审核评审', trigger: 'blur' }]
      }
    }
  },
  methods: {
    handleReviewSubmit() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          this.$emit('reviewSubmit', this.reviewForm)
        }
      });
    }
  }
}
</script>