<template>
  <CyDialog title="传染病上报"
            fullScreen
            ignore-error
            :confirm-click="confirm"
            confirm-text="保存"
  >
    <div v-if="props.prompt">
      <el-alert :title="`诊断：${props.prompt}为传染病填写后才能保存病历`" type="error" effect="dark"/>
    </div>
    <dialog-diseases :pat-no="props.patNo"
                     :times="props.times"
                     ref="dialogRef"/>
  </CyDialog>
</template>

<script setup lang="ts">
import DialogDiseases from "./DialogDiseases.vue";
import {ref} from 'vue'
import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";

export declare type PropsType = {
  patNo: string,
  times: number,
  prompt?: string
}

const props = defineProps<PropsType>()
const dialogRef = ref(null)

const confirm = async () => {
  await dialogRef.value.confirm()
}
</script>

<style scoped lang="scss">

</style>
