fixed overlay not clearing delete bug

This commit is contained in:
2021-09-30 21:46:34 +00:00
parent 9a9abe4d19
commit b89281575d
37 changed files with 384 additions and 401 deletions

View File

@@ -683,33 +683,32 @@ export default {
}
},
async remove() {
const vm = this;
try {
const dialogResult = await window.$gz.dialog.confirmDelete();
if (dialogResult != true) {
return;
}
vm.formState.loading = true;
if (vm.$route.params.recordid == 0) {
this.formState.loading = true;
if (this.$route.params.recordid == 0) {
JUST_DELETED = true;
vm.$router.go(-1);
this.$router.go(-1);
} else {
window.$gz.form.deleteAllErrorBoxErrors(vm);
window.$gz.form.deleteAllErrorBoxErrors(this);
const res = await window.$gz.api.remove(
API_BASE_URL + vm.$route.params.recordid
API_BASE_URL + this.$route.params.recordid
);
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
this.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(this);
} else {
JUST_DELETED = true;
vm.$router.go(-1);
this.$router.go(-1);
}
}
} catch (ex) {
window.$gz.errorHandler.handleFormError(ex, vm);
window.$gz.errorHandler.handleFormError(ex, this);
} finally {
vm.formState.loading = false;
this.formState.loading = false;
}
},
duplicate() {