0
0
Fork 0

Merge branch 'dev' into 7180_bug_supplierListScroll

This commit is contained in:
Javier Segarra 2024-04-18 11:06:33 +00:00
commit 82937a103d
20 changed files with 206 additions and 103 deletions

View File

@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- (Tickets) => Se añade la opción de clonar ticket. #6951
- (Parking) => Se añade la sección Parking. #5186
- (Rutas) => Se añade el campo "servida" a la tabla y se añade también a los filtros. #7130
### Changed
### Fixed

View File

@ -26,7 +26,7 @@ const value = computed({
emit('update:modelValue', value);
},
});
const hover = ref(false);
const styleAttrs = computed(() => {
return $props.isOutlined
? {
@ -41,6 +41,10 @@ const onEnterPress = () => {
emit('keyup.enter');
};
const handleValue = (val = null) => {
value.value = val;
};
const focus = () => {
vnInputRef.value.focus();
};
@ -51,20 +55,33 @@ defineExpose({
</script>
<template>
<div
@mouseover="hover = true"
@mouseleave="hover = false"
:rules="$attrs.required ? [requiredFieldRule] : null"
>
<QInput
ref="vnInputRef"
v-model="value"
v-bind="{ ...$attrs, ...styleAttrs }"
type="text"
:type="$attrs.type"
:class="{ required: $attrs.required }"
@keyup.enter="onEnterPress()"
:rules="$attrs.required ? [requiredFieldRule] : null"
:clearable="false"
>
<template v-if="$slots.prepend" #prepend>
<slot name="prepend" />
</template>
<template v-if="$slots.append" #append>
<slot name="append" />
<template #append>
<slot name="append" v-if="$slots.append" />
<QIcon
name="close"
size="xs"
v-if="hover && value"
@click="handleValue(null)"
></QIcon>
</template>
</QInput>
</div>
</template>

View File

@ -1,7 +1,6 @@
<script setup>
import { computed, ref } from 'vue';
import VnInput from 'components/common/VnInput.vue';
import isValidDate from "filters/isValidDate";
import isValidDate from 'filters/isValidDate';
const props = defineProps({
modelValue: {
@ -17,6 +16,8 @@ const props = defineProps({
default: false,
},
});
const hover = ref(false);
const emit = defineEmits(['update:modelValue']);
const joinDateAndTime = (date, time) => {
@ -77,14 +78,21 @@ const styleAttrs = computed(() => {
</script>
<template>
<VnInput
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
class="vn-input-date"
readonly
:model-value="displayDate(value)"
v-bind="{ ...$attrs, ...styleAttrs }"
readonly
@click="isPopupOpen = true"
>
<template #append>
<QIcon
name="close"
size="xs"
v-if="hover && value"
@click="onDateUpdate(null)"
></QIcon>
<QIcon name="event" class="cursor-pointer">
<QPopupProxy
v-model="isPopupOpen"
@ -94,13 +102,15 @@ const styleAttrs = computed(() => {
:no-parent-event="props.readonly"
>
<QDate
:today-btn="true"
:model-value="formatDate(value)"
@update:model-value="onDateUpdate"
/>
</QPopupProxy>
</QIcon>
</template>
</VnInput>
</QInput>
</div>
</template>
<style lang="scss">

View File

@ -2,7 +2,6 @@
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import isValidDate from 'filters/isValidDate';
import VnInput from "components/common/VnInput.vue";
const props = defineProps({
modelValue: {
@ -20,6 +19,7 @@ const props = defineProps({
});
const { t } = useI18n();
const emit = defineEmits(['update:modelValue']);
const value = computed({
get() {
return props.modelValue;
@ -27,12 +27,7 @@ const value = computed({
set(value) {
const [hours, minutes] = value.split(':');
const date = new Date(props.modelValue);
date.setHours(
Number.parseInt(hours) || 0,
Number.parseInt(minutes) || 0,
0,
0
);
date.setHours(Number.parseInt(hours) || 0, Number.parseInt(minutes) || 0, 0, 0);
emit('update:modelValue', value ? date.toISOString() : null);
},
});
@ -71,7 +66,7 @@ const styleAttrs = computed(() => {
</script>
<template>
<VnInput
<QInput
class="vn-input-time"
readonly
:model-value="formatTime(value)"
@ -79,7 +74,7 @@ const styleAttrs = computed(() => {
@click="isPopupOpen = true"
>
<template #append>
<QIcon name="event" class="cursor-pointer">
<QIcon name="schedule" class="cursor-pointer">
<QPopupProxy
v-model="isPopupOpen"
cover
@ -111,7 +106,7 @@ const styleAttrs = computed(() => {
</QPopupProxy>
</QIcon>
</template>
</VnInput>
</QInput>
</template>
<style lang="scss">

View File

@ -1,4 +1,4 @@
customerFilter:
filter:
name: 'Name'
socialName: 'Social name'
name: Name
socialName: Social name

View File

@ -1,4 +1,4 @@
customerFilter:
filter:
name: 'Nombre'
socialName: 'Razón Social'
name: Nombre
socialName: Razón Social

View File

@ -1,8 +1,8 @@
entryList:
list:
inventoryEntry: 'Inventory entry'
virtualEntry: 'Virtual entry'
inventoryEntry: Inventory entry
virtualEntry: Virtual entry
entryFilter:
filter:
search: 'General search'
reference: 'Reference'
search: General search
reference: Reference

View File

@ -1,8 +1,8 @@
entryList:
list:
inventoryEntry: 'Es inventario'
virtualEntry: 'Es una redada'
inventoryEntry: Es inventario
virtualEntry: Es una redada
entryFilter:
filter:
search: 'Búsqueda general'
reference: 'Referencia'
search: Búsqueda general
reference: Referencia

View File

@ -257,7 +257,7 @@ const requiredFieldRule = (val) => val || t('globals.requiredField');
const isAdministrative = () => hasAny(['administrative']);
const isAgricultural = () =>
invoiceIn.value.supplier.sageWithholdingFk == config.value[0].sageWithholdingFk;
invoiceIn.value?.supplier?.sageWithholdingFk === config.value[0]?.sageWithholdingFk;
function showPdfInvoice() {
if (isAgricultural()) openReport(`InvoiceIns/${entityId.value}/invoice-in-pdf`);

View File

@ -197,6 +197,15 @@ const warehouseList = ref([]);
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.isOk"
:label="t('Served')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
@ -212,6 +221,7 @@ en:
workerFk: Worker
from: From
to: To
Served: Served
es:
params:
warehouseFk: Almacén
@ -229,4 +239,5 @@ es:
Worker: Trabajador
From: Desde
To: Hasta
Served: Servida
</i18n>

View File

@ -11,8 +11,8 @@ import VnInputDate from 'components/common/VnInputDate.vue';
import VnInput from 'components/common/VnInput.vue';
import axios from 'axios';
import VnInputTime from 'components/common/VnInputTime.vue';
import RouteSearchbar from "pages/Route/Card/RouteSearchbar.vue";
import {useStateStore} from "stores/useStateStore";
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
const { t } = useI18n();
const route = useRoute();
@ -26,6 +26,7 @@ const defaultInitialData = {
description: '',
vehicleFk: null,
workerFk: null,
isOk: false,
};
const workerList = ref([]);
@ -211,6 +212,7 @@ const onSave = (data, response) => {
size="sm"
v-model="data.isOk"
:label="t('Is served')"
clearable
/>
</div>
</VnRow>

View File

@ -187,6 +187,15 @@ const ticketColumns = ref([
:label="t('route.summary.packages')"
:value="getTotalPackages(entity.tickets)"
/>
<QCheckbox
:label="
entity.route.isOk
? t('route.summary.closed')
: t('route.summary.open')
"
v-model="entity.route.isOk"
:disable="true"
/>
</QCard>
<QCard class="vn-one">
<div class="header">
@ -278,6 +287,10 @@ en:
m3:
packaging: Packaging
ticket: Ticket
closed: Closed
open: Open
yes: Yes
no: No
es:
route:
summary:
@ -301,4 +314,8 @@ es:
client: Cliente
warehouse: Almacén
packaging: Encajado
closed: Cerrada
open: Abierta
yes:
no: No
</i18n>

View File

@ -95,6 +95,13 @@ const columns = computed(() => [
sortable: true,
align: 'left',
},
{
name: 'isServed',
label: t('Served'),
field: (row) => Boolean(row.isOk),
sortable: true,
align: 'left',
},
{
name: 'actions',
label: '',
@ -265,7 +272,7 @@ const openTicketsDialog = (id) => {
auto-load
>
<template #body="{ rows }">
<div class="q-pa-md">
<div class="q-pa-md route-table">
<QTable
v-model:selected="selectedRows"
:columns="columns"
@ -279,7 +286,7 @@ const openTicketsDialog = (id) => {
:no-data-label="t('globals.noResults')"
>
<template #body-cell-worker="{ row }">
<QTd>
<QTd class="table-input-cell">
<VnSelectFilter
:label="t('Worker')"
v-model="row.workerFk"
@ -312,7 +319,7 @@ const openTicketsDialog = (id) => {
</QTd>
</template>
<template #body-cell-agency="{ row }">
<QTd>
<QTd class="table-input-cell">
<VnSelectFilter
:label="t('Agency')"
v-model="row.agencyModeFk"
@ -329,7 +336,7 @@ const openTicketsDialog = (id) => {
</QTd>
</template>
<template #body-cell-vehicle="{ row }">
<QTd>
<QTd class="table-input-cell">
<VnSelectFilter
:label="t('Vehicle')"
v-model="row.vehicleFk"
@ -397,6 +404,19 @@ const openTicketsDialog = (id) => {
/>
</QTd>
</template>
<template #body-cell-isServed="props">
<QTd>
<QCheckbox v-model="props.value" disable>
<QTooltip>
{{
props.value
? t('Route is closed')
: t('Route is not served')
}}
</QTooltip>
</QCheckbox>
</QTd>
</template>
<template #body-cell-actions="props">
<QTd :props="props">
<div class="flex items-center no-wrap table-actions">
@ -455,7 +475,7 @@ const openTicketsDialog = (id) => {
<style lang="scss" scoped>
.table-input-cell {
min-width: 150px;
max-width: 143px;
}
.route-list {
@ -466,6 +486,11 @@ const openTicketsDialog = (id) => {
.table-actions {
gap: 12px;
}
.lock-icon-cell {
text-align: center;
margin-left: -20%;
}
</style>
<i18n>
en:
@ -479,6 +504,7 @@ es:
Description: Descripción
Hour started: Hora inicio
Hour finished: Hora fin
Served: Servida
newRoute: Nueva Ruta
Clone Selected Routes: Clonar rutas seleccionadas
Select the starting date: Seleccione la fecha de inicio
@ -490,4 +516,6 @@ es:
Add ticket: Añadir tickets
Preview: Vista previa
Summary: Resumen
Route is closed: La ruta está cerrada
Route is not served: La ruta no está servida
</i18n>

View File

@ -1,6 +1,6 @@
travelFilter:
filter:
warehouseOutFk: 'Warehouse Out'
warehouseInFk: 'Warehouse In'
agencyModeFk: 'Agency'
scopeDays: 'Days onward'
warehouseOutFk: Warehouse Out
warehouseInFk: Warehouse In
agencyModeFk: Agency
scopeDays: Days onward

View File

@ -1,6 +1,6 @@
travelFilter:
filter:
warehouseInFk: 'Alm. entrada'
warehouseOutFk: 'Alm. salida'
agencyModeFk: 'Agencia'
scopeDays: 'Días adelante'
warehouseInFk: Alm. entrada
warehouseOutFk: Alm. salida
agencyModeFk: Agencia
scopeDays: Días adelante

View File

@ -1,7 +1,8 @@
const locationOptions ='[role="listbox"] > div.q-virtual-scroll__content > .q-item'
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
describe('VnLocation', () => {
describe('Create', () => {
const inputLocation = ':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
const inputLocation =
'.q-form .q-card> :nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@ -24,7 +25,7 @@ describe('VnLocation', () => {
cy.get(inputLocation).type('ecuador');
cy.get(locationOptions).should('have.length.at.least', 1);
cy.get(`${locationOptions}:nth-child(1)`).click();
cy.get(':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon').click();
cy.get(inputLocation + '> :nth-child(2) > .q-icon').click();
});
});
describe('Fiscal-data', () => {
@ -35,14 +36,29 @@ describe('VnLocation', () => {
cy.waitForElement('.q-card');
});
it('Create postCode', function () {
cy.get(':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(3) > .q-icon').click();
cy.get(
':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(3) > .q-icon'
).click();
cy.get(' .q-card > h1').should('have.text', 'New postcode');
cy.get('.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input').clear('12');
cy.get('.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input').type('1234453');
cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'Valencia');
cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control ', 'Province one');
cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'España');
cy.get(
'.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input'
).clear('12');
cy.get(
'.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input'
).type('1234453');
cy.selectOption(
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ',
'Valencia'
);
cy.selectOption(
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control ',
'Province one'
);
cy.selectOption(
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ',
'España'
);
cy.get('.q-mt-lg > .q-btn--standard').click();
});
});
})
});

View File

@ -8,6 +8,7 @@ describe('ClaimDevelopment', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
cy.waitForElement('tbody');
});
it('should reset line', () => {

View File

@ -1,6 +1,6 @@
/// <reference types="cypress" />
describe('InvoiceInBasicData', () => {
const selects = ':nth-child(1) > :nth-child(1) > .q-field';
const selects = '.q-form .q-card>:nth-child(1) > :nth-child(1) > .q-field';
const appendBtns = 'label button';
const dialogAppendBtns = '.q-dialog label button';
const dialogInputs = '.q-dialog input';

View File

@ -72,6 +72,7 @@ Cypress.Commands.add('getValue', (selector) => {
// Fill Inputs
Cypress.Commands.add('selectOption', (selector, option) => {
cy.waitForElement(selector);
cy.get(selector).find('.q-select__dropdown-icon').click();
cy.get('.q-menu .q-item').contains(option).click();
});
@ -183,11 +184,11 @@ Cypress.Commands.add('closeSideMenu', (element) => {
Cypress.Commands.add('clearSearchbar', (element) => {
if (element) cy.waitForElement(element);
cy.get('#searchbar > form > label > div:nth-child(1) input').clear();
cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').clear();
});
Cypress.Commands.add('writeSearchbar', (value) => {
cy.get('#searchbar > form > label > div:nth-child(1) input').type(value);
cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(value);
});
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);

View File

@ -27,7 +27,10 @@ export default defineConfig({
sassVariables: 'src/quasar-variables.scss',
}),
VueI18nPlugin({
include: path.resolve(__dirname, 'src/i18n/**'),
include: [
path.resolve(__dirname, 'src/i18n/**'),
path.resolve(__dirname, 'src/pages/**/locale/**'),
],
}),
jsconfigPaths(),
],