refactor(person-relative): update schema and form components for family data
- Change value format in radio-parents-input from '1'/'0' to 'yes'/'no' - Remove default labels from select-education and select-job components - Update schema to make fields optional and add new fields - Modify family-parents-form to use new schema and improve UI - Update patient form and models to align with schema changes
This commit is contained in:
No files matched your search
@@ -11,7 +11,7 @@ import { PersonAddressRelativeSchema } from '~/schemas/person-address-relative.s
|
||||
import { PersonAddressSchema } from '~/schemas/person-address.schema'
|
||||
import { PersonContactListSchema } from '~/schemas/person-contact.schema'
|
||||
import { PersonFamiliesSchema } from '~/schemas/person-family.schema'
|
||||
import { ResponsiblePersonSchema } from '~/schemas/person-relative.schema'
|
||||
import { ResponsiblePersonRelativeSchema } from '~/schemas/person-relative.schema'
|
||||
import { uploadAttachment } from '~/services/patient.service'
|
||||
import { getDetail, update } from '~/services/surgery-report.service'
|
||||
import type { SurgeryReport } from '~/models/surgery-report'
|
||||
@@ -28,17 +28,18 @@ import { handleActionEdit } from '~/handlers/surgery-report.handler'
|
||||
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
||||
|
||||
// #region Props & Emits
|
||||
const props = withDefaults(defineProps<{
|
||||
encounter_id: number
|
||||
callbackUrl?: string
|
||||
record_id: number
|
||||
}>(), {
|
||||
|
||||
})
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
encounter_id: number
|
||||
callbackUrl?: string
|
||||
record_id: number
|
||||
}>(),
|
||||
{},
|
||||
)
|
||||
|
||||
// form related state
|
||||
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
|
||||
fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
|
||||
fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person' }),
|
||||
entityName: 'surgery-report',
|
||||
})
|
||||
// #endregion
|
||||
@@ -56,7 +57,7 @@ const selectedOperativeAction = ref<any>(null)
|
||||
onMounted(async () => {
|
||||
const result = await getDetail(props.record_id)
|
||||
if (result.success) {
|
||||
const responseData = {...result.body.data, date: formatDateYyyyMmDd(result.body.data.date)}
|
||||
const responseData = { ...result.body.data, date: formatDateYyyyMmDd(result.body.data.date) }
|
||||
surgeryReport.value = responseData
|
||||
inputForm.value?.setValues(responseData)
|
||||
}
|
||||
@@ -72,17 +73,15 @@ async function handleConfirmAdd() {
|
||||
const response = await handleActionEdit(
|
||||
props.record_id,
|
||||
await composeFormData(),
|
||||
() => { },
|
||||
() => { },
|
||||
() => {},
|
||||
() => {},
|
||||
toast,
|
||||
)
|
||||
goBack()
|
||||
}
|
||||
|
||||
async function composeFormData(): Promise<SurgeryReport> {
|
||||
const [input,] = await Promise.all([
|
||||
inputForm.value?.validate(),
|
||||
])
|
||||
const [input] = await Promise.all([inputForm.value?.validate()])
|
||||
|
||||
const results = [input]
|
||||
const allValid = results.every((r) => r?.valid)
|
||||
@@ -129,9 +128,12 @@ function handleCancelAdd() {
|
||||
:schema="SurgeryReportSchema"
|
||||
:operative-action-list="[]"
|
||||
/>
|
||||
|
||||
|
||||
<div class="my-2 flex justify-end py-2">
|
||||
<Action :enable-draft="false" @click="handleActionClick" />
|
||||
<Action
|
||||
:enable-draft="false"
|
||||
@click="handleActionClick"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Confirmation
|
||||
|
||||
Reference in New Issue
Block a user