diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 38d5d1ed5..56717c628 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; +import axios from 'axios'; import { useSession } from 'src/composables/useSession'; const route = useRoute(); @@ -50,13 +51,20 @@ function setClaimStates(data) { claimStates.value = data; claimStatesCopy.value = data; } - -// Simulate ENUM -let optionsList = [ - { id: null, description: t('claim.basicData.null') }, - { id: 'agency', description: t('claim.basicData.agency') }, - { id: 'delivery', description: t('claim.basicData.delivery') }, -]; +let optionsList; +async function getEnumValues() { + optionsList = [{ id: null, description: t('claim.basicData.null') }]; + const { data } = await axios.get(`Applications/get-enum-values`, { + params: { + schema: 'vn', + table: 'claim', + column: 'pickup', + }, + }); + for (let value of data) + optionsList.push({ id: value, description: t(`claim.basicData.${value}`) }); +} +getEnumValues(); const workerFilter = { options: workers,