diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index e28774e4..8951823f 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -135,33 +135,33 @@ export default { methods: { newItem() { - this.pvm.selectItem( - this.value.items.push({ - id: 0, - concurrency: 0, - notes: null, - wiki: null, - customFields: "{}", - tags: [], - workOrderId: this.value.id, - techNotes: null, - workorderItemStatusId: null, - workorderItemPriorityId: null, - requestDate: null, - warrantyService: false, - isDirty: true, - expenses: [], - labors: [], - loans: [], - parts: [], - partRequests: [], - scheduledUsers: [], - tasks: [], - travels: [], - units: [], - outsideServices: [] - }) - 1 - ); + let newIndex = this.value.items.length; + this.value.items.push({ + id: 0, + concurrency: 0, + notes: null, + wiki: null, + customFields: "{}", + tags: [], + workOrderId: this.value.id, + techNotes: null, + workorderItemStatusId: null, + workorderItemPriorityId: null, + requestDate: null, + warrantyService: false, + isDirty: true, + expenses: [], + labors: [], + loans: [], + parts: [], + partRequests: [], + scheduledUsers: [], + tasks: [], + travels: [], + units: [], + outsideServices: [] + }); + this.pvm.selectItem(newIndex); }, async deleteItem() { if ((await window.$gz.dialog.confirmDelete()) != true) {