This commit is contained in:
2021-03-19 15:00:45 +00:00
parent 7a1b7f1788
commit 845a458fb4

View File

@@ -105,7 +105,7 @@
data-cy="unit"
:error-messages="form().serverErrors(this, 'unit')"
@input="fieldValueChanged('unit')"
:items="rateUnits"
:items="selectLists.priorUnits"
></v-combobox>
</v-col>
@@ -308,7 +308,9 @@ export default {
},
rights: window.$gz.role.defaultRightsObject(),
ayaType: window.$gz.type.ServiceRate,
rateUnits: ["each", "hour"]
selectLists: {
priorUnits: []
}
};
},
//WATCHERS
@@ -706,6 +708,7 @@ let JUST_DELETED = false;
async function initForm(vm) {
await fetchTranslatedText(vm);
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
await populateSelectionLists(vm);
}
//////////////////////////////////////////////////////////
@@ -740,4 +743,17 @@ async function fetchTranslatedText(vm) {
"ServiceRateCustom16"
]);
}
//////////////////////
//
//
async function populateSelectionLists(vm) {
let res = await window.$gz.api.get("service-rate/prior-unit-list");
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.selectLists.priorUnits = res.data;
}
}
</script>