<script lang="ts" setup name="Manage-Box">
import { ref } from 'vue'
import type { Ref } from 'vue'
const props = defineProps({
  applyShow: {
    type: Boolean,
    default: false,
  },
})
const emit = defineEmits(['applyListSubmit', 'handleClose']) // 关闭
interface IapplyList {
  select: string
  epilog: string
  approval: string
  approvalTime: string
}
const applyList: Ref<IapplyList> = ref({})
const handleClose = () => {
  emit('handleClose')
}
const applyListSubmit = () => {
  emit('applyListSubmit', applyList.value)
}
</script>

<template>
  <el-dialog
    v-model="props.applyShow"
    title="审批操作"
    width="50%"
    :before-close="handleClose"
  >
    <el-form
      ref="addPersonListForm"
      label-position="left"
      label-width="100px"
      :model="applyList"
    >
      <el-row :gutter="24">
        <el-col :span="24">
          <el-form-item label="审批意见:">
            <el-radio-group v-model="applyList.select" class="ml-4">
              <el-radio label="1" size="large">
                同意
              </el-radio>
              <el-radio label="2" size="large">
                驳回
              </el-radio>
              <el-radio label="3" size="large">
                拒绝
              </el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="24">
        <el-col :span="24">
          <el-form-item label="审批结论:">
            <el-input
              v-model="applyList.epilog"
              :rows="4"
              show-word-limit
              type="textarea"
            />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="24">
        <el-col :span="12">
          <el-form-item label="审批人:">
            <el-input
              v-model="applyList.approval"
              placeholder="审批人"
              disabled
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="审批时间:">
            <el-input
              v-model="applyList.approvalTime"
              style="width: 100%;"
              placeholder="审批时间"
              disabled
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button type="primary" @click="applyListSubmit">
        提交
      </el-button>
      <el-button type="info" @click="handleClose">
        取消
      </el-button>
    </template>
  </el-dialog>
</template>
