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

View File

@@ -99,7 +99,7 @@ watch(() => props.archiveHistoryId, async (newId) => {
</script> </script>
<template> <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> <template #header>
{{ archiveHistoryId === null ? 'Добавить' : 'Редактировать' }} запись выдачи {{ archiveHistoryId === null ? 'Добавить' : 'Редактировать' }} запись выдачи
</template> </template>