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

@@ -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() {