This commit is contained in:
@@ -201,6 +201,7 @@ function generateMenu(vm, readOnly) {
|
||||
};
|
||||
|
||||
if (readOnly != true) {
|
||||
//TODO: Handle new record here
|
||||
menuOptions.menuItems = [
|
||||
{
|
||||
title: vm.$gzlocale.get("Save"),
|
||||
@@ -276,6 +277,19 @@ export default {
|
||||
//id 0 means create a new record don't load one
|
||||
if (this.$route.params.id != 0) {
|
||||
this.getDataFromApi();
|
||||
} else {
|
||||
//setup for new record
|
||||
//first get rights, are they allowed here at all?
|
||||
//Update the form status
|
||||
// this.$gzform.setFormState({
|
||||
// vm: this,
|
||||
// dirty: false,
|
||||
// valid: true,
|
||||
// loading: false,
|
||||
// readOnly: res.readOnly ? true : false
|
||||
// });
|
||||
// //modify the menu as necessary
|
||||
// generateMenu(this, res.readOnly);
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
@@ -354,8 +368,9 @@ export default {
|
||||
.get(url)
|
||||
.then(res => {
|
||||
if (res.error) {
|
||||
//Not found?
|
||||
if (res.error.code == "2010") {
|
||||
//notify error then navigate backwards
|
||||
//notify not found error then navigate backwards
|
||||
vm.$gzdialog
|
||||
.displayLTErrorMessage(vm, "ErrorAPI2010")
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user