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
class="no-margin q-px-xs"
:class="[getColAlign(col), col.columnClass]"
:style="col.style"
v-if="col.visible ?? true"
@click.ctrl="
($event) =>
@ -525,6 +526,7 @@ function handleOnDataSaved(_) {
:class="getColAlign(col)"
class="sticky no-padding"
@click="stopEventPropagation($event)"
:style="col.style"
>
<QBtn
v-for="(btn, index) of col.actions"
@ -710,7 +712,7 @@ function handleOnDataSaved(_) {
icon="add"
shortcut="+"
/>
<QTooltip>
<QTooltip self="top right">
{{ createForm?.title }}
</QTooltip>
</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);
} else {
store.data = response.data;
if (!document.querySelectorAll('[role="dialog"]').length)
if (!document.querySelectorAll('[role="dialog"][aria-modal="true"]').length)
updateRouter && updateStateParams();
}

View File

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

View File

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

View File

@ -139,6 +139,7 @@ const openTab = (id) =>
:disable-option="{ card: true }"
>
<template #top-left>
<div class="q-mt-sm">
<QBtn
icon="refresh"
size="md"
@ -158,7 +159,7 @@ const openTab = (id) =>
color="primary"
@click="
openConfirmationModal(
$t('salesOrdersTable.deleteConfirmTitle'),
$t('globals.deleteConfirmTitle'),
$t('salesOrdersTable.deleteConfirmMessage'),
removeOrders
)
@ -166,6 +167,7 @@ const openTab = (id) =>
>
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
</QBtn>
</div>
</template>
<template #column-dateSend="{ row }">
<QTd>

View File

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

View File

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

View File

@ -57,9 +57,21 @@ const columns = computed(() => [
field: 'concept',
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>
<template>
<VnTable
ref="tableRef"
@ -69,7 +81,7 @@ const columns = computed(() => [
save-url="WorkerIncomes/crud"
:create="{
urlCreate: 'workerIncomes',
title: t('Create workerBalance'),
title: t('Create balance'),
onDataSaved: () => tableRef.reload(),
formInitialData: {
workerFk: entityId,
@ -81,10 +93,10 @@ const columns = computed(() => [
:right-search="false"
:is-editable="true"
:use-model="true"
:default-remove="false"
/>
</template>
<i18n>
es:
Create workerBalance: Crear balance
Create balance: Crear balance
</i18n>

View File

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

View File

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

View File

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

View File

@ -39,13 +39,31 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'nickname',
label: t('tableColumns.name'),
name: 'firstName',
label: t('tableColumns.firstName'),
isTitle: true,
columnFilter: {
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',
name: 'departmentFk',
@ -66,10 +84,17 @@ const columns = computed(() => [
label: t('tableColumns.email'),
cardVisible: true,
columnFilter: {
alias: 'mu',
inWhere: true,
name: 'email',
},
},
{
align: 'left',
name: 'extension',
label: t('tableColumns.extension'),
cardVisible: true,
columnFilter: {
name: 'extension',
},
hidden: true,
},
{
align: 'right',
@ -180,7 +205,7 @@ async function autofillBic(worker) {
default-mode="table"
redirect="worker"
:right-search="false"
auto-load
:order="['id DESC']"
>
<template #more-create-dialog="{ data }">
<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'
tableColumns:
id: ID
name: Name
firstName: First name
lastName: Last Name
userName: User Name
department: Department
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: $%&.)'
tableColumns:
id: ID
name: Nombre
firstName: Nombre
lastName: Apellidos
userName: Nombre de usuario
department: Departamento
email: Email
fi: NIF
SSN: NSS
extension: Extensión

View File

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