Compare commits

...

33 Commits

Author SHA1 Message Date
Carlos Satorres f903432e74 refs #6553 fix reactivateWorker 2024-09-13 13:46:53 +02:00
Carlos Satorres 04d30186c2 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-09-13 13:06:59 +02:00
Carlos Satorres f7fb18cf0a refs #6553 workerBusiness 2024-09-10 15:02:21 +02:00
Carlos Satorres 02129591cf refs #6553 workerBusiness 2024-09-10 08:42:56 +02:00
Carlos Satorres bf4d11545d 2024-09-09 13:22:15 +02:00
Carlos Satorres 70847176ca refs #6553 fix business slot 2024-09-06 07:15:25 +02:00
Carlos Satorres 97ce44242c refs #6553 fix business summary 2024-09-03 13:58:14 +02:00
Carlos Satorres c75e4cbf95 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-09-03 10:51:41 +02:00
Carlos Satorres 60e9accd99 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-09-03 08:11:01 +02:00
Carlos Satorres 00cd6feb12 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-25 10:19:53 +02:00
Carlos Satorres 8f925401d5 refs #6553 fix VnTable 2024-06-25 10:17:52 +02:00
Carlos Satorres 8363f813de Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-21 12:42:19 +02:00
Carlos Satorres 68d1d0dbb0 refs #6553 function 2024-06-20 13:58:14 +02:00
Carlos Satorres 0e7abe5fa4 Merge branch '6825-vnTable' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-20 13:57:59 +02:00
Carlos Satorres 9c5620f340 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-20 13:35:46 +02:00
Carlos Satorres 41e1d365f3 refs #6553 fix relations 2024-06-19 08:06:03 +02:00
Carlos Satorres b6836fc59e Merge branch '6825-vnTable' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-19 06:50:20 +02:00
Alex Moreno 81591b4f67 fix: use model 2024-06-14 15:01:12 +02:00
Alex Moreno 83a0ec7eb8 Merge branch '6825-vnTable' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-14 14:55:25 +02:00
Alex Moreno 8d60754682 fix(WorkerBusiness): fix card label 2024-06-14 14:50:01 +02:00
Alex Moreno ba57c2fcd9 Merge branch '6825-vnTable' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-14 11:53:14 +02:00
Carlos Satorres 8490f24438 refs #6553 fix reactivateWorker 2024-06-10 09:23:33 +02:00
Carlos Satorres db3ff0416c refs #6553 fix names 2024-06-05 14:31:08 +02:00
Carlos Satorres d7044cfdcc Merge branch '6825-vnTable' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-06-05 10:39:35 +02:00
Carlos Satorres f4792d7921 fix: refs #6553 label css 2024-06-05 10:35:14 +02:00
Carlos Satorres 960129f86c Merge branch 'dev' into 6553-workerBusiness 2024-06-03 13:52:40 +00:00
Carlos Satorres 6e261b7793 refs #6553 fix business summary traductions 2024-06-03 14:38:48 +02:00
Carlos Satorres 4b44b9a979 Merge branch '6553-workerBusiness' of https://gitea.verdnatura.es/verdnatura/salix-front into 6553-workerBusiness 2024-05-31 10:32:53 +02:00
Carlos Satorres 8f1ddb08b3 refs #6553 filterBusiness 2024-05-31 10:32:51 +02:00
Carlos Satorres 330b1c1ec2 Merge branch 'dev' into 6553-workerBusiness 2024-05-30 11:48:56 +00:00
Carlos Satorres 6205feaca4 refs #6553 fix front ibject 2024-05-29 16:37:05 +02:00
Carlos Satorres 0e691436e9 refs #6553 fix front trad 2024-05-29 14:20:49 +02:00
Carlos Satorres 81e6870f71 refs #6553 front section trad 2024-05-28 16:59:59 +02:00
7 changed files with 381 additions and 10 deletions

View File

@ -182,7 +182,7 @@ async function saveChanges(data) {
hasChanges.value = false; hasChanges.value = false;
isLoading.value = false; isLoading.value = false;
emit('saveChanges', data); emit('saveChanges', changes);
quasar.notify({ quasar.notify({
type: 'positive', type: 'positive',
message: t('globals.dataSaved'), message: t('globals.dataSaved'),

View File

@ -270,6 +270,7 @@ function stopEventPropagation(event) {
function reload(params) { function reload(params) {
selected.value = []; selected.value = [];
CrudModelRef.value.reload(params); CrudModelRef.value.reload(params);
emit('saveChanges', params);
} }
function columnName(col) { function columnName(col) {
@ -812,7 +813,7 @@ es:
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
max-width: 100%; max-width: 100%;
margin: 0 auto; margin: 1em auto;
overflow: scroll; overflow: scroll;
white-space: wrap; white-space: wrap;
width: 100%; width: 100%;

View File

@ -269,6 +269,7 @@ globals:
ticketsMonitor: Tickets monitor ticketsMonitor: Tickets monitor
clientsActionsMonitor: Clients and actions clientsActionsMonitor: Clients and actions
serial: Serial serial: Serial
business: Business
medical: Mutual medical: Mutual
supplier: Supplier supplier: Supplier
created: Created created: Created
@ -710,6 +711,7 @@ worker:
timeControl: Time control timeControl: Time control
locker: Locker locker: Locker
balance: Balance balance: Balance
business: Business
medical: Medical medical: Medical
list: list:
name: Name name: Name
@ -743,15 +745,22 @@ worker:
role: Role role: Role
sipExtension: Extension sipExtension: Extension
locker: Locker locker: Locker
fiDueDate: Fecha de caducidad del DNI fiDueDate: DNI expiration date
sex: Sexo sex: Sex
seniority: Antigüedad seniority: Antiquity
fi: DNI/NIE/NIF fi: DNI/NIE/NIF
birth: Fecha de nacimiento birth: Date of birth
isFreelance: Autónomo isFreelance: Autonomous
isSsDiscounted: Bonificación SS isSsDiscounted: Bonus SS
hasMachineryAuthorized: Autorizado para llevar maquinaria hasMachineryAuthorized: Authorized to carry machinery
isDisable: Trabajador desactivado isDisable: Disabled worker
business: Business
started: Start Date
ended: End Date
reasonEnd: Reason for Termination
department: Deparment
workerBusinessCategory: Professional Category
notes: Notes
notificationsManager: notificationsManager:
activeNotifications: Active notifications activeNotifications: Active notifications
availableNotifications: Available notifications availableNotifications: Available notifications
@ -808,6 +817,24 @@ worker:
debit: Debt debit: Debt
credit: Have credit: Have
concept: Concept concept: Concept
business:
tableVisibleColumns:
started: Start Date
ended: End Date
company: Company
reasonEnd: 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: wagon:
pageTitles: pageTitles:
wagons: Wagons wagons: Wagons

View File

@ -273,6 +273,7 @@ globals:
ticketsMonitor: Monitor de tickets ticketsMonitor: Monitor de tickets
clientsActionsMonitor: Clientes y acciones clientsActionsMonitor: Clientes y acciones
serial: Facturas por serie serial: Facturas por serie
business: Contratos
medical: Mutua medical: Mutua
supplier: Proveedor supplier: Proveedor
created: Fecha creación created: Fecha creación
@ -716,6 +717,7 @@ worker:
timeControl: Control de horario timeControl: Control de horario
locker: Taquilla locker: Taquilla
balance: Balance balance: Balance
business: Contrato
formation: Formación formation: Formación
medical: Mutua medical: Mutua
list: list:
@ -750,6 +752,22 @@ worker:
role: Rol role: Rol
sipExtension: Extensión sipExtension: Extensión
locker: Taquilla 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: notificationsManager:
activeNotifications: Notificaciones activas activeNotifications: Notificaciones activas
availableNotifications: Notificaciones disponibles availableNotifications: Notificaciones disponibles
@ -806,6 +824,23 @@ worker:
debit: Debe debit: Debe
credit: Haber credit: Haber
concept: Concepto concept: Concepto
business:
tableVisibleColumns:
started: Fecha inicio
ended: Fecha fin
company: Empresa
reasonEnd: 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: wagon:
pageTitles: pageTitles:
wagons: Vagones wagons: Vagones

View File

@ -0,0 +1,240 @@
<script setup>
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 { 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() {
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
(data) => !data.ended
);
if (hasToReactive) {
quasar
.dialog({
message: t('Do you want to reactivate the user?'),
ok: {
push: true,
color: 'primary',
},
cancel: true,
})
.onOk(async () => {
await axios.patch(`Workers/${entityId.value}`, {
isDisable: false,
});
});
}
}
const columns = computed(() => [
{
name: 'started',
label: t('worker.business.tableVisibleColumns.started'),
align: 'left',
format: ({ started }) => toDate(started),
component: 'date',
cardVisible: true,
create: true,
},
{
name: 'ended',
label: t('worker.business.tableVisibleColumns.ended'),
align: 'left',
format: ({ ended }) => toDate(ended),
component: 'date',
cardVisible: true,
create: true,
},
{
label: t('worker.business.tableVisibleColumns.company'),
align: 'left',
name: 'companyCodeFk',
component: 'select',
attrs: {
url: 'Companies',
fields: ['code'],
optionLabel: 'code',
optionValue: 'code',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'reasonEndFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.reasonEnd'),
attrs: {
url: 'BusinessReasonEnds',
fields: ['id', 'reason'],
optionLabel: 'reason',
},
cardVisible: true,
},
{
align: 'left',
name: 'departmentFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.department'),
attrs: {
url: 'Departments',
fields: ['id', 'name'],
optionLabel: 'name',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workerBusinessProfessionalCategoryFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.professionalCategory'),
attrs: {
url: 'WorkerBusinessProfessionalCategories',
fields: ['id', 'description', 'code'],
optionLabel: 'description',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'calendarTypeFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.calendarType'),
attrs: {
url: 'CalendarTypes',
fields: ['id', 'description'],
optionLabel: 'description',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workcenterFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.workCenter'),
attrs: {
url: 'WorkCenters',
fields: ['id', 'name'],
optionLabel: 'name',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workerBusinessCategoryFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.payrollCategories'),
attrs: {
url: 'payrollCategories',
fields: ['id', 'description'],
optionLabel: 'description',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'occupationCodeFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.occupationCode'),
attrs: {
url: 'OccupationCodes',
fields: ['code', 'name'],
optionValue: 'code',
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'rate',
label: t('worker.business.tableVisibleColumns.rate'),
component: 'input',
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'workerBusinessTypeFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.businessType'),
attrs: {
url: 'WorkerBusinessTypes',
fields: ['id', 'name'],
},
cardVisible: true,
create: true,
},
{
align: 'left',
label: t('worker.business.tableVisibleColumns.amount'),
name: 'amount',
component: 'input',
cardVisible: true,
create: true,
},
{
align: 'left',
label: t('worker.business.tableVisibleColumns.basicSalary'),
name: 'basicSalary',
component: 'input',
cardVisible: true,
create: true,
},
{
name: 'notes',
label: t('worker.business.tableVisibleColumns.notes'),
align: 'left',
component: 'input',
cardVisible: true,
},
]);
</script>
<template>
<VnTable
ref="tableRef"
data-key="WorkerBusiness"
:url="`Workers/${entityId}/Business`"
save-url="/Businesses/crud"
:create="{
urlCreate: `Workers/${entityId}/Business`,
title: 'Create business',
onDataSaved: () => tableRef.reload(),
formInitialData: {},
}"
order="id DESC"
:columns="columns"
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="(data) => reactivateWorker(data)"
>
<!-- <template #column-ended="{ row }">
<VnInputDate v-model="row.ended" />
<QForm v-if="!row.ended"></QForm>
</template> -->
</VnTable>
</template>
<style lang="scss" scoped></style>
<i18n>
es:
Do you want to reactivate the user?: desea reactivar el usuario?
</i18n>

View File

@ -72,6 +72,31 @@ const filter = {
{ {
relation: 'sip', relation: 'sip',
}, },
{
relation: 'business',
scope: {
include: [
{
relation: 'department',
scope: {
fields: ['id', 'name'],
},
},
{
relation: 'reasonEnd',
scope: {
fields: ['id', 'reason'],
},
},
{
relation: 'workerBusinessProfessionalCategory',
scope: {
fields: ['id', 'description'],
},
},
],
},
},
], ],
}; };
</script> </script>
@ -184,6 +209,39 @@ const filter = {
</template> </template>
</VnLv> </VnLv>
</QCard> </QCard>
<QCard class="vn-one">
<VnTitle
:url="`#/worker/${entityId}/business`"
:text="t('worker.summary.business')"
/>
<VnLv
:label="t('worker.summary.started')"
:value="toDate(worker.business[0].started)"
/>
<VnLv
:label="t('worker.summary.ended')"
:value="toDate(worker.business[0].ended)"
/>
<VnLv
:label="t('worker.summary.reasonEnd')"
:value="worker.business[0].reasonEnd?.reason"
/>
<VnLv
:label="t('worker.summary.department')"
:value="worker.business[0].department.name"
/>
<VnLv
:label="t('worker.summary.workerBusinessCategory')"
:value="
worker.business[0].workerBusinessProfessionalCategory.description
"
/>
<VnLv
:label="t('worker.summary.notes')"
:value="worker.business[0].notes"
/>
</QCard>
</template> </template>
</CardSummary> </CardSummary>
</template> </template>

View File

@ -15,6 +15,7 @@ export default {
main: ['WorkerList', 'WorkerDepartment'], main: ['WorkerList', 'WorkerDepartment'],
card: [ card: [
'WorkerBasicData', 'WorkerBasicData',
'WorkerBusiness',
'WorkerNotes', 'WorkerNotes',
'WorkerPda', 'WorkerPda',
'WorkerNotificationsManager', 'WorkerNotificationsManager',
@ -89,6 +90,15 @@ export default {
}, },
component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'), 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', path: 'notes',
name: 'NotesCard', name: 'NotesCard',