<template>
  <el-dialog
    v-model="dialogVisible"
    destroy-on-close
    width="600px"
    :close-on-click-modal="false"
    title="出院申请"
    @close="closeDialog"
  >
    <div style="padding: 0 80px">
      <el-form :model="form" :rules="rules" ref="formRef">
        <el-form-item label="出院方式">
          <el-select v-model="form.outpatientType">
            <el-option
              v-for="(item, index) in dscg_way"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="出院时间">
          <el-radio-group v-model="form.outpatientTime">
            <el-radio value="1">今日</el-radio>
            <el-radio value="2">明日</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="出院描述"
          ><el-input v-model="form.outpatientDescription" type="textarea" rows="5" />
        </el-form-item>
      </el-form>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="submitApplicationForm"> 确认 </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
const { proxy } = getCurrentInstance();
const { dscg_way } = proxy.useDict('dscg_way');
const dialogVisible = ref(false);
const form = reactive({
  outpatientType: [],
  outpatientTime: '',
  outpatientDescription: '',
});

function openDialog() {
  dialogVisible.value = true;
}

defineExpose({
  openDialog,
});
</script>