This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
>
|
||||
</v-select>
|
||||
</v-col>
|
||||
|
||||
{{ obj }}
|
||||
<!-- <template v-for="item in obj">
|
||||
<v-col :key="item.key" cols="12" sm="6" lg="4" xl="3" px-2>
|
||||
<v-card>
|
||||
@@ -149,16 +149,23 @@ export default {
|
||||
return window.$gz.translation.get(ltkey);
|
||||
},
|
||||
templateSelected: function() {
|
||||
console.log("STUB: templateSelected", this.templateId);
|
||||
if (this.formState.dirty) {
|
||||
window.$gz.dialog.confirmLeaveUnsaved().then(dialogResult => {
|
||||
if (dialogResult != true) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.getDataFromApi();
|
||||
},
|
||||
getDataFromApi(recordId) {
|
||||
getDataFromApi() {
|
||||
//COP*IED FROM WIDGET TO BE MODIFIED
|
||||
var vm = this;
|
||||
vm.formState.loading = true;
|
||||
if (!recordId) {
|
||||
throw FORM_KEY + "::getDataFromApi -> Missing recordID!";
|
||||
if (!vm.templateId || vm.templateId == 0) {
|
||||
return;
|
||||
}
|
||||
var url = API_BASE_URL + recordId;
|
||||
var url = API_BASE_URL + vm.templateId;
|
||||
|
||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
|
||||
@@ -166,16 +173,6 @@ export default {
|
||||
.get(url)
|
||||
.then(res => {
|
||||
if (res.error != undefined) {
|
||||
//Not found?
|
||||
if (res.error.code == "2010") {
|
||||
//notify not found error then navigate backwards
|
||||
window.$gz.dialog
|
||||
.displayLTErrorMessage("ErrorAPI2010")
|
||||
.then(() => {
|
||||
// navigate backwards
|
||||
vm.$router.go(-1);
|
||||
});
|
||||
}
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
@@ -189,8 +186,6 @@ export default {
|
||||
loading: false,
|
||||
readOnly: res.readOnly ? true : false
|
||||
});
|
||||
//modify the menu as necessary
|
||||
generateMenu(vm);
|
||||
}
|
||||
})
|
||||
.catch(function handleGetDataFromAPIError(error) {
|
||||
|
||||
Reference in New Issue
Block a user