This commit is contained in:
@@ -233,18 +233,19 @@ 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
|
||||||
|
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
|
||||||
|
ideally not in menu because it would be a lot on a workorder and need space for wo graph subitem links
|
||||||
|
|
||||||
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: failed saved on a grandchild item shouldn't preclude the rest saving
|
||||||
e.g. can workorder status title be changed to a hyper link to status list
|
e.g. if there is a concurrency error on a child that shouldn't block the rest but a fatal error probably should
|
||||||
e.g. can projects title be turned to a hyper link to projects list
|
v.next? needs planning, some things should fail the whole op maybe
|
||||||
ideally not in menu because it would be a lot on a workorder and need space for wo graph subitem links
|
todo: do we need a dirty indicator at every level??
|
||||||
|
todo: "delete selected item" text instead of "Delete" for subitems
|
||||||
todo: failed saved on a grandchild item shouldn't preclude the rest saving
|
todo: workordercustomX translation keys not set yet, just copy workorderItem ones I guess
|
||||||
e.g. if there is a concurrency error on a child that shouldn't block the rest but a fatal error probably should
|
|
||||||
v.next? needs planning, some things should fail the whole op maybe
|
|
||||||
todo: do we need a dirty indicator at every level??
|
|
||||||
todo: "delete selected item" text instead of "Delete" for subitems
|
|
||||||
todo: workordercustomX translation keys not set yet, just copy workorderItem ones I guess
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user