🐛 fix (cprj): fix encounter-id prop for getlist function

This commit is contained in:
Abizrh
2025-11-21 15:43:27 +07:00
parent 2da2961f03
commit 4f8407f978
2 changed files with 5 additions and 3 deletions

No files matched your search

+3 -1
View File
@@ -41,6 +41,7 @@ interface Props {
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const emits = defineEmits(['add', 'edit']) const emits = defineEmits(['add', 'edit'])
const route = useRoute()
const { recordId } = useQueryCRUDRecordId() const { recordId } = useQueryCRUDRecordId()
const { goToEntry, backToList } = useQueryCRUDMode('mode') const { goToEntry, backToList } = useQueryCRUDMode('mode')
@@ -48,6 +49,7 @@ const { goToEntry, backToList } = useQueryCRUDMode('mode')
let units = ref<{ value: string; label: string }[]>([]) let units = ref<{ value: string; label: string }[]>([])
const encounterId = ref<number>(props?.encounter?.id || 0) const encounterId = ref<number>(props?.encounter?.id || 0)
const title = ref('') const title = ref('')
const id = route.params.id
const { const {
data, data,
@@ -60,7 +62,7 @@ const {
} = usePaginatedList({ } = usePaginatedList({
fetchFn: async ({ page, search }) => { fetchFn: async ({ page, search }) => {
const result = await getList({ const result = await getList({
'encounter-id': props.encounter.id, 'encounter-id': id,
'type-code': 'dev-record', 'type-code': 'dev-record',
includes: 'encounter', includes: 'encounter',
search, search,
+2 -2
View File
@@ -71,7 +71,7 @@ onMounted(async () => {
}) })
async function getMyList() { async function getMyList() {
const url = `/api/v1/soapi?type-code=${typeCode.value}?includes=encounter` const url = `/api/v1/soapi?type-code=${typeCode.value}&includes=encounter&encounter-id=${route.params.id}`
const resp = await xfetch(url) const resp = await xfetch(url)
if (resp.success) { if (resp.success) {
data.value = (resp.body as Record<string, any>).data data.value = (resp.body as Record<string, any>).data
@@ -103,7 +103,7 @@ watch(
(val) => { (val) => {
if (val) { if (val) {
if (val === 'early-medical-assessment') { if (val === 'early-medical-assessment') {
typeCode.value = 'early' typeCode.value = 'early-medic'
} else if (val === 'rehab-medical-assessment') { } else if (val === 'rehab-medical-assessment') {
typeCode.value = 'early-rehab' typeCode.value = 'early-rehab'
} else if (val === 'function-assessment') { } else if (val === 'function-assessment') {