27 lines
865 B
TypeScript
27 lines
865 B
TypeScript
// types
|
|
import type { Uom } from '~/models/uom'
|
|
|
|
// services
|
|
import { getUoms } from '~/services/uom.service'
|
|
import { getEncounters } from '~/services/encounter.service'
|
|
|
|
// variables
|
|
export const uoms = ref<{ value: string; label: string }[]>([])
|
|
export const encounterClasses = ref<{ value: string; label: string }[]>([])
|
|
|
|
export const getUomList = async () => {
|
|
const result = await getUoms()
|
|
if (result.success) {
|
|
const currentUoms = result.body?.data || []
|
|
uoms.value = currentUoms.map((uom: Uom) => ({ value: uom.code || uom.erp_id, label: uom.name }))
|
|
}
|
|
}
|
|
|
|
export const getEncounterClassList = async () => {
|
|
const result = await getEncounters()
|
|
if (result.success) {
|
|
const currentValues = result.body?.data || []
|
|
encounterClasses.value = currentValues.map((item: any) => ({ value: item.code || item.id, label: item.name }))
|
|
}
|
|
}
|