fix: update list medicine

This commit is contained in:
riefive
2025-10-06 11:00:14 +07:00
parent 3003ec9d80
commit 301cb82803
5 changed files with 37 additions and 36 deletions
+9 -8
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
// Components
import Dialog from '~/components/pub/base/modal/dialog.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
import AppInstallationList from '~/components/app/installation/list.vue'
@@ -28,11 +28,12 @@ import {
handleActionRemove,
handleCancelForm,
} from '~/handlers/installation.handler'
import { encounterClasses, getEncounterClassConstants } from '~/handlers/_shared.handler'
// Services
import { getInstallations, getInstallationDetail } from '~/services/installation.service'
import { getList, getDetail } from '~/services/installation.service'
import { getValueLabelListConstants as getEncounterList } from '~/services/encounter.service'
const encounterClasses = ref<{ value: string; label: string }[]>([])
const title = ref('')
const {
@@ -45,10 +46,10 @@ const {
fetchData: getInstallationList,
} = usePaginatedList({
fetchFn: async (params: any) => {
// TODO: use pagination params
const result = await getInstallations({
const result = await getList({
search: params.search,
// page: params['page-number'] || 0,
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
})
return { success: result.success || false, body: result.body || {} }
},
@@ -87,7 +88,7 @@ provide('rec_item', recItem)
provide('table_data_loader', isLoading)
const getCurrentInstallationDetail = async (id: number | string) => {
const result = await getInstallationDetail(id)
const result = await getDetail(id)
if (result.success) {
const currentValue = result.body?.data || {}
recItem.value = currentValue
@@ -115,8 +116,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
encounterClasses.value = getEncounterList()
await getInstallationList()
await getEncounterClassConstants()
})
</script>