feat(encounter): enhance form submission handling with detailed logging and fallback mechanism

This commit is contained in:
riefive
2025-11-10 13:58:58 +07:00
parent 1cdcd80383
commit 498a4c1fe5
2 changed files with 45 additions and 2 deletions
+19 -1
View File
@@ -269,6 +269,24 @@ async function handleEvent(menu: string, value?: any) {
}
}
// Handle save button click
function handleSaveClick() {
console.log('🔵 handleSaveClick called')
console.log('🔵 formRef:', formRef.value)
console.log('🔵 isSaveDisabled:', isSaveDisabled.value)
console.log('🔵 selectedPatient:', selectedPatient.value)
console.log('🔵 selectedPatientObject:', selectedPatientObject.value)
console.log('🔵 isSaving:', isSaving.value)
console.log('🔵 isLoadingDetail:', isLoadingDetail.value)
if (formRef.value && typeof formRef.value.submitForm === 'function') {
console.log('🔵 Calling formRef.value.submitForm()')
formRef.value.submitForm()
} else {
console.error('❌ formRef.value is null or submitForm is not a function')
}
}
/**
* Validate SEP number
*/
@@ -745,7 +763,7 @@ onMounted(async () => {
type="button"
class="h-[40px] min-w-[120px] text-white"
:disabled="isSaveDisabled"
@click="formRef?.submitForm()"
@click="handleSaveClick"
>
<Icon
name="i-lucide-save"