This commit is contained in:
2021-05-13 23:10:27 +00:00
parent 5120825125
commit 1cf4f90fd6
2 changed files with 81 additions and 78 deletions

View File

@@ -631,6 +631,81 @@ export default {
}
return ret;
}
//,
// itemList: function() {
// return this.value.items[this.activeWoItemIndex].labors.map((x, i) => {
// return {
// index: i,
// id: x.id,
// serviceStartDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
// x.serviceStartDate,
// this.pvm.timeZoneName,
// this.pvm.languageName,
// this.pvm.hour12
// ),
// serviceStopDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
// x.serviceStopDate,
// this.pvm.timeZoneName,
// this.pvm.languageName,
// this.pvm.hour12
// ),
// serviceRateQuantity: window.$gz.locale.decimalLocalized(
// x.serviceRateQuantity,
// this.pvm.languageName
// ),
// serviceRateViz: x.serviceRateViz,
// userViz: x.userViz,
// noChargeQuantity: window.$gz.locale.decimalLocalized(
// x.noChargeQuantity,
// this.pvm.languageName
// ),
// cost: window.$gz.locale.currencyLocalized(
// x.cost,
// this.pvm.languageName,
// this.pvm.currencyName
// ),
// listPrice: window.$gz.locale.currencyLocalized(
// x.listPrice,
// this.pvm.languageName,
// this.pvm.currencyName
// ),
// price: window.$gz.locale.currencyLocalized(
// x.price,
// this.pvm.languageName,
// this.pvm.currencyName
// ),
// taxName: x.taxName,
// taxAPct:
// window.$gz.locale.decimalLocalized(
// x.taxAPct,
// this.pvm.languageName
// ) + "%",
// taxBPct:
// window.$gz.locale.decimalLocalized(
// x.taxBPct,
// this.pvm.languageName
// ) + "%",
// taxOnTax: x.taxOnTax,
// taxAViz: window.$gz.locale.currencyLocalized(
// x.taxAViz,
// this.pvm.languageName,
// this.pvm.currencyName
// ),
// taxBViz: window.$gz.locale.currencyLocalized(
// x.taxBViz,
// this.pvm.languageName,
// this.pvm.currencyName
// ),
// lineTotalViz: window.$gz.locale.currencyLocalized(
// x.lineTotalViz,
// this.pvm.languageName,
// this.pvm.currencyName
// ),
// serviceDetails: x.serviceDetails
// };
// });
// }
},
computed: {
isDeleted: function() {
@@ -863,7 +938,8 @@ export default {
x.lineTotalViz,
this.pvm.languageName,
this.pvm.currencyName
)
),
serviceDetails: x.serviceDetails
};
});
},

View File

@@ -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) {