This commit is contained in:
@@ -401,17 +401,15 @@ export default {
|
|||||||
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
||||||
"warrantyTerms":"Shipping parts and service"} */
|
"warrantyTerms":"Shipping parts and service"} */
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.value.items[this.activeWoItemIndex].units[
|
||||||
this.value.items[this.activeWoItemIndex].units[
|
this.activeItemIndex
|
||||||
this.activeItemIndex
|
].warrantyViz = JSON.stringify(res.data);
|
||||||
].warrantyViz = JSON.stringify(res.data);
|
|
||||||
});
|
|
||||||
|
|
||||||
// console.log(
|
console.log(
|
||||||
// "warrantyviz:",
|
"warrantyviz:",
|
||||||
// this.value.items[this.activeWoItemIndex].units[this.activeItemIndex]
|
this.value.items[this.activeWoItemIndex].units[this.activeItemIndex]
|
||||||
// .warrantyViz
|
.warrantyViz
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showBulkUnitsDialog() {
|
showBulkUnitsDialog() {
|
||||||
|
|||||||
@@ -430,14 +430,9 @@ export default {
|
|||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} 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
|
//assign opening values
|
||||||
vm.obj.isDirty = false;
|
res.data.isDirty = false;
|
||||||
vm.obj.items.forEach((z, index) => {
|
res.data.items.forEach((z, index) => {
|
||||||
z.uid = index;
|
z.uid = index;
|
||||||
z.isDirty = false;
|
z.isDirty = false;
|
||||||
z.expenses.forEach((x, index) => {
|
z.expenses.forEach((x, index) => {
|
||||||
@@ -475,6 +470,7 @@ export default {
|
|||||||
z.units.forEach((x, index) => {
|
z.units.forEach((x, index) => {
|
||||||
x.uid = index;
|
x.uid = index;
|
||||||
x.isDirty = false;
|
x.isDirty = false;
|
||||||
|
x.warrantyViz = null; //locally added field for reactivity, set on demand in UI not by server
|
||||||
});
|
});
|
||||||
z.outsideServices.forEach((x, index) => {
|
z.outsideServices.forEach((x, index) => {
|
||||||
x.uid = 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
|
//modify the menu as necessary
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
//update which areas are available to user
|
//update which areas are available to user
|
||||||
@@ -1042,6 +1043,7 @@ async function saveUnits(vm, woItemIndex) {
|
|||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//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.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
|
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