From 39b778ab7874cbb53a3f4b4284b1ddbe87621c74 Mon Sep 17 00:00:00 2001 From: hasyim_kai Date: Tue, 25 Nov 2025 14:39:41 +0700 Subject: [PATCH] Feat: UI Laporan Operasi --- .../surgery-report/_common/btn-history.vue | 21 ++++ .../app/surgery-report/_common/filter.vue | 73 +++++++++++ .../surgery-report/_common/history-dialog.vue | 52 ++++++++ .../_common/radio-blood-type.vue | 94 ++++++++++++++ app/components/app/surgery-report/detail.vue | 118 +++++++++++++++--- app/components/app/surgery-report/entry.vue | 106 +++++++++++++--- .../app/surgery-report/multiselect-picker.vue | 33 ----- .../operative-action-list.cfg.ts | 56 --------- .../operative-action/dropdown-action.vue | 30 +++++ .../operative-action/list.cfg.ts | 44 +++++++ .../surgery-report/operative-action/list.vue | 84 +++++++++++++ .../operative-action/picker-dialog.vue | 116 +++++++++++++++++ .../content/surgery-report/detail.vue | 34 ++--- .../content/surgery-report/entry.vue | 52 +------- .../content/surgery-report/list.vue | 29 +++-- .../pub/my-ui/form/view/detail-row.vue | 10 +- app/components/pub/my-ui/modal/dialog.vue | 2 - .../pub/my-ui/nav-header/filter.vue | 11 +- .../[surgery_report_id]/index.vue | 2 +- 19 files changed, 756 insertions(+), 211 deletions(-) create mode 100644 app/components/app/surgery-report/_common/btn-history.vue create mode 100644 app/components/app/surgery-report/_common/filter.vue create mode 100644 app/components/app/surgery-report/_common/history-dialog.vue create mode 100644 app/components/app/surgery-report/_common/radio-blood-type.vue delete mode 100644 app/components/app/surgery-report/multiselect-picker.vue delete mode 100644 app/components/app/surgery-report/operative-action-list.cfg.ts create mode 100644 app/components/app/surgery-report/operative-action/dropdown-action.vue create mode 100644 app/components/app/surgery-report/operative-action/list.cfg.ts create mode 100644 app/components/app/surgery-report/operative-action/list.vue create mode 100644 app/components/app/surgery-report/operative-action/picker-dialog.vue diff --git a/app/components/app/surgery-report/_common/btn-history.vue b/app/components/app/surgery-report/_common/btn-history.vue new file mode 100644 index 00000000..972eab8e --- /dev/null +++ b/app/components/app/surgery-report/_common/btn-history.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/app/components/app/surgery-report/_common/filter.vue b/app/components/app/surgery-report/_common/filter.vue new file mode 100644 index 00000000..d5e99b30 --- /dev/null +++ b/app/components/app/surgery-report/_common/filter.vue @@ -0,0 +1,73 @@ + + + diff --git a/app/components/app/surgery-report/_common/history-dialog.vue b/app/components/app/surgery-report/_common/history-dialog.vue new file mode 100644 index 00000000..d92da4a5 --- /dev/null +++ b/app/components/app/surgery-report/_common/history-dialog.vue @@ -0,0 +1,52 @@ + + + \ No newline at end of file diff --git a/app/components/app/surgery-report/_common/radio-blood-type.vue b/app/components/app/surgery-report/_common/radio-blood-type.vue new file mode 100644 index 00000000..91def086 --- /dev/null +++ b/app/components/app/surgery-report/_common/radio-blood-type.vue @@ -0,0 +1,94 @@ + + + diff --git a/app/components/app/surgery-report/detail.vue b/app/components/app/surgery-report/detail.vue index e10a2b91..e0bb7727 100644 --- a/app/components/app/surgery-report/detail.vue +++ b/app/components/app/surgery-report/detail.vue @@ -1,7 +1,9 @@ diff --git a/app/components/app/surgery-report/entry.vue b/app/components/app/surgery-report/entry.vue index e3862ee5..8ac204f7 100644 --- a/app/components/app/surgery-report/entry.vue +++ b/app/components/app/surgery-report/entry.vue @@ -4,6 +4,7 @@ import { toTypedSchema } from '@vee-validate/zod' import { Form } from '~/components/pub/ui/form' import SelectDate from './_common/select-date.vue' import InputBase from '~/components/pub/my-ui/form/input-base.vue' +import { FieldArray } from 'vee-validate' import * as DE from '~/components/pub/my-ui/doc-entry' import SelectDpjpBedah from './_common/select-dpjp-bedah.vue' @@ -17,16 +18,18 @@ import SelectBirthDesc from './_common/select-birth-desc.vue' import SelectBirthPlaceDesc from './_common/select-birth-place-desc.vue' import SelectSpecimenType from './_common/select-specimen-type.vue' import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue' +import RadioBloodType from './_common/radio-blood-type.vue' +import OperativeActionPicker from './operative-action/picker-dialog.vue' const props = defineProps<{ schema: any initialValues?: any errors?: FormErrors + operativeActionList?: any[] }>() const formSchema = toTypedSchema(props.schema) const formRef = ref() -const isOperativeActionDialogOpen = inject>('isOperativeActionDialogOpen')! defineExpose({ validate: () => formRef.value?.validate(), @@ -34,10 +37,6 @@ defineExpose({ setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate), values: computed(() => formRef.value?.values), }) - -const handleToggleOperativeActionDialog = () => { - isOperativeActionDialogOpen.value = !isOperativeActionDialogOpen.value -} diff --git a/app/components/app/surgery-report/multiselect-picker.vue b/app/components/app/surgery-report/multiselect-picker.vue deleted file mode 100644 index 98a146ce..00000000 --- a/app/components/app/surgery-report/multiselect-picker.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/app/components/app/surgery-report/operative-action-list.cfg.ts b/app/components/app/surgery-report/operative-action-list.cfg.ts deleted file mode 100644 index 2d0a6637..00000000 --- a/app/components/app/surgery-report/operative-action-list.cfg.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { Config } from '~/components/pub/my-ui/data-table' -import type { Patient } from '~/models/patient' -import { defineAsyncComponent } from 'vue' -import { educationCodes, genderCodes } from '~/lib/constants' -import { calculateAge } from '~/lib/utils' - -const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) - -export const config: Config = { - cols: [{}, {}, {}, {}, {}, {}, {}, ], - - headers: [ - [ - { label: 'Tgl Laporan' }, - { label: 'DPJP Bedah' }, - { label: 'DPJP Anastesi' }, - { label: 'Tgl Pembedahan' }, - { label: 'Jenis Operasi' }, - { label: 'Kode Billing' }, - { label: 'Sistem Operasi' }, - ], - ], - - keys: ['date', 'doctor.employee.person.name', 'doctor.employee.person.name', 'date', 'name', 'name', 'name'], - - delKeyNames: [ - { key: 'code', label: 'Kode' }, - { key: 'name', label: 'Nama' }, - ], - - parses: { - date: (rec: unknown): unknown => { - const date = (rec as any).date - if (typeof date == 'object' && date) { - return (date as Date).toLocaleDateString('id-ID') - } else if (typeof date == 'string') { - return (date as string).substring(0, 10) - } - return date - }, - }, - - components: { - // action(rec, idx) { - // return { - // idx, - // rec: rec as object, - // component: action, - // } - // }, - }, - - htmls: { - - }, -} diff --git a/app/components/app/surgery-report/operative-action/dropdown-action.vue b/app/components/app/surgery-report/operative-action/dropdown-action.vue new file mode 100644 index 00000000..7dc56c86 --- /dev/null +++ b/app/components/app/surgery-report/operative-action/dropdown-action.vue @@ -0,0 +1,30 @@ + + + diff --git a/app/components/app/surgery-report/operative-action/list.cfg.ts b/app/components/app/surgery-report/operative-action/list.cfg.ts new file mode 100644 index 00000000..eeb08cff --- /dev/null +++ b/app/components/app/surgery-report/operative-action/list.cfg.ts @@ -0,0 +1,44 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import type { Patient } from '~/models/patient' +import { defineAsyncComponent } from 'vue' +import { educationCodes, genderCodes } from '~/lib/constants' +import { calculateAge } from '~/lib/utils' + +const action = defineAsyncComponent(() => import('./dropdown-action.vue')) + +export const config: Config = { + cols: [{}, {}, {width: 30}, ], + + headers: [ + [ + { label: 'Nama Prosedur' }, + { label: 'Code' }, + { label: 'Action' }, + ], + ], + + keys: ['name', 'code', 'action',], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + + }, +} diff --git a/app/components/app/surgery-report/operative-action/list.vue b/app/components/app/surgery-report/operative-action/list.vue new file mode 100644 index 00000000..8b025e4f --- /dev/null +++ b/app/components/app/surgery-report/operative-action/list.vue @@ -0,0 +1,84 @@ + + + diff --git a/app/components/app/surgery-report/operative-action/picker-dialog.vue b/app/components/app/surgery-report/operative-action/picker-dialog.vue new file mode 100644 index 00000000..a568c159 --- /dev/null +++ b/app/components/app/surgery-report/operative-action/picker-dialog.vue @@ -0,0 +1,116 @@ + + + diff --git a/app/components/content/surgery-report/detail.vue b/app/components/content/surgery-report/detail.vue index 00d15f21..7c266329 100644 --- a/app/components/content/surgery-report/detail.vue +++ b/app/components/content/surgery-report/detail.vue @@ -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) { diff --git a/app/components/content/surgery-report/entry.vue b/app/components/content/surgery-report/entry.vue index d36fcec1..ff817905 100644 --- a/app/components/content/surgery-report/entry.vue +++ b/app/components/content/surgery-report/entry.vue @@ -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 | null>(null) const surgeryReport = ref({}) const isConfirmationOpen = ref(false) const selectedOperativeAction = ref(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) {