feat/consultation-82: wip
This commit is contained in:
@@ -13,7 +13,6 @@ import { toast } from '~/components/pub/ui/toast'
|
||||
// Types
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { ConsultationSchema, type ConsultationFormData } from '~/schemas/consultation.schema'
|
||||
import type { Unit } from '~/models/unit'
|
||||
|
||||
// Handlers
|
||||
import {
|
||||
@@ -32,9 +31,18 @@ import {
|
||||
|
||||
// Services
|
||||
import { getList, getDetail } from '~/services/consultation.service'
|
||||
// import { getList as getUnitList } from '~/services/unit.service' // previously uses getList
|
||||
import { getValueLabelList } from '~/services/unit.service'
|
||||
|
||||
// Models
|
||||
import type { Encounter } from '~/models/encounter'
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
encounter: Encounter
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
console.log(props.encounter);
|
||||
|
||||
let units = ref<{ value: string; label: string }[]>([])
|
||||
const title = ref('')
|
||||
|
||||
@@ -72,7 +80,12 @@ const headerPrep: HeaderPrep = {
|
||||
label: 'Tambah',
|
||||
icon: 'i-lucide-plus',
|
||||
onClick: () => {
|
||||
recItem.value = null
|
||||
recItem.value = {
|
||||
encounter_id: props.encounter.id,
|
||||
date: today.toISOString().slice(0, 10),
|
||||
unit_id: 0,
|
||||
problem: '',
|
||||
}
|
||||
recId.value = 0
|
||||
isFormEntryDialogOpen.value = true
|
||||
isReadonly.value = false
|
||||
@@ -80,6 +93,8 @@ const headerPrep: HeaderPrep = {
|
||||
},
|
||||
}
|
||||
|
||||
const today = new Date()
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
@@ -94,17 +109,6 @@ const getMyDetail = async (id: number | string) => {
|
||||
}
|
||||
}
|
||||
|
||||
// const getUnits = async () => {
|
||||
// const result = await getUnitList()
|
||||
// if (result.success) {
|
||||
// const currentMedicineGroups = result.body?.data || []
|
||||
// units.value = currentMedicineGroups.map((item: Unit) => ({
|
||||
// value: item.code,
|
||||
// label: item.name,
|
||||
// }))
|
||||
// }
|
||||
// }
|
||||
|
||||
// Watch for row actions when recId or recAction changes
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
@@ -140,7 +144,7 @@ onMounted(async () => {
|
||||
/>
|
||||
<List :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||
|
||||
<Dialog v-model:open="isFormEntryDialogOpen" :title="!!recItem ? title : 'Tambah Divisi'" size="xl" prevent-outside>
|
||||
<Dialog v-model:open="isFormEntryDialogOpen" :title="recItem?.id ? 'Edit Konsultasi' : 'Tambah Konsultasi'" size="xl" prevent-outside>
|
||||
<Entry
|
||||
:schema="ConsultationSchema"
|
||||
:values="recItem"
|
||||
|
||||
@@ -16,6 +16,7 @@ import type { Encounter } from '~/models/encounter'
|
||||
import Status from '~/components/app/encounter/status.vue'
|
||||
// import AssesmentFunctionList from '~/components/content/assesment-function/list.vue'
|
||||
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
|
||||
import Consultation from '~/components/content/consultation/list.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -65,7 +66,7 @@ const tabs: TabItem[] = [
|
||||
{ value: 'mcu-lab-pa', label: 'Order Lab PA' },
|
||||
{ value: 'medical-action', label: 'Order Ruang Tindakan' },
|
||||
{ value: 'mcu-result', label: 'Hasil Penunjang' },
|
||||
{ value: 'consultation', label: 'Konsultasi' },
|
||||
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter } },
|
||||
{ value: 'resume', label: 'Resume' },
|
||||
{ value: 'control', label: 'Surat Kontrol' },
|
||||
{ value: 'screening', label: 'Skrinning MPP' },
|
||||
|
||||
Reference in New Issue
Block a user