Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/pr-4774-traducciones This commit looks good Details
gitea/salix-front/pipeline/pr-test This commit looks good Details
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-10-07 09:02:01 +02:00
commit b8407140f9
16 changed files with 169 additions and 69 deletions

View File

@ -497,6 +497,7 @@ function handleOnDataSaved(_) {
auto-width auto-width
class="no-margin q-px-xs" class="no-margin q-px-xs"
:class="[getColAlign(col), col.columnClass]" :class="[getColAlign(col), col.columnClass]"
:style="col.style"
v-if="col.visible ?? true" v-if="col.visible ?? true"
@click.ctrl=" @click.ctrl="
($event) => ($event) =>
@ -525,6 +526,7 @@ function handleOnDataSaved(_) {
:class="getColAlign(col)" :class="getColAlign(col)"
class="sticky no-padding" class="sticky no-padding"
@click="stopEventPropagation($event)" @click="stopEventPropagation($event)"
:style="col.style"
> >
<QBtn <QBtn
v-for="(btn, index) of col.actions" v-for="(btn, index) of col.actions"
@ -710,7 +712,7 @@ function handleOnDataSaved(_) {
icon="add" icon="add"
shortcut="+" shortcut="+"
/> />
<QTooltip> <QTooltip self="top right">
{{ createForm?.title }} {{ createForm?.title }}
</QTooltip> </QTooltip>
</QPageSticky> </QPageSticky>

View File

@ -114,7 +114,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
for (const row of response.data) store.data.push(row); for (const row of response.data) store.data.push(row);
} else { } else {
store.data = response.data; store.data = response.data;
if (!document.querySelectorAll('[role="dialog"]').length) if (!document.querySelectorAll('[role="dialog"][aria-modal="true"]').length)
updateRouter && updateStateParams(); updateRouter && updateStateParams();
} }

View File

@ -293,6 +293,7 @@ globals:
maxTemperature: Max maxTemperature: Max
minTemperature: Min minTemperature: Min
params: params:
id: ID
clientFk: Client id clientFk: Client id
salesPersonFk: Sales person salesPersonFk: Sales person
warehouseFk: Warehouse warehouseFk: Warehouse
@ -300,7 +301,12 @@ globals:
from: From from: From
To: To To: To
stateFk: State stateFk: State
departmentFk: Department
email: Email
SSN: SSN
fi: FI
changePass: Change password changePass: Change password
deleteConfirmTitle: Delete selected elements
errors: errors:
statusUnauthorized: Access denied statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred statusInternalServerError: An internal server error has ocurred
@ -807,14 +813,14 @@ worker:
bankEntity: Swift / BIC bankEntity: Swift / BIC
formation: formation:
tableVisibleColumns: tableVisibleColumns:
course: Curso course: Course
startDate: Fecha Inicio startDate: Start date
endDate: Fecha Fin endDate: End date
center: Centro Formación center: Training center
invoice: Factura invoice: Invoice
amount: Importe amount: Amount
remark: Bonficado remark: Remark
hasDiploma: Diploma hasDiploma: Has diploma
medical: medical:
tableVisibleColumns: tableVisibleColumns:
date: Date date: Date

View File

@ -297,6 +297,7 @@ globals:
maxTemperature: Máx maxTemperature: Máx
minTemperature: Mín minTemperature: Mín
params: params:
id: Id
clientFk: Id cliente clientFk: Id cliente
salesPersonFk: Comercial salesPersonFk: Comercial
warehouseFk: Almacén warehouseFk: Almacén
@ -304,7 +305,12 @@ globals:
from: Desde from: Desde
To: Hasta To: Hasta
stateFk: Estado stateFk: Estado
departmentFk: Departamento
email: Correo
SSN: NSS
fi: NIF
changePass: Cambiar contraseña changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
errors: errors:
statusUnauthorized: Acceso denegado statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor statusInternalServerError: Ha ocurrido un error interno del servidor

View File

@ -139,33 +139,35 @@ const openTab = (id) =>
:disable-option="{ card: true }" :disable-option="{ card: true }"
> >
<template #top-left> <template #top-left>
<QBtn <div class="q-mt-sm">
icon="refresh" <QBtn
size="md" icon="refresh"
color="primary" size="md"
dense color="primary"
flat dense
@click="$refs.table.reload()" flat
> @click="$refs.table.reload()"
<QTooltip>{{ $t('globals.refresh') }}</QTooltip> >
</QBtn> <QTooltip>{{ $t('globals.refresh') }}</QTooltip>
<QBtn </QBtn>
v-if="selectedRows.length" <QBtn
icon="delete" v-if="selectedRows.length"
size="md" icon="delete"
dense size="md"
flat dense
color="primary" flat
@click=" color="primary"
openConfirmationModal( @click="
$t('salesOrdersTable.deleteConfirmTitle'), openConfirmationModal(
$t('salesOrdersTable.deleteConfirmMessage'), $t('globals.deleteConfirmTitle'),
removeOrders $t('salesOrdersTable.deleteConfirmMessage'),
) removeOrders
" )
> "
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip> >
</QBtn> <QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
</QBtn>
</div>
</template> </template>
<template #column-dateSend="{ row }"> <template #column-dateSend="{ row }">
<QTd> <QTd>

View File

@ -15,7 +15,6 @@ salesOrdersTable:
dateMake: Make date dateMake: Make date
client: Client client: Client
salesPerson: Salesperson salesPerson: Salesperson
deleteConfirmTitle: Delete selected elements
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue? deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
agency: Agency agency: Agency
import: Import import: Import

View File

@ -15,7 +15,6 @@ salesOrdersTable:
dateMake: Fecha de realización dateMake: Fecha de realización
client: Cliente client: Cliente
salesPerson: Comercial salesPerson: Comercial
deleteConfirmTitle: Eliminar los elementos seleccionados
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar? deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
agency: Agencia agency: Agencia
import: Importe import: Importe

View File

@ -57,9 +57,21 @@ const columns = computed(() => [
field: 'concept', field: 'concept',
cardVisible: true, cardVisible: true,
}, },
{
align: 'right',
name: 'tableActions',
style: 'max-width: 20px; text-align: initial;',
actions: [
{
title: t('delete'),
icon: 'delete',
action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
isPrimary: true,
},
],
},
]); ]);
</script> </script>
<template> <template>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
@ -69,7 +81,7 @@ const columns = computed(() => [
save-url="WorkerIncomes/crud" save-url="WorkerIncomes/crud"
:create="{ :create="{
urlCreate: 'workerIncomes', urlCreate: 'workerIncomes',
title: t('Create workerBalance'), title: t('Create balance'),
onDataSaved: () => tableRef.reload(), onDataSaved: () => tableRef.reload(),
formInitialData: { formInitialData: {
workerFk: entityId, workerFk: entityId,
@ -81,10 +93,10 @@ const columns = computed(() => [
:right-search="false" :right-search="false"
:is-editable="true" :is-editable="true"
:use-model="true" :use-model="true"
:default-remove="false"
/> />
</template> </template>
<i18n> <i18n>
es: es:
Create workerBalance: Crear balance Create balance: Crear balance
</i18n> </i18n>

View File

@ -96,10 +96,23 @@ const columns = computed(() => [
label: t('worker.formation.tableVisibleColumns.hasDiploma'), label: t('worker.formation.tableVisibleColumns.hasDiploma'),
create: true, create: true,
}, },
{
align: 'right',
name: 'tableActions',
actions: [
{
title: t('delete'),
icon: 'delete',
action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
isPrimary: true,
},
],
},
]); ]);
</script> </script>
<template> <template>
<VnTable <VnTable
class="worker-formation"
ref="tableRef" ref="tableRef"
data-key="WorkerFormation" data-key="WorkerFormation"
:url="`Workers/${entityId}/trainingCourse`" :url="`Workers/${entityId}/trainingCourse`"
@ -120,8 +133,15 @@ const columns = computed(() => [
:right-search="false" :right-search="false"
:is-editable="true" :is-editable="true"
:use-model="true" :use-model="true"
:default-remove="false"
/> />
</template> </template>
<style lang="scss" scoped>
:global(.worker-formation thead > tr > th:nth-child(7)),
:global(.worker-formation thead > tr > th:nth-child(8)) {
max-width: 50px;
}
</style>
<i18n> <i18n>
es: es:
Create training course: Crear curso de formación Create training course: Crear curso de formación

View File

@ -65,6 +65,18 @@ const columns = [
create: true, create: true,
component: 'input', component: 'input',
}, },
{
align: 'right',
name: 'tableActions',
actions: [
{
title: t('delete'),
icon: 'delete',
action: async (row) => await tableRef.value.CrudModelRef.remove([row]),
isPrimary: true,
},
],
},
]; ];
</script> </script>
<template> <template>
@ -87,5 +99,6 @@ const columns = [
:right-search="false" :right-search="false"
:is-editable="true" :is-editable="true"
:use-model="true" :use-model="true"
:default-remove="false"
/> />
</template> </template>

View File

@ -326,16 +326,20 @@ const updateData = async () => {
}; };
const getMailStates = async (date) => { const getMailStates = async (date) => {
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
const month = date.getMonth() + 1;
const prevMonth = month == 1 ? 12 : month - 1;
const params = { const params = {
month: date.getMonth() + 1, month,
year: date.getFullYear(), year: date.getFullYear(),
}; };
const { data } = await axios.get( const curMonthStates = (await axios.get(url, { params })).data;
`WorkerTimeControls/${route.params.id}/getMailStates`, const prevMonthStates = (
{ params } await axios.get(url, { params: { ...params, month: prevMonth } })
); ).data;
workerTimeControlMails.value = data;
workerTimeControlMails.value = curMonthStates.concat(prevMonthStates);
}; };
const showWorkerTimeForm = (propValue, formType) => { const showWorkerTimeForm = (propValue, formType) => {

View File

@ -7,7 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n(); const { t, te } = useI18n();
const props = defineProps({ const props = defineProps({
dataKey: { dataKey: {
type: String, type: String,
@ -16,6 +16,11 @@ const props = defineProps({
}); });
const departments = ref(); const departments = ref();
const getLocale = (label) => {
const globalLocale = `globals.params.${label}`;
return te(globalLocale) ? t(globalLocale) : t(`params.${label}`);
};
</script> </script>
<template> <template>
@ -23,7 +28,7 @@ const departments = ref();
<VnFilterPanel :data-key="props.dataKey" :search-button="true"> <VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }"> <template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs"> <div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong> <strong>{{ getLocale(tag.label) }}: </strong>
<span>{{ formatFn(tag.value) }}</span> <span>{{ formatFn(tag.value) }}</span>
</div> </div>
</template> </template>
@ -64,10 +69,7 @@ const departments = ref();
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection v-if="!departments"> <QItemSection>
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="departments">
<VnSelect <VnSelect
:label="t('Department')" :label="t('Department')"
v-model="params.departmentFk" v-model="params.departmentFk"
@ -82,6 +84,11 @@ const departments = ref();
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem>
<QItemSection>
<VnInput :label="t('Email')" v-model="params.email" is-outlined />
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
@ -99,23 +106,17 @@ const departments = ref();
en: en:
params: params:
search: Contains search: Contains
fi: FI
firstName: First name firstName: First name
lastName: Last name lastName: Last name
userName: User userName: User
extension: Extension extension: Extension
departmentFk: Department
id: ID
es: es:
params: params:
search: Contiene search: Contiene
fi: NIF
firstName: Nombre firstName: Nombre
lastName: Apellidos lastName: Apellidos
userName: Usuario userName: Usuario
extension: Extensión extension: Extensión
departmentFk: Departamento
id: ID
FI: NIF FI: NIF
First Name: Nombre First Name: Nombre
Last Name: Apellidos Last Name: Apellidos

View File

@ -39,13 +39,31 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'nickname', name: 'firstName',
label: t('tableColumns.name'), label: t('tableColumns.firstName'),
isTitle: true, isTitle: true,
columnFilter: { columnFilter: {
name: 'firstName', name: 'firstName',
}, },
}, },
{
align: 'left',
name: 'lastName',
label: t('tableColumns.lastName'),
isTitle: true,
columnFilter: {
name: 'lastName',
},
},
{
align: 'left',
name: 'nickname',
label: t('tableColumns.userName'),
isTitle: true,
columnFilter: {
name: 'userName',
},
},
{ {
align: 'left', align: 'left',
name: 'departmentFk', name: 'departmentFk',
@ -66,10 +84,17 @@ const columns = computed(() => [
label: t('tableColumns.email'), label: t('tableColumns.email'),
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
alias: 'mu', name: 'email',
inWhere: true, },
},
{
align: 'left',
name: 'extension',
label: t('tableColumns.extension'),
cardVisible: true,
columnFilter: {
name: 'extension',
}, },
hidden: true,
}, },
{ {
align: 'right', align: 'right',
@ -180,7 +205,7 @@ async function autofillBic(worker) {
default-mode="table" default-mode="table"
redirect="worker" redirect="worker"
:right-search="false" :right-search="false"
auto-load :order="['id DESC']"
> >
<template #more-create-dialog="{ data }"> <template #more-create-dialog="{ data }">
<div class="q-pa-lg full-width"> <div class="q-pa-lg full-width">

View File

@ -1,6 +1,11 @@
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n' passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
tableColumns: tableColumns:
id: ID id: ID
name: Name firstName: First name
lastName: Last Name
userName: User Name
department: Department department: Department
email: Email email: Email
fi: FI
SSN: SSN
extension: Extension

View File

@ -6,6 +6,11 @@ External: Externo
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)' passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
tableColumns: tableColumns:
id: ID id: ID
name: Nombre firstName: Nombre
lastName: Apellidos
userName: Nombre de usuario
department: Departamento department: Departamento
email: Email email: Email
fi: NIF
SSN: NSS
extension: Extensión

View File

@ -168,6 +168,7 @@ export default {
meta: { meta: {
title: 'log', title: 'log',
icon: 'vn:History', icon: 'vn:History',
acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
}, },
component: () => import('src/pages/Worker/Card/WorkerLog.vue'), component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
}, },