enhance (soapi): get detail

This commit is contained in:
Abizrh
2025-12-09 23:23:07 +07:00
parent a8bf9c172d
commit 6ba4b8ee6a
3 changed files with 11 additions and 6 deletions
+7 -1
View File
@@ -68,6 +68,7 @@ const model = ref({
weight: '',
height: '',
})
const formKey = ref(0)
const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
@@ -95,7 +96,11 @@ async function getDetail() {
isLoading.isTableLoading = true
const resp = await xfetch(`/api/v1/soapi/${recordId.value}`)
if (resp.success) {
diagnoses.value = (resp.body as Record<string, any>).data
const raw = (resp.body as Record<string, any>).data
const values = JSON.parse(raw.value)
console.log('values', values)
model.value = values
formKey.value++ // Force re-render with new data
}
isLoading.isTableLoading = false
}
@@ -158,6 +163,7 @@ provide('icdPreview', icdPreview)
</script>
<template>
<Entry
:key="formKey"
ref="entryRehabRef"
v-model="model"
:schema="schema"
+3 -2
View File
@@ -44,6 +44,7 @@ const model = ref({
const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
})
const formKey = ref(0)
async function getDetail() {
isLoading.isTableLoading = true
@@ -53,7 +54,7 @@ async function getDetail() {
const values = JSON.parse(raw.value)
console.log('values', values)
model.value = values
// diagnoses.value = (resp.body as Record<string, any>).data
formKey.value++ // Force re-render with new data
}
isLoading.isTableLoading = false
}
@@ -136,8 +137,8 @@ provide('table_data_loader', isLoading)
provide('icdPreview', icdPreview)
</script>
<template>
{{ model }}
<Entry
:key="formKey"
ref="entryRef"
v-model="model"
:schema="schema"
+1 -3
View File
@@ -84,9 +84,7 @@ const defaultKeys: Record<string, any> = {
id: 'rehab-medical-assessment',
title: 'Pengkajian Awal Medis Rehabilitasi Medis',
classCode: ['ambulatory'],
// FIXME: just for now
// unit: 'rehab',
unit: 'all',
unit: 'rehab',
afterId: 'early-medical-assessment',
},
functionAssessment: {