feat(sep): implement dpjp
This commit is contained in:
No files matched your search
@@ -9,6 +9,7 @@ import { Input } from '~/components/pub/ui/input'
|
||||
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
|
||||
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'
|
||||
|
||||
// Types
|
||||
@@ -22,17 +23,23 @@ import { useForm } from 'vee-validate'
|
||||
const props = defineProps<{
|
||||
isLoading?: boolean
|
||||
isReadonly?: boolean
|
||||
doctors: any[]
|
||||
patient?: PatientEntity | null | undefined
|
||||
values?: any
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'event', value: any): void
|
||||
(e: 'event', menu: string, value?: any): void
|
||||
}>()
|
||||
|
||||
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
||||
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
||||
|
||||
const admissionTypes = [
|
||||
{ value: '1', label: 'Kontrol' },
|
||||
{ value: '2', label: 'Rujukan' },
|
||||
]
|
||||
|
||||
const items = [
|
||||
{ value: 'item-1', label: 'Item 1' },
|
||||
{ value: 'item-2', label: 'Item 2' },
|
||||
@@ -68,7 +75,6 @@ const onSubmit = handleSubmit((values) => {
|
||||
})
|
||||
|
||||
watch(props, (value) => {
|
||||
console.log('patient changed:', value)
|
||||
const patient = value.patient || ({} as PatientEntity)
|
||||
if (Object.keys(patient).length > 0) {
|
||||
bpjsNumber.value = '-'
|
||||
@@ -116,9 +122,10 @@ watch(props, (value) => {
|
||||
icon-name="i-lucide-chevron-down"
|
||||
v-model="admissionType"
|
||||
v-bind="admissionTypeAttrs"
|
||||
:items="items"
|
||||
:items="admissionTypes"
|
||||
:disabled="isLoading || isReadonly"
|
||||
placeholder="Pilih jalur"
|
||||
@change="emit('event', 'admission-type', $event)"
|
||||
/>
|
||||
</Field>
|
||||
</Cell>
|
||||
@@ -327,14 +334,15 @@ watch(props, (value) => {
|
||||
<span class="text-red-500">*</span>
|
||||
</Label>
|
||||
<Field :errMessage="errors.attendingDoctor">
|
||||
<Select
|
||||
<Combobox
|
||||
id="attendingDoctor"
|
||||
icon-name="i-lucide-chevron-down"
|
||||
v-model="attendingDoctor"
|
||||
v-bind="attendingDoctorAttrs"
|
||||
:items="items"
|
||||
:disabled="isLoading || isReadonly"
|
||||
:items="doctors"
|
||||
:is-disabled="isLoading || isReadonly"
|
||||
placeholder="Pilih DPJP"
|
||||
search-placeholder="Cari DPJP"
|
||||
empty-message="Item tidak ditemukan"
|
||||
/>
|
||||
</Field>
|
||||
</Cell>
|
||||
|
||||
Reference in New Issue
Block a user