From 7c4f08780c6d7ca38542cef8d2a30a3ab17e1595 Mon Sep 17 00:00:00 2001 From: riefive Date: Sat, 6 Dec 2025 04:32:08 +0700 Subject: [PATCH] fix: update encounter payment method --- app/components/app/encounter/entry-form.vue | 27 +---- app/handlers/encounter-entry.handler.ts | 7 +- app/handlers/encounter-init.handler.ts | 107 +++++++------------- app/schemas/integration-encounter.schema.ts | 4 +- 4 files changed, 47 insertions(+), 98 deletions(-) diff --git a/app/components/app/encounter/entry-form.vue b/app/components/app/encounter/entry-form.vue index 86681d2f..64290f3e 100644 --- a/app/components/app/encounter/entry-form.vue +++ b/app/components/app/encounter/entry-form.vue @@ -49,7 +49,6 @@ model.value = genEncounter() // Common preparation const defaultCBItems = [{ label: 'Pilih', value: '' }] -const paymentMethodItems = ref({}) // Emit preparation const emit = defineEmits<{ @@ -84,21 +83,21 @@ const sepTrafficStatus = ref('') const diagnosis = ref('') const noteReference = ref('Hanya diperlukan jika pembayaran jenis JKN') const noteFile = ref('Gunakan file [.pdf, .jpg, .png] dengan ukuran maksimal 1MB') - +const mode = props.mode !== undefined ? props.mode : 'add' const isLoading = props.isLoading !== undefined ? props.isLoading : false const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false -const mode = props.mode !== undefined ? props.mode : 'add' -// SEP validation state from props -const isSepValid = computed(() => props.isSepValid || false) +const isSepValid = computed(() => props.isSepValid || false) // SEP validation state from props const isCheckingSep = computed(() => props.isCheckingSep || false) const isInsurancePayment = computed(() => ['insurance', 'jkn'].includes(paymentMethodCode.value)) const isDateLoading = ref(false) +const isUsePaymentNew = true const debouncedSepNumber = refDebounced(sepNumber, 500) const debouncedCardNumber = refDebounced(cardNumber, 500) const sepFileReview = ref(null) const sippFileReview = ref(null) const unitFullName = ref('') // Unit, specialist, subspecialist const formRef = ref(null) // Expose submit method for parent component +const paymentMethodItems = isUsePaymentNew ? props.payments : CB.recStrToItem(paymentMethodCodes) if (mode === 'add') { // Set default sepDate to current date in YYYY-MM-DD format @@ -236,11 +235,6 @@ function submitForm() { defineExpose({ submitForm, }) - -onMounted(() => { - const isPaymentMethodVclaim = true - paymentMethodItems.value = isPaymentMethodVclaim ? props.payments : CB.recStrToItem(paymentMethodCodes) -})