From 81e6870f711a63055ea72bcfae3877f97987360a Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 May 2024 16:59:59 +0200 Subject: [PATCH 001/104] refs #6553 front section trad --- src/i18n/locale/en.yml | 2 +- src/i18n/locale/es.yml | 1 + src/pages/Worker/Card/WorkerBusiness.vue | 120 +++++++++++++++++++++++ src/router/modules/worker.js | 10 ++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 src/pages/Worker/Card/WorkerBusiness.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 2b46649e1..0a27312a4 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -830,7 +830,7 @@ worker: calendar: Calendar timeControl: Time control locker: Locker - + business: Business list: name: Name email: Email diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index a8b9ecd51..03eb708c5 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -828,6 +828,7 @@ worker: calendar: Calendario timeControl: Control de horario locker: Taquilla + business: Contrato list: name: Nombre email: Email diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue new file mode 100644 index 000000000..2c3eb459b --- /dev/null +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -0,0 +1,120 @@ + + + + + + + diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 384978d13..02ec255da 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -14,6 +14,7 @@ export default { main: ['WorkerList', 'WorkerDepartment'], card: [ 'WorkerBasicData', + 'WorkerBusiness', 'WorkerNotes', 'WorkerPda', 'WorkerNotificationsManager', @@ -86,6 +87,15 @@ export default { }, component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'), }, + { + path: 'business', + name: 'WorkerBusiness', + meta: { + title: 'business', + icon: 'handshake', + }, + component: () => import('src/pages/Worker/Card/WorkerBusiness.vue'), + }, { path: 'notes', name: 'NotesCard', From 0e691436e98dbffe22bbdbad1bbe643e9f3c054f Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 29 May 2024 14:20:49 +0200 Subject: [PATCH 002/104] refs #6553 fix front trad --- src/i18n/locale/en.yml | 18 ++++ src/i18n/locale/es.yml | 17 ++++ src/pages/Worker/Card/WorkerBusiness.vue | 101 +++++++++++++++++++---- 3 files changed, 119 insertions(+), 17 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 0a27312a4..614b5abe0 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -901,6 +901,24 @@ worker: iban: IBAN bankEntity: Swift / BIC imageNotFound: Image not found + business: + tableVisibleColumns: + started: Start Date + ended: End Date + company: Company + reasondEnd: Reason for Termination + department: Department + professionalCategory: Professional Category + calendarType: Work Calendar + workCenter: Work Center + payrollCategories: Contract Category + occupationCode: Contribution Code + rate: Rate + businessType: Contract Type + amount: Salary + basicSalary: Transport Workers Salary + notes: Notes + wagon: pageTitles: wagons: Wagons diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 03eb708c5..3410ee1d5 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -890,6 +890,23 @@ worker: iban: IBAN bankEntity: Swift / BIC imageNotFound: No se ha encontrado la imagen + business: + tableVisibleColumns: + started: Fecha inicio + ended: Fecha fin + company: Empresa + reasondEnd: Motivo finalización + department: Departamento + professionalCategory: Categoria profesional + calendarType: Calendario laboral + workCenter: Centro + payrollCategories: Categoria contrato + occupationCode: Cotización + rate: Tarifa + businessType: Contrato + amount: Salario + basicSalary: Salario transportistas + notes: Notas wagon: pageTitles: wagons: Vagones diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 2c3eb459b..7c0cfaab3 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -1,12 +1,14 @@ @@ -99,19 +173,12 @@ const columns = computed(() => [ From 6205feaca4fb1bb44d119bbbfa95d8ea99902d34 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 29 May 2024 16:37:05 +0200 Subject: [PATCH 003/104] refs #6553 fix front ibject --- src/pages/Worker/Card/WorkerBusiness.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 7c0cfaab3..8a52618db 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -41,7 +41,7 @@ const columns = computed(() => [ { align: 'left', label: t('worker.business.tableVisibleColumns.reasondEnd'), - name: 'reasondEndFk', + name: 'reasonEndFk', component: 'select', attrs: { url: 'BusinessReasonEnds', @@ -117,7 +117,7 @@ const columns = computed(() => [ component: 'select', attrs: { url: 'OccupationCodes', - fields: ['id', 'name'], + fields: ['code', 'name'], }, disable: false, cardVisible: true, From 8f1ddb08b3b16f0e70db9f98c848246cc2c4311f Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 31 May 2024 10:32:51 +0200 Subject: [PATCH 004/104] refs #6553 filterBusiness --- src/pages/Worker/Card/WorkerBusiness.vue | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 8a52618db..172a1a6a1 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -9,6 +9,64 @@ const { t } = useI18n(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); +const businessFilter = { + include: [ + { + relation: 'department', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'workCenter', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'companyCode', + scope: { + fields: ['id', 'code'], + }, + }, + { + relation: 'reasonEnd', + scope: { + fields: ['id', 'reason'], + }, + }, + { + relation: 'occupationCode', + scope: { + fields: ['code', 'name'], + }, + }, + { + relation: 'workerBusinessProfessionalCategory', + scope: { + fields: ['id', 'description'], + }, + }, + { + relation: 'calendarType', + scope: { + fields: ['id', 'description'], + }, + }, + { + relation: 'workerBusinessType', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'workerBusinessAgreement', + scope: { + fields: ['id', 'name'], + }, + }, + ], +}; const columns = computed(() => [ { align: 'left', @@ -176,6 +234,7 @@ const columns = computed(() => [ :url="`Workers/${entityId}/Business`" order="id DESC" :columns="columns" + :user-filter="businessFilter" default-mode="card" auto-load :right-search="false" From 6e261b7793648260911acc104cb4b9060af54874 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 3 Jun 2024 14:38:48 +0200 Subject: [PATCH 005/104] refs #6553 fix business summary traductions --- src/i18n/locale/en.yml | 23 ++++++---- src/i18n/locale/es.yml | 16 +++++++ src/pages/Worker/Card/WorkerBusiness.vue | 17 +++++++ src/pages/Worker/Card/WorkerSummary.vue | 58 ++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 8 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 5562fea1c..a9be22d7d 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -863,15 +863,22 @@ worker: role: Role sipExtension: Extension locker: Locker - fiDueDate: Fecha de caducidad del DNI - sex: Sexo - seniority: Antigüedad + fiDueDate: DNI expiration date + sex: Sex + seniority: Antiquity fi: DNI/NIE/NIF - birth: Fecha de nacimiento - isFreelance: Autónomo - isSsDiscounted: Bonificación SS - hasMachineryAuthorized: Autorizado para llevar maquinaria - isDisable: Trabajador desactivado + birth: Date of birth + isFreelance: Autonomous + isSsDiscounted: Bonus SS + hasMachineryAuthorized: Authorized to carry machinery + isDisable: Disabled worker + business: Business + started: Start Date + ended: End Date + reasonEnd: Reason for Termination + department: Deparment + workerBusinessCategory: Professional Category + notes: Notes notificationsManager: activeNotifications: Active notifications availableNotifications: Available notifications diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 543239bbf..17e61371a 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -861,6 +861,22 @@ worker: role: Rol sipExtension: Extensión locker: Taquilla + fiDueDate: Fecha de caducidad del DNI + sex: Sexo + seniority: Antigüedad + fi: DNI/NIE/NIF + birth: Fecha de nacimiento + isFreelance: Autónomo + isSsDiscounted: Bonificación SS + hasMachineryAuthorized: Autorizado para llevar maquinaria + isDisable: Trabajador desactivado + business: Contrato + started: Fecha de incio + ended: Finalización + reasonEnd: Razón de finalización + department: Departamento + workerBusinessCategory: Categoria profesional + notes: Notas notificationsManager: activeNotifications: Notificaciones activas availableNotifications: Notificaciones disponibles diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 172a1a6a1..782772095 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -75,6 +75,7 @@ const columns = computed(() => [ format: ({ started }) => toDate(started), component: VnInputDate, cardVisible: true, + created: true, }, { align: 'left', @@ -83,6 +84,7 @@ const columns = computed(() => [ format: ({ ended }) => toDate(ended), component: VnInputDate, cardVisible: true, + created: true, }, { align: 'left', @@ -95,6 +97,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -119,6 +122,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -131,6 +135,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -143,6 +148,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -155,6 +161,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -179,6 +186,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -199,6 +207,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -207,6 +216,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -215,6 +225,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -232,6 +243,12 @@ const columns = computed(() => [ ref="tableRef" data-key="WorkerBusiness" :url="`Workers/${entityId}/Business`" + :create="{ + urlCreate: `Workers/${entityId}/Business`, + title: 'Create business', + onDataSaved: ({ id }) => tableRef.redirect(id), + formInitialData: {}, + }" order="id DESC" :columns="columns" :user-filter="businessFilter" diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index 6d6dde97b..ed7eb5856 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -61,6 +61,31 @@ const filter = { { relation: 'sip', }, + { + relation: 'business', + scope: { + include: [ + { + relation: 'department', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'reasonEnd', + scope: { + fields: ['id', 'reason'], + }, + }, + { + relation: 'workerBusinessProfessionalCategory', + scope: { + fields: ['id', 'description'], + }, + }, + ], + }, + }, ], }; @@ -164,6 +189,39 @@ const filter = { + + + + + + + + + + From f4792d7921ef16f690adffd975722a93902a2012 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 5 Jun 2024 10:35:14 +0200 Subject: [PATCH 006/104] fix: refs #6553 label css --- src/pages/Worker/Card/WorkerBusiness.vue | 33 ++++++++++++++---------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 782772095..cd0dee7d8 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -67,6 +67,7 @@ const businessFilter = { }, ], }; + const columns = computed(() => [ { align: 'left', @@ -75,7 +76,7 @@ const columns = computed(() => [ format: ({ started }) => toDate(started), component: VnInputDate, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -84,20 +85,22 @@ const columns = computed(() => [ format: ({ ended }) => toDate(ended), component: VnInputDate, cardVisible: true, - created: true, + create: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.company'), name: 'companyCodeFk', component: 'select', attrs: { url: 'Companies', fields: ['code'], + optionLabel: 'code', + label: t('worker.business.tableVisibleColumns.company'), }, + event: { 'update:modelValue': (a, b) => console.log(a, b) }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -122,7 +125,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -135,7 +138,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -148,7 +151,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -161,15 +164,15 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', label: t('worker.business.tableVisibleColumns.payrollCategories'), - name: 'payrollCategoriesFk', + name: 'workerBusinessCategoryFk', component: 'select', attrs: { - url: 'BusinessReasonEnd', + url: 'payrollCategories', fields: ['id', 'description'], }, disable: false, @@ -183,10 +186,11 @@ const columns = computed(() => [ attrs: { url: 'OccupationCodes', fields: ['code', 'name'], + optionValue: 'code', }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -207,7 +211,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -216,7 +220,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -225,7 +229,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -255,6 +259,7 @@ const columns = computed(() => [ default-mode="card" auto-load :right-search="false" + card-class="grid-two" > From db3ff0416c88b44d951553dc9fdc524144825850 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 5 Jun 2024 14:31:08 +0200 Subject: [PATCH 007/104] refs #6553 fix names --- src/components/VnTable/VnTable.vue | 2 +- src/pages/Worker/Card/WorkerBusiness.vue | 47 +++++++++++++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 93bcfdddb..e08290cd3 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -561,7 +561,7 @@ defineExpose({ display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); max-width: 100%; - margin: 0 auto; + margin: 1em auto; overflow: scroll; white-space: wrap; width: 100%; diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index cd0dee7d8..412f6fb9c 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -71,7 +71,9 @@ const businessFilter = { const columns = computed(() => [ { align: 'left', - label: t('worker.business.tableVisibleColumns.started'), + attrs: { + label: t('worker.business.tableVisibleColumns.started'), + }, name: 'started', format: ({ started }) => toDate(started), component: VnInputDate, @@ -80,7 +82,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.ended'), + attrs: { + label: t('worker.business.tableVisibleColumns.ended'), + }, name: 'ended', format: ({ ended }) => toDate(ended), component: VnInputDate, @@ -104,24 +108,26 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.reasondEnd'), name: 'reasonEndFk', component: 'select', attrs: { url: 'BusinessReasonEnds', fields: ['id', 'reason'], + optionLabel: 'reason', + label: t('worker.business.tableVisibleColumns.reasondEnd'), }, disable: false, cardVisible: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.department'), name: 'departmentFk', component: 'select', attrs: { url: 'Departments', fields: ['id', 'name'], + optionLabel: 'name', + label: t('worker.business.tableVisibleColumns.department'), }, disable: false, cardVisible: true, @@ -129,12 +135,13 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.professionalCategory'), name: 'professionalCategoryFk', component: 'select', attrs: { url: 'WorkerBusinessProfessionalCategories', fields: ['id', 'description', 'code'], + optionLabel: 'description', + label: t('worker.business.tableVisibleColumns.professionalCategory'), }, disable: false, cardVisible: true, @@ -142,12 +149,13 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.calendarType'), name: 'calendarTypeFk', component: 'select', attrs: { url: 'CalendarTypes', fields: ['id', 'description'], + optionLabel: 'description', + label: t('worker.business.tableVisibleColumns.calendarType'), }, disable: false, cardVisible: true, @@ -155,12 +163,13 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.workCenter'), name: 'workCenterFk', component: 'select', attrs: { url: 'WorkCenters', fields: ['id', 'name'], + optionLabel: 'name', + label: t('worker.business.tableVisibleColumns.workCenter'), }, disable: false, cardVisible: true, @@ -168,25 +177,26 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.payrollCategories'), name: 'workerBusinessCategoryFk', component: 'select', attrs: { url: 'payrollCategories', fields: ['id', 'description'], + optionLabel: 'description', + label: t('worker.business.tableVisibleColumns.payrollCategories'), }, disable: false, cardVisible: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.occupationCode'), name: 'occupationCodeFk', component: 'select', attrs: { url: 'OccupationCodes', fields: ['code', 'name'], optionValue: 'code', + label: t('worker.business.tableVisibleColumns.occupationCode'), }, disable: false, cardVisible: true, @@ -194,20 +204,23 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.rate'), name: 'rate', + attrs: { + label: t('worker.business.tableVisibleColumns.rate'), + }, component: 'input', disable: false, cardVisible: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.businessType'), name: 'workerBusinessTypeFk', component: 'select', attrs: { url: 'WorkerBusinessTypes', fields: ['id', 'name'], + optionValue: 'name', + label: t('worker.business.tableVisibleColumns.businessType'), }, disable: false, cardVisible: true, @@ -215,7 +228,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.amount'), + attrs: { + label: t('worker.business.tableVisibleColumns.amount'), + }, name: 'amount', component: 'input', disable: false, @@ -224,7 +239,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.basicSalary'), + attrs: { + label: t('worker.business.tableVisibleColumns.basicSalary'), + }, name: 'basicSalary', component: 'input', disable: false, @@ -233,7 +250,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.notes'), + attrs: { + label: t('worker.business.tableVisibleColumns.notes'), + }, name: 'notes', component: 'input', disable: false, From 8490f244382715ef0a04f0d7414afa9efff60633 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 10 Jun 2024 09:23:33 +0200 Subject: [PATCH 008/104] refs #6553 fix reactivateWorker --- src/i18n/locale/en.yml | 2 +- src/i18n/locale/es.yml | 2 +- src/pages/Worker/Card/WorkerBusiness.vue | 36 +++++++++++++++++++----- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 4d96d948a..5a6058a63 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -915,7 +915,7 @@ worker: started: Start Date ended: End Date company: Company - reasondEnd: Reason for Termination + reasonEnd: Reason for Termination department: Department professionalCategory: Professional Category calendarType: Work Calendar diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 155b59053..802559fcf 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -913,7 +913,7 @@ worker: started: Fecha inicio ended: Fecha fin company: Empresa - reasondEnd: Motivo finalización + reasonEnd: Motivo finalización department: Departamento professionalCategory: Categoria profesional calendarType: Calendario laboral diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 412f6fb9c..b5e7a4e96 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -5,7 +5,11 @@ import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; import VnInputDate from 'src/components/common/VnInputDate.vue'; +import worker from 'src/router/modules/worker'; +import { useQuasar } from 'quasar'; + const { t } = useI18n(); +const quasar = useQuasar(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); @@ -68,6 +72,22 @@ const businessFilter = { ], }; +async function reactivateWorker(value) { + if (value === null) return; + quasar + .dialog({ + message: t('Do you want to reactivate the user?'), + ok: { + push: true, + color: 'primary', + }, + cancel: true, + }) + .onOk(async () => { + worker.isDisable = false; + }); +} + const columns = computed(() => [ { align: 'left', @@ -80,10 +100,12 @@ const columns = computed(() => [ cardVisible: true, create: true, }, + { align: 'left', attrs: { label: t('worker.business.tableVisibleColumns.ended'), + '@update:model-value': 'reactivateWorker()', }, name: 'ended', format: ({ ended }) => toDate(ended), @@ -98,13 +120,12 @@ const columns = computed(() => [ attrs: { url: 'Companies', fields: ['code'], + optionValue: 'id', optionLabel: 'code', label: t('worker.business.tableVisibleColumns.company'), }, - event: { 'update:modelValue': (a, b) => console.log(a, b) }, disable: false, cardVisible: true, - create: true, }, { align: 'left', @@ -114,7 +135,7 @@ const columns = computed(() => [ url: 'BusinessReasonEnds', fields: ['id', 'reason'], optionLabel: 'reason', - label: t('worker.business.tableVisibleColumns.reasondEnd'), + label: t('worker.business.tableVisibleColumns.reasonEnd'), }, disable: false, cardVisible: true, @@ -187,6 +208,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + create: true, }, { align: 'left', @@ -218,8 +240,7 @@ const columns = computed(() => [ component: 'select', attrs: { url: 'WorkerBusinessTypes', - fields: ['id', 'name'], - optionValue: 'name', + fields: ['code', 'name'], label: t('worker.business.tableVisibleColumns.businessType'), }, disable: false, @@ -278,10 +299,11 @@ const columns = computed(() => [ default-mode="card" auto-load :right-search="false" - card-class="grid-two" + card-class="grid-two q-gutter-x-md" > - +es: + Do you want to reactivate the user?: desea reactivar el usuario? From 8d6075468210ad182de7575184b0210443b450a5 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Jun 2024 14:50:01 +0200 Subject: [PATCH 009/104] fix(WorkerBusiness): fix card label --- src/pages/Worker/Card/WorkerBusiness.vue | 89 +++++++++--------------- 1 file changed, 32 insertions(+), 57 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index b5e7a4e96..3985d079e 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import VnInputDate from 'src/components/common/VnInputDate.vue'; import worker from 'src/router/modules/worker'; import { useQuasar } from 'quasar'; @@ -63,12 +62,12 @@ const businessFilter = { fields: ['id', 'name'], }, }, - { - relation: 'workerBusinessAgreement', - scope: { - fields: ['id', 'name'], - }, - }, + // { Falla + // relation: 'workerBusinessAgreement', + // scope: { + // fields: ['id', 'name'], + // }, + // }, ], }; @@ -90,67 +89,59 @@ async function reactivateWorker(value) { const columns = computed(() => [ { - align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.started'), - }, name: 'started', + label: t('worker.business.tableVisibleColumns.started'), + align: 'left', format: ({ started }) => toDate(started), - component: VnInputDate, + component: 'date', cardVisible: true, create: true, }, { - align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.ended'), - '@update:model-value': 'reactivateWorker()', - }, name: 'ended', + label: t('worker.business.tableVisibleColumns.ended'), + align: 'left', format: ({ ended }) => toDate(ended), - component: VnInputDate, + component: 'date', cardVisible: true, create: true, }, { + label: t('worker.business.tableVisibleColumns.company'), align: 'left', name: 'companyCodeFk', component: 'select', attrs: { url: 'Companies', fields: ['code'], - optionValue: 'id', optionLabel: 'code', - label: t('worker.business.tableVisibleColumns.company'), + optionValue: 'code', }, - disable: false, cardVisible: true, }, { align: 'left', name: 'reasonEndFk', component: 'select', + label: t('worker.business.tableVisibleColumns.reasonEnd'), attrs: { url: 'BusinessReasonEnds', fields: ['id', 'reason'], optionLabel: 'reason', - label: t('worker.business.tableVisibleColumns.reasonEnd'), }, - disable: false, cardVisible: true, }, { align: 'left', name: 'departmentFk', component: 'select', + label: t('worker.business.tableVisibleColumns.department'), attrs: { url: 'Departments', fields: ['id', 'name'], optionLabel: 'name', - label: t('worker.business.tableVisibleColumns.department'), }, - disable: false, cardVisible: true, create: true, }, @@ -158,13 +149,12 @@ const columns = computed(() => [ align: 'left', name: 'professionalCategoryFk', component: 'select', + label: t('worker.business.tableVisibleColumns.professionalCategory'), attrs: { url: 'WorkerBusinessProfessionalCategories', fields: ['id', 'description', 'code'], optionLabel: 'description', - label: t('worker.business.tableVisibleColumns.professionalCategory'), }, - disable: false, cardVisible: true, create: true, }, @@ -172,13 +162,12 @@ const columns = computed(() => [ align: 'left', name: 'calendarTypeFk', component: 'select', + label: t('worker.business.tableVisibleColumns.calendarType'), attrs: { url: 'CalendarTypes', fields: ['id', 'description'], optionLabel: 'description', - label: t('worker.business.tableVisibleColumns.calendarType'), }, - disable: false, cardVisible: true, create: true, }, @@ -186,13 +175,12 @@ const columns = computed(() => [ align: 'left', name: 'workCenterFk', component: 'select', + label: t('worker.business.tableVisibleColumns.workCenter'), attrs: { url: 'WorkCenters', fields: ['id', 'name'], optionLabel: 'name', - label: t('worker.business.tableVisibleColumns.workCenter'), }, - disable: false, cardVisible: true, create: true, }, @@ -200,13 +188,12 @@ const columns = computed(() => [ align: 'left', name: 'workerBusinessCategoryFk', component: 'select', + label: t('worker.business.tableVisibleColumns.payrollCategories'), attrs: { url: 'payrollCategories', fields: ['id', 'description'], optionLabel: 'description', - label: t('worker.business.tableVisibleColumns.payrollCategories'), }, - disable: false, cardVisible: true, create: true, }, @@ -214,69 +201,55 @@ const columns = computed(() => [ align: 'left', name: 'occupationCodeFk', component: 'select', + label: t('worker.business.tableVisibleColumns.occupationCode'), attrs: { url: 'OccupationCodes', fields: ['code', 'name'], optionValue: 'code', - label: t('worker.business.tableVisibleColumns.occupationCode'), }, - disable: false, cardVisible: true, create: true, }, { align: 'left', name: 'rate', - attrs: { - label: t('worker.business.tableVisibleColumns.rate'), - }, + label: t('worker.business.tableVisibleColumns.rate'), component: 'input', - disable: false, cardVisible: true, }, { align: 'left', name: 'workerBusinessTypeFk', component: 'select', + label: t('worker.business.tableVisibleColumns.businessType'), attrs: { url: 'WorkerBusinessTypes', fields: ['code', 'name'], - label: t('worker.business.tableVisibleColumns.businessType'), }, - disable: false, cardVisible: true, create: true, }, { align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.amount'), - }, + label: t('worker.business.tableVisibleColumns.amount'), name: 'amount', component: 'input', - disable: false, cardVisible: true, create: true, }, { align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.basicSalary'), - }, + label: t('worker.business.tableVisibleColumns.basicSalary'), name: 'basicSalary', component: 'input', - disable: false, cardVisible: true, create: true, }, { - align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.notes'), - }, name: 'notes', + label: t('worker.business.tableVisibleColumns.notes'), + align: 'left', component: 'input', - disable: false, cardVisible: true, }, ]); @@ -287,20 +260,22 @@ const columns = computed(() => [ ref="tableRef" data-key="WorkerBusiness" :url="`Workers/${entityId}/Business`" + save-url="/Businesses/crud" :create="{ urlCreate: `Workers/${entityId}/Business`, title: 'Create business', - onDataSaved: ({ id }) => tableRef.redirect(id), + onDataSaved: () => tableRef.reload(), formInitialData: {}, }" order="id DESC" :columns="columns" - :user-filter="businessFilter" + :filter="businessFilter" default-mode="card" auto-load :right-search="false" card-class="grid-two q-gutter-x-md" - > + :is-editable="true" + /> From 81591b4f67db4cd0e3a57f9d596fb20f66ce629f Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Jun 2024 15:01:12 +0200 Subject: [PATCH 010/104] fix: use model --- src/pages/Worker/Card/WorkerBusiness.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 3985d079e..f17c9cbcb 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -275,6 +275,7 @@ const columns = computed(() => [ :right-search="false" card-class="grid-two q-gutter-x-md" :is-editable="true" + :use-model="true" /> From 41e1d365f3a05fdf9f21c34e95a29c07f81fabe9 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 19 Jun 2024 08:06:03 +0200 Subject: [PATCH 011/104] refs #6553 fix relations --- src/pages/Worker/Card/WorkerBusiness.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index f17c9cbcb..17085f02c 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -147,7 +147,7 @@ const columns = computed(() => [ }, { align: 'left', - name: 'professionalCategoryFk', + name: 'workerBusinessProfessionalCategoryFk', component: 'select', label: t('worker.business.tableVisibleColumns.professionalCategory'), attrs: { @@ -173,7 +173,7 @@ const columns = computed(() => [ }, { align: 'left', - name: 'workCenterFk', + name: 'workcenterFk', component: 'select', label: t('worker.business.tableVisibleColumns.workCenter'), attrs: { From 68d1d0dbb07e7cbccb5a0d2600bfbea536a2442a Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 20 Jun 2024 13:58:14 +0200 Subject: [PATCH 012/104] refs #6553 function --- src/pages/Worker/Card/WorkerBusiness.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 17085f02c..fbf43f63a 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -106,6 +106,7 @@ const columns = computed(() => [ component: 'date', cardVisible: true, create: true, + 'update:modelValue': reactivateWorker(), }, { label: t('worker.business.tableVisibleColumns.company'), From 8f925401d525aa2fd615d598efd81323bf31cf56 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 25 Jun 2024 10:17:52 +0200 Subject: [PATCH 013/104] refs #6553 fix VnTable --- src/pages/Worker/Card/WorkerBusiness.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index fbf43f63a..bb1cfd990 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import worker from 'src/router/modules/worker'; import { useQuasar } from 'quasar'; const { t } = useI18n(); @@ -29,7 +28,7 @@ const businessFilter = { { relation: 'companyCode', scope: { - fields: ['id', 'code'], + fields: ['code'], }, }, { @@ -71,8 +70,9 @@ const businessFilter = { ], }; -async function reactivateWorker(value) { - if (value === null) return; +async function reactivateWorker(business) { + console.log('value: ', business); + if (business === null) return; quasar .dialog({ message: t('Do you want to reactivate the user?'), @@ -83,7 +83,7 @@ async function reactivateWorker(value) { cancel: true, }) .onOk(async () => { - worker.isDisable = false; + business.isDisable = false; }); } @@ -106,7 +106,6 @@ const columns = computed(() => [ component: 'date', cardVisible: true, create: true, - 'update:modelValue': reactivateWorker(), }, { label: t('worker.business.tableVisibleColumns.company'), @@ -120,6 +119,7 @@ const columns = computed(() => [ optionValue: 'code', }, cardVisible: true, + create: true, }, { align: 'left', @@ -217,6 +217,7 @@ const columns = computed(() => [ label: t('worker.business.tableVisibleColumns.rate'), component: 'input', cardVisible: true, + create: true, }, { align: 'left', @@ -225,7 +226,7 @@ const columns = computed(() => [ label: t('worker.business.tableVisibleColumns.businessType'), attrs: { url: 'WorkerBusinessTypes', - fields: ['code', 'name'], + fields: ['id', 'name'], }, cardVisible: true, create: true, @@ -277,6 +278,7 @@ const columns = computed(() => [ card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" + @save-changes="reactivateWorker" /> From 97ce44242c34fd5f4aec318c7c45216aa301b011 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Sep 2024 13:58:14 +0200 Subject: [PATCH 014/104] refs #6553 fix business summary --- src/pages/Worker/Card/WorkerBusiness.vue | 62 +----------------------- src/pages/Worker/Card/WorkerSummary.vue | 2 +- 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index bb1cfd990..3aa32b2f1 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -11,64 +11,6 @@ const quasar = useQuasar(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); -const businessFilter = { - include: [ - { - relation: 'department', - scope: { - fields: ['id', 'name'], - }, - }, - { - relation: 'workCenter', - scope: { - fields: ['id', 'name'], - }, - }, - { - relation: 'companyCode', - scope: { - fields: ['code'], - }, - }, - { - relation: 'reasonEnd', - scope: { - fields: ['id', 'reason'], - }, - }, - { - relation: 'occupationCode', - scope: { - fields: ['code', 'name'], - }, - }, - { - relation: 'workerBusinessProfessionalCategory', - scope: { - fields: ['id', 'description'], - }, - }, - { - relation: 'calendarType', - scope: { - fields: ['id', 'description'], - }, - }, - { - relation: 'workerBusinessType', - scope: { - fields: ['id', 'name'], - }, - }, - // { Falla - // relation: 'workerBusinessAgreement', - // scope: { - // fields: ['id', 'name'], - // }, - // }, - ], -}; async function reactivateWorker(business) { console.log('value: ', business); @@ -271,14 +213,14 @@ const columns = computed(() => [ }" order="id DESC" :columns="columns" - :filter="businessFilter" default-mode="card" auto-load + :disable-option="{ table: true }" :right-search="false" card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" - @save-changes="reactivateWorker" + @save-changes="reactivateWorker(entityId)" /> diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index df8d01bfc..57d2036fe 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -212,7 +212,7 @@ const filter = { Date: Fri, 6 Sep 2024 07:15:25 +0200 Subject: [PATCH 015/104] refs #6553 fix business slot --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Worker/Card/WorkerBusiness.vue | 41 +++++++++++++----------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index bddaf9196..73707b9be 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -260,6 +260,7 @@ globals: ticketsMonitor: Tickets monitor clientsActionsMonitor: Clients and actions serial: Serial + business: Business created: Created worker: Worker now: Now diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f42738a8a..ba4de742e 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -264,6 +264,7 @@ globals: ticketsMonitor: Monitor de tickets clientsActionsMonitor: Clientes y acciones serial: Facturas por serie + business: Contratos created: Fecha creación worker: Trabajador now: Ahora diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 3aa32b2f1..007eb415d 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -5,6 +5,7 @@ import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; import { useQuasar } from 'quasar'; +import VnInputTime from 'components/common/VnInputTime.vue'; const { t } = useI18n(); const quasar = useQuasar(); @@ -12,23 +13,22 @@ const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); -async function reactivateWorker(business) { - console.log('value: ', business); - if (business === null) return; - quasar - .dialog({ - message: t('Do you want to reactivate the user?'), - ok: { - push: true, - color: 'primary', - }, - cancel: true, - }) - .onOk(async () => { - business.isDisable = false; - }); +async function reactivateWorker(data) { + console.log('value: ', data); + // if (business === null) return; + // quasar + // .dialog({ + // message: t('Do you want to reactivate the user?'), + // ok: { + // push: true, + // color: 'primary', + // }, + // cancel: true, + // }) + // .onOk(async () => { + // business.isDisable = false; + // }); } - const columns = computed(() => [ { name: 'started', @@ -220,8 +220,13 @@ const columns = computed(() => [ card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" - @save-changes="reactivateWorker(entityId)" - /> + @on-data-saved="tableRef.reactivateWorker()" + > + + From 02129591cfbd2351a671f9cbc3e0e2f7bc0d6196 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Sep 2024 08:42:56 +0200 Subject: [PATCH 016/104] refs #6553 workerBusiness --- src/pages/Worker/Card/WorkerBusiness.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 007eb415d..1f03f1ed3 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,11 +4,9 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import { useQuasar } from 'quasar'; -import VnInputTime from 'components/common/VnInputTime.vue'; +import VnInputDate from 'src/components/common/VnInputDate.vue'; const { t } = useI18n(); -const quasar = useQuasar(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); @@ -223,7 +221,7 @@ const columns = computed(() => [ @on-data-saved="tableRef.reactivateWorker()" > From f7fb18cf0aaec68a7edb6a9abb86cd498f47f611 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Sep 2024 15:02:21 +0200 Subject: [PATCH 017/104] refs #6553 workerBusiness --- src/components/CrudModel.vue | 2 +- src/components/VnTable/VnTable.vue | 1 + src/pages/Worker/Card/WorkerBusiness.vue | 50 +++++++++++++++--------- src/pages/Worker/Card/WorkerSummary.vue | 2 +- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 33c831e3f..df4af5875 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -182,7 +182,7 @@ async function saveChanges(data) { hasChanges.value = false; isLoading.value = false; - emit('saveChanges', data); + emit('saveChanges', changes); quasar.notify({ type: 'positive', message: t('globals.dataSaved'), diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 5876dd39b..76e1d7821 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -258,6 +258,7 @@ function stopEventPropagation(event) { function reload(params) { selected.value = []; CrudModelRef.value.reload(params); + emit('saveChanges', params); } function columnName(col) { diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 1f03f1ed3..2c1800043 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,28 +4,42 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import VnInputDate from 'src/components/common/VnInputDate.vue'; +import { useQuasar } from 'quasar'; +import axios from 'axios'; const { t } = useI18n(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); +const quasar = useQuasar(); async function reactivateWorker(data) { - console.log('value: ', data); - // if (business === null) return; - // quasar - // .dialog({ - // message: t('Do you want to reactivate the user?'), - // ok: { - // push: true, - // color: 'primary', - // }, - // cancel: true, - // }) - // .onOk(async () => { - // business.isDisable = false; - // }); + console.log('value: ', data.updates[0].data.ended); + console.log('data: ', entityId.value); + // const filter = { + // where: { id: entityId.value }, + // }; + // console.log('filter: ', filter); + const { worker } = await axios.get(`Workers`, { + params: { + filter: JSON.stringify({ id: entityId.value }), + }, + }); + console.log('worker', worker); + if (!data.updates[0].data.ended) { + quasar + .dialog({ + message: t('Do you want to reactivate the user?'), + ok: { + push: true, + color: 'primary', + }, + cancel: true, + }) + .onOk(async () => { + worker.isDisable = false; + }); + } } const columns = computed(() => [ { @@ -218,12 +232,12 @@ const columns = computed(() => [ card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" - @on-data-saved="tableRef.reactivateWorker()" + @save-changes="(data) => reactivateWorker(data)" > - diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index 839b1b26c..066dd4b33 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -225,7 +225,7 @@ const filter = { Date: Fri, 13 Sep 2024 13:46:53 +0200 Subject: [PATCH 018/104] refs #6553 fix reactivateWorker --- src/pages/Worker/Card/WorkerBusiness.vue | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 2c1800043..dfe3a502b 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -13,20 +13,11 @@ const tableRef = ref(); const entityId = computed(() => route.params.id); const quasar = useQuasar(); -async function reactivateWorker(data) { - console.log('value: ', data.updates[0].data.ended); - console.log('data: ', entityId.value); - // const filter = { - // where: { id: entityId.value }, - // }; - // console.log('filter: ', filter); - const { worker } = await axios.get(`Workers`, { - params: { - filter: JSON.stringify({ id: entityId.value }), - }, - }); - console.log('worker', worker); - if (!data.updates[0].data.ended) { +async function reactivateWorker() { + const hasToReactive = tableRef.value.CrudModelRef.formData.find( + (data) => !data.ended + ); + if (hasToReactive) { quasar .dialog({ message: t('Do you want to reactivate the user?'), @@ -37,7 +28,9 @@ async function reactivateWorker(data) { cancel: true, }) .onOk(async () => { - worker.isDisable = false; + await axios.patch(`Workers/${entityId.value}`, { + isDisable: false, + }); }); } } From 257ec7926e2be3074b5c36a42ef880ce59289e00 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 8 Oct 2024 12:18:18 +0200 Subject: [PATCH 019/104] refs #7917 fix routeCard --- src/pages/Route/Card/RouteCard.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/Route/Card/RouteCard.vue b/src/pages/Route/Card/RouteCard.vue index 461f2d95e..fccf0cda6 100644 --- a/src/pages/Route/Card/RouteCard.vue +++ b/src/pages/Route/Card/RouteCard.vue @@ -7,10 +7,12 @@ import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';