feat(encounter): add patientId to formValues and reset recSelectId on add-sep event

This commit is contained in:
riefive
2025-11-06 14:30:38 +07:00
parent d5c06add1d
commit 48b8ee5d2c
3 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -115,11 +115,12 @@ watch(props, (value) => {
function onAddSep() {
const formValues = {
patientId: patientId.value || '',
doctorCode: doctorId.value,
subSpecialistCode: subSpecialistId.value,
registerDate: registerDate.value,
paymentType: paymentType.value,
cardNumber: bpjsNumber.value,
paymentType: paymentType.value,
sepType: sepType.value
}
emit('event', 'add-sep', formValues)
@@ -77,7 +77,6 @@ watch(debouncedSearch, (newValue) => {
emit('fetch', { search: newValue })
}
})
</script>
<template>
@@ -43,6 +43,7 @@ const sepsList = ref<Array<{ value: string; label: string }>>([])
const participantGroupsList = ref<Array<{ value: string; label: string }>>([])
const specialistsTree = ref<TreeItem[]>([])
const doctorsList = ref<Array<{ value: string; label: string }>>([])
const recSelectId = ref<number | null>(null)
function handleSavePatient() {
selectedPatientObject.value = null
@@ -82,6 +83,7 @@ function handleEvent(menu: string, value?: any) {
} else if (menu === 'add') {
navigateTo('/client/patient/add')
} else if (menu === 'add-sep') {
recSelectId.value = null
toNavigateSep({ sourcePath: route.path, resource: 'encounter', isService: 'false', ...value })
} else if (menu === 'save') {
console.log('Save encounter:', value)
@@ -179,6 +181,7 @@ async function handleInit() {
await handleFetchSpecialists()
}
provide('rec_select_id', recSelectId)
provide('table_data_loader', isLoading)
onMounted(async () => {