From 51725d7f73594805ae3afad8d3bb7989b0000fc1 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Fri, 12 Dec 2025 16:12:24 +0700 Subject: [PATCH 1/5] feat(patient): doc preview, integration to select ethnic and lang (#229) * impl: opts for ethnic and lang * fix: doc related for preview fix: upload dokumen kk dan ktp fix dokumen preview fix: add preview doc on edit form --- app/components/app/patient/entry-form.vue | 135 +++++++++++++++--- .../app/patient/fields/select-ethnicity.vue | 37 ++--- .../app/patient/fields/select-lang.vue | 21 +-- app/components/app/patient/preview.vue | 85 ++++++++++- app/components/content/patient/detail.vue | 18 +++ app/components/content/patient/form.vue | 56 +++++++- app/models/ethnic.ts | 2 +- app/models/language.ts | 4 +- app/services/ethnic.service.ts | 44 ++++++ app/services/language.service.ts | 44 ++++++ app/services/patient.service.ts | 9 +- 11 files changed, 400 insertions(+), 55 deletions(-) create mode 100644 app/services/ethnic.service.ts create mode 100644 app/services/language.service.ts diff --git a/app/components/app/patient/entry-form.vue b/app/components/app/patient/entry-form.vue index c2e187a5..34dd2a34 100644 --- a/app/components/app/patient/entry-form.vue +++ b/app/components/app/patient/entry-form.vue @@ -11,6 +11,7 @@ import { calculateAge } from '~/models/person' // components import * as DE from '~/components/pub/my-ui/doc-entry' import { InputBase, FileField as FileUpload } from '~/components/pub/my-ui/form' +import { Skeleton } from '~/components/pub/ui/skeleton' import { SelectBirthPlace } from '~/components/app/person/fields' import { InputName, @@ -60,10 +61,20 @@ interface PatientFormInput { interface Props { isReadonly: boolean + languageOptions?: { value: string; label: string }[] + ethnicOptions?: { value: string; label: string }[] initialValues?: PatientFormInput + mode?: 'add' | 'edit' + identityFileUrl?: string + familyCardFileUrl?: string } const props = defineProps() + +const emit = defineEmits<{ + (e: 'preview', url: string): void +}>() + const formSchema = toTypedSchema(PatientSchema) const { values, resetForm, setValues, setFieldValue, validate, setFieldError } = useForm({ @@ -208,6 +219,7 @@ watch( label="Suku" placeholder="Pilih suku bangsa" :is-disabled="isReadonly || values.nationality !== 'WNI'" + :items="ethnicOptions || []" /> - - +
+ + +
+ Dokumen Tersimpan +
+ Dokumen KTP + + +
+
+ + Lihat Dokumen +
+
+ + No Data +
+
+
+
+
+
+ + +
+ Dokumen Tersimpan +
+ Dokumen KK + + +
+
+ + Lihat Dokumen +
+
+ + No Data +
+
+
+
+
diff --git a/app/components/app/patient/fields/select-ethnicity.vue b/app/components/app/patient/fields/select-ethnicity.vue index 43ef6cba..73645441 100644 --- a/app/components/app/patient/fields/select-ethnicity.vue +++ b/app/components/app/patient/fields/select-ethnicity.vue @@ -6,6 +6,7 @@ import { cn } from '~/lib/utils' import * as DE from '~/components/pub/my-ui/doc-entry' const props = defineProps<{ + items: { value: string; label: string }[] fieldName?: string label?: string placeholder?: string @@ -28,23 +29,23 @@ const { labelClass, } = props -const ethnicOptions = [ - { label: 'Tidak diketahui', value: 'unknown', priority: 1 }, - { label: 'Jawa', value: 'jawa' }, - { label: 'Sunda', value: 'sunda' }, - { label: 'Batak', value: 'batak' }, - { label: 'Betawi', value: 'betawi' }, - { label: 'Minangkabau', value: 'minangkabau' }, - { label: 'Bugis', value: 'bugis' }, - { label: 'Madura', value: 'madura' }, - { label: 'Banjar', value: 'banjar' }, - { label: 'Bali', value: 'bali' }, - { label: 'Dayak', value: 'dayak' }, - { label: 'Aceh', value: 'aceh' }, - { label: 'Sasak', value: 'sasak' }, - { label: 'Papua', value: 'papua' }, - { label: 'Lainnya', value: 'lainnya', priority: -100 }, -] +// const ethnicOptions = [ +// { label: 'Tidak diketahui', value: 'unknown', priority: 1 }, +// { label: 'Jawa', value: 'jawa' }, +// { label: 'Sunda', value: 'sunda' }, +// { label: 'Batak', value: 'batak' }, +// { label: 'Betawi', value: 'betawi' }, +// { label: 'Minangkabau', value: 'minangkabau' }, +// { label: 'Bugis', value: 'bugis' }, +// { label: 'Madura', value: 'madura' }, +// { label: 'Banjar', value: 'banjar' }, +// { label: 'Bali', value: 'bali' }, +// { label: 'Dayak', value: 'dayak' }, +// { label: 'Aceh', value: 'aceh' }, +// { label: 'Sasak', value: 'sasak' }, +// { label: 'Papua', value: 'papua' }, +// { label: 'Lainnya', value: 'lainnya', priority: -100 }, +// ]