Merge branch 'test' into warmfix_8556_excludeDates

This commit is contained in:
Javier Segarra 2025-05-02 09:28:21 +02:00
commit adf33c14ae
36 changed files with 202 additions and 204 deletions

2
Jenkinsfile vendored
View File

@ -125,7 +125,7 @@ pipeline {
sh "docker-compose ${env.COMPOSE_PARAMS} pull db"
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
def modules = sh(script: 'node test/cypress/docker/find/find.js', returnStdout: true).trim()
def modules = sh(script: "node test/cypress/docker/find/find.js ${env.COMPOSE_TAG}", returnStdout: true).trim()
echo "E2E MODULES: ${modules}"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
sh "sh test/cypress/docker/cypressParallel.sh 1 '${modules}'"

View File

@ -284,7 +284,7 @@ function updateAndEmit(evt, { val, res, old } = { val: null, res: null, old: nul
state.set(modelValue, val);
if (!$props.url) arrayData.store.data = val;
emit(evt, state.get(modelValue), res, old);
emit(evt, state.get(modelValue), res, old, formData);
}
function trimData(data) {

View File

@ -33,7 +33,7 @@ onBeforeRouteLeave(() => {
});
onBeforeMount(async () => {
stateStore.cardDescriptorChangeValue(markRaw(props.descriptor));
if (props.visual) stateStore.cardDescriptorChangeValue(markRaw(props.descriptor));
const route = router.currentRoute.value;
try {

View File

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
import axios from 'axios';
import { usePrintService } from 'composables/usePrintService';
import VnUserLink from '../ui/VnUserLink.vue';
import { downloadFile } from 'src/composables/downloadFile';
@ -21,6 +22,7 @@ const rows = ref([]);
const dmsRef = ref();
const formDialog = ref({});
const token = useSession().getTokenMultimedia();
const { openReport } = usePrintService();
const $props = defineProps({
model: {
@ -198,12 +200,7 @@ const columns = computed(() => [
color: 'primary',
}),
click: (prop) =>
downloadFile(
prop.row.id,
$props.downloadModel,
undefined,
prop.row.download,
),
openReport(`dms/${prop.row.id}/downloadFile`, {}, '_blank'),
},
{
component: QBtn,

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted, onUnmounted, watch, computed } from 'vue';
import { ref, onMounted, onUnmounted, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';

View File

@ -161,7 +161,7 @@ const arrayData = useArrayData(arrayDataKey, {
searchUrl: false,
mapKey: $attrs['map-key'],
});
const isMenuOpened = ref(false);
const computedSortBy = computed(() => {
return $props.sortBy || $props.optionLabel + ' ASC';
});
@ -184,7 +184,9 @@ onMounted(() => {
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
});
const someIsLoading = computed(() => isLoading.value || arrayData?.isLoading?.value);
const someIsLoading = computed(
() => (isLoading.value || !!arrayData?.isLoading?.value) && !isMenuOpened.value,
);
function findKeyInOptions() {
if (!$props.options) return;
return filter($props.modelValue, $props.options)?.length;
@ -368,8 +370,9 @@ function getCaption(opt) {
hide-bottom-space
:input-debounce="useURL ? '300' : '0'"
:loading="someIsLoading"
:disable="someIsLoading"
@virtual-scroll="onScroll"
@popup-hide="isMenuOpened = false"
@popup-show="isMenuOpened = true"
@keydown="handleKeyDown"
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
:data-url="url"

View File

@ -132,8 +132,7 @@ const card = toRef(props, 'item');
display: flex;
flex-direction: column;
gap: 4px;
white-space: nowrap;
width: 192px;
p {
margin-bottom: 0;
}

View File

@ -1,8 +1,6 @@
<script setup>
import { onBeforeMount, watch, computed, ref } from 'vue';
import { watch, ref, onMounted } from 'vue';
import { useArrayData } from 'composables/useArrayData';
import { useState } from 'src/composables/useState';
import { useRoute } from 'vue-router';
import VnDescriptor from './VnDescriptor.vue';
const $props = defineProps({
@ -20,39 +18,50 @@ const $props = defineProps({
},
});
const state = useState();
const route = useRoute();
let arrayData;
let store;
let entity;
const entity = ref();
const isLoading = ref(false);
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
defineExpose({ getData });
const containerRef = ref(null);
onBeforeMount(async () => {
arrayData = useArrayData($props.dataKey, {
onMounted(async () => {
let isPopup;
let el = containerRef.value.$el;
while (el) {
if (el.classList?.contains('q-menu')) {
isPopup = true;
break;
}
el = el.parentElement;
}
arrayData = useArrayData($props.dataKey + (isPopup ? 'Proxy' : ''), {
url: $props.url,
userFilter: $props.filter,
skip: 0,
oneRecord: true,
});
store = arrayData.store;
entity = computed(() => {
const data = store.data ?? {};
if (data) emit('onFetch', data);
return data;
});
// It enables to load data only once if the module is the same as the dataKey
if (!isSameDataKey.value || !route.params.id) await getData();
watch(
() => [$props.url, $props.filter],
async () => {
if (!isSameDataKey.value) await getData();
await getData();
},
{ immediate: true },
);
watch(
() => arrayData.store.data,
(newValue) => {
entity.value = newValue;
},
);
});
defineExpose({ getData });
const emit = defineEmits(['onFetch']);
async function getData() {
store.url = $props.url;
store.filter = $props.filter ?? {};
@ -60,18 +69,15 @@ async function getData() {
try {
await arrayData.fetch({ append: false, updateRouter: false });
const { data } = store;
state.set($props.dataKey, data);
emit('onFetch', data);
} finally {
isLoading.value = false;
}
}
const emit = defineEmits(['onFetch']);
</script>
<template>
<VnDescriptor v-model="entity" v-bind="$attrs" :module="dataKey">
<VnDescriptor v-model="entity" v-bind="$attrs" :module="dataKey" ref="containerRef">
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template>

View File

@ -1,4 +1,4 @@
import { onMounted, computed } from 'vue';
import { onMounted, computed, ref } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import { useArrayDataStore } from 'stores/useArrayDataStore';
@ -346,7 +346,7 @@ export function useArrayData(key, userOptions) {
}
const totalRows = computed(() => (store.data && store.data.length) || 0);
const isLoading = computed(() => store.isLoading || false);
const isLoading = ref(store.isLoading || false);
return {
fetch,

View File

@ -4,11 +4,6 @@ import AccountSummary from './AccountSummary.vue';
</script>
<template>
<QPopupProxy style="max-width: 10px">
<AccountDescriptor
v-if="$attrs.id"
v-bind="$attrs"
:summary="AccountSummary"
:proxy-render="true"
/>
<AccountDescriptor v-if="$attrs.id" v-bind="$attrs" :summary="AccountSummary" />
</QPopupProxy>
</template>

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { toDateHourMinSec, toPercentage } from 'src/filters';
@ -9,7 +9,6 @@ import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/Departme
import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import { getUrl } from 'src/composables/getUrl';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import filter from './ClaimFilter.js';
@ -23,7 +22,6 @@ const $props = defineProps({
const route = useRoute();
const { t } = useI18n();
const salixUrl = ref();
const entityId = computed(() => {
return $props.id || route.params.id;
});
@ -31,10 +29,6 @@ const entityId = computed(() => {
function stateColor(entity) {
return entity?.claimState?.classColor;
}
onMounted(async () => {
salixUrl.value = await getUrl('');
});
</script>
<template>
@ -126,7 +120,7 @@ onMounted(async () => {
size="md"
icon="assignment"
color="primary"
:href="salixUrl + 'ticket/' + entity.ticketFk + '/sale-tracking'"
:to="{ name: 'TicketSaleTracking', params: { id: entity.ticketFk } }"
>
<QTooltip>{{ t('claim.saleTracking') }}</QTooltip>
</QBtn>
@ -134,7 +128,7 @@ onMounted(async () => {
size="md"
icon="visibility"
color="primary"
:href="salixUrl + 'ticket/' + entity.ticketFk + '/tracking/index'"
:to="{ name: 'TicketTracking', params: { id: entity.ticketFk } }"
>
<QTooltip>{{ t('claim.ticketTracking') }}</QTooltip>
</QBtn>

View File

@ -4,11 +4,6 @@ import ClaimSummary from './ClaimSummary.vue';
</script>
<template>
<QPopupProxy style="max-width: 10px">
<ClaimDescriptor
v-if="$attrs.id"
v-bind="$attrs.id"
:summary="ClaimSummary"
:proxy-render="true"
/>
<ClaimDescriptor v-if="$attrs.id" v-bind="$attrs" :summary="ClaimSummary" />
</QPopupProxy>
</template>

View File

@ -77,10 +77,10 @@ const isDefaultAddress = (address) => {
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
};
const setDefault = (address) => {
const setDefault = async (address) => {
const url = `Clients/${route.params.id}`;
const payload = { defaultAddressFk: address.id };
axios.patch(url, payload).then((res) => {
await axios.patch(url, payload).then((res) => {
if (res.data) {
client.value.defaultAddressFk = res.data.defaultAddressFk;
sortAddresses();

View File

@ -1,9 +1,9 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import { useQuasar } from 'quasar';
import { usePrintService } from 'composables/usePrintService';
import { downloadFile } from 'src/composables/downloadFile';
import CustomerFileManagementDelete from 'src/pages/Customer/components/CustomerFileManagementDelete.vue';
@ -12,7 +12,7 @@ const { t } = useI18n();
const quasar = useQuasar();
const route = useRoute();
const router = useRouter();
const { openReport } = usePrintService();
const $props = defineProps({
id: {
type: Number,
@ -24,7 +24,7 @@ const $props = defineProps({
},
});
const setDownloadFile = () => downloadFile($props.id);
const setDownloadFile = () => openReport(`dms/${$props.id}/downloadFile`, {}, '_blank');
const toCustomerFileManagementEdit = () => {
router.push({

View File

@ -4,11 +4,6 @@ import ParkingSummary from './ParkingSummary.vue';
</script>
<template>
<QPopupProxy style="max-width: 10px">
<ParkingDescriptor
v-if="$attrs.id"
v-bind="$attrs.id"
:summary="ParkingSummary"
:proxy-render="true"
/>
<ParkingDescriptor v-if="$attrs.id" v-bind="$attrs" :summary="ParkingSummary" />
</QPopupProxy>
</template>

View File

@ -40,13 +40,11 @@ const dateRanges = computed(() => {
return { from, to };
});
const reportParams = computed(() => {
return {
recipientId: Number(route.params.id),
to: dateRange(dateRanges.value.to)[1],
from: dateRange(dateRanges.value.from)[1],
};
});
const reportParams = computed(() => ({
recipientId: Number(route.params.id),
from: dateRange(dateRanges.value.from)[0].toISOString(),
to: dateRange(dateRanges.value.to)[1].toISOString(),
}));
async function getSupplierConsumptionData() {
await arrayData.fetch({ append: false });

View File

@ -8,7 +8,6 @@ import VnRow from 'components/ui/VnRow.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnInputTime from 'components/common/VnInputTime.vue';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
@ -25,7 +24,9 @@ const { validate } = useValidator();
const { notify } = useNotify();
const router = useRouter();
const { t } = useI18n();
const canEditZone = useAcl().hasAcl('Ticket', 'editZone', 'WRITE');
const canEditZone = useAcl().hasAny([
{ model: 'Ticket', props: 'editZone', accessType: 'WRITE' },
]);
const agencyFetchRef = ref();
const warehousesOptions = ref([]);
@ -57,26 +58,38 @@ const zoneWhere = computed(() => {
});
async function getLanded(params) {
getDate(`Agencies/getLanded`, params);
const data = await getDate(`Agencies/getLanded`, params);
formData.value.landed = data.landed;
const shippedDate = new Date(params.shipped);
const landedDate = new Date(data.hour);
shippedDate.setHours(
landedDate.getHours(),
landedDate.getMinutes(),
landedDate.getSeconds(),
);
formData.value.shipped = shippedDate.toISOString();
}
async function getShipped(params) {
getDate(`Agencies/getShipped`, params);
const data = await getDate(`Agencies/getShipped`, params);
formData.value.landed = params.landed;
const [hours, minutes, seconds] = data.hour.split(':').map(Number);
let shippedDate = new Date(data.shipped);
shippedDate.setHours(hours, minutes, seconds);
formData.value.shipped = shippedDate.toISOString();
}
async function getDate(query, params) {
for (const param in params) {
if (!params[param]) return;
}
formData.value.zoneFk = null;
zonesOptions.value = [];
const { data } = await axios.get(query, { params });
if (!data) return notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
formData.value.zoneFk = data.zoneFk;
if (data.landed) formData.value.landed = data.landed;
if (data.shipped) formData.value.shipped = data.shipped;
return data;
}
const onChangeZone = async (zoneId) => {
@ -125,6 +138,7 @@ const addressId = computed({
formData.value.addressFk = val;
onChangeAddress(val);
getShipped({
shipped: formData.value?.shipped,
landed: formData.value?.landed,
addressFk: val,
agencyModeFk: formData.value?.agencyModeFk,
@ -262,8 +276,6 @@ async function getZone(options) {
<VnSelect
:label="t('ticketList.client')"
v-model="clientId"
option-value="id"
option-label="name"
url="Clients"
:fields="['id', 'name']"
sort-by="id"
@ -283,7 +295,7 @@ async function getZone(options) {
</template>
</VnSelect>
<VnSelect
:label="t('ticketList.warehouse')"
:label="t('basicData.warehouse')"
v-model="warehouseId"
option-value="id"
option-label="name"
@ -291,23 +303,38 @@ async function getZone(options) {
hide-selected
map-options
:required="true"
:rules="validate('ticketList.warehouse')"
:rules="validate('basicData.warehouse')"
/>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md no-wrap">
<VnSelect
:label="t('basicData.address')"
v-model="addressId"
option-value="id"
option-label="nickname"
:options="addresses"
hide-selected
map-options
:required="true"
:sort-by="['isActive DESC']"
:rules="validate('basicData.address')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItem
v-bind="scope.itemProps"
:class="{ disabled: !scope.opt.isActive }"
>
<QItemSection style="min-width: min-content" avatar>
<QIcon
v-if="
scope.opt.isActive &&
formData.client.defaultAddressFk === scope.opt.id
"
size="sm"
color="grey"
name="star"
class="fill-icon"
/>
</QItemSection>
<QItemSection>
<QItemLabel
:class="{
@ -333,6 +360,9 @@ async function getZone(options) {
{{ scope.opt?.agencyMode?.name }}</span
>
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
@ -414,13 +444,6 @@ async function getZone(options) {
:rules="validate('ticketList.shipped')"
@update:model-value="setShipped"
/>
<VnInputTime
:label="t('basicData.shippedHour')"
v-model="formData.shipped"
:required="true"
:rules="validate('basicData.shippedHour')"
@update:model-value="setShipped"
/>
<VnInputDate
:label="t('basicData.landed')"
v-model="formData.landed"

View File

@ -1,5 +1,4 @@
<script setup>
import { reactive } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
@ -30,31 +29,29 @@ const { t } = useI18n();
const router = useRouter();
const { notify } = useNotify();
const newTicketFormData = reactive({});
const date = new Date();
const createTicket = async () => {
async function createTicket(formData) {
const expeditionIds = $props.selectedExpeditions.map((expedition) => expedition.id);
const params = {
clientId: $props.ticket.clientFk,
landed: newTicketFormData.landed,
landed: formData.landed,
warehouseId: $props.ticket.warehouseFk,
addressId: $props.ticket.addressFk,
agencyModeId: $props.ticket.agencyModeFk,
routeId: newTicketFormData.routeFk,
routeId: formData.routeFk,
expeditionIds: expeditionIds,
};
const { data } = await axios.post('Expeditions/moveExpeditions', params);
notify(t('globals.dataSaved'), 'positive');
router.push({ name: 'TicketSummary', params: { id: data.id } });
};
}
</script>
<template>
<FormModelPopup
model="expeditionNewTicket"
:form-initial-data="newTicketFormData"
:form-initial-data="{}"
:save-fn="createTicket"
>
<template #form-inputs="{ data }">

View File

@ -20,6 +20,7 @@ export default {
'isFreezed',
'isTaxDataChecked',
'hasElectronicInvoice',
'defaultAddressFk',
'credit',
],
include: [

View File

@ -144,8 +144,6 @@ const setUserParams = (params) => {
($event) => onCategoryChange($event, searchFn)
"
:options="categoriesOptions"
option-value="id"
option-label="name"
hide-selected
dense
filled
@ -159,10 +157,7 @@ const setUserParams = (params) => {
<VnSelect
:label="t('negative.type')"
v-model="params.typeFk"
@update:model-value="searchFn()"
:options="itemTypesOptions"
option-value="id"
option-label="name"
hide-selected
dense
filled

View File

@ -121,7 +121,7 @@ const ticketColumns = computed(() => [
format: (row, dashIfEmpty) => dashIfEmpty(row.lines),
},
{
align: 'left',
align: 'right',
label: t('advanceTickets.import'),
name: 'totalWithVat',
hidden: true,
@ -172,6 +172,15 @@ const ticketColumns = computed(() => [
headerClass: 'horizontal-separator',
name: 'futureLiters',
},
{
label: t('advanceTickets.preparation'),
name: 'futurePreparation',
field: 'futurePreparation',
align: 'left',
sortable: true,
headerClass: 'horizontal-separator',
columnFilter: false,
},
{
align: 'left',
label: t('advanceTickets.futureZone'),
@ -196,15 +205,17 @@ const ticketColumns = computed(() => [
label: t('advanceTickets.notMovableLines'),
headerClass: 'horizontal-separator',
name: 'notMovableLines',
class: 'shrink',
},
{
align: 'left',
label: t('advanceTickets.futureLines'),
headerClass: 'horizontal-separator',
name: 'futureLines',
class: 'shrink',
},
{
align: 'left',
align: 'right',
label: t('advanceTickets.futureImport'),
name: 'futureTotalWithVat',
hidden: true,
@ -385,7 +396,12 @@ watch(
if (!$el) return;
const head = $el.querySelector('thead');
const firstRow = $el.querySelector('thead > tr');
const headSelectionCol = $el.querySelector(
'thead tr.bg-header th.q-table--col-auto-width',
);
if (headSelectionCol) {
headSelectionCol.classList.add('horizontal-separator');
}
const newRow = document.createElement('tr');
destinationElRef.value = document.createElement('th');
originElRef.value = document.createElement('th');
@ -394,8 +410,10 @@ watch(
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
destinationElRef.value.setAttribute('colspan', '7');
originElRef.value.setAttribute('colspan', '9');
originElRef.value.classList.add('advance-icon');
destinationElRef.value.setAttribute('colspan', '9');
originElRef.value.setAttribute('colspan', '11');
destinationElRef.value.textContent = `${t(
'advanceTickets.destination',
@ -490,8 +508,6 @@ watch(
selection: 'multiple',
}"
v-model:selected="selectedTickets"
:pagination="{ rowsPerPage: 0 }"
:no-data-label="$t('globals.noResults')"
:right-search="false"
:order="['futureTotalWithVat ASC']"
auto-load

View File

@ -65,7 +65,7 @@ onMounted(async () => await getItemPackingTypes());
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<template #body="{ params }">
<QItem class="q-my-sm">
<QItemSection>
<VnInputDate
@ -93,12 +93,10 @@ onMounted(async () => await getItemPackingTypes());
option-value="code"
option-label="description"
:info="t('iptInfo')"
@update:model-value="searchFn()"
dense
filled
:use-like="false"
>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -110,12 +108,10 @@ onMounted(async () => await getItemPackingTypes());
option-value="code"
option-label="description"
:info="t('iptInfo')"
@update:model-value="searchFn()"
dense
filled
:use-like="false"
>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -134,7 +130,6 @@ onMounted(async () => await getItemPackingTypes());
:label="t('params.isFullMovable')"
v-model="params.isFullMovable"
toggle-indeterminate
@update:model-value="searchFn()"
dense
/>
</QItemSection>
@ -157,13 +152,9 @@ onMounted(async () => await getItemPackingTypes());
:label="t('params.warehouseFk')"
v-model="params.warehouseFk"
:options="warehousesOptions"
option-value="id"
option-label="name"
@update:model-value="searchFn()"
dense
filled
>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -172,7 +163,6 @@ onMounted(async () => await getItemPackingTypes());
toggle-indeterminate
:label="t('params.onlyWithDestination')"
v-model="params.onlyWithDestination"
@update:model-value="searchFn()"
dense
/>
</QItemSection>

View File

@ -49,7 +49,7 @@ const groupedStates = ref([]);
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<template #body="{ params }">
<QItem>
<QItemSection>
<VnInput v-model="params.clientFk" :label="t('Customer ID')" filled />
@ -97,10 +97,7 @@ const groupedStates = ref([]);
<VnSelect
:label="t('State')"
v-model="params.stateFk"
@update:model-value="searchFn()"
:options="states"
option-value="id"
option-label="name"
emit-value
map-options
use-input
@ -117,7 +114,6 @@ const groupedStates = ref([]);
<VnSelect
:label="t('params.groupedStates')"
v-model="params.groupedStates"
@update:model-value="searchFn()"
:options="groupedStates"
option-label="code"
emit-value
@ -152,7 +148,6 @@ const groupedStates = ref([]);
<QItemSection>
<QCheckbox
v-model="params.myTeam"
@update:model-value="searchFn()"
:label="t('My team')"
toggle-indeterminate
/>
@ -160,7 +155,6 @@ const groupedStates = ref([]);
<QItemSection>
<QCheckbox
v-model="params.pending"
@update:model-value="searchFn()"
:label="t('Pending')"
toggle-indeterminate
/>
@ -170,7 +164,6 @@ const groupedStates = ref([]);
<QItemSection>
<QCheckbox
v-model="params.hasInvoice"
@update:model-value="searchFn()"
:label="t('Invoiced')"
toggle-indeterminate
/>
@ -178,7 +171,6 @@ const groupedStates = ref([]);
<QItemSection>
<QCheckbox
v-model="params.hasRoute"
@update:model-value="searchFn()"
:label="t('Routed')"
toggle-indeterminate
/>
@ -192,10 +184,7 @@ const groupedStates = ref([]);
<VnSelect
:label="t('Province')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provinces"
option-value="id"
option-label="name"
emit-value
map-options
use-input
@ -212,7 +201,6 @@ const groupedStates = ref([]);
<VnSelect
:label="t('Agency')"
v-model="params.agencyModeFk"
@update:model-value="searchFn()"
:options="agencies"
emit-value
map-options
@ -230,10 +218,7 @@ const groupedStates = ref([]);
<VnSelect
:label="t('Warehouse')"
v-model="params.warehouseFk"
@update:model-value="searchFn()"
:options="warehouses"
option-value="id"
option-label="name"
emit-value
map-options
use-input

View File

@ -85,11 +85,12 @@ const ticketColumns = computed(() => [
label: t('advanceTickets.liters'),
name: 'liters',
align: 'left',
class: 'shrink',
headerClass: 'horizontal-separator',
},
{
label: t('advanceTickets.import'),
name: 'import',
name: 'totalWithVat',
align: 'left',
headerClass: 'horizontal-separator',
columnFilter: false,
@ -177,7 +178,12 @@ watch(
if (!$el) return;
const head = $el.querySelector('thead');
const firstRow = $el.querySelector('thead > tr');
const headSelectionCol = $el.querySelector(
'thead tr.bg-header th.q-table--col-auto-width',
);
if (headSelectionCol) {
headSelectionCol.classList.add('horizontal-separator');
}
const newRow = document.createElement('tr');
destinationElRef.value = document.createElement('th');
originElRef.value = document.createElement('th');
@ -185,9 +191,10 @@ watch(
newRow.classList.add('bg-header');
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
originElRef.value.classList.add('advance-icon');
destinationElRef.value.setAttribute('colspan', '7');
originElRef.value.setAttribute('colspan', '9');
destinationElRef.value.setAttribute('colspan', '9');
originElRef.value.setAttribute('colspan', '7');
originElRef.value.textContent = `${t('advanceTickets.origin')}`;
destinationElRef.value.textContent = `${t('advanceTickets.destination')}`;
@ -317,7 +324,7 @@ watch(
</QBadge>
<span v-else> {{ dashIfEmpty(row.state) }}</span>
</template>
<template #column-import="{ row }">
<template #column-totalWithVat="{ row }">
<QBadge
:text-color="
totalPriceColor(row.totalWithVat) === 'warning'
@ -371,4 +378,12 @@ watch(
:deep(.horizontal-bottom-separator) {
border-bottom: 4px solid white !important;
}
:deep(th.advance-icon::after) {
content: '>>';
font-size: larger;
position: absolute;
text-align: center;
float: 0;
left: 0;
}
</style>

View File

@ -67,7 +67,7 @@ onMounted(async () => {
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<template #body="{ params }">
<QItem class="q-my-sm">
<QItemSection>
<VnInputDate
@ -113,11 +113,9 @@ onMounted(async () => {
option-value="code"
option-label="description"
:info="t('iptInfo')"
@update:model-value="searchFn()"
dense
filled
>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -129,11 +127,9 @@ onMounted(async () => {
option-value="code"
option-label="description"
:info="t('iptInfo')"
@update:model-value="searchFn()"
dense
filled
>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -142,13 +138,9 @@ onMounted(async () => {
:label="t('params.state')"
v-model="params.state"
:options="stateOptions"
option-value="id"
option-label="name"
@update:model-value="searchFn()"
dense
filled
>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -157,13 +149,9 @@ onMounted(async () => {
:label="t('params.futureState')"
v-model="params.futureState"
:options="stateOptions"
option-value="id"
option-label="name"
@update:model-value="searchFn()"
dense
filled
>
</VnSelect>
/>
</QItemSection>
</QItem>
@ -173,7 +161,6 @@ onMounted(async () => {
:label="t('params.problems')"
v-model="params.problems"
:toggle-indeterminate="false"
@update:model-value="searchFn()"
/>
</QItemSection>
</QItem>
@ -183,13 +170,9 @@ onMounted(async () => {
:label="t('params.warehouseFk')"
v-model="params.warehouseFk"
:options="warehousesOptions"
option-value="id"
option-label="name"
@update:model-value="searchFn()"
dense
filled
>
</VnSelect>
/>
</QItemSection>
</QItem>
</template>

View File

@ -579,7 +579,7 @@ function setReference(data) {
hide-selected
required
@update:model-value="() => onClientSelected(data)"
:sort-by="'id ASC'"
:sort-by="['id ASC']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -605,7 +605,7 @@ function setReference(data) {
map-options
required
:disable="!data.clientId"
:sort-by="'isActive DESC'"
:sort-by="['isActive DESC']"
@update:model-value="() => fetchAvailableAgencies(data)"
>
<template #option="scope">

View File

@ -120,6 +120,7 @@ basicData:
difference: Difference
total: Total
price: Price
warehouse: Warehouse
newPrice: New price
chargeDifference: Charge difference to
withoutNegatives: Create without negatives

View File

@ -47,6 +47,7 @@ basicData:
difference: Diferencia
total: Total
price: Precio
warehouse: Almacén
newPrice: Nuevo precio
chargeDifference: Cargar diferencia a
withoutNegatives: Crear sin negativos

View File

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

View File

@ -4,9 +4,11 @@ import VnCard from 'src/components/common/VnCard.vue';
</script>
<template>
<VnCard
data-key="Worker"
:data-key="$attrs['data-key'] ?? 'Worker'"
url="Workers/summary"
:id-in-where="true"
:descriptor="WorkerDescriptor"
v-bind="$attrs"
v-on="$attrs"
/>
</template>

View File

@ -2,7 +2,6 @@
import { computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import EntityDescriptor from 'src/components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
@ -11,6 +10,8 @@ import VnImg from 'src/components/ui/VnImg.vue';
import EditPictureForm from 'components/EditPictureForm.vue';
import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue';
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import WorkerCard from './WorkerCard.vue';
const $props = defineProps({
id: {
@ -52,14 +53,17 @@ const handlePhotoUpdated = (evt = false) => {
};
</script>
<template>
<EntityDescriptor
<CardDescriptor
v-bind="$attrs"
ref="cardDescriptorRef"
:data-key="dataKey"
:summary="$props.summary"
url="Workers/summary"
:card="WorkerCard"
:id="entityId"
:filter="{ where: { id: entityId } }"
title="user.nickname"
@on-fetch="getIsExcluded"
module="Worker"
>
<template #menu="{ entity }">
<WorkerDescriptorMenu
@ -165,7 +169,7 @@ const handlePhotoUpdated = (evt = false) => {
</QBtn>
</QCardActions>
</template>
</EntityDescriptor>
</CardDescriptor>
<VnChangePassword
ref="changePassRef"
:submit-fn="

View File

@ -2,7 +2,6 @@
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
import { axiosNoError } from 'src/boot/axios';
import FetchData from 'components/FetchData.vue';
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
@ -282,10 +281,10 @@ const fetchWeekData = async () => {
};
try {
const [{ data: mailData }, { data: countData }] = await Promise.all([
axiosNoError.get(`Workers/${route.params.id}/mail`, {
axios.get(`Workers/${route.params.id}/mail`, {
params: { filter: { where } },
}),
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
axios.get('WorkerTimeControlMails/count', { params: { where } }),
]);
const mail = mailData[0];
@ -293,8 +292,9 @@ const fetchWeekData = async () => {
state.value = mail?.state;
reason.value = mail?.reason;
canResend.value = !!countData.count;
} catch {
} catch (error) {
state.value = null;
if (error?.status != 403) throw error;
}
};

View File

@ -89,7 +89,7 @@ watch(
v-model="formData.geoFk"
url="Postcodes/location"
:fields="['geoFk', 'code', 'townFk', 'countryFk']"
:sort-by="'code ASC'"
:sort-by="['code ASC']"
option-value="geoFk"
option-label="code"
:filter-options="['code']"

View File

@ -188,16 +188,14 @@ const exprBuilder = (param, value) => {
return {
code: { like: `%${value}%` },
};
case 'id':
case 'price':
case 'agencyModeFk':
return {
agencyModeFk: value,
[param]: value,
};
case 'search':
return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
case 'price':
return {
price: value,
};
}
};

View File

@ -6,6 +6,9 @@ const FINDED_PATHS = ['src', E2E_PATH];
function getGitDiff(options) {
const TARGET_BRANCH = options[2] || 'dev';
execSync(`git fetch origin ${TARGET_BRANCH}`, {
encoding: 'utf-8',
});
const diff = execSync(`git diff --name-only origin/${TARGET_BRANCH}`, {
encoding: 'utf-8',
});

View File

@ -76,8 +76,8 @@ describe('TicketList', () => {
});
}).as('ticket');
cy.get('[data-cy="Warehouse_select"]').type('Warehouse Five');
cy.get('.q-menu .q-item').contains('Warehouse Five').click();
cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse Five');
cy.searchBtnFilterPanel();
cy.wait('@ticket').then((interception) => {
const data = interception.response.body[1];
expect(data.hasComponentLack).to.equal(1);