-
+ >
+
+
+ Подождите, загружаем данные…
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/resources/js/Pages/Nurse/Components/AddMedicalHistoryModal.vue b/resources/js/Pages/Nurse/Components/AddMedicalHistoryModal.vue
index 0db3c5b..a1e9530 100644
--- a/resources/js/Pages/Nurse/Components/AddMedicalHistoryModal.vue
+++ b/resources/js/Pages/Nurse/Components/AddMedicalHistoryModal.vue
@@ -160,10 +160,10 @@ const onChangeSearch = (historyId) => {
form.value.urgency_id = res.data.urgency_id
form.value.visit_result_id = res.data.visit_result_id
- form.value.birth_date = res.data.birth_date ? format(new Date(res.data.birth_date), 'yyyy-MM-dd HH:mm:ss') : null
- form.value.death_date = res.data.death_date ? format(new Date(res.data.death_date), 'yyyy-MM-dd HH:mm:ss') : null
- form.value.extract_date = res.data.extract_date ? format(new Date(res.data.extract_date), 'yyyy-MM-dd HH:mm:ss') : null
- form.value.recipient_date = res.data.recipient_date ? format(new Date(res.data.recipient_date), 'yyyy-MM-dd HH:mm:ss') : null
+ form.value.birth_date = res.data.birth_date
+ form.value.death_date = res.data.death_date
+ form.value.extract_date = res.data.extract_date
+ form.value.recipient_date = res.data.recipient_date
})
}
diff --git a/resources/js/Pages/Nurse/Components/EditMedicalHistoryModal.vue b/resources/js/Pages/Nurse/Components/EditMedicalHistoryModal.vue
index f9ece66..b680bc9 100644
--- a/resources/js/Pages/Nurse/Components/EditMedicalHistoryModal.vue
+++ b/resources/js/Pages/Nurse/Components/EditMedicalHistoryModal.vue
@@ -28,6 +28,7 @@ const props = defineProps({
const form = ref({
patient_source: 'mis',
+ original_id: null,
patient_id: null,
full_name: '',
urgency_id: 1,
@@ -128,7 +129,9 @@ const fetchPatient = async (historyId) => {
loading.value = true
await axios.get(`/api/nurse/patients/${historyId}`)
.then(res => {
+ form.value.patient_source = res.data.source_type
form.value.patient_id = historyId
+ form.value.original_id = res.data.original_id
form.value.full_name = res.data.full_name
form.value.urgency_id = res.data.urgency_id
form.value.visit_result_id = res.data.visit_result_id
diff --git a/resources/js/Pages/Nurse/Report/Index.vue b/resources/js/Pages/Nurse/Report/Index.vue
index 33c76e8..b2d5004 100644
--- a/resources/js/Pages/Nurse/Report/Index.vue
+++ b/resources/js/Pages/Nurse/Report/Index.vue
@@ -5,12 +5,14 @@ import AppContainer from "../../../Components/AppContainer.vue";
import AppPanel from "../../../Components/AppPanel.vue";
import DatePickerQuery from "../../../Components/DatePickerQuery.vue";
import UrgencyBadge from "../../../Components/UrgencyBadge.vue";
-import {h, ref, shallowRef} from "vue"
+import {h, onMounted, ref, shallowRef} from "vue"
import {TbCirclePlus, TbPencil} from 'vue-icons-plus/tb'
import {useAuthStore} from "../../../Stores/auth.js";
import AddMedicalHistoryModal from "../Components/AddMedicalHistoryModal.vue";
import EditMedicalHistoryModal from "../Components/EditMedicalHistoryModal.vue";
import {router} from "@inertiajs/vue3";
+import ActionsColumnDataTable from "../Components/ActionsColumnDataTable.vue";
+import {useAppDialog} from "../../../Composables/useAppDialog.js";
const props = defineProps({
inDepartmentHistories: {
@@ -44,6 +46,7 @@ const showEditMedicalHistoryModal = shallowRef(false)
const editHistoryId = ref(null)
const authStore = useAuthStore()
const userDepartment = authStore.userDepartment
+const loading = ref(false)
const columns = [
{
@@ -74,8 +77,13 @@ const columns = [
align: 'end',
render: (row) => {
return h(
- NButton, { size: 'tiny', type: 'default', secondary: true, onClick: () => onClickEditButton(row.id) },
- { default: () => 'Редактировать', icon: () => h(TbPencil, { size: '18px' }) })
+ ActionsColumnDataTable,
+ {
+ row: row,
+ onClickDelete: (historyId) => onClickDeleteButton(historyId),
+ onClickEdit: (historyId) => onClickEditButton(historyId),
+ }
+ )
}
}
]
@@ -85,6 +93,32 @@ const onClickEditButton = (historyId) => {
editHistoryId.value = historyId
}
+const onClickDeleteButton = async (historyId) => {
+ const confirmed = await useAppDialog({
+ title: 'Удалить историю?',
+ content: 'Это действие необратимо',
+ onConfirm: async () => {
+ await axios.delete(`/api/nurse/patients/${historyId}`)
+ }
+ })
+
+ if (confirmed) {
+ loading.value = true
+ router.reload({
+ only: [
+ 'inDepartmentHistories',
+ 'recipientHistories',
+ 'dischargedHistories',
+ 'deceasedHistories',
+ 'transferredHistories'
+ ],
+ onSuccess: () => {
+ loading.value = false
+ }
+ })
+ }
+}
+
const submit = () => {
router.post('/nurse/report/save', {}, {
onSuccess: () => {
@@ -111,7 +145,7 @@ const formattedLabel = (word, count) => {
-
+
@@ -127,6 +161,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
+ :loading="loading"
/>
@@ -135,6 +170,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
+ :loading="loading"
/>
@@ -143,6 +179,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
+ :loading="loading"
/>
@@ -151,6 +188,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
+ :loading="loading"
/>
@@ -159,11 +197,12 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
+ :loading="loading"
/>
-
+
Сохранить отчет
diff --git a/resources/js/app.js b/resources/js/app.js
index 197b9c6..7a1c5cc 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -6,6 +6,7 @@ import * as Sentry from "@sentry/vue";
import {startGlobalLoading, stopGlobalLoading} from "./Composables/useGlobalLoading.js";
import './bootstrap';
import '../css/app.css';
+import {NConfigProvider, NDialogProvider, NMessageProvider, ruRU, dateRuRU, darkTheme} from "naive-ui";
router.on('start', () => {
startGlobalLoading()
@@ -23,6 +24,21 @@ router.on('exception', () => {
stopGlobalLoading()
})
+const themeOverrides = {
+ Modal: {
+ peers: {
+ Dialog: {
+ borderRadius: '8px'
+ },
+ Card: {
+ borderRadius: '8px'
+ },
+ }
+ },
+ Dialog: {
+ borderRadius: '8px'
+ },
+}
createInertiaApp({
id: 'onboard',
@@ -31,8 +47,19 @@ createInertiaApp({
return pages[`./Pages/${name}.vue`]
},
setup({el, App, props, plugin}) {
- const vueApp = createApp({
- render: () => h(App, props)
+ const vueApp = createApp({
+ render: () => h(NConfigProvider, {
+ theme: darkTheme,
+ themeOverrides: themeOverrides,
+ locale: ruRU,
+ dateLocale: dateRuRU
+ }, {
+ default: () => h(NDialogProvider, {}, {
+ default: () => h(NMessageProvider, {}, {
+ default: () => h(App, props)
+ })
+ })
+ })
})
const pinia = createPinia()
diff --git a/routes/api.php b/routes/api.php
index 9e2d07b..03b18e6 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -97,6 +97,7 @@ Route::middleware(['auth:sanctum'])->group(function () {
Route::prefix('{id}')->group(function () {
Route::get('/', [\App\Http\Controllers\Api\NurseController::class, 'getPatient']);
Route::post('/correction', [\App\Http\Controllers\Api\NurseController::class, 'storeCorrection']);
+ Route::delete('/', [\App\Http\Controllers\Api\NurseController::class, 'deleteHistory']);
});
Route::post('/search', [\App\Http\Controllers\Api\NurseController::class, 'searchPatients']);
Route::post('/', [\App\Http\Controllers\Api\NurseController::class, 'storePatient']);