This commit is contained in:
2021-07-09 23:18:58 +00:00
parent 34bf6d6aa1
commit 9c91109236
3 changed files with 89 additions and 7 deletions

View File

@@ -732,7 +732,16 @@ async function clickHandler(menuItem) {
}
});
break;
case "WorkOrderItemPartList":
m.vm.$router.push({
name: "svc-workorder-item-parts",
params: {
aType: m.vm.ayaType,
objectId: m.vm.obj.id,
name: m.vm.obj.partNumber
}
});
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -857,6 +866,32 @@ function generateMenu(vm) {
});
}
//---- SHOW ALL ---
menuOptions.menuItems.push({ divider: true, inset: false });
menuOptions.menuItems.push({
title: "WorkOrderList", //note: technically it opens teh woitemunitlist not workorders but it's confusing in the UI otherwise and this is how people would think about it
icon: "$ayiTools",
key: FORM_KEY + ":WorkOrderItemPartList",
vm: vm
});
//MIGRATE_OUTSTANDING show all: workorderlist, unitlist, quotelist, pmlist
menuOptions.menuItems.push({
title: "QuoteList",
icon: "$ayiPencilAlt",
key: FORM_KEY + ":QuoteList",
vm: vm
});
menuOptions.menuItems.push({
title: "PMList",
icon: "$ayiBusinessTime",
key: FORM_KEY + ":PMList",
vm: vm
});
menuOptions.menuItems.push({ divider: true, inset: false });
window.$gz.eventBus.$emit("menu-change", menuOptions);

View File

@@ -15,6 +15,9 @@
:reload="reload"
@selection-change="handleSelected"
data-cy="WorkOrderItemPartsTable"
:client-criteria="clientCriteria"
:pre-filter-mode="preFilterMode"
@clear-pre-filter="clearPreFilter"
>
</gz-data-table>
</div>
@@ -26,6 +29,26 @@ export default {
created() {
this.rights = window.$gz.role.getRights(window.$gz.type.WorkOrder);
window.$gz.eventBus.$on("menu-click", clickHandler);
//------ Show all ----
//OPTIONAL "Show All" FILTER
this.objectId = window.$gz.util.stringToIntOrNull(
this.$route.params.objectId
);
this.aForType = window.$gz.util.stringToIntOrNull(this.$route.params.aType);
if (this.objectId && this.objectId != 0 && this.aForType) {
//OBJECTID,AYATYPE
this.clientCriteria = `${this.objectId},${this.aForType}`;
this.preFilterMode = {
icon: window.$gz.util.iconForType(this.aForType),
id: this.objectId,
ayatype: this.aForType,
viz: this.$route.params.name,
clearable: true
};
}
//------ /show all ----
generateMenu(this);
},
beforeDestroy() {
@@ -36,12 +59,22 @@ export default {
rights: window.$gz.role.defaultRightsObject(),
aType: window.$gz.type.WorkOrderItemPart,
selectedItems: [],
reload: false
reload: false,
clientCriteria: undefined,
preFilterMode: null,
objectId: null,
aForType: null,
name: null
};
},
methods: {
handleSelected(selected) {
this.selectedItems = selected;
},
clearPreFilter() {
this.clientCriteria = null;
this.preFilterMode = null;
this.reload = !this.reload;
}
}
};