diff --git a/src/composables/useRole.js b/src/composables/useRole.js index ff54b409c..e700b1f2e 100644 --- a/src/composables/useRole.js +++ b/src/composables/useRole.js @@ -13,6 +13,7 @@ export function useRole() { name: data.user.name, nickname: data.user.nickname, lang: data.user.lang || 'es', + departmentFk: data.user.worker.department.departmentFk, }; state.setUser(userData); state.setRoles(roles); diff --git a/src/pages/Monitor/MonitorClients.vue b/src/pages/Monitor/MonitorClients.vue index c814d623e..99110df16 100644 --- a/src/pages/Monitor/MonitorClients.vue +++ b/src/pages/Monitor/MonitorClients.vue @@ -9,12 +9,14 @@ import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnRow from 'src/components/ui/VnRow.vue'; import { dateRange } from 'src/filters'; import useOpenURL from 'src/composables/useOpenURL'; +import { useState } from 'src/composables/useState'; const { t } = useI18n(); const dates = dateRange(Date.vnNew()); const from = ref(dates[0]); const to = ref(dates[1]); +const state = useState(); const filter = computed(() => { const obj = {}; const formatFrom = setHours(from.value, 'from'); @@ -25,7 +27,9 @@ const filter = computed(() => { else if (formatFrom && !formatTo) stamp = { gte: formatFrom }; else if (formatFrom && formatTo) stamp = { between: [formatFrom, formatTo] }; - return Object.assign(obj, { where: { 'v.stamp': stamp } }); + return Object.assign(obj, { + where: { 'v.stamp': stamp, departmentFk: state.getUser().departmentFk }, + }); }); function exprBuilder(param, value) {