This commit is contained in:
2021-03-19 15:05:53 +00:00
parent 845a458fb4
commit ae68ec0695
3 changed files with 23 additions and 14 deletions

View File

@@ -87,16 +87,6 @@
lg="4"
xl="3"
>
<!-- <v-text-field
v-model="obj.unit"
:readonly="formState.readOnly"
:label="$ay.t('RateUnitChargeDescriptionID')"
ref="unit"
data-cy="unit"
:error-messages="form().serverErrors(this, 'unit')"
@input="fieldValueChanged('unit')"
></v-text-field> -->
<v-combobox
v-model="obj.unit"
:readonly="formState.readOnly"

View File

@@ -87,7 +87,7 @@
lg="4"
xl="3"
>
<v-text-field
<v-combobox
v-model="obj.unit"
:readonly="formState.readOnly"
:label="$ay.t('RateUnitChargeDescriptionID')"
@@ -95,7 +95,8 @@
data-cy="unit"
:error-messages="form().serverErrors(this, 'unit')"
@input="fieldValueChanged('unit')"
></v-text-field>
:items="selectLists.priorUnits"
></v-combobox>
</v-col>
<v-col
v-if="form().showMe(this, 'ContractOnly')"
@@ -294,7 +295,10 @@ export default {
serverError: {}
},
rights: window.$gz.role.defaultRightsObject(),
ayaType: window.$gz.type.TravelRate
ayaType: window.$gz.type.TravelRate,
selectLists: {
priorUnits: []
}
};
},
//WATCHERS
@@ -692,6 +696,7 @@ let JUST_DELETED = false;
async function initForm(vm) {
await fetchTranslatedText(vm);
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
await populateSelectionLists(vm);
}
//////////////////////////////////////////////////////////
@@ -726,4 +731,17 @@ async function fetchTranslatedText(vm) {
"TravelRateCustom16"
]);
}
//////////////////////
//
//
async function populateSelectionLists(vm) {
let res = await window.$gz.api.get("travel-rate/prior-unit-list");
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.selectLists.priorUnits = res.data;
}
}
</script>