From 9c91109236a15ac37722296a2cbb00d2f22800fe Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 9 Jul 2021 23:18:58 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 24 +++++++++--- ayanova/src/views/inv-part.vue | 37 ++++++++++++++++++- .../src/views/svc-workorder-item-parts.vue | 35 +++++++++++++++++- 3 files changed, 89 insertions(+), 7 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 997340a5..142db640 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -420,11 +420,24 @@ 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: show all, for most lists showing Work orders and the work order icon seems ok for things like project, customer etc however, + for a tech user it could show either scheduled or labor records so then would need more detailed clarification + But then that would potentially display in a confusing manner like when I tried to do workorderitemunits and it just shows "Units" and the icon is the same for Unit so it looks like + a link to a Units list not a workorderitemunits list + Need to determine a standard + look for "show all" and see whats available in trans keys + can I put a section header in menu to disambiguate it? + What if I used the work order icon for each but put differing text as needed if more than one sub item? + +todo 2: Implement "Show All" feature for workorder lists as follows: + WorkORderItemScheduledUserDataList + WorkOrderItemLaborDataList + labor and scheduled user records available from several places: Dashboard menu, schedule menu, also under Administration->Users for the benefit of users with rights to that + Shows obvs only if they are capable of being scheduled + + + + 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 @@ -1214,3 +1227,4 @@ BUILD 115 - Unit edit form "Work orders" menu item implemented to show all WorkOrderItemUnit list filtered by unit (replicates the "Show All" workorders feature from v7) - Loan unit edit form "Work orders" menu item implemented to show all WorkOrders list filtered by loan unit (replicates the "Show All" workorders feature from v7) - Project edit form "Work orders" menu item implemented to show all WorkOrders list filtered by project (new feature) +- Part edit form "Work orders" menu item implemented to show all WorkOrders list filtered by part (new feature) diff --git a/ayanova/src/views/inv-part.vue b/ayanova/src/views/inv-part.vue index de8e7e89..8481fdd9 100644 --- a/ayanova/src/views/inv-part.vue +++ b/ayanova/src/views/inv-part.vue @@ -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); diff --git a/ayanova/src/views/svc-workorder-item-parts.vue b/ayanova/src/views/svc-workorder-item-parts.vue index 36eaef66..282912a9 100644 --- a/ayanova/src/views/svc-workorder-item-parts.vue +++ b/ayanova/src/views/svc-workorder-item-parts.vue @@ -15,6 +15,9 @@ :reload="reload" @selection-change="handleSelected" data-cy="WorkOrderItemPartsTable" + :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.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; } } };