From 2e09fbd9688b907dafe4b1fac3caadc955f5c5c7 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 25 Dec 2023 20:38:13 -0300 Subject: [PATCH] Department tree and summary view --- src/components/CreateDepartmentChild.vue | 100 ++++++++++++++ src/components/ui/VnTree.vue | 88 +++++++++--- src/i18n/en/index.js | 20 +++ src/i18n/es/index.js | 20 +++ .../Department/Card/DepartmentBasicData.vue | 3 + src/pages/Department/Card/DepartmentCard.vue | 34 +++++ .../Department/Card/DepartmentDescriptor.vue | 129 ++++++++++++++++++ .../Department/Card/DepartmentSummary.vue | 107 +++++++++++++++ src/router/modules/department.js | 46 +++++++ src/router/modules/index.js | 2 + src/router/modules/worker.js | 1 + src/router/routes.js | 4 +- 12 files changed, 532 insertions(+), 22 deletions(-) create mode 100644 src/components/CreateDepartmentChild.vue create mode 100644 src/pages/Department/Card/DepartmentBasicData.vue create mode 100644 src/pages/Department/Card/DepartmentCard.vue create mode 100644 src/pages/Department/Card/DepartmentDescriptor.vue create mode 100644 src/pages/Department/Card/DepartmentSummary.vue create mode 100644 src/router/modules/department.js diff --git a/src/components/CreateDepartmentChild.vue b/src/components/CreateDepartmentChild.vue new file mode 100644 index 000000000..8f5b4b874 --- /dev/null +++ b/src/components/CreateDepartmentChild.vue @@ -0,0 +1,100 @@ + + + + + + + +es: + Name: Nombre + New department: Nuevo departamento + diff --git a/src/components/ui/VnTree.vue b/src/components/ui/VnTree.vue index 08541b6df..23faf770f 100644 --- a/src/components/ui/VnTree.vue +++ b/src/components/ui/VnTree.vue @@ -1,12 +1,22 @@ @@ -109,4 +153,6 @@ const createNode = async () => { Departments: Departamentos Remove: Quitar Create: Crear - + Are you sure you want to delete it?: ¿Seguro que quieres eliminarlo? + Delete department: Eliminar departamento + diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 66e725f4f..023016f4c 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -604,6 +604,26 @@ export default { amount: 'Amount', }, }, + department: { + pageTitles: { + basicData: 'Basic data', + department: 'Department', + summary: 'Summary', + }, + basicData: 'Basic data', + name: 'Name', + code: 'Code', + chat: 'Chat', + bossDepartment: 'Boss Department', + email: 'Email', + selfConsumptionCustomer: 'Self-consumption customer', + telework: 'Telework', + notifyOnErrors: 'Notify on errors', + worksInProduction: 'Works in production', + hasToRefill: 'Fill in days without physical check-ins', + hasToSendMail: 'Send check-ins by email', + departmentRemoved: 'Department removed', + }, worker: { pageTitles: { workers: 'Workers', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 66f14a2c1..8eb15af43 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -604,6 +604,26 @@ export default { country: 'País', }, }, + department: { + pageTitles: { + basicData: 'Basic data', + department: 'Departamentos', + summary: 'Resumen', + }, + basicData: 'Datos básicos', + name: 'Nombre', + code: 'Código', + chat: 'Chat', + bossDepartment: 'Jefe de departamento', + email: 'Email', + selfConsumptionCustomer: 'Cliente autoconsumo', + telework: 'Teletrabaja', + notifyOnErrors: 'Notificar errores', + worksInProduction: 'Pertenece a producción', + hasToRefill: 'Completar días sin registros físicos', + hasToSendMail: 'Enviar fichadas por mail', + departmentRemoved: 'Departamento eliminado', + }, worker: { pageTitles: { workers: 'Trabajadores', diff --git a/src/pages/Department/Card/DepartmentBasicData.vue b/src/pages/Department/Card/DepartmentBasicData.vue new file mode 100644 index 000000000..c4068c60d --- /dev/null +++ b/src/pages/Department/Card/DepartmentBasicData.vue @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/Department/Card/DepartmentCard.vue b/src/pages/Department/Card/DepartmentCard.vue new file mode 100644 index 000000000..a175d6bb4 --- /dev/null +++ b/src/pages/Department/Card/DepartmentCard.vue @@ -0,0 +1,34 @@ + + + + +es: + Search worker: Buscar trabajador + You can search by worker id or name: Puedes buscar por id o nombre del trabajador + diff --git a/src/pages/Department/Card/DepartmentDescriptor.vue b/src/pages/Department/Card/DepartmentDescriptor.vue new file mode 100644 index 000000000..1f7e6dcbb --- /dev/null +++ b/src/pages/Department/Card/DepartmentDescriptor.vue @@ -0,0 +1,129 @@ + + + + + es: + Department workers: Trabajadores del departamento + diff --git a/src/pages/Department/Card/DepartmentSummary.vue b/src/pages/Department/Card/DepartmentSummary.vue new file mode 100644 index 000000000..40bb4c83d --- /dev/null +++ b/src/pages/Department/Card/DepartmentSummary.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/router/modules/department.js b/src/router/modules/department.js new file mode 100644 index 000000000..aaffc3460 --- /dev/null +++ b/src/router/modules/department.js @@ -0,0 +1,46 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/department', + name: 'Department', + meta: { + title: 'department', + icon: 'vn:greuge', + }, + component: RouterView, + redirect: { name: 'DepartmentCard' }, + menus: { + main: [], + card: ['DepartmentBasicData'], + }, + children: [ + { + name: 'DepartmentCard', + path: 'department/:id', + component: () => import('src/pages/Department/Card/DepartmentCard.vue'), + redirect: { name: 'DepartmentSummary' }, + children: [ + { + name: 'DepartmentSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => + import('src/pages/Department/Card/DepartmentSummary.vue'), + }, + { + name: 'DepartmentBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => + import('src/pages/Department/Card/DepartmentBasicData.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 1eff2c180..68d1d8146 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -10,6 +10,7 @@ import Route from './route'; import Supplier from './Supplier'; import Travel from './travel'; import Order from './order'; +import Department from './department'; export default [ Customer, @@ -24,4 +25,5 @@ export default [ Travel, Order, invoiceIn, + Department, ]; diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index f2332618f..27a6f19a9 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -12,6 +12,7 @@ export default { menus: { main: ['WorkerList', 'WorkerDepartment'], card: ['WorkerNotificationsManager'], + departmentCard: ['BasicData'], }, children: [ { diff --git a/src/router/routes.js b/src/router/routes.js index ee8b30d64..32f5aaef6 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -8,8 +8,9 @@ import wagon from './modules/wagon'; import supplier from './modules/Supplier'; import route from './modules/route'; import travel from './modules/travel'; +import department from './modules/department'; import shelving from 'src/router/modules/shelving'; -import order from "src/router/modules/order"; +import order from 'src/router/modules/order'; const routes = [ { @@ -61,6 +62,7 @@ const routes = [ route, supplier, travel, + department, { path: '/:catchAll(.*)*', name: 'NotFound',