This commit is contained in:
2021-06-10 22:45:10 +00:00
parent bec1c0088f
commit cfd54c2ab8
2 changed files with 24 additions and 46 deletions

View File

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

View File

@@ -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;
}
});
}
}
}
}