This commit is contained in:
2021-07-09 22:14:39 +00:00
parent 4c09edee2a
commit ad36de371a
4 changed files with 56 additions and 6 deletions

View File

@@ -428,6 +428,8 @@ todo: add Project to default workorderlist. Also, anything that is a feature to
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)
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
@@ -1213,5 +1215,5 @@ BUILD CHANGES OF NOTE
BUILD 115
- "WorkOrder" changed to "Work order" in all English translation keys that displayed it
- Customer "WorkOrders" menu item implemented, is the "Show All" workorders feature from v7
- Project "WorkOrders" menu item implemented
- Customer "Work orders" menu item implemented, is the "Show All" workorders feature from v7
- Project "Work orders" menu item implemented

View File

@@ -1282,6 +1282,16 @@ async function clickHandler(menuItem) {
postCode: m.vm.obj.postCode
});
break;
case "WorkOrderItemUnitList":
m.vm.$router.push({
name: "svc-workorder-item-units",
params: {
aType: m.vm.ayaType,
objectId: m.vm.obj.id,
name: m.vm.obj.serial
}
});
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -1378,14 +1388,16 @@ function generateMenu(vm) {
});
//---- SHOW ALL ---
//MIGRATE_OUTSTANDING show all: workorderlist, unitlist, quotelist, pmlist
menuOptions.menuItems.push({
title: "WorkOrderList",
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 + ":WorkOrderList",
key: FORM_KEY + ":WorkOrderItemUnitList",
vm: vm
});
//MIGRATE_OUTSTANDING show all: workorderlist, unitlist, quotelist, pmlist
menuOptions.menuItems.push({
title: "QuoteList",
icon: "$ayiPencilAlt",

View File

@@ -15,6 +15,9 @@
:reload="reload"
@selection-change="handleSelected"
data-cy="WorkOrderItemUnitsTable"
: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.WorkOrderItemUnit,
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;
}
}
};

View File

@@ -69,6 +69,7 @@ export default {
window.$gz.eventBus.$on("menu-click", clickHandler);
await fetchTranslatedText();
//------ Show all ----
//OPTIONAL "Show All" FILTER
this.objectId = window.$gz.util.stringToIntOrNull(
this.$route.params.objectId
@@ -87,6 +88,8 @@ export default {
clearable: true
};
}
//------ /show all ----
generateMenu(this);
},
beforeDestroy() {