From 7d5bf2b185058a5207229ce5dbda0545f0ce144d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 19 Jul 2021 23:47:08 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 2 -- ayanova/src/views/cust-customer.vue | 12 +++++++++- ayanova/src/views/svc-units.vue | 36 ++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 4d35129a..2db346d0 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -424,8 +424,6 @@ todo: many biz objects are not using new PUT methodology CURRENTLY DOING: more misc stuff below to complete workorder!!! - - todo: customer->show all units not coded yet! Gasp! So shock, much freaky CASES TODO: diff --git a/ayanova/src/views/cust-customer.vue b/ayanova/src/views/cust-customer.vue index 0bc7ccf5..5693876e 100644 --- a/ayanova/src/views/cust-customer.vue +++ b/ayanova/src/views/cust-customer.vue @@ -1409,6 +1409,16 @@ async function clickHandler(menuItem) { } }); break; + case "UnitList": + m.vm.$router.push({ + name: "svc-units", + params: { + aType: m.vm.ayaType, + objectId: m.vm.obj.id, + name: m.vm.obj.name + } + }); + break; default: window.$gz.eventBus.$emit( "notify-warning", @@ -1513,7 +1523,6 @@ function generateMenu(vm) { vm: vm }); - //MIGRATE_OUTSTANDING show all: unitlist, quotelist, pmlist menuOptions.menuItems.push({ title: "UnitList", icon: "$ayiFan", @@ -1521,6 +1530,7 @@ function generateMenu(vm) { vm: vm }); + //MIGRATE_OUTSTANDING show all: unitlist, quotelist, pmlist menuOptions.menuItems.push({ title: "QuoteList", icon: "$ayiPencilAlt", diff --git a/ayanova/src/views/svc-units.vue b/ayanova/src/views/svc-units.vue index 639e44ea..03e64896 100644 --- a/ayanova/src/views/svc-units.vue +++ b/ayanova/src/views/svc-units.vue @@ -15,6 +15,9 @@ :reload="reload" @selection-change="handleSelected" data-cy="unitsTable" + :client-criteria="clientCriteria" + :pre-filter-mode="preFilterMode" + @clear-pre-filter="clearPreFilter" > @@ -26,6 +29,27 @@ export default { created() { this.rights = window.$gz.role.getRights(window.$gz.type.Unit); 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 +60,22 @@ export default { rights: window.$gz.role.defaultRightsObject(), aType: window.$gz.type.Unit, 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; } } };