This commit is contained in:
2021-07-05 19:07:33 +00:00
parent 3faa664ef8
commit b95dcfb13c
30 changed files with 69 additions and 137 deletions

View File

@@ -435,7 +435,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "service-rate-edit",
params: {
recordid: res.data.id,

View File

@@ -393,7 +393,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "tax-code-edit",
params: {
recordid: res.data.id,

View File

@@ -433,7 +433,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "travel-rate-edit",
params: {
recordid: res.data.id,

View File

@@ -384,7 +384,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "adm-translation",
params: {
recordid: res.data.id,

View File

@@ -713,7 +713,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "adm-user",
params: {
recordid: res.data.id,

View File

@@ -310,6 +310,16 @@ let editor = null;
export default {
async created() {
let vm = this;
//Not valid without report data options
if (vm.$route.params.reportDataOptions == null) {
throw new Error(
"ay-report-edit::created - missing report data options cannot proceed"
);
// // navigate backwards
vm.$router.go(-1);
return;
}
try {
await initForm(vm);
@@ -317,32 +327,7 @@ export default {
vm.formState.readOnly = !vm.rights.change;
window.$gz.eventBus.$on("menu-click", clickHandler);
// //id 0 means create or duplicate to new
// if (vm.$route.params.recordid != 0) {
// //is there already an obj from a prior operation?
// if (vm.$route.params.obj) {
// //yes, no need to fetch it
// vm.obj = vm.$route.params.obj;
// window.$gz.form.setFormState({
// vm: vm,
// loading: false
// });
// } else {
// await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
// }
// //Ok, we're here now fetch the report data and can handle includeWoItemDescendants if necessary
// await fetchReportData(vm);
// } else {
// //New record so there *MUST* be an aType on the route params
// await fetchReportData(vm); //go ahead and fetch report data now, no need to handle includeWoItemDescendants
// window.$gz.form.setFormState({
// vm: vm,
// loading: false
// });
// }
//console.log("report-edit created params are:", vm.$route.params);
let setDirty = false;
let setValid = true;
@@ -366,9 +351,15 @@ export default {
"Copy"
)}`;
setDirty = true;
} else {
//brand new report, not a duplicate or previous data
vm.obj.aType = vm.$route.params.reportDataOptions.AType;
}
}
//in any case we need the sample data so fetch it here after the setup for new or existing or duplicate is completed above
await fetchReportData(vm);
//---------------
//setup the editor and models
@@ -848,7 +839,7 @@ Handlebars.registerHelper('loud', function (aString) {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "ay-report-edit",
params: {
recordid: res.data.id,
@@ -926,7 +917,8 @@ Handlebars.registerHelper('loud', function (aString) {
name: "ay-report-edit",
params: {
recordid: 0,
obj: this.obj
obj: this.obj, // Pass data object to new form
reportDataOptions: this.$route.params.reportDataOptions
}
});
},

View File

@@ -290,7 +290,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "customer-note-edit",
params: {
recordid: res.data.id,

View File

@@ -757,7 +757,16 @@ const FORM_CUSTOM_TEMPLATE_KEY = "Customer"; //<-- Should always be CoreBizObjec
export default {
async created() {
let vm = this;
//Prevent returning back to the /0 NEW route after having just created a new record and instead return to the original new source page
// console.log("cust-customer created params: ", vm.$route.params);
// if (
// vm.$route.params.recordid == null ||
// (vm.$route.params.recordid == 0 && vm.$route.params.newRecord == null) //here recordid will technically be "0" if returned back to it from prior new
// ) {
// // navigate backwards
// vm.$router.go(-1);
// return;
// }
try {
await initForm(vm);
@@ -1029,7 +1038,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "customer-edit",
params: {
recordid: res.data.id,

View File

@@ -934,7 +934,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "head-office-edit",
params: {
recordid: res.data.id,

View File

@@ -758,7 +758,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "cust-user",
params: {
recordid: res.data.id,

View File

@@ -527,7 +527,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "csr-edit",
params: {
recordid: res.data.id,

View File

@@ -77,9 +77,6 @@ export default {
vm.formState.ready = true;
}
},
// beforeRouteEnter(to, from, next) {
// next(window.$gz.store.state.notifyAvailable);
// },
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
},

View File

@@ -542,7 +542,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "home-notify-subscription",
params: {
recordid: res.data.id,

View File

@@ -415,7 +415,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "reminder-edit",
params: {
recordid: res.data.id,

View File

@@ -466,7 +466,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "review-edit",
params: {
recordid: res.data.id,

View File

@@ -550,7 +550,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "part-assembly-edit",
params: {
recordid: res.data.id,

View File

@@ -1541,7 +1541,7 @@ export default {
//update of existing record
vm.obj = res.data;
} else {
this.$router.push({
this.$router.replace({
name: "inv-purchase-order",
params: {
recordid: res.data.id,

View File

@@ -1716,7 +1716,7 @@ export default {
//update of existing record
vm.obj = res.data;
} else {
this.$router.push({
this.$router.replace({
name: "contract-edit",
params: {
recordid: res.data.id,

View File

@@ -521,7 +521,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "csr-edit",
params: {
recordid: res.data.id,
@@ -611,7 +611,7 @@ export default {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//Navigate to new record
//Navigate to record
this.$router.push({
name: "csr-edit",
params: {
@@ -650,7 +650,7 @@ export default {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//Navigate to new record
//Navigate to record
this.$router.push({
name: "csr-edit",
params: {

View File

@@ -674,7 +674,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "loan-unit-edit",
params: {
recordid: res.data.id,

View File

@@ -409,7 +409,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "project-edit",
params: {
recordid: res.data.id,

View File

@@ -467,7 +467,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "svc-task-group",
params: {
recordid: res.data.id,

View File

@@ -522,7 +522,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "unit-model-edit",
params: {
recordid: res.data.id,

View File

@@ -1049,7 +1049,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "unit-edit",
params: {
recordid: res.data.id,

View File

@@ -283,7 +283,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "svc-work-order-item-priority-edit",
params: {
recordid: res.data.id,

View File

@@ -296,7 +296,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "svc-work-order-status-edit",
params: {
recordid: res.data.id,

View File

@@ -344,7 +344,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "svc-work-order-status-edit",
params: {
recordid: res.data.id,

View File

@@ -833,7 +833,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "vendor-edit",
params: {
recordid: res.data.id,

View File

@@ -512,7 +512,7 @@ export default {
//Change URL to new record
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
this.$router.push({
this.$router.replace({
name: "widget-edit",
params: {
recordid: res.data.id,