diff --git a/app/components/app/person-contact/entry-form.vue b/app/components/app/person-contact/entry-form.vue index 266ba000..516f50ae 100644 --- a/app/components/app/person-contact/entry-form.vue +++ b/app/components/app/person-contact/entry-form.vue @@ -2,16 +2,18 @@ import { toTypedSchema } from '@vee-validate/zod' // components +import * as DE from '~/components/pub/my-ui/doc-entry' import { Form } from '~/components/pub/ui/form' import { FieldArray } from 'vee-validate' import { SelectContactType } from './fields' -import { InputBase } from '~/components/pub/my-ui/form' +import { ButtonAction, InputBase } from '~/components/pub/my-ui/form' const props = defineProps<{ title: string schema: any - contactLimit: number + contactLimit?: number initialValues?: any + isReadonly?: boolean }>() const { contactLimit = 5 } = props @@ -24,6 +26,8 @@ defineExpose({ setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate), values: computed(() => formRef.value?.values), }) + +const { title = 'Kontak Pasien', isReadonly = false } = props @@ -33,79 +37,67 @@ defineExpose({ keep-values :validation-schema="formSchema" :validate-on-mount="false" + :initial-values="initialValues ? initialValues : {}" validation-mode="onSubmit" - :initial-values="initialValues || { contacts: [{ contactType: '', contactNumber: '' }] }" > - - {{ props.title || 'Kontak Pasien' }} + + {{ title }} - - - - + + + {{ push({ relation: '', name: '', address: '', phone: '' }) }} + + + - - - - - - - - - + + + + - - - + + + + - - - - Tambah Kontak - - - - + + diff --git a/app/components/app/person-contact/fields/select-contact-type.vue b/app/components/app/person-contact/fields/select-contact-type.vue index d6f8fe24..c63a0bee 100644 --- a/app/components/app/person-contact/fields/select-contact-type.vue +++ b/app/components/app/person-contact/fields/select-contact-type.vue @@ -1,14 +1,13 @@ - - + {{ label }} - - + - - + + diff --git a/app/components/app/person-relative/entry-form.vue b/app/components/app/person-relative/entry-form.vue index e8e51433..40b08c43 100644 --- a/app/components/app/person-relative/entry-form.vue +++ b/app/components/app/person-relative/entry-form.vue @@ -6,14 +6,14 @@ import { FieldArray } from 'vee-validate' import * as DE from '~/components/pub/my-ui/doc-entry' import { Form } from '~/components/pub/ui/form' import { SelectRelations } from './fields' -import InputBase from '~/components/pub/my-ui/form/input-base.vue' -import ButtonAction from '~/components/pub/my-ui/form/button-action.vue' +import { ButtonAction, InputBase } from '~/components/pub/my-ui/form' const props = defineProps<{ title: string schema: any isReadonly?: boolean initialValues?: any + contactLimit?: number }>() const formSchema = toTypedSchema(props.schema) @@ -26,7 +26,7 @@ defineExpose({ values: computed(() => formRef.value?.values), }) -const { title = 'Kontak Pasien', isReadonly = false } = props +const { title = 'Kontak Pasien', isReadonly = false, contactLimit = 5 } = props @@ -102,9 +102,9 @@ const { title = 'Kontak Pasien', isReadonly = false } = props
- {{ props.title || 'Kontak Pasien' }} +
+ {{ title }}