This commit is contained in:
2021-08-13 22:23:50 +00:00
parent dcffa704ed
commit 066deafd70
6 changed files with 79 additions and 3 deletions

View File

@@ -16,6 +16,9 @@
:reload="reload"
@selection-change="handleSelected"
data-cy="customersTable"
:client-criteria="clientCriteria"
:pre-filter-mode="preFilterMode"
@clear-pre-filter="clearPreFilter"
>
</gz-data-table>
</div>
@@ -27,6 +30,27 @@ export default {
created() {
this.rights = window.$gz.role.getRights(window.$gz.type.Customer);
window.$gz.eventBus.$on("menu-click", clickHandler);
//------ pre-filter ----
//OPTIONAL "Show All customers of head office" 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
};
}
//------ /pre-filter ----
generateMenu(this);
},
beforeDestroy() {
@@ -37,12 +61,19 @@ export default {
rights: window.$gz.role.defaultRightsObject(),
aType: window.$gz.type.Customer,
selectedItems: [],
reload: false
reload: false,
clientCriteria: undefined,
preFilterMode: null
};
},
methods: {
handleSelected(selected) {
this.selectedItems = selected;
},
clearPreFilter() {
this.clientCriteria = null;
this.preFilterMode = null;
this.reload = !this.reload;
}
}
};

View File

@@ -1286,7 +1286,16 @@ async function clickHandler(menuItem) {
postCode: m.vm.obj.postCode
});
break;
case "CustomerList":
m.vm.$router.push({
name: "cust-customers",
params: {
aType: m.vm.ayaType,
objectId: m.vm.obj.id,
name: m.vm.obj.name
}
});
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",

View File

@@ -1749,6 +1749,11 @@ async function clickHandler(menuItem) {
name: "svc-work-order-item-priorities"
});
break;
case "taskgroupslist":
m.vm.$router.push({
name: "svc-task-groups"
});
break;
case "pm":
window.$gz.eventBus.$emit("openobject", {
type: window.$gz.type.PM,
@@ -1906,6 +1911,12 @@ function generateMenu(vm) {
key: FORM_KEY + ":prioritylist",
vm: vm
});
menuOptions.menuItems.push({
title: "TaskGroupList",
icon: "$ayiTasks",
key: FORM_KEY + ":taskgroupslist",
vm: vm
});
}
menuOptions.menuItems.push({ divider: true, inset: false });

View File

@@ -1828,6 +1828,11 @@ async function clickHandler(menuItem) {
name: "svc-work-order-item-priorities"
});
break;
case "taskgroupslist":
m.vm.$router.push({
name: "svc-task-groups"
});
break;
case "quote":
window.$gz.eventBus.$emit("openobject", {
type: window.$gz.type.Quote,
@@ -1990,6 +1995,12 @@ function generateMenu(vm) {
key: FORM_KEY + ":prioritylist",
vm: vm
});
menuOptions.menuItems.push({
title: "TaskGroupList",
icon: "$ayiTasks",
key: FORM_KEY + ":taskgroupslist",
vm: vm
});
}
menuOptions.menuItems.push({ divider: true, inset: false });

View File

@@ -1920,6 +1920,11 @@ async function clickHandler(menuItem) {
name: "svc-work-order-item-priorities"
});
break;
case "taskgroupslist":
m.vm.$router.push({
name: "svc-task-groups"
});
break;
case "quote":
window.$gz.eventBus.$emit("openobject", {
type: window.$gz.type.Quote,
@@ -2082,6 +2087,13 @@ function generateMenu(vm) {
key: FORM_KEY + ":prioritylist",
vm: vm
});
menuOptions.menuItems.push({
title: "TaskGroupList",
icon: "$ayiTasks",
key: FORM_KEY + ":taskgroupslist",
vm: vm
});
}
menuOptions.menuItems.push({ divider: true, inset: false });