fix: update list medicine
This commit is contained in:
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// Components
|
// 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 Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||||
import AppInstallationList from '~/components/app/installation/list.vue'
|
import AppInstallationList from '~/components/app/installation/list.vue'
|
||||||
@@ -28,11 +28,12 @@ import {
|
|||||||
handleActionRemove,
|
handleActionRemove,
|
||||||
handleCancelForm,
|
handleCancelForm,
|
||||||
} from '~/handlers/installation.handler'
|
} from '~/handlers/installation.handler'
|
||||||
import { encounterClasses, getEncounterClassConstants } from '~/handlers/_shared.handler'
|
|
||||||
|
|
||||||
// Services
|
// 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 title = ref('')
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -45,10 +46,10 @@ const {
|
|||||||
fetchData: getInstallationList,
|
fetchData: getInstallationList,
|
||||||
} = usePaginatedList({
|
} = usePaginatedList({
|
||||||
fetchFn: async (params: any) => {
|
fetchFn: async (params: any) => {
|
||||||
// TODO: use pagination params
|
const result = await getList({
|
||||||
const result = await getInstallations({
|
|
||||||
search: params.search,
|
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 || {} }
|
return { success: result.success || false, body: result.body || {} }
|
||||||
},
|
},
|
||||||
@@ -87,7 +88,7 @@ provide('rec_item', recItem)
|
|||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
const getCurrentInstallationDetail = async (id: number | string) => {
|
const getCurrentInstallationDetail = async (id: number | string) => {
|
||||||
const result = await getInstallationDetail(id)
|
const result = await getDetail(id)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const currentValue = result.body?.data || {}
|
const currentValue = result.body?.data || {}
|
||||||
recItem.value = currentValue
|
recItem.value = currentValue
|
||||||
@@ -115,8 +116,8 @@ watch([recId, recAction], () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
encounterClasses.value = getEncounterList()
|
||||||
await getInstallationList()
|
await getInstallationList()
|
||||||
await getEncounterClassConstants()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
} from '~/handlers/medicine-group.handler'
|
} from '~/handlers/medicine-group.handler'
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
import { getMedicineGroups, getMedicineGroupDetail } from '~/services/medicine-group.service'
|
import { getList, getDetail } from '~/services/medicine-group.service'
|
||||||
|
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
|
||||||
@@ -44,7 +44,11 @@ const {
|
|||||||
fetchData: getMedicineGroupList,
|
fetchData: getMedicineGroupList,
|
||||||
} = usePaginatedList({
|
} = usePaginatedList({
|
||||||
fetchFn: async (params: any) => {
|
fetchFn: async (params: any) => {
|
||||||
const result = await getMedicineGroups({ search: params.search, page: params['page-number'] || 0 })
|
const result = await getList({
|
||||||
|
search: params.search,
|
||||||
|
'page-number': params['page-number'] || 0,
|
||||||
|
'page-size': params['page-size'] || 10,
|
||||||
|
})
|
||||||
return { success: result.success || false, body: result.body || {} }
|
return { success: result.success || false, body: result.body || {} }
|
||||||
},
|
},
|
||||||
entityName: 'medicine-group',
|
entityName: 'medicine-group',
|
||||||
@@ -82,7 +86,7 @@ provide('rec_item', recItem)
|
|||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
const getCurrentMedicineGroupDetail = async (id: number | string) => {
|
const getCurrentMedicineGroupDetail = async (id: number | string) => {
|
||||||
const result = await getMedicineGroupDetail(id)
|
const result = await getDetail(id)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const currentValue = result.body?.data || {}
|
const currentValue = result.body?.data || {}
|
||||||
recItem.value = currentValue
|
recItem.value = currentValue
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
} from '~/handlers/medicine-method.handler'
|
} from '~/handlers/medicine-method.handler'
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
import { getMedicineMethods, getMedicineMethodDetail } from '~/services/medicine-method.service'
|
import { getList, getDetail } from '~/services/medicine-method.service'
|
||||||
|
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
|
||||||
@@ -44,7 +44,11 @@ const {
|
|||||||
fetchData: getMedicineMethodList,
|
fetchData: getMedicineMethodList,
|
||||||
} = usePaginatedList({
|
} = usePaginatedList({
|
||||||
fetchFn: async (params: any) => {
|
fetchFn: async (params: any) => {
|
||||||
const result = await getMedicineMethods({ search: params.search, page: params['page-number'] || 0 })
|
const result = await getList({
|
||||||
|
search: params.search,
|
||||||
|
'page-number': params['page-number'] || 0,
|
||||||
|
'page-size': params['page-size'] || 10,
|
||||||
|
})
|
||||||
return { success: result.success || false, body: result.body || {} }
|
return { success: result.success || false, body: result.body || {} }
|
||||||
},
|
},
|
||||||
entityName: 'medicine-method',
|
entityName: 'medicine-method',
|
||||||
@@ -82,7 +86,7 @@ provide('rec_item', recItem)
|
|||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
const getCurrentMedicineMethodDetail = async (id: number | string) => {
|
const getCurrentMedicineMethodDetail = async (id: number | string) => {
|
||||||
const result = await getMedicineMethodDetail(id)
|
const result = await getDetail(id)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const currentValue = result.body?.data || {}
|
const currentValue = result.body?.data || {}
|
||||||
recItem.value = currentValue
|
recItem.value = currentValue
|
||||||
|
|||||||
@@ -31,18 +31,16 @@ import {
|
|||||||
handleActionRemove,
|
handleActionRemove,
|
||||||
handleCancelForm,
|
handleCancelForm,
|
||||||
} from '~/handlers/medicine.handler'
|
} from '~/handlers/medicine.handler'
|
||||||
import {
|
|
||||||
medicineGroups,
|
|
||||||
medicineMethods,
|
|
||||||
uoms,
|
|
||||||
getMedicineGroupList,
|
|
||||||
getMedicineMethodList,
|
|
||||||
getUomList,
|
|
||||||
} from '~/handlers/_shared.handler'
|
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
import { getMedicines, getMedicineDetail } from '~/services/medicine.service'
|
import { getList, getDetail } from '~/services/medicine.service'
|
||||||
|
import { getValueLabelList as getMedicineGroupList } from '~/services/medicine-group.service'
|
||||||
|
import { getValueLabelList as getMedicineMethodList } from '~/services/medicine-method.service'
|
||||||
|
import { getValueLabelList as getUomList } from '~/services/uom.service'
|
||||||
|
|
||||||
|
const medicineGroups = ref<{ value: string; label: string }[]>([])
|
||||||
|
const medicineMethods = ref<{ value: string; label: string }[]>([])
|
||||||
|
const uoms = ref<{ value: string; label: string }[]>([])
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -55,9 +53,10 @@ const {
|
|||||||
fetchData: getMedicineList,
|
fetchData: getMedicineList,
|
||||||
} = usePaginatedList({
|
} = usePaginatedList({
|
||||||
fetchFn: async (params: any) => {
|
fetchFn: async (params: any) => {
|
||||||
const result = await getMedicines({
|
const result = await getList({
|
||||||
search: params.search,
|
search: params.search,
|
||||||
page: params['page-number'] || 0,
|
'page-number': params['page-number'] || 0,
|
||||||
|
'page-size': params['page-size'] || 10,
|
||||||
includes: 'medicineGroup,medicineMethod,uom',
|
includes: 'medicineGroup,medicineMethod,uom',
|
||||||
})
|
})
|
||||||
return { success: result.success || false, body: result.body || {} }
|
return { success: result.success || false, body: result.body || {} }
|
||||||
@@ -97,7 +96,7 @@ provide('rec_item', recItem)
|
|||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
const getCurrentMedicineDetail = async (id: number | string) => {
|
const getCurrentMedicineDetail = async (id: number | string) => {
|
||||||
const result = await getMedicineDetail(id)
|
const result = await getDetail(id)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const currentValue = result.body?.data || {}
|
const currentValue = result.body?.data || {}
|
||||||
recItem.value = currentValue
|
recItem.value = currentValue
|
||||||
@@ -124,10 +123,10 @@ watch([recId, recAction], () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
medicineGroups.value = await getMedicineGroupList()
|
||||||
|
medicineMethods.value = await getMedicineMethodList()
|
||||||
|
uoms.value = await getUomList()
|
||||||
await getMedicineList()
|
await getMedicineList()
|
||||||
await getMedicineGroupList()
|
|
||||||
await getMedicineMethodList()
|
|
||||||
await getUomList()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
// variables
|
// variables
|
||||||
export const medicineGroups = ref<{ value: string; label: string }[]>([])
|
|
||||||
export const medicineMethods = ref<{ value: string; label: string }[]>([])
|
|
||||||
export const encounterClasses = ref<{ value: string; label: string }[]>([])
|
|
||||||
export const divisions = ref<{ value: string | number; label: string }[]>([])
|
|
||||||
export const installations = ref<{ value: string; label: string }[]>([])
|
export const installations = ref<{ value: string; label: string }[]>([])
|
||||||
export const specialists = ref<{ value: string | number; label: string }[]>([])
|
export const specialists = ref<{ value: string | number; label: string }[]>([])
|
||||||
export const uoms = ref<{ value: string; label: string }[]>([])
|
|
||||||
export const units = ref<{ value: string | number; label: string }[]>([])
|
export const units = ref<{ value: string | number; label: string }[]>([])
|
||||||
|
|
||||||
Reference in New Issue
Block a user