fix: improve monitorClient.department
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Javier Segarra 2025-03-28 14:31:11 +01:00
parent cce3a0cef8
commit d60d7da33c
1 changed files with 11 additions and 7 deletions

View File

@ -26,9 +26,11 @@ const filter = computed(() => {
if (!formatFrom && formatTo) stamp = { lte: formatTo }; if (!formatFrom && formatTo) stamp = { lte: formatTo };
else if (formatFrom && !formatTo) stamp = { gte: formatFrom }; else if (formatFrom && !formatTo) stamp = { gte: formatFrom };
else if (formatFrom && formatTo) stamp = { between: [formatFrom, formatTo] }; else if (formatFrom && formatTo) stamp = { between: [formatFrom, formatTo] };
return Object.assign(obj, { return Object.assign(obj, {
where: { 'v.stamp': stamp, departmentFk: state.getUser().departmentFk }, where: {
'v.stamp': stamp,
'c.departmentFk': state.getUser().value.departmentFk,
},
}); });
}); });
@ -36,8 +38,6 @@ function exprBuilder(param, value) {
switch (param) { switch (param) {
case 'clientFk': case 'clientFk':
return { [`c.id`]: value }; return { [`c.id`]: value };
case 'departmentFk':
return { [`c.${param}`]: value };
} }
} }
@ -70,9 +70,13 @@ const columns = computed(() => [
align: 'left', align: 'left',
name: 'departmentFk', name: 'departmentFk',
label: t('customer.summary.team'), label: t('customer.summary.team'),
component: 'select', columnFilter: {
attrs: { component: 'select',
url: 'Departments', attrs: {
url: 'Departments',
},
alias: 'c',
inWhere: true,
}, },
columnField: { columnField: {
component: null, component: null,