feat: refs #6897 enhance entry management with new filters and localization updates
This commit is contained in:
parent
abce9c66ee
commit
962a49868e
|
@ -28,6 +28,7 @@ const hover = ref();
|
||||||
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
||||||
|
|
||||||
async function orderBy(name, direction) {
|
async function orderBy(name, direction) {
|
||||||
|
console.log('orderBy');
|
||||||
if (!name) return;
|
if (!name) return;
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case 'DESC':
|
case 'DESC':
|
||||||
|
@ -40,7 +41,11 @@ async function orderBy(name, direction) {
|
||||||
direction = 'DESC';
|
direction = 'DESC';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
console.log('name: ', name);
|
||||||
if (!direction) return await arrayData.deleteOrder(name);
|
if (!direction) return await arrayData.deleteOrder(name);
|
||||||
|
|
||||||
|
console.log('direction: ', direction);
|
||||||
|
console.log('name: ', name);
|
||||||
await arrayData.addOrder(name, direction);
|
await arrayData.addOrder(name, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,6 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
const isSelect = selectRegex.test(column?.component);
|
const isSelect = selectRegex.test(column?.component);
|
||||||
if (isSelect) column.attrs = { ...column.attrs, 'emit-value': false };
|
if (isSelect) column.attrs = { ...column.attrs, 'emit-value': false };
|
||||||
|
|
||||||
console.log('row[column.name]: ', row[column.name]);
|
|
||||||
const node = h(VnColumn, {
|
const node = h(VnColumn, {
|
||||||
row: row,
|
row: row,
|
||||||
class: 'temp-input',
|
class: 'temp-input',
|
||||||
|
@ -410,7 +409,6 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
'update:modelValue': async (value) => {
|
'update:modelValue': async (value) => {
|
||||||
if (isSelect) {
|
if (isSelect) {
|
||||||
console.log('value: ', value);
|
|
||||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
row[column?.name + 'TextValue'] =
|
row[column?.name + 'TextValue'] =
|
||||||
value[column.attrs?.optionLabel ?? 'name'];
|
value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
@ -521,7 +519,6 @@ function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
|
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
|
||||||
return dashIfEmpty(row[col?.name + 'TextValue']);
|
return dashIfEmpty(row[col?.name + 'TextValue']);
|
||||||
} else {
|
} else {
|
||||||
console.log('format');
|
|
||||||
return col.format(row, dashIfEmpty);
|
return col.format(row, dashIfEmpty);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -498,7 +498,6 @@ entry:
|
||||||
entryTypeDescription: Tipo entrada
|
entryTypeDescription: Tipo entrada
|
||||||
invoiceAmount: Importe
|
invoiceAmount: Importe
|
||||||
dated: Fecha
|
dated: Fecha
|
||||||
|
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: Ticket ID
|
ticketFk: Ticket ID
|
||||||
|
|
|
@ -127,16 +127,26 @@ async function deleteEntry() {
|
||||||
width="lg-width"
|
width="lg-width"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
<QItem
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="showEntryReport(entity)"
|
||||||
|
data-cy="show-entry-report"
|
||||||
|
>
|
||||||
<QItemSection>{{ t('Show entry report') }}</QItemSection>
|
<QItemSection>{{ t('Show entry report') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="recalculateRates(entity)">
|
<QItem
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="recalculateRates(entity)"
|
||||||
|
data-cy="recalculate-rates"
|
||||||
|
>
|
||||||
<QItemSection>{{ t('Recalculate rates') }}</QItemSection>
|
<QItemSection>{{ t('Recalculate rates') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="cloneEntry(entity)">
|
<QItem v-ripple clickable @click="cloneEntry(entity)" data-cy="clone-entry">
|
||||||
<QItemSection>{{ t('Clone') }}</QItemSection>
|
<QItemSection>{{ t('Clone') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="deleteEntry(entity)">
|
<QItem v-ripple clickable @click="deleteEntry(entity)" data-cy="delete-entry">
|
||||||
<QItemSection>{{ t('Delete') }}</QItemSection>
|
<QItemSection>{{ t('Delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -55,11 +55,7 @@ const entryFilterPanel = ref();
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{
|
{{ t('params.isExcludedFromAvailable') }}
|
||||||
t(
|
|
||||||
'entry.list.tableVisibleColumns.isExcludedFromAvailable',
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QCheckbox>
|
</QCheckbox>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -218,70 +214,7 @@ const entryFilterPanel = ref();
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('params.entryTypeCode')"
|
|
||||||
v-model="params.entryTypeCode"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('params.agencyModeId')"
|
|
||||||
v-model="params.agencyModeId"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
url="AgencyModes"
|
|
||||||
:fields="['id', 'name']"
|
|
||||||
hide-selected
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
v-model="params.evaNotes"
|
|
||||||
:label="t('params.evaNotes')"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('params.warehouseOutFk')"
|
|
||||||
v-model="params.warehouseOutFk"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
url="Warehouses"
|
|
||||||
:fields="['id', 'name']"
|
|
||||||
hide-selected
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('params.warehouseInFk')"
|
|
||||||
v-model="params.warehouseInFk"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
url="Warehouses"
|
|
||||||
:fields="['id', 'name']"
|
|
||||||
hide-selected
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -299,6 +232,15 @@ const entryFilterPanel = ref();
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.evaNotes"
|
||||||
|
:label="t('params.evaNotes')"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -268,7 +268,6 @@ onBeforeMount(async () => {
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Entries/filter',
|
url: 'Entries/filter',
|
||||||
order: 'id DESC',
|
|
||||||
userFilter: entryQueryFilter,
|
userFilter: entryQueryFilter,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
@ -292,7 +291,6 @@ onBeforeMount(async () => {
|
||||||
companyFk: user?.companyFk,
|
companyFk: user?.companyFk,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
order="id DESC"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="entry"
|
redirect="entry"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
@ -320,6 +318,7 @@ onBeforeMount(async () => {
|
||||||
:onFilterTravelSelected="
|
:onFilterTravelSelected="
|
||||||
(data, result) => (data.travelFk = result)
|
(data, result) => (data.travelFk = result)
|
||||||
"
|
"
|
||||||
|
data-cy="entry-travel-select"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
|
|
@ -132,6 +132,7 @@ entry:
|
||||||
showEntryReport: Show entry report
|
showEntryReport: Show entry report
|
||||||
entryFilter:
|
entryFilter:
|
||||||
params:
|
params:
|
||||||
|
isExcludedFromAvailable: Exclude from inventory
|
||||||
invoiceNumber: Invoice number
|
invoiceNumber: Invoice number
|
||||||
travelFk: Travel
|
travelFk: Travel
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
|
@ -143,8 +144,16 @@ entryFilter:
|
||||||
isBooked: Booked
|
isBooked: Booked
|
||||||
isConfirmed: Confirmed
|
isConfirmed: Confirmed
|
||||||
isOrdered: Ordered
|
isOrdered: Ordered
|
||||||
|
isReceived: Received
|
||||||
search: General search
|
search: General search
|
||||||
reference: Reference
|
reference: Reference
|
||||||
|
landed: Landed
|
||||||
|
id: Id
|
||||||
|
agencyModeId: Agency
|
||||||
|
evaNotes: Notes
|
||||||
|
warehouseOutFk: Origin
|
||||||
|
warehouseInFk: Destiny
|
||||||
|
entryTypeCode: Entry type
|
||||||
myEntries:
|
myEntries:
|
||||||
id: ID
|
id: ID
|
||||||
landed: Landed
|
landed: Landed
|
||||||
|
|
|
@ -133,19 +133,22 @@ entry:
|
||||||
workerFk: Comprador
|
workerFk: Comprador
|
||||||
entryFilter:
|
entryFilter:
|
||||||
params:
|
params:
|
||||||
invoiceNumber: Núm. factura
|
isExcludedFromAvailable: Inventario
|
||||||
travelFk: Envío
|
|
||||||
companyFk: Empresa
|
|
||||||
currencyFk: Moneda
|
|
||||||
supplierFk: Proveedor
|
|
||||||
from: Desde
|
|
||||||
to: Hasta
|
|
||||||
created: Fecha creación
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
isOrdered: Pedida
|
||||||
search: Búsqueda general
|
isConfirmed: Confirmado
|
||||||
reference: Referencia
|
isReceived: Recibida
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Fecha
|
||||||
|
id: Id
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Modo agencia
|
||||||
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeCode: Tipo de entrada
|
||||||
|
hasToShowDeletedEntries: Mostrar entradas eliminadas
|
||||||
myEntries:
|
myEntries:
|
||||||
id: ID
|
id: ID
|
||||||
landed: F. llegada
|
landed: F. llegada
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
describe('Entry', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('buyer');
|
||||||
|
cy.visit(`/#/entry/list`);
|
||||||
|
});
|
||||||
|
it('Filter deleted entries and other fields', () => {
|
||||||
|
cy.get('button[data-cy="vnTableCreateBtn"]').click();
|
||||||
|
cy.get('input[data-cy="entry-travel-select"]').type('1{enter}');
|
||||||
|
cy.get('button[data-cy="descriptor-more-opts"]').click();
|
||||||
|
cy.get('div[data-cy="delete-entry"]').click();
|
||||||
|
cy.visit(`/#/entry/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
cy.get('span[title="Date"]').click();
|
||||||
|
cy.get('span[title="Date"]').click();
|
||||||
|
cy.get('td[data-row-index="0"][data-col-field="landed"]').contains('-');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue