This commit is contained in:
@@ -169,7 +169,7 @@ export default {
|
|||||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||||
languageName: window.$gz.locale.getResolvedLanguage(),
|
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||||
hour12: window.$gz.locale.getHour12(),
|
hour12: window.$gz.locale.getHour12(),
|
||||||
deletedGraphItems: { items: [], scheduledUsers: [] },
|
deletedGraphItems: { items: [], scheduledUsers: [] }, //todo: other grandchildren
|
||||||
selectLists: {
|
selectLists: {
|
||||||
wostatus: [],
|
wostatus: [],
|
||||||
allowedwostatus: []
|
allowedwostatus: []
|
||||||
@@ -319,6 +319,8 @@ export default {
|
|||||||
case window.$gz.type.WorkOrderItemScheduledUser:
|
case window.$gz.type.WorkOrderItemScheduledUser:
|
||||||
this.deletedGraphItems.scheduledUsers.push(item.id);
|
this.deletedGraphItems.scheduledUsers.push(item.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//todo: other grandchildren
|
||||||
}
|
}
|
||||||
this.setDirty();
|
this.setDirty();
|
||||||
},
|
},
|
||||||
@@ -435,7 +437,7 @@ export default {
|
|||||||
noProblem = await deleteScheduledUsers(vm);
|
noProblem = await deleteScheduledUsers(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo: other children
|
//todo: other grandchildren
|
||||||
|
|
||||||
//WOITEMS
|
//WOITEMS
|
||||||
if (noProblem) {
|
if (noProblem) {
|
||||||
@@ -624,6 +626,33 @@ async function saveHeader(vm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////
|
||||||
|
// STATES
|
||||||
|
//
|
||||||
|
async function saveState(vm) {
|
||||||
|
//CHANGED?
|
||||||
|
let totalItems = vm.obj.states.length;
|
||||||
|
if (totalItems == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < totalItems; i++) {
|
||||||
|
let o = vm.obj.states[i];
|
||||||
|
if (o.concurrency == null) {
|
||||||
|
//it's new so save it
|
||||||
|
let res = await window.$gz.api.upsert(`${API_BASE_URL}states`, o);
|
||||||
|
if (res.error) {
|
||||||
|
displayResError(vm, res);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
vm.obj.states[i] = res.data;
|
||||||
|
//set locked status of entire wo now
|
||||||
|
vm.obj.isLockedAtServer = vm.currentState.locked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// ITEMS
|
// ITEMS
|
||||||
//
|
//
|
||||||
@@ -669,7 +698,7 @@ async function saveItems(vm) {
|
|||||||
o.workorderId = res.data.workorderId;
|
o.workorderId = res.data.workorderId;
|
||||||
//walk all unsaved children and set the workorder id so they can save
|
//walk all unsaved children and set the workorder id so they can save
|
||||||
o.scheduledUsers.forEach(z => (z.workorderItemId = o.id));
|
o.scheduledUsers.forEach(z => (z.workorderItemId = o.id));
|
||||||
//todo: children
|
//todo: other grandchildren
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -685,6 +714,8 @@ async function saveItems(vm) {
|
|||||||
}
|
}
|
||||||
return true; //made it through
|
return true; //made it through
|
||||||
}
|
}
|
||||||
|
//####################################################################################
|
||||||
|
//## GRANDCHILDREN
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// SCHEDULED USERS
|
// SCHEDULED USERS
|
||||||
@@ -737,32 +768,7 @@ async function saveScheduledUsers(vm, woitemindex) {
|
|||||||
return true; //made it
|
return true; //made it
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////
|
//todo: other grandchildren
|
||||||
// STATES
|
|
||||||
//
|
|
||||||
async function saveState(vm) {
|
|
||||||
//CHANGED?
|
|
||||||
let totalItems = vm.obj.states.length;
|
|
||||||
if (totalItems == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (let i = 0; i < totalItems; i++) {
|
|
||||||
let o = vm.obj.states[i];
|
|
||||||
if (o.concurrency == null) {
|
|
||||||
//it's new so save it
|
|
||||||
let res = await window.$gz.api.upsert(`${API_BASE_URL}states`, o);
|
|
||||||
if (res.error) {
|
|
||||||
displayResError(vm, res);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
vm.obj.states[i] = res.data;
|
|
||||||
//set locked status of entire wo now
|
|
||||||
vm.obj.isLockedAtServer = vm.currentState.locked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Error display
|
// Error display
|
||||||
@@ -780,7 +786,7 @@ function displayResError(vm, res) {
|
|||||||
function setSubRights(vm) {
|
function setSubRights(vm) {
|
||||||
//determine rights to each which sections are hidden due to form customized out or rights / roles
|
//determine rights to each which sections are hidden due to form customized out or rights / roles
|
||||||
//todo: determine this and set accordingly, for now all set to available true during init
|
//todo: determine this and set accordingly, for now all set to available true during init
|
||||||
//## NOTE: these are subrights only, descendents still need to first check if workorder isLockedAtServer and rights are read only etc before this level is checked
|
//## NOTE: these are subrights only, descendants still need to first check if workorder isLockedAtServer and rights are read only etc before this level is checked
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user