From 5481ad6478b7924e773083c58f8e4cedca03e1a9 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 21 Feb 2025 15:23:44 +0100 Subject: [PATCH 1/9] fix: refs #6553 workerBusiness --- src/pages/Worker/Card/WorkerBusiness.vue | 41 +++++++++++++++------- src/pages/Worker/Card/WorkerDescriptor.vue | 7 ++++ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 6025ae289..e3582a2d5 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -3,7 +3,7 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; -import { toDate } from 'src/filters'; +import { dashIfEmpty, toDate } from 'src/filters'; import { useQuasar } from 'quasar'; import axios from 'axios'; @@ -15,7 +15,7 @@ const quasar = useQuasar(); async function reactivateWorker() { const hasToReactive = tableRef.value.CrudModelRef.formData.find( - (data) => !data.ended + (data) => !data.ended, ); if (hasToReactive) { quasar @@ -38,25 +38,25 @@ const columns = computed(() => [ { name: 'started', label: t('worker.business.tableVisibleColumns.started'), - align: 'left', format: ({ started }) => toDate(started), component: 'date', cardVisible: true, create: true, + width: '90px', }, { name: 'ended', label: t('worker.business.tableVisibleColumns.ended'), - align: 'left', format: ({ ended }) => toDate(ended), component: 'date', cardVisible: true, create: true, + width: '90px', }, { label: t('worker.business.tableVisibleColumns.company'), - align: 'left', + toolTip: t('worker.business.tableVisibleColumns.company'), name: 'companyCodeFk', component: 'select', attrs: { @@ -65,23 +65,23 @@ const columns = computed(() => [ optionLabel: 'code', optionValue: 'code', }, - cardVisible: true, create: true, + width: '60px', }, { - align: 'left', name: 'reasonEndFk', component: 'select', label: t('worker.business.tableVisibleColumns.reasonEnd'), + toolTip: t('worker.business.tableVisibleColumns.reasonEnd'), attrs: { url: 'BusinessReasonEnds', fields: ['id', 'reason'], optionLabel: 'reason', }, cardVisible: true, + format: ({ reason }, dashIfEmpty) => dashIfEmpty(reason), }, { - align: 'left', name: 'departmentFk', component: 'select', label: t('worker.business.tableVisibleColumns.department'), @@ -89,15 +89,19 @@ const columns = computed(() => [ url: 'Departments', fields: ['id', 'name'], optionLabel: 'name', + optionValue: 'id', }, cardVisible: true, create: true, + width: '80px', + format: ({ departmentName }, dashIfEmpty) => dashIfEmpty(departmentName), }, { align: 'left', name: 'workerBusinessProfessionalCategoryFk', component: 'select', label: t('worker.business.tableVisibleColumns.professionalCategory'), + toolTip: t('worker.business.tableVisibleColumns.professionalCategory'), attrs: { url: 'WorkerBusinessProfessionalCategories', fields: ['id', 'description', 'code'], @@ -105,6 +109,9 @@ const columns = computed(() => [ }, cardVisible: true, create: true, + width: '100px', + format: ({ professionalDescription }, dashIfEmpty) => + dashIfEmpty(professionalDescription), }, { align: 'left', @@ -118,6 +125,8 @@ const columns = computed(() => [ }, cardVisible: true, create: true, + format: ({ calendarTypeDescription }, dashIfEmpty) => + dashIfEmpty(calendarTypeDescription), }, { align: 'left', @@ -131,6 +140,8 @@ const columns = computed(() => [ }, cardVisible: true, create: true, + width: '100px', + format: ({ workCenterName }, dashIfEmpty) => dashIfEmpty(workCenterName), }, { align: 'left', @@ -144,6 +155,7 @@ const columns = computed(() => [ }, cardVisible: true, create: true, + format: ({ payrollDescription }, dashIfEmpty) => dashIfEmpty(payrollDescription), }, { align: 'left', @@ -157,6 +169,7 @@ const columns = computed(() => [ }, cardVisible: true, create: true, + format: ({ occupationName }, dashIfEmpty) => dashIfEmpty(occupationName), }, { align: 'left', @@ -165,6 +178,7 @@ const columns = computed(() => [ component: 'input', cardVisible: true, create: true, + width: '50px', }, { align: 'left', @@ -177,6 +191,8 @@ const columns = computed(() => [ }, cardVisible: true, create: true, + format: ({ workerBusinessTypeName }, dashIfEmpty) => + dashIfEmpty(workerBusinessTypeName), }, { align: 'left', @@ -185,6 +201,7 @@ const columns = computed(() => [ component: 'input', cardVisible: true, create: true, + width: '70px', }, { align: 'left', @@ -193,6 +210,7 @@ const columns = computed(() => [ component: 'input', cardVisible: true, create: true, + width: '70px', }, { name: 'notes', @@ -208,7 +226,7 @@ const columns = computed(() => [ diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index de3f634e2..0e946f1dd 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => {