0
0
Fork 0

fix: refs #6636 Call getEnumValues method

This commit is contained in:
Guillermo Bonet 2024-04-05 11:01:48 +02:00
parent 9310d863aa
commit 1a15ccec2c
1 changed files with 15 additions and 7 deletions

View File

@ -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,