This commit is contained in:
2021-05-17 22:36:24 +00:00
parent ad9270ab30
commit c892a622d7
2 changed files with 22 additions and 7 deletions

View File

@@ -451,6 +451,10 @@ export default {
const isPost = vm.obj.id == 0;
//some ops require a full refresh like ones that trigger contract changes
let forceFullRefresh = false;
let contractIdBeforeSave = vm.obj.contractId;
//reset error object
this.saveResult.fatal = false;
this.saveResult.errors = null;
@@ -519,11 +523,21 @@ export default {
}
});
} else {
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true
});
//check if full refresh is necessary
if (vm.obj.contractId != contractIdBeforeSave) {
//there may be others which is why I'm doing it this way with the extra variable
forceFullRefresh = true;
}
if (forceFullRefresh) {
await vm.getDataFromApi(vm.$route.params.recordid);
} else {
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true
});
}
}
}
} catch (ex) {
@@ -644,8 +658,6 @@ async function saveHeader(vm) {
//}
} else {
//this sets 'o' to all values in assigned *except* the ones itemized with removedKey which is a fake key and just used for this trick to work
//as undefined won't
console.log("Header save, return data is: ", res.data);