This commit is contained in:
2021-05-17 22:55:16 +00:00
parent ac3fc49fc4
commit e5f1923c94
3 changed files with 30 additions and 13 deletions

View File

@@ -260,7 +260,8 @@ export default {
saveResult: {
fatal: false, //fatal error, further save is pointless, bail early and report
errors: null //contains error objects from save
}
},
lastGetContractId: null
};
},
//WATCHERS
@@ -369,6 +370,7 @@ export default {
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.obj = res.data;
vm.lastGetContractId = vm.obj.contractId; //preserve for triggering full update if something changes it later
//assign opening UID's
vm.obj.items.forEach((z, index) => {
@@ -453,8 +455,6 @@ export default {
//some ops require a full refresh like ones that trigger contract changes
let forceFullRefresh = false;
let contractIdBeforeSave = vm.obj.contractId;
console.log("ContractIdBeforeSave=", contractIdBeforeSave);
//reset error object
this.saveResult.fatal = false;
@@ -525,8 +525,8 @@ export default {
});
} else {
//check if full refresh is necessary
console.log("ContractIdAfterSave=", vm.obj.contractId);
if (vm.obj.contractId != contractIdBeforeSave) {
if (vm.obj.contractId != vm.obj.lastGetContractId) {
//there may be others which is why I'm doing it this way with the extra variable
forceFullRefresh = true;
}