From 5712810ae28548f97727adaeefed9aceb2015ca1 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 7 May 2024 12:00:20 +0200 Subject: [PATCH] fix: refs #6938 rollback phone --- src/pages/Worker/Card/WorkerBasicData.vue | 3 -- src/pages/Worker/Card/WorkerDescriptor.vue | 26 +++++++++++- src/pages/Worker/Card/WorkerSummary.vue | 49 ++++++++++++++++++++-- 3 files changed, 69 insertions(+), 9 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue index 775472065..c59f4281d 100644 --- a/src/pages/Worker/Card/WorkerBasicData.vue +++ b/src/pages/Worker/Card/WorkerBasicData.vue @@ -27,7 +27,6 @@ const workerFilter = { }, { relation: 'sip', scope: { fields: ['extension', 'secret'] } }, { relation: 'department', scope: { include: { relation: 'department' } } }, - { relation: 'client', scope: {fields:['phone']} }, ], }; const workersFilter = { @@ -87,7 +86,6 @@ const maritalStatus = [ :label="t('Mobile extension')" clearable /> - @@ -159,7 +157,6 @@ es: Last name: Apellidos Business phone: Teléfono de empresa Mobile extension: Extensión móvil - Personal phone: Teléfono personal Boss: Jefe Marital status: Estado civil Married: Casado/a diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index 6f876b8fa..a20ad5546 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -31,7 +31,29 @@ const entityId = computed(() => { }); const worker = ref(); -const filter = { where: { id: entityId } }; +const filter = { + include: [ + { + relation: 'user', + scope: { + fields: ['email', 'name', 'nickname'], + }, + }, + { + relation: 'department', + scope: { + include: [ + { + relation: 'department', + }, + ], + }, + }, + { + relation: 'sip', + }, + ], +}; const sip = ref(null); @@ -60,7 +82,7 @@ const setData = (entity) => { $props.id || params.id); +const entityId = computed(() => $props.id || route.params.id); const workerUrl = ref(); onMounted(async () => { workerUrl.value = (await getUrl('')) + `worker/${entityId.value}/`; }); -const filter = { where: { id: entityId.value } }; +const filter = { + include: [ + { + relation: 'user', + scope: { + fields: ['email', 'name', 'nickname', 'roleFk'], + include: { + relation: 'role', + scope: { + fields: ['name'], + }, + }, + }, + }, + { + relation: 'department', + scope: { + include: { + relation: 'department', + scope: { + fields: ['name'], + }, + }, + }, + }, + { + relation: 'boss', + }, + { + relation: 'client', + }, + { + relation: 'sip', + }, + ], +}; + + +