<template>
  <el-form :model="form" :rules="rules" ref="ruleForm" label-width="90px">
    <el-form-item label="审核结果" prop="audit_status">
      <el-select v-model="form.audit_status" placeholder="请选择审核结果" size="small" style="width:100%;">
        <el-option label="通过" :value="2"></el-option>
        <el-option label="驳回" :value="3"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="审核评审" prop="audit_remarks">
      <el-input v-model="form.audit_remarks" 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="handleSubmit" size="mini">提交</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
export default {
  data() {
    return {
      form: {
        audit_status: '',
        audit_remarks: ''
      },
      rules: {
        audit_status: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
        audit_remarks: [{ required: true, message: '请输入审核评审', trigger: 'blur' }]
      }
    }
  },
  methods: {
    handleSubmit() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          this.$emit('auditSubmit', this.form)
        }
      });
    }
  }
}
</script>