enhance (soapi): get detail
This commit is contained in:
No files matched your search
@@ -68,6 +68,7 @@ const model = ref({
|
|||||||
weight: '',
|
weight: '',
|
||||||
height: '',
|
height: '',
|
||||||
})
|
})
|
||||||
|
const formKey = ref(0)
|
||||||
|
|
||||||
const isLoading = reactive<DataTableLoader>({
|
const isLoading = reactive<DataTableLoader>({
|
||||||
isTableLoading: false,
|
isTableLoading: false,
|
||||||
@@ -95,7 +96,11 @@ async function getDetail() {
|
|||||||
isLoading.isTableLoading = true
|
isLoading.isTableLoading = true
|
||||||
const resp = await xfetch(`/api/v1/soapi/${recordId.value}`)
|
const resp = await xfetch(`/api/v1/soapi/${recordId.value}`)
|
||||||
if (resp.success) {
|
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
|
isLoading.isTableLoading = false
|
||||||
}
|
}
|
||||||
@@ -158,6 +163,7 @@ provide('icdPreview', icdPreview)
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Entry
|
<Entry
|
||||||
|
:key="formKey"
|
||||||
ref="entryRehabRef"
|
ref="entryRehabRef"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const model = ref({
|
|||||||
const isLoading = reactive<DataTableLoader>({
|
const isLoading = reactive<DataTableLoader>({
|
||||||
isTableLoading: false,
|
isTableLoading: false,
|
||||||
})
|
})
|
||||||
|
const formKey = ref(0)
|
||||||
|
|
||||||
async function getDetail() {
|
async function getDetail() {
|
||||||
isLoading.isTableLoading = true
|
isLoading.isTableLoading = true
|
||||||
@@ -53,7 +54,7 @@ async function getDetail() {
|
|||||||
const values = JSON.parse(raw.value)
|
const values = JSON.parse(raw.value)
|
||||||
console.log('values', values)
|
console.log('values', values)
|
||||||
model.value = values
|
model.value = values
|
||||||
// diagnoses.value = (resp.body as Record<string, any>).data
|
formKey.value++ // Force re-render with new data
|
||||||
}
|
}
|
||||||
isLoading.isTableLoading = false
|
isLoading.isTableLoading = false
|
||||||
}
|
}
|
||||||
@@ -136,8 +137,8 @@ provide('table_data_loader', isLoading)
|
|||||||
provide('icdPreview', icdPreview)
|
provide('icdPreview', icdPreview)
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
{{ model }}
|
|
||||||
<Entry
|
<Entry
|
||||||
|
:key="formKey"
|
||||||
ref="entryRef"
|
ref="entryRef"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
|
|||||||
@@ -84,9 +84,7 @@ const defaultKeys: Record<string, any> = {
|
|||||||
id: 'rehab-medical-assessment',
|
id: 'rehab-medical-assessment',
|
||||||
title: 'Pengkajian Awal Medis Rehabilitasi Medis',
|
title: 'Pengkajian Awal Medis Rehabilitasi Medis',
|
||||||
classCode: ['ambulatory'],
|
classCode: ['ambulatory'],
|
||||||
// FIXME: just for now
|
unit: 'rehab',
|
||||||
// unit: 'rehab',
|
|
||||||
unit: 'all',
|
|
||||||
afterId: 'early-medical-assessment',
|
afterId: 'early-medical-assessment',
|
||||||
},
|
},
|
||||||
functionAssessment: {
|
functionAssessment: {
|
||||||
|
|||||||
Reference in New Issue
Block a user