Merge branch 'master' into hotfix_remove_reserved
gitea/salix-front/pipeline/pr-master This commit is unstable Details

This commit is contained in:
Alex Moreno 2025-03-21 10:22:19 +00:00
commit 07f24cb9ae
8 changed files with 31 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, toRefs, computed, watch, onMounted, useAttrs } from 'vue'; import { ref, toRefs, computed, watch, onMounted, useAttrs, nextTick } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import { useRequired } from 'src/composables/useRequired'; import { useRequired } from 'src/composables/useRequired';
@ -247,6 +247,7 @@ async function fetchFilter(val) {
} }
async function filterHandler(val, update) { async function filterHandler(val, update) {
if (isLoading.value) return update();
if (!val && lastVal.value === val) { if (!val && lastVal.value === val) {
lastVal.value = val; lastVal.value = val;
return update(); return update();
@ -294,6 +295,7 @@ async function onScroll({ to, direction, from, index }) {
await arrayData.loadMore(); await arrayData.loadMore();
setOptions(arrayData.store.data); setOptions(arrayData.store.data);
vnSelectRef.value.scrollTo(lastIndex); vnSelectRef.value.scrollTo(lastIndex);
await nextTick();
isLoading.value = false; isLoading.value = false;
} }
} }

View File

@ -893,6 +893,8 @@ components:
VnLv: VnLv:
copyText: '{copyValue} has been copied to the clipboard' copyText: '{copyValue} has been copied to the clipboard'
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789' iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789'
VnNotes:
clientWithoutPhone: 'The following clients do not have a phone number and the message will not be sent to them: {clientWithoutPhone}'
weekdays: weekdays:
sun: Sunday sun: Sunday
mon: Monday mon: Monday

View File

@ -980,6 +980,8 @@ components:
VnLv: VnLv:
copyText: '{copyValue} se ha copiado al portapepeles' copyText: '{copyValue} se ha copiado al portapepeles'
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789' iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789'
VnNotes:
clientWithoutPhone: 'Estos clientes no tienen asociado número de télefono y el sms no les será enviado: {clientWithoutPhone}'
weekdays: weekdays:
sun: Domingo sun: Domingo
mon: Lunes mon: Lunes

View File

@ -199,12 +199,22 @@ const confirmRemove = (ticket) => {
const openSmsDialog = async () => { const openSmsDialog = async () => {
const clientsId = []; const clientsId = [];
const clientsPhone = []; const clientsPhone = [];
const clientWithoutPhone = [];
for (let ticket of selectedRows.value) { for (let ticket of selectedRows.value) {
clientsId.push(ticket?.clientFk); clientsId.push(ticket?.clientFk);
const { data: client } = await axios.get(`Clients/${ticket?.clientFk}`); const { data: client } = await axios.get(`Clients/${ticket?.clientFk}`);
if (!client.phone) {
clientWithoutPhone.push(ticket?.clientFk);
continue;
}
clientsPhone.push(client.phone); clientsPhone.push(client.phone);
} }
if (clientWithoutPhone.length) {
quasar.notify({
type: 'warning',
message: t('components.VnNotes.clientWithoutPhone', { clientWithoutPhone }),
});
}
quasar.dialog({ quasar.dialog({
component: SendSmsDialog, component: SendSmsDialog,

View File

@ -1,5 +1,6 @@
<script setup> <script setup>
import { ref, nextTick } from 'vue'; import { ref, nextTick, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -17,12 +18,12 @@ const maritalStatus = [
{ code: 'M', name: t('Married') }, { code: 'M', name: t('Married') },
{ code: 'S', name: t('Single') }, { code: 'S', name: t('Single') },
]; ];
async function setAdvancedSummary(data) {
const advanced = (await useAdvancedSummary('Workers', data.id)) ?? {}; onMounted(async () => {
const advanced = await useAdvancedSummary('Workers', useRoute().params.id);
Object.assign(form.value.formData, advanced); Object.assign(form.value.formData, advanced);
await nextTick(); nextTick(() => (form.value.hasChanges = false));
if (form.value) form.value.hasChanges = false; });
}
</script> </script>
<template> <template>
<FetchData <FetchData
@ -42,7 +43,6 @@ async function setAdvancedSummary(data) {
:url-update="`Workers/${$route.params.id}`" :url-update="`Workers/${$route.params.id}`"
auto-load auto-load
model="Worker" model="Worker"
@on-fetch="setAdvancedSummary"
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>

View File

@ -16,6 +16,7 @@ const $props = defineProps({
v-if="$props.id" v-if="$props.id"
:id="$props.id" :id="$props.id"
:summary="DepartmentSummary" :summary="DepartmentSummary"
data-key="DepartmentDescriptorProxy"
/> />
</QPopupProxy> </QPopupProxy>
</template> </template>

View File

@ -19,7 +19,7 @@ function notIsLocations(ifIsFalse, ifIsTrue) {
<template> <template>
<VnCard <VnCard
data-key="Zone" data-key="Zone"
:url="notIsLocations('Zones', undefined)" :url="notIsLocations(`Zones/${route.params.id}`, undefined)"
:descriptor="ZoneDescriptor" :descriptor="ZoneDescriptor"
:filter="filter" :filter="filter"
:filter-panel="notIsLocations(ZoneFilterPanel, undefined)" :filter-panel="notIsLocations(ZoneFilterPanel, undefined)"

View File

@ -271,12 +271,14 @@ export default {
path: 'department', path: 'department',
name: 'Department', name: 'Department',
redirect: { name: 'WorkerDepartment' }, redirect: { name: 'WorkerDepartment' },
component: () => import('src/pages/Worker/WorkerDepartment.vue'), meta: { title: 'department', icon: 'vn:greuge' },
children: [ children: [
{ {
component: () =>
import('src/pages/Worker/WorkerDepartment.vue'),
meta: { title: 'department', icon: 'vn:greuge' },
name: 'WorkerDepartment', name: 'WorkerDepartment',
path: 'list', path: 'list',
meta: { title: 'department', icon: 'vn:greuge' },
}, },
departmentCard, departmentCard,
], ],