<script setup lang="ts">
import { useReviewProcess } from "/@/hooks";

const emit = defineEmits(["changeStatus"]);

const process_status = {
  successStatus: "7",
  failstatus: "12"
};

const { formRef, formRules, formData, handleChangeStatus } = useReviewProcess({
  callback: () => emit("changeStatus", formData),
  failStatus: process_status.failstatus
});
</script>

<template>
  <el-form
    ref="formRef"
    :rules="formRules"
    :model="formData"
    label-width="100px"
    justify-between
    inline
    flex
  >
    <div flex flex-col style="width: 50%">
      <el-form-item label="审核状态" prop="status">
        <el-select placeholder="请选择审核状态" v-model="formData.status">
          <el-option :value="process_status.successStatus" label="通过" />
          <el-option :value="process_status.failstatus" label="不通过" />
        </el-select>
      </el-form-item>

      <el-form-item label="备注" prop="remark">
        <el-input
          type="textarea"
          :maxlength="2000"
          :rows="5"
          placeholder="请输入备注"
          v-model="formData.remark"
        />
      </el-form-item>
    </div>

    <el-button type="primary" @click="handleChangeStatus"
      >提交审核结果</el-button
    >
  </el-form>
</template>
