<script setup lang="ts">
import { ElForm } from "element-plus";
import { reactive } from "vue";
import { audit_rules } from "../../config/rules";
import { useAudit } from "../../hooks/use-audit";

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

const { handleAudit, formRef } = useAudit(() =>
  emit("changeStatus", formData.status)
);
const formData = reactive({
  status: ""
});
</script>
<template>
  <h1 text-xl font-bold py-2>财务审核</h1>
  <el-form ref="formRef" :model="formData" :rules="audit_rules">
    <el-form-item label="审核状态" prop="status">
      <div flex justify-between w-full>
        <el-select placeholder="请选择审核状态" v-model="formData.status">
          <el-option label="通过" value="3" />
          <el-option label="不通过" value="6" />
        </el-select>

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