0
0
Fork 0

Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6942-improveInvoceIn

This commit is contained in:
Jorge Penadés 2024-05-20 09:31:58 +02:00
commit c1a6bca508
4 changed files with 119 additions and 33 deletions

View File

@ -830,6 +830,7 @@ worker:
calendar: Calendar calendar: Calendar
timeControl: Time control timeControl: Time control
locker: Locker locker: Locker
list: list:
name: Name name: Name
email: Email email: Email
@ -861,6 +862,15 @@ worker:
role: Role role: Role
sipExtension: Extension sipExtension: Extension
locker: Locker locker: Locker
fiDueDate: Fecha de caducidad del DNI
sex: Sexo
seniority: Antigüedad
fi: DNI/NIE/NIF
birth: Cumpleaños
isFreelance: Autónomo
isSsDiscounted: Bonificación SS
hasMachineryAuthorized: Autorizado para llevar maquinaria
isDisable: Trabajador desactivado
notificationsManager: notificationsManager:
activeNotifications: Active notifications activeNotifications: Active notifications
availableNotifications: Available notifications availableNotifications: Available notifications

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useVnConfirm } from 'composables/useVnConfirm';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
@ -43,30 +43,17 @@ const setData = (entity) => {
data.value = useCardDescription(entity.name, entity.id); data.value = useCardDescription(entity.name, entity.id);
}; };
const removeDepartment = () => { const removeDepartment = async () => {
quasar try {
.dialog({ await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value);
title: 'Are you sure you want to delete it?', router.push({ name: 'WorkerDepartment' });
message: 'Delete department', notify('department.departmentRemoved', 'positive');
ok: { } catch (err) {
push: true, console.error('Error removing department');
color: 'primary', }
},
cancel: true,
})
.onOk(async () => {
try {
await axios.post(
`/Departments/${entityId.value}/removeChild`,
entityId.value
);
router.push({ name: 'WorkerDepartment' });
notify('department.departmentRemoved', 'positive');
} catch (err) {
console.error('Error removing department');
}
});
}; };
const { openConfirmationModal } = useVnConfirm();
</script> </script>
<template> <template>
<CardDescriptor <CardDescriptor
@ -84,7 +71,17 @@ const removeDepartment = () => {
" "
> >
<template #menu="{}"> <template #menu="{}">
<QItem v-ripple clickable @click="removeDepartment()"> <QItem
v-ripple
clickable
@click="
openConfirmationModal(
t('Are you sure you want to delete it?'),
t('Delete department'),
removeDepartment
)
"
>
<QItemSection>{{ t('Delete') }}</QItemSection> <QItemSection>{{ t('Delete') }}</QItemSection>
</QItem> </QItem>
</template> </template>

View File

@ -2,7 +2,7 @@
import { ref } from 'vue'; import { ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import FormModel from 'src/components/FormModel.vue'; import FormModel from 'src/components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
@ -74,12 +74,11 @@ const maritalStatus = [
model="Worker" model="Worker"
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow>
<VnInput :label="t('Name')" clearable v-model="data.firstName" /> <VnInput :label="t('Name')" clearable v-model="data.firstName" />
<VnInput :label="t('Last name')" clearable v-model="data.lastName" /> <VnInput :label="t('Last name')" clearable v-model="data.lastName" />
</VnRow> </VnRow>
<VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<VnInput v-model="data.phone" :label="t('Business phone')" clearable /> <VnInput v-model="data.phone" :label="t('Business phone')" clearable />
<VnInput <VnInput
v-model="data.mobileExtension" v-model="data.mobileExtension"
@ -88,7 +87,7 @@ const maritalStatus = [
/> />
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow>
<VnSelect <VnSelect
:label="t('Boss')" :label="t('Boss')"
:options="workersOptions" :options="workersOptions"
@ -119,7 +118,7 @@ const maritalStatus = [
/> />
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow>
<VnSelect <VnSelect
:label="t('Origin country')" :label="t('Origin country')"
:options="countriesOptions" :options="countriesOptions"
@ -138,7 +137,7 @@ const maritalStatus = [
/> />
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow>
<VnInput v-model="data.SSN" :label="t('SSN')" clearable /> <VnInput v-model="data.SSN" :label="t('SSN')" clearable />
<VnInput <VnInput
v-model="data.locker" v-model="data.locker"
@ -147,6 +146,36 @@ const maritalStatus = [
clearable clearable
/> />
</VnRow> </VnRow>
<VnRow>
<VnInputDate :label="t('fiDueDate')" v-model="data.fiDueDate" />
<VnInput v-model="data.sex" :label="t('sex')" clearable />
</VnRow>
<VnRow>
<VnInputDate :label="t('seniority')" v-model="data.seniority" />
<VnInput v-model="data.fi" :label="t('fi')" />
</VnRow>
<VnRow>
<VnInputDate :label="t('birth')" v-model="data.birth" />
</VnRow>
<VnRow>
<QCheckbox
size="sm"
:label="t('isFreelance')"
v-model="data.isFreelance"
/>
<QCheckbox
size="sm"
v-model="data.isSsDiscounted"
:label="t(`isSsDiscounted`)"
/>
<QCheckbox
size="sm"
v-model="data.hasMachineryAuthorized"
:label="t(`hasMachineryAuthorized`)"
/>
<QCheckbox size="sm" v-model="data.isDisable" :label="t(`isDisable`)" />
</VnRow>
</template> </template>
</FormModel> </FormModel>
</template> </template>
@ -165,4 +194,13 @@ es:
Education level: Nivel educación Education level: Nivel educación
SSN: NSS SSN: NSS
Locker: Taquilla Locker: Taquilla
fiDueDate: Fecha de caducidad del DNI
seniority: Antigüedad
hasMachineryAuthorized: Autorizado para llevar maquinaria
isFreelance: Autónomo
isDisable: Trabajador desactivado
fi: DNI/NIE/NIF
sex: Sexo
birth: Cumpleaños
isSsDiscounted: Bonificación SS
</i18n> </i18n>

View File

@ -2,7 +2,7 @@
import { ref, onMounted, computed } from 'vue'; import { ref, onMounted, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { dashIfEmpty } from 'src/filters'; import { dashIfEmpty, toDate } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
@ -111,6 +111,47 @@ const filter = {
</VnLv> </VnLv>
<VnLv :label="t('worker.summary.locker')" :value="worker.locker" /> <VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
</QCard> </QCard>
<QCard class="vn-one">
<VnTitle
:url="workerUrl + `basic-data`"
:text="t('worker.summary.basicData')"
/>
<VnLv
:label="t('worker.summary.fiDueDate')"
:value="toDate(worker.fiDueDate)"
/>
<VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
<VnLv
:label="t('worker.summary.seniority')"
:value="toDate(worker.seniority)"
/>
<VnLv :label="t('worker.summary.fi')" :value="worker.fi" />
<VnLv :label="t('worker.summary.birth')" :value="toDate(worker.birth)" />
<QCheckbox
class="padding-none"
:label="t('worker.summary.isFreelance')"
v-model="worker.isFreelance"
:disable="true"
/>
<QCheckbox
class="padding-none"
:label="t('worker.summary.isSsDiscounted')"
v-model="worker.isSsDiscounted"
:disable="true"
/>
<QCheckbox
class="padding-none"
:label="t('worker.summary.hasMachineryAuthorized')"
v-model="worker.hasMachineryAuthorized"
:disable="true"
/>
<QCheckbox
class="padding-none"
:label="t('worker.summary.isDisable')"
v-model="worker.isDisable"
:disable="true"
/>
</QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :text="t('worker.summary.userData')" /> <VnTitle :text="t('worker.summary.userData')" />
<VnLv :label="t('worker.summary.userId')" :value="worker.user.id" /> <VnLv :label="t('worker.summary.userId')" :value="worker.user.id" />