This commit is contained in:
@@ -430,14 +430,9 @@ export default {
|
||||
vm.formState.serverError = res.error;
|
||||
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
|
||||
vm.lastGetCustomerId = vm.obj.customerId; //preserve for triggering full update if something changes it later
|
||||
|
||||
//assign opening values
|
||||
vm.obj.isDirty = false;
|
||||
vm.obj.items.forEach((z, index) => {
|
||||
res.data.isDirty = false;
|
||||
res.data.items.forEach((z, index) => {
|
||||
z.uid = index;
|
||||
z.isDirty = false;
|
||||
z.expenses.forEach((x, index) => {
|
||||
@@ -475,6 +470,7 @@ export default {
|
||||
z.units.forEach((x, index) => {
|
||||
x.uid = index;
|
||||
x.isDirty = false;
|
||||
x.warrantyViz = null; //locally added field for reactivity, set on demand in UI not by server
|
||||
});
|
||||
z.outsideServices.forEach((x, index) => {
|
||||
x.uid = index;
|
||||
@@ -482,6 +478,11 @@ export default {
|
||||
});
|
||||
});
|
||||
|
||||
//insert into vue data
|
||||
vm.obj = res.data;
|
||||
vm.lastGetContractId = vm.obj.contractId; //preserve for triggering full update if something changes it later
|
||||
vm.lastGetCustomerId = vm.obj.customerId; //preserve for triggering full update if something changes it later
|
||||
|
||||
//modify the menu as necessary
|
||||
generateMenu(vm);
|
||||
//update which areas are available to user
|
||||
@@ -1042,6 +1043,7 @@ async function saveUnits(vm, woItemIndex) {
|
||||
} else {
|
||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||
res.data.isDirty = false; //prime isDirty to detect future edits
|
||||
res.data.warrantyViz = null; //Add local key so it's reactive in vue
|
||||
vm.obj.items[woItemIndex].units.splice(i, 1, res.data); //vue needs the splice rather than just setting the value in order to trigger reactivity or else the UI won't update
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user