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

This commit is contained in:
Alex Moreno 2025-04-30 10:00:13 +02:00
commit 15010d3e41
10 changed files with 64 additions and 28 deletions

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;
@ -369,6 +371,8 @@ function getCaption(opt) {
:input-debounce="useURL ? '300' : '0'"
:loading="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

@ -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

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

View File

@ -291,7 +291,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"
@ -299,7 +299,7 @@ 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">

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

@ -85,6 +85,7 @@ const ticketColumns = computed(() => [
label: t('advanceTickets.liters'),
name: 'liters',
align: 'left',
class: 'shrink',
headerClass: 'horizontal-separator',
},
{
@ -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')}`;
@ -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

@ -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

@ -280,7 +280,7 @@ const fetchWeekData = async () => {
week: selectedWeekNumber.value,
};
try {
const [{ data: mailData }, { data: countData }] = await Promise.allS([
const [{ data: mailData }, { data: countData }] = await Promise.all([
axios.get(`Workers/${route.params.id}/mail`, {
params: { filter: { where } },
}),
@ -292,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

@ -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);