diff --git a/ayanova/src/components/work-order-item-outside-services.vue b/ayanova/src/components/work-order-item-outside-services.vue index 7a2875bb..c6286a82 100644 --- a/ayanova/src/components/work-order-item-outside-services.vue +++ b/ayanova/src/components/work-order-item-outside-services.vue @@ -614,6 +614,10 @@ export default { activeWoItemIndex: { default: null, type: Number + }, + gotoIndex: { + default: null, + type: Number } }, watch: { @@ -621,6 +625,12 @@ export default { if (val != oldVal) { this.setDefaultView(); } + }, + gotoIndex(val, oldVal) { + if (val != oldVal) { + this.selectedRow = [{ index: val }]; + this.activeItemIndex = val; + } } }, methods: { diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index d24123c9..821fd793 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -515,6 +515,7 @@ v-model="value" :pvm="pvm" :active-wo-item-index="activeItemIndex" + :goto-index="gotoOutsideServiceIndex" data-cy="woItemOutsideServices" @change="$emit('change')" /> @@ -559,7 +560,7 @@ export default { return { activeItemIndex: null, selectedRow: [], - test: null + gotoOutsideServiceIndex: null }; }, props: { @@ -623,56 +624,23 @@ export default { // WorkOrderItemOutsideService: 73, } } - - // z.expenses.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.labors.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.loans.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.parts.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.partRequests.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.scheduledUsers.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.tasks.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.travels.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.units.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); - // z.outsideServices.forEach((x, index) => { - // x.uid = index; - // x.isDirty = false; - // }); }); - // if (gotype != window.$gz.type.WorkOrder) { - // //not workorder? Then must be a descendant so let's gooooooooooo! - // this.goto = { type: gotype, id: goid }; - // } if (navto.woitemindex != null) { this.selectedRow = [{ index: navto.woitemindex }]; this.activeItemIndex = navto.woitemindex; + if (navto.childindex != null) { + this.$nextTick(() => { + switch (val.type) { + case window.$gz.type.WorkOrderItemOutsideService: + this.gotoOutsideServiceIndex = navto.childindex; + break; + case window.$gz.type.WorkOrderItemScheduledUser: + this.gotoScheduledUserIndex = navto.childindex; + break; + } + }); + } } } }