This commit is contained in:
2021-07-19 23:47:08 +00:00
parent 8a078c9114
commit 7d5bf2b185
3 changed files with 46 additions and 4 deletions

View File

@@ -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:

View File

@@ -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",

View File

@@ -15,6 +15,9 @@
:reload="reload"
@selection-change="handleSelected"
data-cy="unitsTable"
:client-criteria="clientCriteria"
:pre-filter-mode="preFilterMode"
@clear-pre-filter="clearPreFilter"
>
</gz-data-table>
</div>
@@ -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;
}
}
};