This commit is contained in:
2021-04-12 18:49:36 +00:00
parent 07336466a2
commit 3a62c5cd26
2 changed files with 25 additions and 26 deletions

View File

@@ -233,7 +233,8 @@ BIG PICTURE STUFF
CURRENT ACTIONABLE TODOS CURRENT ACTIONABLE TODOS
todo: need to add a popup error if attempting to save from locked to locked state and there are other changes that need to be saved
(or let error from server handle it?? Not a first class UI experience though and might be a quite common mistake)
todo: can I turn control labels into hyperlinks for getting to feeder records? If not then need to find a way to accomplish it todo: can I turn control labels into hyperlinks for getting to feeder records? If not then need to find a way to accomplish it
e.g. can workorder status title be changed to a hyper link to status list e.g. can workorder status title be changed to a hyper link to status list
e.g. can projects title be turned to a hyper link to projects list e.g. can projects title be turned to a hyper link to projects list

View File

@@ -409,30 +409,26 @@ export default {
window.$gz.form.deleteAllErrorBoxErrors(vm); window.$gz.form.deleteAllErrorBoxErrors(vm);
//####################################################### //#######################################################
// ███████╗ █████╗ ██╗ ██╗███████╗
// ██╔════╝██╔══██╗██║ ██║██╔════╝
// ███████╗███████║██║ ██║█████╗
// ╚════██║██╔══██║╚██╗ ██╔╝██╔══╝
// ███████║██║ ██║ ╚████╔╝ ███████╗
// ╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝
//walk the tree and save dirty //walk the tree and save dirty
//items in order //items in correct order
//individual save will throw on
//exception short circuiting here
//Delete flagged items first upwards from bottom of graph
//one by one individually
//then save all items downwards from top of graph
//mostly via workorderitem
//######################################################## //########################################################
let noProblem = true; let noProblem = true;
//HEADER MUST BE SAVED FIRST IF IT's NEW //UNSAVED HEADER MUST BE FIRST
//(otherwise there's nothing to hang the other things off of) //(otherwise there's nothing to hang the other things off of)
let headerSaved = false; let headerSaved = false;
if (this.obj.concurrency == 0) { if (this.obj.concurrency == 0) {
console.log("concurrency 0, saving header");
noProblem = await saveHeader(vm); noProblem = await saveHeader(vm);
headerSaved = true; headerSaved = true;
} }
//### STATE first if unlocking only //LOCKED? State must be saved first then (assuming it unlocks)
//if moving to another locked state this will block further updates below but we're accepting that
//and user can unlock first to finish updating
let stateSaved = false; let stateSaved = false;
if (this.obj.isLockedAtServer) { if (this.obj.isLockedAtServer) {
noProblem = await saveState(vm); noProblem = await saveState(vm);
@@ -619,7 +615,6 @@ async function saveHeader(vm) {
} }
let isPost = o.id == 0; let isPost = o.id == 0;
let res = await window.$gz.api.upsert(`${API_BASE_URL}`, o); let res = await window.$gz.api.upsert(`${API_BASE_URL}`, o);
console.log("result of saving header is ", res);
if (res.error) { if (res.error) {
displayResError(vm, res); displayResError(vm, res);
return false; return false;
@@ -630,6 +625,9 @@ async function saveHeader(vm) {
if (isPost) { if (isPost) {
vm.obj.id = res.data.id; vm.obj.id = res.data.id;
vm.obj.serial = res.data.serial; vm.obj.serial = res.data.serial;
//walk all unsaved direct children and set the workorder id so they can save
o.states.forEach(z => (z.workOrderId = o.id));
o.items.forEach(z => (z.workOrderId = o.id));
} }
return true; return true;
} }