This commit is contained in:
@@ -310,15 +310,11 @@ let editor = null;
|
|||||||
export default {
|
export default {
|
||||||
async created() {
|
async created() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
//Not valid without report data options
|
|
||||||
if (vm.$route.params.reportDataOptions == null) {
|
// console.log(
|
||||||
throw new Error(
|
// "ay-report created reportdataoptions:",
|
||||||
"ay-report-edit::created - missing report data options cannot proceed"
|
// vm.$route.params.reportDataOptions
|
||||||
);
|
// );
|
||||||
// // navigate backwards
|
|
||||||
vm.$router.go(-1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await initForm(vm);
|
await initForm(vm);
|
||||||
@@ -339,6 +335,7 @@ export default {
|
|||||||
//yes, no need to fetch it
|
//yes, no need to fetch it
|
||||||
this.obj = this.$route.params.obj;
|
this.obj = this.$route.params.obj;
|
||||||
} else {
|
} else {
|
||||||
|
//FETCH EXISTING
|
||||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -353,6 +350,16 @@ export default {
|
|||||||
setDirty = true;
|
setDirty = true;
|
||||||
} else {
|
} else {
|
||||||
//brand new report, not a duplicate or previous data
|
//brand new report, not a duplicate or previous data
|
||||||
|
//Not valid without report data options
|
||||||
|
if (vm.$route.params.reportDataOptions == null) {
|
||||||
|
window.$gz.eventBus.$emit(
|
||||||
|
"notify-error",
|
||||||
|
"ay-report-edit::created - missing report data options cannot proceed"
|
||||||
|
);
|
||||||
|
// // navigate backwards
|
||||||
|
vm.$router.go(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
vm.obj.aType = vm.$route.params.reportDataOptions.AType;
|
vm.obj.aType = vm.$route.params.reportDataOptions.AType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user