Feat: UI Laporan Operasi

This commit is contained in:
hasyim_kai
2025-11-25 14:39:41 +07:00
parent f6ae61849d
commit 39b778ab78
19 changed files with 756 additions and 211 deletions
@@ -32,14 +32,14 @@ const headerPrep: HeaderPrep = {
// #endregion
// #region Lifecycle Hooks
onMounted(async () => {
const result = await getDetail(controlLetterId, {
includes: "unit,specialist,subspecialist,doctor-employee-person",
})
if (result.success) {
controlLetter.value = result.body?.data
}
})
// onMounted(async () => {
// const result = await getDetail(controlLetterId, {
// includes: "unit,specialist,subspecialist,doctor-employee-person",
// })
// if (result.success) {
// controlLetter.value = result.body?.data
// }
// })
// #endregion
// #region Functions
@@ -50,19 +50,8 @@ function goBack() {
// #endregion region
// #region Utilities & event handlers
function handleAction(type: string) {
switch (type) {
// case 'edit':
// navigateTo({
// name: 'rehab-encounter-id-surgery-report-control_letter_id-edit',
// params: { id: encounterId, "control_letter_id": controlLetterId },
// })
// break
case 'back':
goBack()
break
}
function handleAction() {
goBack()
}
// #endregion
@@ -72,6 +61,5 @@ function handleAction(type: string) {
<template>
<Header :prep="headerPrep" :ref-search-nav="headerPrep.refSearchNav" />
<AppSurgeryReportDetail :instance="controlLetter" @click="handleAction" />
<AppSurgeryReportDetail :instance="surgeryReport" @click="handleAction" />
</template>
@@ -15,6 +15,7 @@ import { ResponsiblePersonSchema } from '~/schemas/person-relative.schema'
import { uploadAttachment } from '~/services/patient.service'
import { getDetail, update } from '~/services/surgery-report.service'
import type { SurgeryReport } from '~/models/surgery-report'
import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue'
import { toast } from '~/components/pub/ui/toast'
import { withBase } from '~/models/_base'
@@ -48,24 +49,6 @@ const inputForm = ref<ExposedForm<any> | null>(null)
const surgeryReport = ref({})
const isConfirmationOpen = ref(false)
const selectedOperativeAction = ref<any>(null)
const isOperativeActionDialogOpen = ref(false)
provide("isOperativeActionDialogOpen", isOperativeActionDialogOpen);
const headerPrep: HeaderPrep = {
title: "Pilih Tindakan",
icon: 'i-lucide-history',
}
const refSearchNav: RefSearchNav = {
onClick: () => {
// open filter modal
},
onInput: (val: string) => {
searchInput.value = val
},
onClear: () => {
searchInput.value = ''
},
}
// #endregion
// #region Lifecycle Hooks
@@ -131,13 +114,6 @@ async function handleActionClick(eventType: string) {
function handleCancelAdd() {
isConfirmationOpen.value = false
}
function actionDialogHandler(type: string) {
if (type === 'submit') {
// icdPreview.value.procedures = selectedOperativeAction.value || []
}
isOperativeActionDialogOpen.value = false
}
// #endregion
// #region Watchers
@@ -146,39 +122,17 @@ function actionDialogHandler(type: string) {
<template>
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Update Laporan Operasi</div>
<code>{{ selectedOperativeAction }}</code>
<AppSurgeryReportEntry
ref="inputForm"
:schema="SurgeryReportSchema"
:operative-action-list="[]"
/>
<div class="my-2 flex justify-end py-2">
<Action :enable-draft="false" @click="handleActionClick" />
</div>
<Dialog
v-model:open="isOperativeActionDialogOpen"
title=""
size="xl"
>
<Header
:prep="headerPrep"
:ref-search-nav="refSearchNav"
v-model:search="searchInput"
@search="handleSearch" />
<AppSurgeryReportPicker
v-model:model-value="selectedOperativeAction"
:data="data"
:pagination-meta="paginationMeta"
@page-change="handlePageChange"
/>
<div class="my-2 flex justify-end py-2">
<ActionDialog @click="actionDialogHandler" />
</div>
</Dialog>
<Confirmation
v-model:open="isConfirmationOpen"
title="Simpan Data"
+17 -12
View File
@@ -27,6 +27,7 @@ const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSe
entityName: 'surgery-report',
})
const isHistoryDialogOpen = ref(false)
const isFilterDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const summaryLoading = ref(false)
@@ -58,6 +59,12 @@ const refSearchNav: RefSearchNav = {
searchInput.value = ''
},
}
headerPrep.components = [
{
component: defineAsyncComponent(() => import('~/components/app/surgery-report/_common/btn-history.vue')),
props: { }
},
];
// #endregion
// #region Lifecycle Hooks
@@ -79,6 +86,9 @@ async function getListData() {
}
// Handle confirmation result
function handleFiltering(value: any) {
isFilterDialogOpen.value = false
}
async function handleConfirmDelete(record: any, action: string) {
if (action === 'delete' && record?.id) {
try {
@@ -108,6 +118,7 @@ provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
provide('isHistoryDialogOpen', isHistoryDialogOpen)
// #endregion
// #region Watchers
@@ -148,10 +159,7 @@ watch([recId, recAction], () => {
]" />
<div v-else>
<Header v-model:search="searchInput"
:prep="headerPrep"
:ref-search-nav="refSearchNav"
@search="handleSearch" />
<Header :prep="headerPrep" />
<Filter
:prep="headerPrep"
@@ -162,14 +170,11 @@ watch([recId, recAction], () => {
<AppSurgeryReportList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
<Dialog v-model:open="isFilterDialogOpen" title="Filter" size="lg">
<!-- <AppEncounterFilter
:installation="{
msg: { placeholder: 'Pilih' },
items: [],
}"
:schema="{}"
/> -->
aaaaaaa
<AppSurgeryReportCommonFilter @submit="handleFiltering" />
</Dialog>
<Dialog v-model:open="isHistoryDialogOpen" title="History">
<AppSurgeryReportCommonHistoryDialog />
</Dialog>
<RecordConfirmation v-model:open="isRecordConfirmationOpen" action="delete" :record="recItem"