feat: add departmentFk to user data and filter clients by department
gitea/salix-front/pipeline/head There was a failure building this commit
Details
gitea/salix-front/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
69da78b655
commit
2a3e072b1b
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue