This commit is contained in:
@@ -71,6 +71,14 @@ todo: notification new bell alert count add to title so shows in task bar when n
|
|||||||
todo: browser back to new record page
|
todo: browser back to new record page
|
||||||
when make new record then go back goes to new record again, should it go to record before *new* record page instead??
|
when make new record then go back goes to new record again, should it go to record before *new* record page instead??
|
||||||
|
|
||||||
|
todo: link back to list from single edit form
|
||||||
|
it would be very handy to have a simple link back to the list or back a level
|
||||||
|
on each edit form. If new record then it skips that and goes to list
|
||||||
|
so maybe a specific link to list, not just a back link
|
||||||
|
ideally accessible from the form, not two click by having to open menu, but
|
||||||
|
not sure about that, maybe in wide mode it could surface that from menu but in
|
||||||
|
narrow mode no shortcut because they could use the nav menu anyway and because fuck em, that's why :)
|
||||||
|
|
||||||
todo: notifications form if left sitting there should auto-refresh when it gets any new notifications?
|
todo: notifications form if left sitting there should auto-refresh when it gets any new notifications?
|
||||||
not 100% sure about this one, maybe it's a nice to have feature but a waste of time otherwise
|
not 100% sure about this one, maybe it's a nice to have feature but a waste of time otherwise
|
||||||
|
|
||||||
|
|||||||
@@ -280,29 +280,33 @@ export default {
|
|||||||
vm.formState.readOnly = !vm.rights.change;
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
|
let setDirty = false;
|
||||||
|
let setValid = true;
|
||||||
|
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
if (vm.$route.params.recordid != 0) {
|
if (vm.$route.params.recordid != 0) {
|
||||||
//is there already an obj from a prior operation?
|
//is there already an obj from a prior operation?
|
||||||
if (this.$route.params.obj) {
|
if (this.$route.params.obj) {
|
||||||
//yes, no need to fetch it
|
//yes, no need to fetch it
|
||||||
this.obj = this.$route.params.obj;
|
this.obj = this.$route.params.obj;
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window.$gz.form.setFormState({
|
//Might be a duplicate and contain another record
|
||||||
vm: vm,
|
if (this.$route.params.obj) {
|
||||||
loading: false
|
this.obj = this.$route.params.obj;
|
||||||
});
|
this.obj.concurrency = undefined;
|
||||||
|
this.obj.id = 0;
|
||||||
|
setDirty = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
loading: false,
|
||||||
valid: true
|
dirty: setDirty,
|
||||||
|
valid: setValid
|
||||||
});
|
});
|
||||||
|
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
@@ -588,41 +592,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async duplicate() {
|
async duplicate() {
|
||||||
let vm = this;
|
//Navigate to new record
|
||||||
if (!vm.canDuplicate || vm.$route.params.recordid == 0) {
|
this.$router.push({
|
||||||
return;
|
name: "unit-model-edit",
|
||||||
}
|
params: {
|
||||||
window.$gz.form.setFormState({
|
recordid: 0,
|
||||||
vm: vm,
|
obj: this.obj
|
||||||
loading: true
|
|
||||||
});
|
|
||||||
let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid;
|
|
||||||
|
|
||||||
try {
|
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
|
||||||
let res = await window.$gz.api.upsert(url);
|
|
||||||
if (res.error) {
|
|
||||||
vm.formState.serverError = res.error;
|
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
|
||||||
} else {
|
|
||||||
//Navigate to new record
|
|
||||||
this.$router.push({
|
|
||||||
name: "unit-model-edit",
|
|
||||||
params: {
|
|
||||||
recordid: res.data.id,
|
|
||||||
obj: res.data // Pass data object to new form
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
});
|
||||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
|
||||||
} finally {
|
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//end methods
|
//end methods
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -737,29 +737,33 @@ export default {
|
|||||||
vm.formState.readOnly = !vm.rights.change;
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
|
let setDirty = false;
|
||||||
|
let setValid = true;
|
||||||
|
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
if (vm.$route.params.recordid != 0) {
|
if (vm.$route.params.recordid != 0) {
|
||||||
//is there already an obj from a prior operation?
|
//is there already an obj from a prior operation?
|
||||||
if (this.$route.params.obj) {
|
if (this.$route.params.obj) {
|
||||||
//yes, no need to fetch it
|
//yes, no need to fetch it
|
||||||
this.obj = this.$route.params.obj;
|
this.obj = this.$route.params.obj;
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window.$gz.form.setFormState({
|
//Might be a duplicate and contain another record
|
||||||
vm: vm,
|
if (this.$route.params.obj) {
|
||||||
loading: false
|
this.obj = this.$route.params.obj;
|
||||||
});
|
this.obj.concurrency = undefined;
|
||||||
|
this.obj.id = 0;
|
||||||
|
setDirty = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
loading: false,
|
||||||
valid: true
|
dirty: setDirty,
|
||||||
|
valid: setValid
|
||||||
});
|
});
|
||||||
|
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
@@ -1115,41 +1119,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async duplicate() {
|
async duplicate() {
|
||||||
let vm = this;
|
//Navigate to new record
|
||||||
if (!vm.canDuplicate || vm.$route.params.recordid == 0) {
|
this.$router.push({
|
||||||
return;
|
name: "unit-edit",
|
||||||
}
|
params: {
|
||||||
window.$gz.form.setFormState({
|
recordid: 0,
|
||||||
vm: vm,
|
obj: this.obj
|
||||||
loading: true
|
|
||||||
});
|
|
||||||
let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid;
|
|
||||||
|
|
||||||
try {
|
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
|
||||||
let res = await window.$gz.api.upsert(url);
|
|
||||||
if (res.error) {
|
|
||||||
vm.formState.serverError = res.error;
|
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
|
||||||
} else {
|
|
||||||
//Navigate to new record
|
|
||||||
this.$router.push({
|
|
||||||
name: "unit-edit",
|
|
||||||
params: {
|
|
||||||
recordid: res.data.id,
|
|
||||||
obj: res.data // Pass data object to new form
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
});
|
||||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
|
||||||
} finally {
|
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
AddressCopyPhysicalToClipBoard() {
|
AddressCopyPhysicalToClipBoard() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
let ret = "";
|
let ret = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user