From 25d44323f4ca966b850d8ac2488c1106fc66ae2c Mon Sep 17 00:00:00 2001 From: riefive Date: Tue, 21 Oct 2025 13:24:51 +0700 Subject: [PATCH] feat(sep): create constant of sep --- app/components/app/sep/entry-form.vue | 26 ++++++++-------- .../pub/my-ui/combobox/combobox.vue | 12 ++++++-- app/lib/constants.ts | 30 +++++++++++++++++++ 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/app/components/app/sep/entry-form.vue b/app/components/app/sep/entry-form.vue index 82491a5f..978dc4f0 100644 --- a/app/components/app/sep/entry-form.vue +++ b/app/components/app/sep/entry-form.vue @@ -317,17 +317,17 @@ watch(props, (value) => { >
- +
- +
@@ -403,17 +403,17 @@ watch(props, (value) => { >
- +
- +
@@ -432,14 +432,14 @@ watch(props, (value) => { >
diff --git a/app/components/pub/my-ui/combobox/combobox.vue b/app/components/pub/my-ui/combobox/combobox.vue index 23505393..3bcce02b 100644 --- a/app/components/pub/my-ui/combobox/combobox.vue +++ b/app/components/pub/my-ui/combobox/combobox.vue @@ -16,14 +16,15 @@ const props = defineProps<{ const emit = defineEmits<{ 'update:modelValue': [value: string] + 'update:searchText': [value: string] }>() const open = ref(false) - +const searchText = ref('') +const debouncedSearchText = refDebounced(searchText, 500) // 500ms debounce const selectedItem = computed(() => props.items.find((item) => item.value === props.modelValue)) const displayText = computed(() => { - console.log(selectedItem) if (selectedItem.value?.label) { return selectedItem.value.label } @@ -34,6 +35,12 @@ watch(props, () => { console.log(props.modelValue) }) +watch(debouncedSearchText, (newValue) => { + if (newValue.length > 0) { + emit('update:searchText', newValue) + } +}) + const searchableItems = computed(() => { const itemsWithSearch = props.items.map((item) => ({ ...item, @@ -106,6 +113,7 @@ function onSelect(item: Item) { class="h-9 border-0 border-b border-gray-200 bg-white text-black focus:ring-0 dark:border-gray-700 dark:bg-gray-800 dark:text-white" :placeholder="searchPlaceholder || 'Cari...'" :aria-label="`Cari ${displayText}`" + :v-model="searchText" /> {{ emptyMessage || 'Item tidak ditemukan.' }} diff --git a/app/lib/constants.ts b/app/lib/constants.ts index 59dd9bf5..93fef8c4 100644 --- a/app/lib/constants.ts +++ b/app/lib/constants.ts @@ -366,3 +366,33 @@ export const medicalActionTypeCode: Record = { } as const export type medicalActionTypeCodeKey = keyof typeof medicalActionTypeCode + +export const lakaStatuses: Record = { + '0': 'Bukan Kecelakaan lalu lintas [BKLL]', + '1': 'KLL dan Bukan Kecelakaan Kerja [BKK]', + '2': 'KLL', + '3': 'KK', +} + +export const supportCodes: Record = { + '1': 'Radioterapi', + '2': 'Kemoterapi', + '3': 'Rehabilitasi Medik', + '4': 'Rehabilitasi Psikososial', + '5': 'Transfusi Darah', + '6': 'Pelayanan Gigi', + '7': 'Laboratorium', + '8': 'USG', + '9': 'Farmasi', + '10': 'Lain-Lain', + '11': 'MRI', + '12': 'HEMODIALISA', +} + +export const serviceAssessments: Record = { + '1': 'Poli spesialis tidak tersedia pada hari sebelumnya', + '2': 'Jam Poli telah berakhir pada hari sebelumnya', + '3': 'Dokter Spesialis yang dimaksud tidak praktek pada hari sebelumnya', + '4': 'Atas Instruksi RS', + '5': 'Tujuan Kontrol', +}