Compare commits
33 Commits
dev
...
6553-worke
Author | SHA1 | Date |
---|---|---|
Carlos Satorres | f903432e74 | |
Carlos Satorres | 04d30186c2 | |
Carlos Satorres | f7fb18cf0a | |
Carlos Satorres | 02129591cf | |
Carlos Satorres | bf4d11545d | |
Carlos Satorres | 70847176ca | |
Carlos Satorres | 97ce44242c | |
Carlos Satorres | c75e4cbf95 | |
Carlos Satorres | 60e9accd99 | |
Carlos Satorres | 00cd6feb12 | |
Carlos Satorres | 8f925401d5 | |
Carlos Satorres | 8363f813de | |
Carlos Satorres | 68d1d0dbb0 | |
Carlos Satorres | 0e7abe5fa4 | |
Carlos Satorres | 9c5620f340 | |
Carlos Satorres | 41e1d365f3 | |
Carlos Satorres | b6836fc59e | |
Alex Moreno | 81591b4f67 | |
Alex Moreno | 83a0ec7eb8 | |
Alex Moreno | 8d60754682 | |
Alex Moreno | ba57c2fcd9 | |
Carlos Satorres | 8490f24438 | |
Carlos Satorres | db3ff0416c | |
Carlos Satorres | d7044cfdcc | |
Carlos Satorres | f4792d7921 | |
Carlos Satorres | 960129f86c | |
Carlos Satorres | 6e261b7793 | |
Carlos Satorres | 4b44b9a979 | |
Carlos Satorres | 8f1ddb08b3 | |
Carlos Satorres | 330b1c1ec2 | |
Carlos Satorres | 6205feaca4 | |
Carlos Satorres | 0e691436e9 | |
Carlos Satorres | 81e6870f71 |
|
@ -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'),
|
||||
|
|
|
@ -270,6 +270,7 @@ function stopEventPropagation(event) {
|
|||
function reload(params) {
|
||||
selected.value = [];
|
||||
CrudModelRef.value.reload(params);
|
||||
emit('saveChanges', params);
|
||||
}
|
||||
|
||||
function columnName(col) {
|
||||
|
@ -812,7 +813,7 @@ es:
|
|||
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%;
|
||||
|
|
|
@ -269,6 +269,7 @@ globals:
|
|||
ticketsMonitor: Tickets monitor
|
||||
clientsActionsMonitor: Clients and actions
|
||||
serial: Serial
|
||||
business: Business
|
||||
medical: Mutual
|
||||
supplier: Supplier
|
||||
created: Created
|
||||
|
@ -710,6 +711,7 @@ worker:
|
|||
timeControl: Time control
|
||||
locker: Locker
|
||||
balance: Balance
|
||||
business: Business
|
||||
medical: Medical
|
||||
list:
|
||||
name: Name
|
||||
|
@ -743,15 +745,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
|
||||
|
@ -808,6 +817,24 @@ worker:
|
|||
debit: Debt
|
||||
credit: Have
|
||||
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:
|
||||
pageTitles:
|
||||
wagons: Wagons
|
||||
|
|
|
@ -273,6 +273,7 @@ globals:
|
|||
ticketsMonitor: Monitor de tickets
|
||||
clientsActionsMonitor: Clientes y acciones
|
||||
serial: Facturas por serie
|
||||
business: Contratos
|
||||
medical: Mutua
|
||||
supplier: Proveedor
|
||||
created: Fecha creación
|
||||
|
@ -716,6 +717,7 @@ worker:
|
|||
timeControl: Control de horario
|
||||
locker: Taquilla
|
||||
balance: Balance
|
||||
business: Contrato
|
||||
formation: Formación
|
||||
medical: Mutua
|
||||
list:
|
||||
|
@ -750,6 +752,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
|
||||
|
@ -806,6 +824,23 @@ worker:
|
|||
debit: Debe
|
||||
credit: Haber
|
||||
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:
|
||||
pageTitles:
|
||||
wagons: Vagones
|
||||
|
|
|
@ -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>
|
|
@ -72,6 +72,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'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
</script>
|
||||
|
@ -184,6 +209,39 @@ const filter = {
|
|||
</template>
|
||||
</VnLv>
|
||||
</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>
|
||||
</CardSummary>
|
||||
</template>
|
||||
|
|
|
@ -15,6 +15,7 @@ export default {
|
|||
main: ['WorkerList', 'WorkerDepartment'],
|
||||
card: [
|
||||
'WorkerBasicData',
|
||||
'WorkerBusiness',
|
||||
'WorkerNotes',
|
||||
'WorkerPda',
|
||||
'WorkerNotificationsManager',
|
||||
|
@ -89,6 +90,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',
|
||||
|
|
Loading…
Reference in New Issue