diff --git a/components/layout/full/vertical-sidebar/NavGroup/NavGroup.vue b/components/layout/full/vertical-sidebar/NavGroup/NavGroup.vue index 49f3de7..437793e 100644 --- a/components/layout/full/vertical-sidebar/NavGroup/NavGroup.vue +++ b/components/layout/full/vertical-sidebar/NavGroup/NavGroup.vue @@ -6,9 +6,9 @@ const props = defineProps({ item: Object }); - + /> --> {{ $t(props.item.header) }} diff --git a/components/layout/full/vertical-sidebar/VerticalSidebar.vue b/components/layout/full/vertical-sidebar/VerticalSidebar.vue index d98c378..49721ac 100644 --- a/components/layout/full/vertical-sidebar/VerticalSidebar.vue +++ b/components/layout/full/vertical-sidebar/VerticalSidebar.vue @@ -96,6 +96,11 @@ function showData(data: any) { // MiniSidebar Icons End const customizer = useCustomizerStore(); const sidebarMenu = shallowRef(sidebarItems); + +// Toggle mini sidebar +const toggleMiniSidebar = () => { + customizer.SET_MINI_SIDEBAR(!customizer.mini_sidebar); +}; + + diff --git a/components/pendaftaran/BiodataPasien.vue b/components/pendaftaran/BiodataPasien.vue index 5bcb582..824c131 100644 --- a/components/pendaftaran/BiodataPasien.vue +++ b/components/pendaftaran/BiodataPasien.vue @@ -2,6 +2,7 @@ import api from '@/services/api'; import type { Props } from '~/types/common'; import type { PatientData } from '~/types/pendaftaran'; +import { Icon } from '@iconify/vue'; const props = withDefaults(defineProps(), { readonly: false @@ -36,7 +37,7 @@ const searchPatients = async (search: string) => { } loadingPatients.value = true; - + try { const response = await api.get('/reference/pasien', { params: { @@ -58,7 +59,7 @@ const searchPatients = async (search: string) => { // Handle search input with debounce const handleSearchInput = (value: string) => { - if(value === formData.value.noRekamMedis) { + if (value === formData.value.noRekamMedis) { patientItems.value = selectedPatient.value ? [selectedPatient.value] : []; return; } @@ -88,9 +89,9 @@ const handlePatientSelect = (patient: PatientData | null) => { // Fetch patient by RM number (for edit mode) const fetchPatientByRm = async (rm: string) => { if (!rm) return; - + loadingPatients.value = true; - + try { const response = await api.get('/reference/pasien', { params: { @@ -117,15 +118,15 @@ const fetchPatientByRm = async (rm: string) => { watchEffect(async () => { const rm = formData.value.noRekamMedis; const nama = formData.value.namaPasien; - + // Use nextTick to ensure all reactive updates are complete await nextTick(); - + // If both RM and Nama are populated but selectedPatient is not, fetch patient details if (rm && nama && !selectedPatient.value) { await fetchPatientByRm(rm); } - + // Clear selectedPatient if RM is cleared if (!rm && selectedPatient.value) { selectedPatient.value = null; @@ -160,15 +161,15 @@ if (!Array.isArray(formData.value.nomorTelepon)) { const handlePhoneInput = (event: Event) => { const input = event.target as HTMLInputElement; const value = input.value; - + // Only allow numbers const numericValue = value.replace(/\D/g, ''); newPhoneNumber.value = numericValue; - + // Validate format and length const lengthValidation = phoneLength(numericValue); const formatValidation = indonesianPhoneFormat(numericValue); - + if (lengthValidation !== true) { phoneError.value = lengthValidation; } else if (formatValidation !== true) { @@ -180,18 +181,18 @@ const handlePhoneInput = (event: Event) => { const addPhoneNumber = () => { if (!newPhoneNumber.value.trim()) return; - + // Validate before saving const lengthValidation = phoneLength(newPhoneNumber.value); const formatValidation = indonesianPhoneFormat(newPhoneNumber.value); - + if (lengthValidation !== true || formatValidation !== true) { return; } - + // Add to list formData.value.nomorTelepon.push(newPhoneNumber.value); - + // Reset input newPhoneNumber.value = ''; phoneError.value = true; @@ -200,73 +201,77 @@ const addPhoneNumber = () => { const deletePhoneNumber = (index: number) => { formData.value.nomorTelepon.splice(index, 1); }; + +// Ref for no rekam medis input +const noRekamMedisInput = ref(); + +// Expose method to focus on no rekam medis +const focusNoRekamMedis = () => { + if (noRekamMedisInput.value) { + noRekamMedisInput.value.focus(); + } +}; + +defineExpose({ + focusNoRekamMedis +});