feat(sep): adjust entry form of sep

This commit is contained in:
riefive
2025-11-06 15:50:29 +07:00
parent 7eecdc67ec
commit daf9c8f46c
3 changed files with 54 additions and 4 deletions
+25 -1
View File
@@ -11,10 +11,12 @@ import { Textarea } from '~/components/pub/ui/textarea'
import Select from '~/components/pub/ui/select/Select.vue'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-single.vue'
import TreeSelect from '~/components/pub/my-ui/select-tree/tree-select.vue'
// Types
import { IntegrationBpjsSchema, type IntegrationBpjsFormData } from '~/schemas/integration-bpjs.schema'
import type { PatientEntity } from '~/models/patient'
import type { TreeItem } from '~/components/pub/my-ui/select-tree/type'
// Helpers
import { watch } from 'vue'
@@ -45,6 +47,7 @@ const props = defineProps<{
provinces: any[]
cities: any[]
districts: any[]
specialists?: TreeItem[]
patient?: PatientEntity | null | undefined
objects?: any
values?: any
@@ -96,6 +99,7 @@ const [accidentCity, accidentCityAttrs] = defineField('accidentCity')
const [accidentDistrict, accidentDistrictAttrs] = defineField('accidentDistrict')
const [suplesi, suplesiAttrs] = defineField('suplesi')
const [suplesiNumber, suplesiNumberAttrs] = defineField('suplesiNumber')
const [subSpecialistId, subSpecialistIdAttrs] = defineField('subSpecialistId')
const titleLetterNumber = computed(() => (admissionType.value === '3' ? 'Surat Kontrol' : 'Surat Rujukan'))
const titleLetterDate = computed(() =>
admissionType.value === '3' ? 'Tanggal Surat Kontrol' : 'Tanggal Surat Rujukan',
@@ -123,6 +127,10 @@ if (mode === 'add') {
sepDate.value = `${year}-${month}-${day}`
}
async function onFetchChildren(parentId: string): Promise<void> {
console.log('onFetchChildren', parentId)
}
// Submit handler
const onSubmit = handleSubmit((values) => {
console.log('✅ Validated form values:', JSON.stringify(values, null, 2))
@@ -456,7 +464,7 @@ onMounted(() => {
</Field>
</Cell>
<Cell>
<Cell v-if="isShowPatient">
<Label height="compact">
Klinik Tujuan
<span class="text-red-500">*</span>
@@ -476,6 +484,22 @@ onMounted(() => {
</Field>
</Cell>
<Cell>
<Label height="compact">
Spesialis / Subspesialis
<span class="text-red-500">*</span>
</Label>
<Field :errMessage="errors.subSpecialistId">
<TreeSelect
id="subSpecialistId"
v-model="subSpecialistId"
v-bind="subSpecialistIdAttrs"
:data="specialists || []"
:on-fetch-children="onFetchChildren"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">
DPJP