From 4a39e73625ac39623841e93a6adb8e6d0ffdcdc9 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Thu, 17 Nov 2022 14:03:50 +0100 Subject: [PATCH 01/23] refs #4834 @7h --- src/i18n/en/index.js | 38 +++ src/i18n/es/index.js | 37 +++ src/pages/Worker/Card/WorkerCard.vue | 43 +++ src/pages/Worker/Card/WorkerSummary.vue | 280 ++++++++++++++++++ src/pages/Worker/Card/WorkerSummaryDialog.vue | 21 ++ src/pages/Worker/WorkerList.vue | 92 ++++++ src/pages/Worker/WorkerMain.vue | 17 ++ src/router/modules/worker.js | 47 +++ src/router/routes.js | 2 + 9 files changed, 577 insertions(+) create mode 100644 src/pages/Worker/Card/WorkerCard.vue create mode 100644 src/pages/Worker/Card/WorkerSummary.vue create mode 100644 src/pages/Worker/Card/WorkerSummaryDialog.vue create mode 100644 src/pages/Worker/WorkerList.vue create mode 100644 src/pages/Worker/WorkerMain.vue create mode 100644 src/router/modules/worker.js diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 229a5b995..687fbdce7 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -249,6 +249,44 @@ export default { returnOfMaterial: 'Return of material authorization (RMA)' }, }, + worker: { + pageTitles: { + workers: 'Workers', + list: 'List', + }, + list: { + name: 'Name', + email: 'Email', + phone: 'Phone', + mobile: 'Mobile', + active: 'Active', + department: 'Department', + schedule: 'Schedule', + }, + card: { + workerId: 'Worker ID', + name: 'Name', + email: 'Email', + phone: 'Phone', + mobile: 'Mobile', + active: 'Active', + warehouse: 'Warehouse', + agency: 'Agency', + salesPerson: 'Sales person', + }, + summary: { + basicData: 'Basic data', + boss: 'Boss', + phoneExtension: 'Phone extension', + entPhone: 'Enterprise phone', + personalPhone: 'Personal phone', + noBoss: 'No boss', + userData: 'User data', + userId: 'User ID', + role: 'Role', + sipExtension: 'Extension', + }, + }, components: { topbar: {}, userPanel: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index c8dff9d30..84586ab47 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -247,6 +247,43 @@ export default { picked: 'Recogida', returnOfMaterial: 'Autorización de retorno de materiales (RMA)' } + }, worker: { + pageTitles: { + workers: 'Trabajadores', + list: 'Listado', + }, + list: { + name: 'Nombre', + email: 'Email', + phone: 'Teléfono', + mobile: 'Móvil', + active: 'Activo', + department: 'Departamento', + schedule: 'Horario', + }, + card: { + workerId: 'ID Trabajador', + name: 'Nombre', + email: 'Email', + phone: 'Teléfono', + mobile: 'Móvil', + active: 'Activo', + warehouse: 'Almacén', + agency: 'Empresa', + salesPerson: 'Comercial', + }, + summary: { + basicData: 'Datos básicos', + boss: 'Jefe', + phoneExtension: 'Extensión de teléfono', + entPhone: 'Teléfono de empresa', + personalPhone: 'Teléfono personal', + noBoss: 'Sin jefe', + userData: 'Datos de usuario', + userId: 'ID del usuario', + role: 'Rol', + sipExtension: 'Extensión', + }, }, components: { topbar: {}, diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue new file mode 100644 index 000000000..856710e17 --- /dev/null +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -0,0 +1,43 @@ + + diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue new file mode 100644 index 000000000..043622340 --- /dev/null +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -0,0 +1,280 @@ + + + + diff --git a/src/pages/Worker/Card/WorkerSummaryDialog.vue b/src/pages/Worker/Card/WorkerSummaryDialog.vue new file mode 100644 index 000000000..4eedb6f6a --- /dev/null +++ b/src/pages/Worker/Card/WorkerSummaryDialog.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue new file mode 100644 index 000000000..90a14d96d --- /dev/null +++ b/src/pages/Worker/WorkerList.vue @@ -0,0 +1,92 @@ + + + diff --git a/src/pages/Worker/WorkerMain.vue b/src/pages/Worker/WorkerMain.vue new file mode 100644 index 000000000..099e82879 --- /dev/null +++ b/src/pages/Worker/WorkerMain.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js new file mode 100644 index 000000000..d5703d04b --- /dev/null +++ b/src/router/modules/worker.js @@ -0,0 +1,47 @@ +import { RouterView } from 'vue-router'; + +export default { + name: 'Worker', + path: '/worker', + meta: { + title: 'workers', + icon: 'vn:worker' + }, + component: RouterView, + redirect: { name: 'WorkerMain' }, + children: [ + { + name: 'WorkerMain', + path: '', + component: () => import('src/pages/Worker/WorkerMain.vue'), + redirect: { name: 'WorkerList' }, + children: [ + { + name: 'WorkerList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + component: () => import('src/pages/Worker/WorkerList.vue'), + }, + ] + }, + { + name: 'WorkerCard', + path: ':id', + component: () => import('src/pages/Worker/Card/WorkerCard.vue'), + redirect: { name: 'WorkerSummary' }, + children: [ + { + name: 'WorkerSummary', + path: 'summary', + meta: { + title: 'summary' + }, + component: () => import('src/pages/Worker/Card/WorkerSummary.vue'), + }, + ] + }, + ] +}; diff --git a/src/router/routes.js b/src/router/routes.js index a7261379f..4b9ca728c 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,6 +1,7 @@ import customer from './modules/customer'; import ticket from './modules/ticket'; import claim from './modules/claim'; +import worker from './modules/worker'; const routes = [ { @@ -25,6 +26,7 @@ const routes = [ customer, ticket, claim, + worker, { path: '/:pathMatch(.*)*', name: 'NotFound', -- 2.40.1 From b74569e67149a76e1cae573331b1e45d58af31bc Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 18 Nov 2022 07:59:19 +0100 Subject: [PATCH 02/23] refs #4834 worker card & descriptor implementation @1h --- src/i18n/en/index.js | 6 + src/i18n/es/index.js | 6 + src/pages/Worker/Card/WorkerCard.vue | 53 +++++---- src/pages/Worker/Card/WorkerDescriptor.vue | 121 +++++++++++++++++++++ src/pages/Worker/Card/WorkerPopover.vue | 15 +++ src/pages/Worker/Card/WorkerSummary.vue | 2 +- 6 files changed, 183 insertions(+), 20 deletions(-) create mode 100644 src/pages/Worker/Card/WorkerDescriptor.vue create mode 100644 src/pages/Worker/Card/WorkerPopover.vue diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 687fbdce7..3cc76edb3 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -253,6 +253,7 @@ export default { pageTitles: { workers: 'Workers', list: 'List', + basicData: 'Basic data', }, list: { name: 'Name', @@ -305,4 +306,9 @@ export default { moreOptions: 'More options' } }, + notFound: { + pageTitles: { + undefined: 'Undefined', + }, + } }; diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 84586ab47..cdaee02bd 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -251,6 +251,7 @@ export default { pageTitles: { workers: 'Trabajadores', list: 'Listado', + basicData: 'Datos básicos', }, list: { name: 'Nombre', @@ -303,4 +304,9 @@ export default { moreOptions: 'Más opciones', } }, + notFound: { + pageTitles: { + undefined: 'Página no encontrada', + }, + } }; diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue index 856710e17..b014e9b7f 100644 --- a/src/pages/Worker/Card/WorkerCard.vue +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -1,6 +1,7 @@ + diff --git a/src/pages/Worker/Card/WorkerPopover.vue b/src/pages/Worker/Card/WorkerPopover.vue new file mode 100644 index 000000000..5aad1377c --- /dev/null +++ b/src/pages/Worker/Card/WorkerPopover.vue @@ -0,0 +1,15 @@ + + diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index 043622340..e39027dd6 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -104,7 +104,7 @@ function sipExtension() { - + {{ t('worker.list.department') }} -- 2.40.1 From 863a74ee67afdb26f895fcc49ea7f51359cfead0 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 18 Nov 2022 08:05:23 +0100 Subject: [PATCH 03/23] Translations --- src/i18n/en/index.js | 5 ----- src/i18n/es/index.js | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 3cc76edb3..2f2b40d85 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -305,10 +305,5 @@ export default { summary: 'Summary', moreOptions: 'More options' } - }, - notFound: { - pageTitles: { - undefined: 'Undefined', - }, } }; diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index cdaee02bd..179f94add 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -303,10 +303,5 @@ export default { summary: 'Resumen', moreOptions: 'Más opciones', } - }, - notFound: { - pageTitles: { - undefined: 'Página no encontrada', - }, } }; -- 2.40.1 From f5f47f4994272d8bdfd3a9181cde45037d41e26c Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Tue, 22 Nov 2022 14:35:40 +0100 Subject: [PATCH 04/23] add worker img --- src/pages/Worker/Card/WorkerDescriptor.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index 3fa7af4b2..1f9820524 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -65,10 +65,15 @@ function sipExtension() { if (worker.value.sip) return worker.value.sip.extension; return '-'; } + +function getWorkerAvatar() { + return `/api/Images/user/160x160/${worker.value.user.id}/download`; +}