diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 7c3737f6..8df60408 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -55,6 +55,12 @@ todo: v8 migrate additions ## CLIENT MISC ITEMS +todo: cleanup unnecessary use of a ayatype access inside the Methods of objects as it's now available in vue via main object, + e.g. where you see this: ayaTypes().XXXX you can replace it directly with this: $ay.ayt().XXXX and then REMOVE completely the ayaTypes() method in the vm of that object +todo: use const, not let unless need to reassign the variable + Going to need a case by case through all uses but it's a very important precaution so code it that way now for all new code + + todo: gzdecimal triggering dirty just by clicking into and out of a field witha value in it. also, it sometimes shows without the decimal then with the decimal for editing then without, it's crazy the decimal thing is probbly what's triggering the dirty change. diff --git a/ayanova/src/components/work-order-header.vue b/ayanova/src/components/work-order-header.vue index 002def7f..39549f26 100644 --- a/ayanova/src/components/work-order-header.vue +++ b/ayanova/src/components/work-order-header.vue @@ -120,4 +120,196 @@ export default { } } }; + +/* +Example workorder +{ + id: 10, + concurrency: 7728489, + serial: 10, + notes: "Quae officia placeat aliquid ducimus consequatur quia.", + wiki: null, + customFields: null, + tags: ["green", "zone6"], + customerId: 12, + projectId: null, + internalReferenceNumber: "irf-3339", + customerReferenceNumber: "crf-1889", + customerContactName: "contact name here", + fromQuoteId: null, + fromPMId: null, + fromCSRId: null, + serviceDate: "2021-05-29T21:25:31.421011Z", + completeByDate: "2021-06-03T21:25:31.421011Z", + invoiceNumber: null, + customerSignature: null, + customerSignatureName: null, + customerSignatureCaptured: "0001-01-01T00:00:00Z", + postAddress: null, + postCity: null, + postRegion: null, + postCountry: null, + postCode: null, + address: null, + city: null, + region: null, + country: null, + latitude: null, + longitude: null, + items: [ + { + id: 21, + concurrency: 7728489, + notes: "itemnotes", + wiki: null, + customFields: null, + tags: [], + workOrderId: 10, + techNotes: "technotes", + workorderItemStatusId: null, + workorderItemPriorityId: null, + requestDate: "2021-05-29T21:25:31.421011Z", + warrantyService: false, + isDirty: false, + expenses: [], + labors: [], + loans: [], + parts: [], + partRequests: [], + scheduledUsers: [ + { + id: 41, + concurrency: 7728489, + userId: 15, + estimatedQuantity: 1.0, + startDate: null, + stopDate: null, + serviceRateId: null, + isDirty: false, + workOrderItemId: 21 + }, + { + id: 42, + concurrency: 7728489, + userId: 22, + estimatedQuantity: 2.0, + startDate: null, + stopDate: null, + serviceRateId: null, + isDirty: false, + workOrderItemId: 21 + } + ], + tasks: [], + travels: [], + units: [], + outsideServices: [] + }, + { + id: 22, + concurrency: 7728489, + notes: "itemnotes", + wiki: null, + customFields: null, + tags: [], + workOrderId: 10, + techNotes: "technotes", + workorderItemStatusId: null, + workorderItemPriorityId: null, + requestDate: "2021-05-29T21:25:31.421011Z", + warrantyService: false, + isDirty: false, + expenses: [], + labors: [], + loans: [], + parts: [], + partRequests: [], + scheduledUsers: [ + { + id: 43, + concurrency: 7728489, + userId: 24, + estimatedQuantity: 1.0, + startDate: null, + stopDate: null, + serviceRateId: null, + isDirty: false, + workOrderItemId: 22 + }, + { + id: 44, + concurrency: 7728489, + userId: 40, + estimatedQuantity: 2.0, + startDate: null, + stopDate: null, + serviceRateId: null, + isDirty: false, + workOrderItemId: 22 + } + ], + tasks: [], + travels: [], + units: [], + outsideServices: [] + } + ], + states: [ + { + id: 37, + concurrency: 7728489, + workOrderId: 10, + workOrderStatusId: 2, + created: "2021-05-29T21:30:31.421011Z", + userId: 37, + isDirty: false, + workOrderStatus: null + }, + { + id: 38, + concurrency: 7728489, + workOrderId: 10, + workOrderStatusId: 3, + created: "2021-05-29T22:25:31.421011Z", + userId: 10, + isDirty: false, + workOrderStatus: null + }, + { + id: 39, + concurrency: 7728489, + workOrderId: 10, + workOrderStatusId: 1, + created: "2021-05-29T22:30:31.421011Z", + userId: 31, + isDirty: false, + workOrderStatus: null + }, + { + id: 40, + concurrency: 7728489, + workOrderId: 10, + workOrderStatusId: 3, + created: "2021-05-29T23:25:31.421011Z", + userId: 2, + isDirty: false, + workOrderStatus: null + }, + { + id: 41, + concurrency: 7728489, + workOrderId: 10, + workOrderStatusId: 9, + created: "2021-04-06T00:10:44.636Z", + userId: 1, + isDirty: false, + workOrderStatus: null + } + ], + isDirty: false, + isLockedAtServer: false + }; + + +*/ diff --git a/ayanova/src/views/svc-workorder.vue b/ayanova/src/views/svc-workorder.vue index f6c6aeb0..39427928 100644 --- a/ayanova/src/views/svc-workorder.vue +++ b/ayanova/src/views/svc-workorder.vue @@ -614,6 +614,9 @@ async function saveHeader(vm) { return true; } let isPost = vm.obj.id == 0; + const clone = { items: undefined, states: undefined, ...vm.obj }; + + console.log("CLONING RESULT:", { obj: vm.obj, clone: clone }); let res = await window.$gz.api.upsert(`${API_BASE_URL}`, vm.obj); if (res.error) { displayResError(vm, res); @@ -965,6 +968,7 @@ async function initForm(vm) { async function fetchTranslatedText(vm) { await window.$gz.translation.cacheTranslations([ "WorkOrder", + "Customer", "WorkOrderSerialNumber", "WorkOrderSummary", "WorkOrderStatus", @@ -1016,196 +1020,4 @@ async function populateSelectionLists(vm) { //--------- } - -/* -Example workorder -{ - id: 10, - concurrency: 7728489, - serial: 10, - notes: "Quae officia placeat aliquid ducimus consequatur quia.", - wiki: null, - customFields: null, - tags: ["green", "zone6"], - customerId: 12, - projectId: null, - internalReferenceNumber: "irf-3339", - customerReferenceNumber: "crf-1889", - customerContactName: "contact name here", - fromQuoteId: null, - fromPMId: null, - fromCSRId: null, - serviceDate: "2021-05-29T21:25:31.421011Z", - completeByDate: "2021-06-03T21:25:31.421011Z", - invoiceNumber: null, - customerSignature: null, - customerSignatureName: null, - customerSignatureCaptured: "0001-01-01T00:00:00Z", - postAddress: null, - postCity: null, - postRegion: null, - postCountry: null, - postCode: null, - address: null, - city: null, - region: null, - country: null, - latitude: null, - longitude: null, - items: [ - { - id: 21, - concurrency: 7728489, - notes: "itemnotes", - wiki: null, - customFields: null, - tags: [], - workOrderId: 10, - techNotes: "technotes", - workorderItemStatusId: null, - workorderItemPriorityId: null, - requestDate: "2021-05-29T21:25:31.421011Z", - warrantyService: false, - isDirty: false, - expenses: [], - labors: [], - loans: [], - parts: [], - partRequests: [], - scheduledUsers: [ - { - id: 41, - concurrency: 7728489, - userId: 15, - estimatedQuantity: 1.0, - startDate: null, - stopDate: null, - serviceRateId: null, - isDirty: false, - workOrderItemId: 21 - }, - { - id: 42, - concurrency: 7728489, - userId: 22, - estimatedQuantity: 2.0, - startDate: null, - stopDate: null, - serviceRateId: null, - isDirty: false, - workOrderItemId: 21 - } - ], - tasks: [], - travels: [], - units: [], - outsideServices: [] - }, - { - id: 22, - concurrency: 7728489, - notes: "itemnotes", - wiki: null, - customFields: null, - tags: [], - workOrderId: 10, - techNotes: "technotes", - workorderItemStatusId: null, - workorderItemPriorityId: null, - requestDate: "2021-05-29T21:25:31.421011Z", - warrantyService: false, - isDirty: false, - expenses: [], - labors: [], - loans: [], - parts: [], - partRequests: [], - scheduledUsers: [ - { - id: 43, - concurrency: 7728489, - userId: 24, - estimatedQuantity: 1.0, - startDate: null, - stopDate: null, - serviceRateId: null, - isDirty: false, - workOrderItemId: 22 - }, - { - id: 44, - concurrency: 7728489, - userId: 40, - estimatedQuantity: 2.0, - startDate: null, - stopDate: null, - serviceRateId: null, - isDirty: false, - workOrderItemId: 22 - } - ], - tasks: [], - travels: [], - units: [], - outsideServices: [] - } - ], - states: [ - { - id: 37, - concurrency: 7728489, - workOrderId: 10, - workOrderStatusId: 2, - created: "2021-05-29T21:30:31.421011Z", - userId: 37, - isDirty: false, - workOrderStatus: null - }, - { - id: 38, - concurrency: 7728489, - workOrderId: 10, - workOrderStatusId: 3, - created: "2021-05-29T22:25:31.421011Z", - userId: 10, - isDirty: false, - workOrderStatus: null - }, - { - id: 39, - concurrency: 7728489, - workOrderId: 10, - workOrderStatusId: 1, - created: "2021-05-29T22:30:31.421011Z", - userId: 31, - isDirty: false, - workOrderStatus: null - }, - { - id: 40, - concurrency: 7728489, - workOrderId: 10, - workOrderStatusId: 3, - created: "2021-05-29T23:25:31.421011Z", - userId: 2, - isDirty: false, - workOrderStatus: null - }, - { - id: 41, - concurrency: 7728489, - workOrderId: 10, - workOrderStatusId: 9, - created: "2021-04-06T00:10:44.636Z", - userId: 1, - isDirty: false, - workOrderStatus: null - } - ], - isDirty: false, - isLockedAtServer: false - }; - - -*/