diff --git a/app/Http/Controllers/ArchiveInfoController.php b/app/Http/Controllers/ArchiveInfoController.php
index 19417c2..3b67dbb 100644
--- a/app/Http/Controllers/ArchiveInfoController.php
+++ b/app/Http/Controllers/ArchiveInfoController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
+use App\Http\Resources\ArchiveInfoResource;
use App\Models\ArchiveInfo;
use App\Models\Mis\SttMedicalHistory;
use Illuminate\Http\Request;
@@ -35,4 +36,26 @@ class ArchiveInfoController extends Controller
return $hasCreated;
}
+
+ public function check(Request $request)
+ {
+ $data = $request->validate([
+ 'id' => 'required',
+ ]);
+
+ $archive = ArchiveInfo::where('mis_history_id', $data['id'])
+ ->orWhere('foxpro_history_id', $data['id'])
+ ->first();
+
+ if (isset($archive)) {
+ return response()->json([
+ 'id' => $archive->mis_history_id ?? $archive->foxpro_history_id,
+ 'type' => $archive->mis_history_id ? 'mis' : 'foxpro',
+ ]);
+ }
+
+ return response()->json([
+ 'message' => 'Карты нет в архиве'
+ ])->setStatusCode(404);
+ }
}
diff --git a/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue b/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue
index 9755752..fcc93ed 100644
--- a/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue
+++ b/resources/js/Pages/Home/ArchiveHistoryCreateModal/Index.vue
@@ -1,15 +1,21 @@
@@ -126,17 +189,20 @@ const onSubmit = async (e) => {
:loading="loadingFilterPatients"
:options="filteredPatients"
v-model:value="archiveInfo.id"
+ @update:value="(val) => updateValueSearch(val)"
@search="handleSearchCard"
/>
-
+
@@ -147,6 +213,7 @@ const onSubmit = async (e) => {
type="primary"
attr-type="submit"
form="formAddToArchive"
+ :disabled="archiveCardStore.isSetPreOpenCard"
@click="onSubmit">
Добавить карту
diff --git a/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue b/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue
index 9f27e3a..f954b3b 100644
--- a/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue
+++ b/resources/js/Pages/Home/ArchiveHistoryModal/Index.vue
@@ -4,6 +4,7 @@ import ArchiveHistoryMoveModal from '../ArchiveHistoryMoveModal/Index.vue'
import {computed, ref, watch} from "vue";
import {useMedicalHistoryFilter} from "../../../Composables/useMedicalHistoryFilter.js";
import {useNotification} from "../../../Composables/useNotification.js";
+import {useArchiveCard} from "../../../Stores/ArchiveCard.js";
const open = defineModel('open')
const props = defineProps({
@@ -12,6 +13,7 @@ const props = defineProps({
}
})
+const archiveCardStore = useArchiveCard()
const {filtersRef} = useMedicalHistoryFilter()
const {errorApi} = useNotification()
const loading = ref(true)
@@ -96,17 +98,26 @@ const columns = [
{
title: 'Организация',
key: 'org',
- width: 220
+ width: 220,
+ ellipsis: {
+ tooltip: true
+ }
},
{
title: 'ФИО',
key: 'employee_name',
- width: 180
+ width: 180,
+ ellipsis: {
+ tooltip: true
+ }
},
{
title: 'Должность',
key: 'employee_post',
- width: 120
+ width: 120,
+ ellipsis: {
+ tooltip: true
+ }
},
]
const rowProps = (row) => ({
@@ -154,6 +165,7 @@ const onSubmit = async () => {
watch(() => props.patientInfo, async (newId) => {
if (newId) {
await loadPatientData()
+ archiveCardStore.isOpenArchiveCard = false
}
}, { immediate: true })
@@ -187,7 +199,7 @@ watch(() => props.patientInfo, async (newId) => {
Добавить
-
+
diff --git a/resources/js/Pages/Home/DataTable/Index.vue b/resources/js/Pages/Home/DataTable/Index.vue
index 926ee93..f7090e8 100644
--- a/resources/js/Pages/Home/DataTable/Index.vue
+++ b/resources/js/Pages/Home/DataTable/Index.vue
@@ -3,6 +3,7 @@ import {NDataTable, NEllipsis, NTag} from "naive-ui"
import {computed, h, reactive, ref, watch} from "vue"
import {useMedicalHistoryFilter} from "../../../Composables/useMedicalHistoryFilter.js";
import ArchiveHistoryModal from '../ArchiveHistoryModal/Index.vue'
+import {useArchiveCard} from "../../../Stores/ArchiveCard.js";
const props = defineProps({
filters: {
@@ -24,6 +25,7 @@ const props = defineProps({
})
const { isLoading, handlePageChange, handlePageSizeChange, meta, filtersRef } = useMedicalHistoryFilter(props.filters)
+const archiveCardStore = useArchiveCard()
const dataTable = ref(props.data ?? [])
const archiveStatusColumn = (status) => {
@@ -132,6 +134,14 @@ const onUpdateHistory = ({data, patientId}) => {
watch(() => props.data, (newData) => {
dataTable.value = newData
})
+
+watch(() => archiveCardStore.isOpenArchiveCard, (isOpen) => {
+ if (isOpen) {
+ selectedPatientInfo.value = Object.assign(archiveCardStore.preOpenCard)
+ showArchiveHistoryModal.value = true
+ archiveCardStore.setPreOpenCard(null)
+ }
+})
diff --git a/resources/js/Pages/Home/Index.vue b/resources/js/Pages/Home/Index.vue
index 4177292..064d5db 100644
--- a/resources/js/Pages/Home/Index.vue
+++ b/resources/js/Pages/Home/Index.vue
@@ -34,6 +34,10 @@ const onHandleSearch = (search) => {
handleSearch(search)
}
+const openArchiveCard = (card) => {
+
+}
+
const handleBeforeLeave = (tabName) => {
handleViewTypeChange(tabName)
return true
@@ -105,7 +109,7 @@ const handleBeforeLeave = (tabName) => {
min-height="calc(100vh - 212px)"
max-height="calc(100vh - 320px)"
/>
-
+ openArchiveCard(card)" />
diff --git a/resources/js/Stores/ArchiveCard.js b/resources/js/Stores/ArchiveCard.js
new file mode 100644
index 0000000..d109d10
--- /dev/null
+++ b/resources/js/Stores/ArchiveCard.js
@@ -0,0 +1,27 @@
+import {defineStore} from "pinia";
+import {computed, ref} from "vue";
+
+export const useArchiveCard = defineStore('archive-card', () => {
+ const preOpenCard = ref(null)
+ const isOpenArchiveCard = ref(false)
+
+ const isSetPreOpenCard = computed(() => preOpenCard.value !== null)
+
+ const setPreOpenCard = (card) => {
+ preOpenCard.value = card
+ }
+
+ const resetPreOpenCard = () => {
+ preOpenCard.value = null
+ }
+
+ return {
+ preOpenCard,
+ isOpenArchiveCard,
+
+ isSetPreOpenCard,
+
+ setPreOpenCard,
+ resetPreOpenCard
+ }
+})
diff --git a/routes/api.php b/routes/api.php
index b92411a..765cf9e 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -31,6 +31,8 @@ Route::prefix('archive')->group(function () {
});
});
+ Route::post('check', [\App\Http\Controllers\ArchiveInfoController::class, 'check']);
+
Route::post('create', [\App\Http\Controllers\ArchiveInfoController::class, 'store']);
});