From e9ed2a3715889cedecfd4d25166085816c7a80f0 Mon Sep 17 00:00:00 2001 From: riefive Date: Fri, 28 Nov 2025 14:48:29 +0700 Subject: [PATCH] feat: implement SEP search functionality and enhance history management --- app/components/app/encounter/entry-form.vue | 24 +++------ app/components/app/sep/action-history.vue | 31 +++++++++++ app/components/app/sep/list-cfg.history.ts | 52 ++++++++++++++----- app/components/app/sep/list-history.vue | 5 +- app/components/app/sep/view-history.vue | 3 +- app/components/content/encounter/entry.vue | 16 ++++++ app/components/content/sep/entry.vue | 2 +- app/handlers/integration-sep-entry.handler.ts | 14 ++--- 8 files changed, 108 insertions(+), 39 deletions(-) create mode 100644 app/components/app/sep/action-history.vue diff --git a/app/components/app/encounter/entry-form.vue b/app/components/app/encounter/entry-form.vue index 43a7a48c..961b105c 100644 --- a/app/components/app/encounter/entry-form.vue +++ b/app/components/app/encounter/entry-form.vue @@ -183,6 +183,10 @@ function onAddSep() { emit('event', 'add-sep', formValues) } +function onSearchSep() { + emit('event', 'search-sep', { cardNumber: cardNumber.value }) +} + // Submit handler const onSubmit = handleSubmit((values) => { console.log('✅ Validated form values:', JSON.stringify(values, null, 2)) @@ -193,23 +197,11 @@ const onSubmit = handleSubmit((values) => { const formRef = ref(null) function submitForm() { - console.log('🔵 submitForm called, formRef:', formRef.value) - console.log('🔵 Form values:', { - doctorId: doctorId.value, - subSpecialistId: subSpecialistId.value, - registerDate: registerDate.value, - paymentType: paymentType.value, - }) - console.log('🔵 Form errors:', errors.value) - console.log('🔵 Form meta:', meta.value) - // Trigger form submit using native form submit // This will trigger validation and onSubmit handler if (formRef.value) { - console.log('🔵 Calling formRef.value.requestSubmit()') formRef.value.requestSubmit() } else { - console.warn('⚠️ formRef.value is null, cannot submit form') // Fallback: directly call onSubmit handler // Create a mock event object const mockEvent = { @@ -218,7 +210,6 @@ function submitForm() { } as SubmitEvent // Call onSubmit directly - console.log('🔵 Calling onSubmit with mock event') onSubmit(mockEvent) } } @@ -498,7 +489,7 @@ defineExpose({ v-bind="sepNumberAttrs" placeholder="Tambah SEP terlebih dahulu" class="flex-1" - :disabled="isLoading || isReadonly" + :disabled="isLoading || isReadonly || isSepValid" />