This commit is contained in:
@@ -926,87 +926,14 @@ async function saveLabors(vm, woItemIndex) {
|
||||
childUid: o.uid
|
||||
});
|
||||
} else {
|
||||
/*
|
||||
PUT RETURN:
|
||||
{
|
||||
"data": {
|
||||
"id": 35,
|
||||
"concurrency": 8017869,
|
||||
"userId": 30,
|
||||
"userViz": "Jonas Collins",
|
||||
"serviceStartDate": "2021-02-25T22:00:00Z",
|
||||
"serviceStopDate": "2021-02-25T23:00:00Z",
|
||||
"serviceRateId": 6,
|
||||
"serviceRateViz": "Blue SX",
|
||||
"serviceDetails": "Totam ut molestiae repellendus.",
|
||||
"serviceRateQuantity": 1,
|
||||
"noChargeQuantity": 0,
|
||||
"serviceBankId": null,
|
||||
"taxCodeSaleId": 2,
|
||||
"taxCodeSaleViz": "Goods only",
|
||||
"cost": 9.832906505480832,
|
||||
"listPrice": 15.24100508349529,
|
||||
"price": 15.24100508349529,
|
||||
"taxName": "Goods only",
|
||||
"taxAPct": 7,
|
||||
"taxBPct": 0,
|
||||
"taxOnTax": false,
|
||||
"taxAViz": 1.0668703558446704,
|
||||
"taxBViz": 0,
|
||||
"lineTotalViz": 16.30787543933996,
|
||||
"isDirty": true,
|
||||
"workOrderItemId": 18
|
||||
}
|
||||
}
|
||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||
|
||||
|
||||
POST RETURN:
|
||||
{
|
||||
"data": {
|
||||
"id": 37,
|
||||
"concurrency": 8017875,
|
||||
"userId": 9,
|
||||
"userViz": "Anabel Satterfield - TechLimited",
|
||||
"serviceStartDate": "2021-05-13T22:38:35.334Z",
|
||||
"serviceStopDate": "2021-05-13T23:21:00Z",
|
||||
"serviceRateId": 6,
|
||||
"serviceRateViz": "Blue SX",
|
||||
"serviceDetails": null,
|
||||
"serviceRateQuantity": 1,
|
||||
"noChargeQuantity": 0,
|
||||
"serviceBankId": null,
|
||||
"taxCodeSaleId": 2,
|
||||
"taxCodeSaleViz": "Goods only",
|
||||
"cost": 9.832906505480832,
|
||||
"listPrice": 15.24100508349529,
|
||||
"price": 15.24100508349529,
|
||||
"taxName": "Goods only",
|
||||
"taxAPct": 7,
|
||||
"taxBPct": 0,
|
||||
"taxOnTax": false,
|
||||
"taxAViz": 1.0668703558446704,
|
||||
"taxBViz": 0,
|
||||
"lineTotalViz": 16.30787543933996,
|
||||
"isDirty": true,
|
||||
"workOrderItemId": 18
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
//update any server changed fields
|
||||
//always updated:
|
||||
o.concurrency = res.data.concurrency;
|
||||
o.isDirty = false;
|
||||
|
||||
//new records only...
|
||||
if (isPost) {
|
||||
o.id = res.data.id;
|
||||
o.workOrderItemId = res.data.workOrderItemId;
|
||||
}
|
||||
vm.obj.items[woItemIndex].labors.splice(i, 1, res.data); //vue needs the splice to trigger reactivity or else the UI won't update
|
||||
//vm.obj.items[woItemIndex].labors[i] = res.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
return; //made it
|
||||
return;
|
||||
}
|
||||
|
||||
async function deleteLabors(vm, woItemIndex) {
|
||||
|
||||
Reference in New Issue
Block a user