This commit is contained in:
2022-01-26 00:00:41 +00:00
parent 617e13b5ff
commit 8c15b5c610
6 changed files with 47 additions and 6 deletions

View File

@@ -268,6 +268,19 @@ I've done the *Orders but nothing else other than a quick check of customer, so
giong to need to go through all fields in all docs to make sure this is working properly
Not working:
formErrorFromSaveResult - input is: [{"error":{"code":"2200","details":[{"target":"ServiceRateId","error":"2204"}],"message":"ErrorAPI2200"},"itemUid":0,"childKey":"scheduledUsers"}] svc-workorder.vue:1831
FormErrorFromSaveREsult calling error target from with following z value: {"error":{"code":"2200","details":[{"target":"ServiceRateId","error":"2204"}],"message":"ErrorAPI2200"},"itemUid":0,"childKey":"scheduledUsers"}
SaveScheduledUsers handleSaveError param is: {"error":{"code":"2200","details":[{"target":"ServiceRateId","error":"2204"}],"message":"ErrorAPI2200"},"itemUid":0,"childKey":"scheduledUsers"}
Working:
formErrorFromSaveResult - input is: [{"error":{"code":"2200","details":[{"target":"ServiceRateId","error":"2204"}],"message":"ErrorAPI2200"},"itemUid":0,"childKey":"scheduledUsers","childUid":0}] svc-workorder.vue:1831
FormErrorFromSaveREsult calling error target from with following z value: {"error":{"code":"2200","details":[{"target":"ServiceRateId","error":"2204"}],"message":"ErrorAPI2200"},"itemUid":0,"childKey":"scheduledUsers","childUid":0}
SaveScheduledUsers handleSaveError param is: {"error":{"code":"2200","details":[{"target":"ServiceRateId","error":"2204"}],"message":"ErrorAPI2200"},"itemUid":0,"childKey":"scheduledUsers","childUid":0}
- 1 todo: Search limited to a type is *not* working, it just returns all results, search from a Customer for example and you will see all object results
- 1 todo: window.$gz.locale.diffHoursFromUTC8601String is often calculated a total of 1.99 due to some rounding even though the two times look identical
must be seconds or something, needs a round up in those cases, that's weird. To recreate try a start time of 11:21 and end time of 1:21pm which should be two hours but is 1.99 hours

View File

@@ -259,6 +259,8 @@
lg="4"
xl="3"
>
server errors:
{{ formState }}
<gz-pick-list
:ref="
`Items[${activeWoItemIndex}].scheduledUsers[${activeItemIndex}].serviceRateId`

View File

