This commit is contained in:
@@ -580,10 +580,100 @@ export default {
|
|||||||
goto(val, oldVal) {
|
goto(val, oldVal) {
|
||||||
if (val != oldVal) {
|
if (val != oldVal) {
|
||||||
console.log("WOITEM WATCH GOTO VALUE CHANGED", val);
|
console.log("WOITEM WATCH GOTO VALUE CHANGED", val);
|
||||||
|
let navto = { woitemindex: null, childindex: null };
|
||||||
|
//find the item in question then trigger the nav
|
||||||
|
let keepgoing = true;
|
||||||
|
|
||||||
|
this.value.items.forEach((z, itemindex) => {
|
||||||
|
if (keepgoing) {
|
||||||
|
switch (val.type) {
|
||||||
|
case window.$gz.type.WorkOrderItem:
|
||||||
|
if (z.id == val.id) {
|
||||||
|
navto.woitemindex = itemindex;
|
||||||
|
keepgoing = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case window.$gz.type.WorkOrderItemOutsideService:
|
||||||
|
z.outsideServices.forEach((x, childindex) => {
|
||||||
|
if (x.id == val.id) {
|
||||||
|
navto.woitemindex = itemindex;
|
||||||
|
navto.childindex = childindex;
|
||||||
|
keepgoing = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemExpense: 36,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemLabor: 37,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemLoan: 38,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemPart: 39,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemPartRequest: 40,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemScheduledUser: 41,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemTask: 42,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemTravel: 43,
|
||||||
|
// //corebizobject
|
||||||
|
// WorkOrderItemUnit: 44,
|
||||||
|
// 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) {
|
// if (gotype != window.$gz.type.WorkOrder) {
|
||||||
// //not workorder? Then must be a descendant so let's gooooooooooo!
|
// //not workorder? Then must be a descendant so let's gooooooooooo!
|
||||||
// this.goto = { type: gotype, id: goid };
|
// this.goto = { type: gotype, id: goid };
|
||||||
// }
|
// }
|
||||||
|
if (navto.woitemindex != null) {
|
||||||
|
this.selectedRow = [{ index: navto.woitemindex }];
|
||||||
|
this.activeItemIndex = navto.woitemindex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -99,12 +99,10 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
vm.formState.ready = true;
|
vm.formState.ready = true;
|
||||||
//navigate somewhere??
|
//navigate somewhere??
|
||||||
console.log("workorder init params:", this.$route.params);
|
|
||||||
if (this.$route.params.gotype != null) {
|
if (this.$route.params.gotype != null) {
|
||||||
//find out which woitem and then find out which type to set and then set them as the active item somehow
|
//find out which woitem and then find out which type to set and then set them as the active item somehow
|
||||||
const gotype = Number(this.$route.params.gotype);
|
const gotype = Number(this.$route.params.gotype);
|
||||||
const goid = Number(this.$route.params.goid);
|
const goid = Number(this.$route.params.goid);
|
||||||
console.log("GO ACTIVATED, GOING....");
|
|
||||||
if (gotype != window.$gz.type.WorkOrder) {
|
if (gotype != window.$gz.type.WorkOrder) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
//not workorder? Then must be a descendant so let's gooooooooooo!
|
//not workorder? Then must be a descendant so let's gooooooooooo!
|
||||||
|
|||||||
Reference in New Issue
Block a user