From 76d1df235de0270dd7663fc5fbd6e0fb127983f9 Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Fri, 19 Dec 2025 00:36:13 +0900 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=B2=D1=8F=D0=B7=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D1=8B=20=D0=BA=20?= =?UTF-8?q?=D1=81=D0=BC=D0=B5=D0=BD=D0=B5=20=D1=81=D1=82=D0=B0=D1=82=D1=83?= =?UTF-8?q?=D1=81=D0=B0=20=D0=B8=D0=B7=20=D0=BC=D0=BE=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BE=D0=BA=D0=BE=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Home/ArchiveHistoryModal/Index.vue | 24 ++++++++++++----- .../Home/ArchiveHistoryMoveModal/Index.vue | 2 +- resources/js/Pages/Home/DataTable/Index.vue | 26 ++++++++++++++++--- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue b/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue index 4dd6988..6d2fc72 100644 --- a/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue +++ b/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue @@ -45,7 +45,7 @@ const loadPatientData = async () => { loading.value = true try { - axios.get(`/api/si/patients/${props.patientId}?view_type=${filtersRef.value.view_type}`).then(res => { + await axios.get(`/api/si/patients/${props.patientId}?view_type=${filtersRef.value.view_type}`).then(res => { patient.value = res.data patientData.value = res.data.info archiveInfo.value = res.data.archiveInfo ?? { @@ -109,8 +109,15 @@ const rowProps = (row) => ({ } }) -const onUpdateHistory = (updatedData) => { - loadPatientData() +const onUpdateHistory = async ({data}) => { + await loadPatientData() + const updatedData = { + status: archiveInfo.value.status, + } + emits('historyUpdated', { + data: updatedData, + patientId: props.patientId + }) } const hasCreateNew = computed(() => archiveInfo.value === null) @@ -119,11 +126,14 @@ const onSubmit = async () => { try { await axios.post(`/api/archive/histories/info/${props.patientId}`, archiveInfo.value).then(res => { // onCloseWithoutSave() + const updatedData = { + status: archiveInfo.value.status, + } emits('historyUpdated', { - type: hasCreateNew.value ? 'created' : 'updated', - data: res.data, + data: updatedData, patientId: props.patientId }) + open.value = false }) } catch (error) { @@ -134,9 +144,9 @@ const onSubmit = async () => { } // Наблюдаем за изменением patientId -watch(() => props.patientId, (newId) => { +watch(() => props.patientId, async (newId) => { if (newId) { - loadPatientData() + await loadPatientData() } }, { immediate: true }) diff --git a/resources/js/Pages/Home/ArchiveHistoryMoveModal/Index.vue b/resources/js/Pages/Home/ArchiveHistoryMoveModal/Index.vue index 3170c35..d89c1fb 100644 --- a/resources/js/Pages/Home/ArchiveHistoryMoveModal/Index.vue +++ b/resources/js/Pages/Home/ArchiveHistoryMoveModal/Index.vue @@ -73,12 +73,12 @@ const submit = () => { : `/api/archive/histories/move/${archiveHistory.value.id}` axios.post(url, archiveHistory.value).then(res => { - onCloseWithoutSave() emits('historyUpdated', { type: props.isCreateNew ? 'created' : 'updated', data: res.data, historyId: archiveHistory.value.id }) + onCloseWithoutSave() }) } catch (error) { diff --git a/resources/js/Pages/Home/DataTable/Index.vue b/resources/js/Pages/Home/DataTable/Index.vue index 39ca734..9ade34a 100644 --- a/resources/js/Pages/Home/DataTable/Index.vue +++ b/resources/js/Pages/Home/DataTable/Index.vue @@ -1,6 +1,6 @@