@@ -209,7 +209,7 @@
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].units[${activeItemIndex}].workOrderItemUnitTags`
`Items[${activeWoItemIndex}].units[${activeItemIndex}].tags`
)
"
@input="

View File

@@ -992,6 +992,7 @@ async function saveUnits(vm, woItemIndex) {
//Server will update fields on put or post for most 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
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].units.splice(i, 1, res.data);
}
}
@@ -1034,6 +1035,7 @@ async function saveScheduledUsers(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].scheduledUsers.splice(i, 1, res.data);
}
}
@@ -1102,6 +1104,7 @@ async function saveTasks(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].tasks.splice(i, 1, res.data);
}
}
@@ -1208,6 +1211,7 @@ async function saveParts(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most pm graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].parts.splice(i, 1, res.data);
}
}
@@ -1244,6 +1248,7 @@ async function saveLabors(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most pm graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].labors.splice(i, 1, res.data);
}
}
@@ -1311,6 +1316,7 @@ async function saveTravels(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most pm graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].travels.splice(i, 1, res.data);
}
}
@@ -1407,6 +1413,7 @@ async function saveExpenses(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most pm graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].expenses.splice(i, 1, res.data);
}
}
@@ -1471,6 +1478,7 @@ async function saveLoans(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most pm graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].loans.splice(i, 1, res.data);
}
}
@@ -1542,6 +1550,7 @@ async function saveOutsideServices(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most pm graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].outsideServices.splice(i, 1, res.data);
}
}

View File

@@ -1059,6 +1059,7 @@ async function saveUnits(vm, woItemIndex) {
//Server will update fields on put or post for most 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
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].units.splice(i, 1, res.data);
}
}
@@ -1100,6 +1101,7 @@ async function saveScheduledUsers(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].scheduledUsers.splice(i, 1, res.data);
}
}
@@ -1166,6 +1168,7 @@ async function saveTasks(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].tasks.splice(i, 1, res.data);
}
}
@@ -1270,6 +1273,7 @@ async function saveParts(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most quote graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].parts.splice(i, 1, res.data);
}
}
@@ -1306,6 +1310,7 @@ async function saveLabors(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most quote graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].labors.splice(i, 1, res.data);
}
}
@@ -1373,6 +1378,7 @@ async function saveTravels(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most quote graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].travels.splice(i, 1, res.data);
}
}
@@ -1469,6 +1475,7 @@ async function saveExpenses(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most quote graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].expenses.splice(i, 1, res.data);
}
}
@@ -1533,6 +1540,7 @@ async function saveLoans(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most quote graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].loans.splice(i, 1, res.data);
}
}
@@ -1604,6 +1612,7 @@ async function saveOutsideServices(vm, woItemIndex) {
} else {
//Server will update fields on put or post for most quote graph objecs so need to update entire object here
res.data.isDirty = false; //prime isDirty to detect future edits
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].outsideServices.splice(i, 1, res.data);
}
}

View File

@@ -1151,6 +1151,7 @@ async function saveUnits(vm, woItemIndex) {
//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
res.data.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].units.splice(i, 1, res.data);
}
}
@@ -1170,8 +1171,6 @@ async function saveScheduledUsers(vm, woItemIndex) {
for (let i = 0; i < vm.obj.items[woItemIndex].scheduledUsers.length; i++) {
if (vm.obj.items[woItemIndex].scheduledUsers[i].isDirty) {
// console.log("BEFORE", vm.obj.items[woItemIndex].scheduledUsers[i].uid);
//clone and skip viz and other fields
const o = window.$gz.util.deepCopySkip(
vm.obj.items[woItemIndex].scheduledUsers[i],
@@ -1182,6 +1181,7 @@ async function saveScheduledUsers(vm, woItemIndex) {
`${API_BASE_URL}items/scheduled-users`,
o
);
if (res.error) {
handleSaveError(vm, {
error: res.error,
@@ -1192,6 +1192,7 @@ async function saveScheduledUsers(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].scheduledUsers.splice(i, 1, res.data);
}
}
@@ -1260,6 +1261,7 @@ async function saveTasks(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].tasks.splice(i, 1, res.data);
}
}
@@ -1366,6 +1368,7 @@ async function saveParts(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].parts.splice(i, 1, res.data);
}
}
@@ -1433,6 +1436,7 @@ async function savePartRequests(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].partRequests.splice(i, 1, res.data);
}
}
@@ -1469,6 +1473,7 @@ async function saveLabors(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].labors.splice(i, 1, res.data);
}
}
@@ -1536,6 +1541,7 @@ async function saveTravels(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].travels.splice(i, 1, res.data);
}
}
@@ -1632,6 +1638,7 @@ async function saveExpenses(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].expenses.splice(i, 1, res.data);
}
}
@@ -1696,6 +1703,7 @@ async function saveLoans(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].loans.splice(i, 1, res.data);
}
}
@@ -1767,6 +1775,7 @@ async function saveOutsideServices(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.uid = i; //set uid again as it's lost in the save
vm.obj.items[woItemIndex].outsideServices.splice(i, 1, res.data);
}
}
@@ -1828,13 +1837,12 @@ function formErrorFromSaveResult(vm) {
details: [],
message: "ErrorAPI2200"
};
//console.log("formErrorFromSaveResult - input is:", vm.saveResult.errors);
vm.saveResult.errors.forEach(z => {
//console.log("z", z);
//{error:{code:xx,message:xx,target:xx},fatal:true}
if (z.error.details != null) {
z.error.details.forEach(x => {
const target = errorTargetFromSaveResult(vm, z, x.target);
if (target != null) {
ret.details.push({
message: x.message,