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

@@ -346,6 +346,9 @@ CURRENTLY DOING: labors
and in future Unit change may trigger this as well so make it re-usable
Once this is in place, perhaps don't need the whole contract control stuff anymore since it should just handle it...right?
todo: address setting - rather than setting it *at* the client automatically shouldn't it set at the server automatically?
this would remove some weight from the client and with a forcefullrefresh system in place that will help with this as well.
todo: check contract expiry for applying!!
todo: Test back end correctly sets contract on new wo and correctly sets response time (complete by date) on NEW workorder

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);