89b6163da8
commit82e33c6dbfMerge:f96cbdbeba740aAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Thu Dec 4 13:21:37 2025 +0700 Merge pull request #209 from dikstub-rssa/feat/move-kai-ui-to-sidebar-195 Feat/move kai UI to sidebar 195 commitf96cbdb173Merge:5de005762556a5Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Thu Dec 4 12:07:25 2025 +0700 Merge pull request #210 from dikstub-rssa/feat/procedure-room-order Feat/procedure room order commit62556a5c7dMerge:93a294d5de0057Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Thu Dec 4 12:07:18 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commit5de0057278Merge:71ca7f9782034cAuthor: Andsky <andrianovsky95@gmail.com> Date: Thu Dec 4 11:56:31 2025 +0700 Merge pull request #211 from dikstub-rssa/feat/micro-lab-order-50 Feat/micro lab order 50 commit93a294d8d0Merge:6c2636726365bbAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 11:18:49 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commit26365bbd2eMerge:b6b56d1e7cab6cAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 11:18:33 2025 +0700 Merge branch 'dev' of github.com:dikstub-rssa/simrs-fe into dev commit6c26367c1dAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 10:51:40 2025 +0700 feat/procedure-room-order: added item commita0dfd214e5Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 10:25:50 2025 +0700 feat/procedure-room-order: finishing commitacb573e279Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 10:25:35 2025 +0700 feat/procedure-room-order: adjust procedure-room-order commit9adb77d10bAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 10:24:52 2025 +0700 feat/procedure-room-order: adjust material-package commit52454a019eMerge:0a0fb73b6b56d1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Dec 4 10:23:14 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commitb6b56d186dAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Thu Dec 4 10:17:16 2025 +0700 dev: hotfix, cleaning some pubs commit0a0fb73483Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Wed Dec 3 14:33:13 2025 +0700 feat/procedure-room-order: flow for procedure room commit7b4b4eecf9Merge:9f72e1db172125Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Dec 3 10:18:15 2025 +0700 Merge branch 'feat/mcu-order' into feat/procedure-room-order commit782034c2b1Merge:bae0a22b80ee5aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Dec 3 10:16:45 2025 +0700 Merge branch 'dev' into feat/micro-lab-order-50 commit9f72e1df47Merge:fa0ae98b80ee5aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Dec 3 10:02:57 2025 +0700 Merge branch 'dev' into feat/procedure-room-order commitfa0ae9866eAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Dec 3 09:44:33 2025 +0700 feat/procedure-room-order: wip #3 commitce93f996d9Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Dec 3 09:43:36 2025 +0700 feat/procedure-room-order: wip #2 + procedure-room commit4444e87cb3Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Dec 3 09:42:31 2025 +0700 feat/procedure-room-order: wip #1 + material-package + material-package-item commitb172125d99Merge:b2d3c149b7a719Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Dec 1 20:41:58 2025 +0700 Merge branch 'feat/page-cleaning' into feat/mcu-order commitbae0a222b8Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Dec 1 01:51:04 2025 +0700 feat/micro-lab-order-50: adjust for antibiotic commit1ee0f39e7dAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Dec 1 01:50:39 2025 +0700 feat/micro-lab-order-50: added antibiotic commit95e27a8b6fAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 30 13:00:04 2025 +0700 feat/micro-lab-order-50: wip commita002ef6c6eMerge:fb2f01bb2d3c14Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 30 12:50:31 2025 +0700 Merge branch 'feat/mcu-order' into feat/micro-lab-order-50 commitb2d3c14ddcAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 30 12:48:11 2025 +0700 feat/mcu-order: adjustment commitfb2f01bd36Merge:9a481fe5c92f8bAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 30 12:43:11 2025 +0700 Merge branch 'feat/mcu-order' into feat/micro-lab-order-50 commit5c92f8b946Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 30 12:30:19 2025 +0700 feat/mcu-order: added the components commit9a481fec14Merge:425123978fc289Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Nov 28 21:18:10 2025 +0700 Merge branch 'dev' into feat/micro-lab-order-50 commit4251239f7cAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Nov 28 21:17:18 2025 +0700 feat/micro-lab-order-50: wip commitcf5789549eAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Sun Nov 23 15:56:31 2025 +0700 feat/mcu: improved wip commita40eac35f8Merge:3211972baf6ab1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 19 22:23:18 2025 +0700 Merge branch 'dev' into feat/radiology-order-54 commit3211972a84Merge:e3fc1e4ccabe01Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Nov 15 20:15:07 2025 +0700 Merge branch 'dev' into feat/radiology-order-54 commite3fc1e4ab9Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Nov 15 20:14:38 2025 +0700 feat/radiology-order-54: adjust wip
199 lines
5.4 KiB
Vue
199 lines
5.4 KiB
Vue
<script setup lang="ts">
|
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
|
|
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
|
import { toast } from '~/components/pub/ui/toast'
|
|
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
|
|
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
|
|
|
// Handlers
|
|
import type { ToastFn } from '~/handlers/_handler'
|
|
|
|
// Apps
|
|
import {
|
|
recId,
|
|
recAction,
|
|
recItem,
|
|
isReadonly,
|
|
isFormEntryDialogOpen,
|
|
isRecordConfirmationOpen,
|
|
handleActionSave,
|
|
handleActionRemove,
|
|
} from '~/handlers/mcu-order.handler'
|
|
import { getList, getDetail, submit } from '~/services/mcu-order.service'
|
|
import type { McuOrder } from '~/models/mcu-order'
|
|
// import List from '~/components/app/mcu-order/micro-list.vue'
|
|
import ConfirmationInfo from '~/components/app/mcu-order/confirmation-info.vue'
|
|
|
|
// Props
|
|
const props = defineProps<{
|
|
scopeCode: string
|
|
}>()
|
|
|
|
// Common preparations
|
|
const route = useRoute()
|
|
const { crudQueryParams } = useQueryCRUD()
|
|
|
|
const title = ref('')
|
|
const plainEid = route.params.id
|
|
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0 // here the
|
|
const isSubmitConfirmationOpen = ref(false)
|
|
|
|
// Data
|
|
const {
|
|
data,
|
|
isLoading,
|
|
paginationMeta,
|
|
searchInput,
|
|
fetchData: getMyList,
|
|
} = usePaginatedList<McuOrder>({
|
|
fetchFn: async ({ page, search }) => {
|
|
const result = await getList({
|
|
search,
|
|
page,
|
|
'scope-code': props.scopeCode,
|
|
'encounter-id': encounter_id,
|
|
includes: 'doctor,doctor-employee,doctor-employee-person,items,items-mcuSrc',
|
|
})
|
|
return { success: result.success || false, body: result.body || {} }
|
|
},
|
|
entityName: 'mcu-order'
|
|
})
|
|
|
|
// Header
|
|
const headerPrep: HeaderPrep = {
|
|
title: 'Order Lab Mikro',
|
|
icon: 'i-lucide-box',
|
|
refSearchNav: {
|
|
placeholder: 'Cari (min. 3 karakter)...',
|
|
minLength: 3,
|
|
debounceMs: 500,
|
|
showValidationFeedback: true,
|
|
onInput: (value: string) => {
|
|
searchInput.value = value
|
|
},
|
|
onClick: () => {},
|
|
onClear: () => {},
|
|
},
|
|
addNav: {
|
|
label: 'Tambah',
|
|
icon: 'i-lucide-plus',
|
|
onClick: async () => {
|
|
const saveResp = await handleActionSave({ encounter_id, scope_code: props.scopeCode }, () => {}, () =>{}, toast)
|
|
if (saveResp.success) {
|
|
crudQueryParams.value = { mode: 'entry', recordId: saveResp.body?.data?.id.toString() }
|
|
}
|
|
},
|
|
},
|
|
}
|
|
|
|
// List component
|
|
let List: Component
|
|
if(props.scopeCode == 'radiology') {
|
|
List = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
|
} else if(props.scopeCode == 'cp-lab') {
|
|
List = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
|
} else if (props.scopeCode == 'micro-lab') {
|
|
List = defineAsyncComponent(() => import('~/components/app/mcu-order/micro-list.vue'))
|
|
} else {
|
|
List = defineAsyncComponent(() => import('~/components/content/encounter/status.vue'))
|
|
}
|
|
|
|
// Reactivities
|
|
provide('rec_id', recId)
|
|
provide('rec_action', recAction)
|
|
provide('rec_item', recItem)
|
|
provide('table_data_loader', isLoading)
|
|
|
|
watch([recId, recAction], () => {
|
|
switch (recAction.value) {
|
|
case ActionEvents.showDetail:
|
|
getMyDetail(recId.value)
|
|
title.value = 'Detail Order Lab PK'
|
|
isReadonly.value = true
|
|
break
|
|
case ActionEvents.showEdit:
|
|
getMyDetail(recId.value)
|
|
title.value = 'Edit Order Lab PK'
|
|
isReadonly.value = false
|
|
break
|
|
case ActionEvents.showConfirmDelete:
|
|
isRecordConfirmationOpen.value = true
|
|
break
|
|
}
|
|
})
|
|
|
|
///// Functions
|
|
async function getMyDetail (id: number | string) {
|
|
const result = await getDetail(id)
|
|
if (result.success) {
|
|
const currentValue = result.body?.data || {}
|
|
recItem.value = currentValue
|
|
isFormEntryDialogOpen.value = true
|
|
}
|
|
}
|
|
|
|
function cancel(data: McuOrder) {
|
|
recId.value = data.id
|
|
recItem.value = data
|
|
isRecordConfirmationOpen.value = true
|
|
}
|
|
|
|
function edit(data: McuOrder) {
|
|
crudQueryParams.value = { mode: 'entry', recordId: data.id.toString() }
|
|
}
|
|
|
|
function confirmSubmit(data: McuOrder) {
|
|
recId.value = data.id
|
|
recItem.value = data
|
|
isSubmitConfirmationOpen.value = true
|
|
}
|
|
|
|
async function handleActionSubmit(id: number, refresh: () => void, toast: ToastFn) {
|
|
const result = await submit(id)
|
|
if (result.success) {
|
|
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
|
setTimeout(refresh, 300)
|
|
} else {
|
|
toast({ title: 'Gagal', description: 'Gagal menjalankan perintah', variant: 'destructive' })
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<Header :prep="{ ...headerPrep }" />
|
|
|
|
<List
|
|
v-if="!isLoading.dataListLoading"
|
|
:data="data"
|
|
:pagination-meta="paginationMeta"
|
|
@cancel="cancel"
|
|
@edit="edit"
|
|
@submit="confirmSubmit"
|
|
/>
|
|
|
|
<RecordConfirmation
|
|
v-model:open="isRecordConfirmationOpen"
|
|
action="delete"
|
|
:record="recItem"
|
|
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
|
@cancel=""
|
|
>
|
|
<ConfirmationInfo :rec-item="recItem" />
|
|
</RecordConfirmation>
|
|
|
|
<RecordConfirmation
|
|
v-model:open="isSubmitConfirmationOpen"
|
|
action="delete"
|
|
customTitle="Ajukan Resep"
|
|
customMessage="Proses akan mengajukan resep ini untuk diproses lebih lanjut. Lanjutkan?"
|
|
customConfirmText="Ajukan"
|
|
:record="recItem"
|
|
@confirm="() => handleActionSubmit(recId, getMyList, toast)"
|
|
@cancel=""
|
|
>
|
|
<ConfirmationInfo :rec-item="recItem" />
|
|
</RecordConfirmation>
|
|
</template>
|