From 9a8ee9d90f669a5395b14107d86d9f788118fa92 Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Tue, 2 Dec 2025 14:50:10 +0700 Subject: [PATCH] dev: hotfix, consultation --- app/components/app/consultation/entry.vue | 22 ++++++++++---------- app/components/content/consultation/list.vue | 2 +- app/models/consultation.ts | 14 ++++++------- app/schemas/consultation.schema.ts | 2 +- app/services/unit.service.ts | 11 ++++------ 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/app/components/app/consultation/entry.vue b/app/components/app/consultation/entry.vue index bff12bfb..873bfd40 100644 --- a/app/components/app/consultation/entry.vue +++ b/app/components/app/consultation/entry.vue @@ -35,24 +35,24 @@ const { defineField, errors, meta } = useForm({ initialValues: { date: props.values.date || today.toISOString().slice(0, 10), problem: '', - dstUnit_id: 0, - } as Partial, + dstUnit_code: '', + } as ConsultationFormData, }) const [date, dateAttrs] = defineField('date') -const [unit_id, unitAttrs] = defineField('unit_id') +const [unit_code, unitAttrs] = defineField('unit_code') const [problem, problemAttrs] = defineField('problem') // Fill fields from props.values if provided if (props.values) { if (props.values.date !== undefined) date.value = props.values.date.substring(0, 10) - if (props.values.dstUnit_id !== undefined) unit_id.value = props.values.dstUnit_id + if (props.values.dstUnit_code !== undefined) unit_code.value = props.values.dstUnit_code if (props.values.problem !== undefined) problem.value = props.values.problem } const resetForm = () => { date.value = date.value ?? today.toISOString().slice(0, 10) - unit_id.value = 0 + unit_code.value = 0 problem.value = '' } @@ -62,7 +62,7 @@ function onSubmitForm(values: any) { encounter_id: props.encounter_id, date: date.value ? `${date.value}T00:00:00Z` : '', problem: problem.value || '', - dstUnit_id: unit_id.value || 0, + dstUnit_code: unit_code.value || '', } emit('submit', formData, resetForm) } @@ -89,18 +89,18 @@ function onCancelForm() { Unit - - {{ errors.unit_id }} + + {{ errors.unit_code }}