This commit is contained in:
2021-07-09 23:41:53 +00:00
parent 231738bc00
commit bb4cb6fbba
5 changed files with 110 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ export default new Vuex.Store({
notifyAvailable: true,
isCustomerUser: false,
isSubContractorUser: false,
isScheduleableUser: false,
customerRights: {},
userId: 0,
userName: "NOT AUTHENTICATED",
@@ -74,6 +75,7 @@ export default new Vuex.Store({
state.userType = data.userType;
state.isSubContractorUser = data.userType == 5;
state.isCustomerUser = data.userType == 3 || data.userType == 4;
state.isScheduleableUser = data.userType == 1 || data.userType == 5;
state.downloadToken = data.dlt;
state.tfaEnabled = data.tfaEnabled;
if (data.customerRights) {
@@ -101,6 +103,7 @@ export default new Vuex.Store({
state.notifyAvailable = true;
state.isCustomerUser = false;
state.isSubContractorUser = false;
state.isScheduleableUser = false;
state.homePage = undefined;
state.navItems = [];
state.translationText = {};

View File

@@ -1014,6 +1014,26 @@ async function clickHandler(menuItem) {
case "disable2fa":
m.vm.disableTfa();
break;
case "WorkOrderItemScheduledUserList":
m.vm.$router.push({
name: "svc-workorder-item-scheduled-users",
params: {
aType: m.vm.ayaType,
objectId: m.vm.obj.id,
name: m.vm.obj.name
}
});
break;
case "WorkOrderItemLaborList":
m.vm.$router.push({
name: "svc-workorder-item-labors",
params: {
aType: m.vm.ayaType,
objectId: m.vm.obj.id,
name: m.vm.obj.name
}
});
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -1124,6 +1144,21 @@ function generateMenu(vm) {
vm: vm
});
}
if (vm.obj.userType == 1 || vm.obj.userType == 5) {
menuOptions.menuItems.push({
title: "WorkOrderItemScheduledUserList",
icon: "$ayiUserClock",
key: FORM_KEY + ":WorkOrderItemScheduledUserList",
vm: vm
});
menuOptions.menuItems.push({
title: "WorkOrderItemLaborList",
icon: "$ayiHammer",
key: FORM_KEY + ":WorkOrderItemLaborList",
vm: vm
});
}
}
}
@@ -1191,7 +1226,9 @@ async function fetchTranslatedText(vm) {
"UserPageAddress",
"SendPasswordResetCode",
"AuthDisableTwoFactor",
"AuthTwoFactorDisabled"
"AuthTwoFactorDisabled",
"WorkOrderItemScheduledUserList",
"WorkOrderItemLaborList"
]);
}

View File

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

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