fix: workerSummary

This commit is contained in:
Alex Moreno 2025-02-05 11:16:02 +01:00
parent 9ff1d3fa83
commit 54962fbb56
2 changed files with 7 additions and 73 deletions

View File

@ -15,6 +15,10 @@ const props = defineProps({
type: Object, type: Object,
default: null, default: null,
}, },
userFilter: {
type: Object,
default: null,
},
entityId: { entityId: {
type: [Number, String], type: [Number, String],
default: null, default: null,
@ -34,6 +38,7 @@ const isSummary = ref();
const arrayData = useArrayData(props.dataKey, { const arrayData = useArrayData(props.dataKey, {
url: props.url, url: props.url,
filter: props.filter, filter: props.filter,
userFilter: props.userFilter,
skip: 0, skip: 0,
}); });
const { store } = arrayData; const { store } = arrayData;

View File

@ -12,7 +12,6 @@ import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary'; import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue'; import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue';
import axios from 'axios';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -28,76 +27,6 @@ const entityId = computed(() => $props.id || route.params.id);
const basicDataUrl = ref(null); const basicDataUrl = ref(null);
const advancedSummary = ref(); const advancedSummary = ref();
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['name', 'nickname', 'roleFk'],
include: [
{
relation: 'role',
scope: {
fields: ['name'],
},
},
{
relation: 'emailUser',
scope: {
fields: ['email'],
},
},
],
},
},
{
relation: 'department',
scope: {
include: {
relation: 'department',
scope: {
fields: ['name'],
},
},
},
},
{
relation: 'boss',
},
{
relation: 'client',
},
{
relation: 'sip',
},
{
relation: 'business',
scope: {
include: [
{
relation: 'department',
scope: {
fields: ['id', 'name'],
},
},
{
relation: 'reasonEnd',
scope: {
fields: ['id', 'reason'],
},
},
{
relation: 'workerBusinessProfessionalCategory',
scope: {
fields: ['id', 'description'],
},
},
],
},
},
],
};
onBeforeMount(async () => { onBeforeMount(async () => {
advancedSummary.value = await useAdvancedSummary('Workers', entityId.value); advancedSummary.value = await useAdvancedSummary('Workers', entityId.value);
basicDataUrl.value = `#/worker/${entityId.value}/basic-data`; basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
@ -107,8 +36,8 @@ onBeforeMount(async () => {
<template> <template>
<CardSummary <CardSummary
ref="summary" ref="summary"
:url="`Workers/summary`" url="Workers/summary"
:user-filter="{ where: { id: entityId }, filter }" :user-filter="{ where: { id: entityId } }"
data-key="Worker" data-key="Worker"
> >
<template #header="{ entity }"> <template #header="{ entity }">