diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 33ea686c..e75a821b 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -420,12 +420,11 @@ todo: many biz objects are not using new PUT methodology CURRENTLY DOING: - - todo 2: Implement "Show All" feature for related objects also add a Show all workorders for Tech User's in their menu so they can see their own workorders at a glance actually, there's a *lot* of these potentiall e.g. WorkorderItemParts filtered from Part menu etc etc I guess literally everything that is a sublist should have a filter on it's parent type that it's tracking (loanunit, schedusers, labor you fucking name it) + (In v7 it was Client, LoanItem and Unit only) todo 1: "DispatchFull" and "DispatchLimited" roles MUST be renamed to "ServiceFull" and "ServiceLimited" to match other roles and intent dispatch is a subset of a service manager job diff --git a/ayanova/src/views/svc-loaner.vue b/ayanova/src/views/svc-loaner.vue index 2fa3b168..57c4b836 100644 --- a/ayanova/src/views/svc-loaner.vue +++ b/ayanova/src/views/svc-loaner.vue @@ -816,7 +816,16 @@ async function clickHandler(menuItem) { }); } break; - + case "WorkOrderList": + m.vm.$router.push({ + name: "svc-workorder-item-loans", + params: { + aType: m.vm.ayaType, + objectId: m.vm.obj.id, + name: m.vm.obj.name + } + }); + break; default: window.$gz.eventBus.$emit( "notify-warning", @@ -907,6 +916,7 @@ function generateMenu(vm) { //---- SHOW ALL --- //MIGRATE_OUTSTANDING show all: workorderlist, quotelist, pmlist + menuOptions.menuItems.push({ title: "WorkOrderList", icon: "$ayiTools", diff --git a/ayanova/src/views/svc-workorder-item-loans.vue b/ayanova/src/views/svc-workorder-item-loans.vue index 92bd0d53..3aa306c8 100644 --- a/ayanova/src/views/svc-workorder-item-loans.vue +++ b/ayanova/src/views/svc-workorder-item-loans.vue @@ -15,6 +15,9 @@ :reload="reload" @selection-change="handleSelected" data-cy="WorkOrderItemLoansTable" + :client-criteria="clientCriteria" + :pre-filter-mode="preFilterMode" + @clear-pre-filter="clearPreFilter" > @@ -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.WorkOrderItemLoan, 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; } } };