From cded128c4ccc05112a201f00c85fc8adc654fd07 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 12 Dec 2023 08:45:08 -0300 Subject: [PATCH 1/6] WIP --- src/components/FormModel.vue | 2 +- src/i18n/en/index.js | 24 ++- src/i18n/es/index.js | 24 ++- src/pages/Worker/WorkerCreate.vue | 285 ++++++++++++++++++++++++++++++ src/pages/Worker/WorkerList.vue | 10 ++ src/router/modules/travel.js | 2 +- src/router/modules/worker.js | 9 + 7 files changed, 352 insertions(+), 4 deletions(-) create mode 100644 src/pages/Worker/WorkerCreate.vue diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 453b3ffe1..34964fc12 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -84,7 +84,7 @@ onUnmounted(() => { const isLoading = ref(false); // Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas const hasChanges = ref(!$props.observeFormChanges); -const originalData = ref({...$props.formInitialData}); +const originalData = ref({ ...$props.formInitialData }); const formData = computed(() => state.get($props.model)); const formUrl = computed(() => $props.url); diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index fb603deca..6deaad5b3 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -457,7 +457,7 @@ export default { list: { parking: 'Parking', priority: 'Priority', - newShelving: 'New Shelving' + newShelving: 'New Shelving', }, summary: { code: 'Code', @@ -480,6 +480,7 @@ export default { basicData: 'Basic data', summary: 'Summary', notifications: 'Notifications', + workerCreate: 'New worker', }, list: { name: 'Name', @@ -489,6 +490,7 @@ export default { active: 'Active', department: 'Department', schedule: 'Schedule', + newWorker: 'New worker', }, card: { workerId: 'Worker ID', @@ -520,6 +522,25 @@ export default { subscribed: 'Subscribed to the notification', unsubscribed: 'Unsubscribed from the notification', }, + create: { + name: 'Name', + lastName: 'Last name', + birth: 'Birth', + fi: 'Fi', + code: 'Worker code', + phone: 'Phone', + postcode: 'Postcode', + province: 'Province', + city: 'City', + street: 'Street', + webUser: 'Web user', + personalEmail: 'Personal email', + company: 'Company', + boss: 'Boss', + payMethods: 'Pay method', + iban: 'IBAN', + bankEntity: 'Swift / BIC', + }, imageNotFound: 'Image not found', }, wagon: { @@ -638,6 +659,7 @@ export default { create: 'Create', summary: 'Summary', extraCommunity: 'Extra community', + travelCreate: 'New travel', }, summary: { confirmed: 'Confirmed', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 75ee011c3..801a76b15 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -459,7 +459,7 @@ export default { list: { parking: 'Parking', priority: 'Prioridad', - newShelving: 'Nuevo Carro' + newShelving: 'Nuevo Carro', }, summary: { code: 'Código', @@ -482,6 +482,7 @@ export default { basicData: 'Datos básicos', summary: 'Resumen', notifications: 'Notificaciones', + workerCreate: 'Nuevo trabajador', }, list: { name: 'Nombre', @@ -491,6 +492,7 @@ export default { active: 'Activo', department: 'Departamento', schedule: 'Horario', + newWorker: 'Nuevo trabajador', }, card: { workerId: 'ID Trabajador', @@ -522,6 +524,25 @@ export default { subscribed: 'Se ha suscrito a la notificación', unsubscribed: 'Se ha dado de baja de la notificación', }, + create: { + name: 'Nombre', + lastName: 'Apellido', + birth: 'Fecha de nacimiento', + fi: 'DNI/NIF/NIE', + code: 'Código de trabajador', + phone: 'Teléfono', + postcode: 'Código postal', + province: 'Provincia', + city: 'Población', + street: 'Dirección', + webUser: 'Usuario Web', + personalEmail: 'Correo personal', + company: 'Empresa', + boss: 'Jefe', + payMethods: 'Método de pago', + iban: 'IBAN', + bankEntity: 'Swift / BIC', + }, imageNotFound: 'No se ha encontrado la imagen', }, wagon: { @@ -640,6 +661,7 @@ export default { create: 'Crear', summary: 'Resumen', extraCommunity: 'Extra comunitarios', + travelCreate: 'Nuevo envío', }, summary: { confirmed: 'Confirmado', diff --git a/src/pages/Worker/WorkerCreate.vue b/src/pages/Worker/WorkerCreate.vue new file mode 100644 index 000000000..3a40278b9 --- /dev/null +++ b/src/pages/Worker/WorkerCreate.vue @@ -0,0 +1,285 @@ + + + diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index a09c370ef..e7e86d16e 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -27,6 +27,10 @@ function viewSummary(id) { }, }); } + +const redirectToCreateView = () => { + router.push({ name: 'WorkerCreate' }); +}; + + + + {{ t('worker.list.newWorker') }} + + diff --git a/src/router/modules/travel.js b/src/router/modules/travel.js index bd0a2067d..e6ede5c67 100644 --- a/src/router/modules/travel.js +++ b/src/router/modules/travel.js @@ -42,7 +42,7 @@ export default { path: 'create', name: 'TravelCreate', meta: { - title: 'extraCommunity', + title: 'travelCreate', icon: '', }, component: () => import('src/pages/Travel/TravelCreate.vue'), diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index e5ee7c1a2..dfc994e96 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -29,6 +29,15 @@ export default { }, component: () => import('src/pages/Worker/WorkerList.vue'), }, + { + path: 'create', + name: 'WorkerCreate', + meta: { + title: 'workerCreate', + icon: '', + }, + component: () => import('src/pages/Worker/WorkerCreate.vue'), + }, ], }, { From c93a418dd370a0496472c28d6ec023e156393091 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 12 Dec 2023 11:58:44 -0300 Subject: [PATCH 2/6] WIP --- src/components/CreateBankEntityForm.vue | 26 +++++++++++++++++++++++++ src/pages/Worker/WorkerCreate.vue | 7 +++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/components/CreateBankEntityForm.vue diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue new file mode 100644 index 000000000..4492aae40 --- /dev/null +++ b/src/components/CreateBankEntityForm.vue @@ -0,0 +1,26 @@ + + + + + +en: + name: Name * +es: + name: Nombre * + diff --git a/src/pages/Worker/WorkerCreate.vue b/src/pages/Worker/WorkerCreate.vue index 3a40278b9..eff4bb8a5 100644 --- a/src/pages/Worker/WorkerCreate.vue +++ b/src/pages/Worker/WorkerCreate.vue @@ -38,6 +38,10 @@ const newWorkerForm = ref({ city: null, street: null, name: null, + email: null, + bossFk: null, + iban: null, + bankEntityFk: null, }); const filtersOptions = reactive({ @@ -112,7 +116,6 @@ const onFetchWorkerConfig = (workerConfig) => { url-create="Workers/new" model="worker" :form-initial-data="newWorkerForm" - :observe-form-changes="false" >