Fix: Refactor surat kontrol
This commit is contained in:
+3
-3
@@ -36,11 +36,10 @@ async function fetchDpjp(specialistId: string, subspecialistId: string) {
|
||||
doctors.value = await getDoctorLabelList({
|
||||
serviceType: 1,
|
||||
serviceDate: new Date().toISOString().substring(0, 10),
|
||||
specialistCode: 0,
|
||||
includes: 'employee-person',
|
||||
// "unit-id": parseInt(unitId),
|
||||
"specialist-id": String(specialistId),
|
||||
"subspecialist-id": String(subspecialistId),
|
||||
"specialist-code": String(specialistId),
|
||||
"subspecialist-code": String(subspecialistId),
|
||||
}, true)
|
||||
}
|
||||
|
||||
@@ -54,6 +53,7 @@ const selectedSubSpecialistId = inject<Ref<string | null>>("selectedSubSpecialis
|
||||
|
||||
watch([ selectedSpecialistId, selectedSubSpecialistId], () => {
|
||||
if (selectedSpecialistId.value && selectedSubSpecialistId.value) {
|
||||
console.log(`Select Doctor`)
|
||||
fetchDpjp( selectedSpecialistId.value, selectedSubSpecialistId.value)
|
||||
}
|
||||
})
|
||||
-1
@@ -54,7 +54,6 @@ watch([selectedUnitId], () => {
|
||||
fetchSpecialists(selectedUnitId.value)
|
||||
}
|
||||
})
|
||||
console.log(selectedUnitId.value)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
+1
-1
@@ -37,7 +37,7 @@ async function fetchSubSpecialists(specialistId: string) {
|
||||
serviceType: 1,
|
||||
serviceDate: new Date().toISOString().substring(0, 10),
|
||||
specialistCode: 0,
|
||||
"specialist-id": String(specialistId),
|
||||
"specialist-code": String(specialistId),
|
||||
}, true)
|
||||
}
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ provide("selectedSubSpecialistId", selectedSubSpecialistId);
|
||||
|
||||
<template>
|
||||
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Tambah Surat Kontrol</div>
|
||||
<AppOutpatientEncounterEntryForm
|
||||
<AppControlLetterEntryForm
|
||||
ref="controlLetterForm"
|
||||
:schema="ControlLetterSchema"
|
||||
:selected-unit-id="selectedUnitId"
|
||||
+1
-1
@@ -75,5 +75,5 @@ function handleAction(type: string) {
|
||||
<template>
|
||||
<Header :prep="headerPrep" :ref-search-nav="headerPrep.refSearchNav" />
|
||||
|
||||
<AppOutpatientEncounterPreview :instance="controlLetter" @click="handleAction" />
|
||||
<AppControlLetterPreview :instance="controlLetter" @click="handleAction" />
|
||||
</template>
|
||||
+4
-4
@@ -61,9 +61,9 @@ onMounted(async () => {
|
||||
const result = await getDetail(controlLetterId)
|
||||
if (result.success) {
|
||||
const responseData = {...result.body.data, date: formatDateYyyyMmDd(result.body.data.date)}
|
||||
selectedUnitId.value = responseData?.unit_id
|
||||
selectedSpecialistId.value = responseData?.specialist_id
|
||||
selectedSubSpecialistId.value = responseData?.subspecialist_id
|
||||
selectedUnitId.value = responseData?.unit_code
|
||||
selectedSpecialistId.value = responseData?.specialist_code
|
||||
selectedSubSpecialistId.value = responseData?.subspecialist_code
|
||||
|
||||
controlLetter.value = responseData
|
||||
controlLetterForm.value?.setValues(responseData)
|
||||
@@ -135,7 +135,7 @@ provide("selectedSubSpecialistId", selectedSubSpecialistId);
|
||||
|
||||
<template>
|
||||
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Update Surat Kontrol</div>
|
||||
<AppOutpatientEncounterEntryForm
|
||||
<AppControlLetterEntryForm
|
||||
ref="controlLetterForm"
|
||||
:schema="ControlLetterSchema"
|
||||
:selected-unit-id="selectedUnitId"
|
||||
+1
-1
@@ -151,7 +151,7 @@ watch([recId, recAction], () => {
|
||||
:ref-search-nav="refSearchNav"
|
||||
@search="handleSearch" />
|
||||
|
||||
<AppOutpatientEncounterList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||
<AppControlLetterList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||
|
||||
<RecordConfirmation v-model:open="isRecordConfirmationOpen" action="delete" :record="recItem"
|
||||
@confirm="handleConfirmDelete" @cancel="handleCancelConfirmation">
|
||||
@@ -16,7 +16,7 @@ import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
|
||||
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
|
||||
import PrescriptionList from '~/components/content/prescription/list.vue'
|
||||
import Consultation from '~/components/content/consultation/list.vue'
|
||||
import EncounterList from '~/components/content/outpatient/encounter/list.vue'
|
||||
import ControlLetterList from '~/components/content/control-letter/list.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -71,7 +71,7 @@ const tabs: TabItem[] = [
|
||||
{ value: 'mcu-result', label: 'Hasil Penunjang' },
|
||||
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter: data } },
|
||||
{ value: 'resume', label: 'Resume' },
|
||||
{ value: 'control', label: 'Surat Kontrol', component: EncounterList, props: { encounter: data } },
|
||||
{ value: 'control', label: 'Surat Kontrol', component: ControlLetterList, props: { encounter: data } },
|
||||
{ value: 'screening', label: 'Skrinning MPP' },
|
||||
{ value: 'supporting-document', label: 'Upload Dokumen Pendukung' },
|
||||
]
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ const canRead = true
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<ContentOutpatientEncounterEdit />
|
||||
<ContentControlLetterEdit />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ const canRead = true
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<ContentOutpatientEncounterDetail :patient-id="Number(route.params.id)" />
|
||||
<ContentControlLetterDetail :patient-id="Number(route.params.id)" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</div>
|
||||
|
||||
@@ -35,7 +35,7 @@ const callbackUrl = route.query['return-path'] as string | undefined
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<ContentOutpatientEncounterAdd :callback-url="callbackUrl" />
|
||||
<ContentControlLetterAdd :callback-url="callbackUrl" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user