Compare commits

..

2 Commits

Author SHA1 Message Date
brusnitsyn
3f9d7fe30b Добавлен onCloseWithoutSave при нажатии на закрыть 2025-12-19 00:40:52 +09:00
brusnitsyn
cc10b54ece Реализация onCloseWithoutSave 2025-12-19 00:40:19 +09:00
2 changed files with 8 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ const archiveInfo = ref({
post_in: null,
status: null
})
const emits = defineEmits(['historyUpdated'])
const emits = defineEmits(['historyUpdated', 'closeWithoutSave'])
const onResetData = () => {
archiveInfo.value = {
@@ -35,6 +35,10 @@ const onResetData = () => {
}
}
const onCloseWithoutSave = () => {
emits('closeWithoutSave')
open.value = false
}
const patientData = ref({
...patient.value.info
@@ -152,7 +156,7 @@ watch(() => props.patientId, async (newId) => {
</script>
<template>
<NModal v-model:show="open" preset="card" class="max-w-4xl" closable @close="open = false">
<NModal v-model:show="open" preset="card" class="max-w-4xl" closable @close="onCloseWithoutSave">
<template #header>
{{ patient.info?.medcardnum }} {{ patient.info?.family }} {{ patient.info?.name }} {{ patient.info?.ot }}
</template>
@@ -180,7 +184,7 @@ watch(() => props.patientId, async (newId) => {
<template #action>
<NFlex justify="end" align="center">
<NSpace align="center" :size="0">
<NButton secondary>
<NButton secondary @click="onCloseWithoutSave">
Закрыть без сохранения
</NButton>
<NDivider vertical />

View File

@@ -99,7 +99,7 @@ watch(() => props.archiveHistoryId, async (newId) => {
</script>
<template>
<NModal v-model:show="open" preset="card" class="max-w-2xl" closable @close="open = false">
<NModal v-model:show="open" preset="card" class="max-w-2xl" closable @close="onCloseWithoutSave">
<template #header>
{{ archiveHistoryId === null ? 'Добавить' : 'Редактировать' }} запись выдачи
</template>