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 });
|
||||
|
||||
async function orderBy(name, direction) {
|
||||
console.log('orderBy');
|
||||
if (!name) return;
|
||||
switch (direction) {
|
||||
case 'DESC':
|
||||
|
@ -40,7 +41,11 @@ async function orderBy(name, direction) {
|
|||
direction = 'DESC';
|
||||
break;
|
||||
}
|
||||
console.log('name: ', name);
|
||||
if (!direction) return await arrayData.deleteOrder(name);
|
||||
|
||||
console.log('direction: ', direction);
|
||||
console.log('name: ', name);
|
||||
await arrayData.addOrder(name, direction);
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,6 @@ async function renderInput(rowId, field, clickedElement) {
|
|||
const isSelect = selectRegex.test(column?.component);
|
||||
if (isSelect) column.attrs = { ...column.attrs, 'emit-value': false };
|
||||
|
||||
console.log('row[column.name]: ', row[column.name]);
|
||||
const node = h(VnColumn, {
|
||||
row: row,
|
||||
class: 'temp-input',
|
||||
|
@ -410,7 +409,6 @@ async function renderInput(rowId, field, clickedElement) {
|
|||
eventHandlers: {
|
||||
'update:modelValue': async (value) => {
|
||||
if (isSelect) {
|
||||
console.log('value: ', value);
|
||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||
row[column?.name + 'TextValue'] =
|
||||
value[column.attrs?.optionLabel ?? 'name'];
|
||||
|
@ -521,7 +519,6 @@ function formatColumnValue(col, row, dashIfEmpty) {
|
|||
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
|
||||
return dashIfEmpty(row[col?.name + 'TextValue']);
|
||||
} else {
|
||||
console.log('format');
|
||||
return col.format(row, dashIfEmpty);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -498,7 +498,6 @@ entry:
|
|||
entryTypeDescription: Tipo entrada
|
||||
invoiceAmount: Importe
|
||||
dated: Fecha
|
||||
|
||||
ticket:
|
||||
params:
|
||||
ticketFk: Ticket ID
|
||||
|
|
|
@ -127,16 +127,26 @@ async function deleteEntry() {
|
|||
width="lg-width"
|
||||
>
|
||||
<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>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="recalculateRates(entity)">
|
||||
<QItem
|
||||
v-ripple
|
||||
clickable
|
||||
@click="recalculateRates(entity)"
|
||||
data-cy="recalculate-rates"
|
||||
>
|
||||
<QItemSection>{{ t('Recalculate rates') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="cloneEntry(entity)">
|
||||
<QItem v-ripple clickable @click="cloneEntry(entity)" data-cy="clone-entry">
|
||||
<QItemSection>{{ t('Clone') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="deleteEntry(entity)">
|
||||
<QItem v-ripple clickable @click="deleteEntry(entity)" data-cy="delete-entry">
|
||||
<QItemSection>{{ t('Delete') }}</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
|
|
@ -55,11 +55,7 @@ const entryFilterPanel = ref();
|
|||
toggle-indeterminate
|
||||
>
|
||||
<QTooltip>
|
||||
{{
|
||||
t(
|
||||
'entry.list.tableVisibleColumns.isExcludedFromAvailable',
|
||||
)
|
||||
}}
|
||||
{{ t('params.isExcludedFromAvailable') }}
|
||||
</QTooltip>
|
||||
</QCheckbox>
|
||||
</QItemSection>
|
||||
|
@ -218,70 +214,7 @@ const entryFilterPanel = ref();
|
|||
/>
|
||||
</QItemSection>
|
||||
</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>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
|
@ -299,6 +232,15 @@ const entryFilterPanel = ref();
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.evaNotes"
|
||||
:label="t('params.evaNotes')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
|
|
@ -268,7 +268,6 @@ onBeforeMount(async () => {
|
|||
url="Entries/filter"
|
||||
:array-data-props="{
|
||||
url: 'Entries/filter',
|
||||
order: 'id DESC',
|
||||
userFilter: entryQueryFilter,
|
||||
}"
|
||||
>
|
||||
|
@ -292,7 +291,6 @@ onBeforeMount(async () => {
|
|||
companyFk: user?.companyFk,
|
||||
},
|
||||
}"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
redirect="entry"
|
||||
:right-search="false"
|
||||
|
@ -320,6 +318,7 @@ onBeforeMount(async () => {
|
|||
:onFilterTravelSelected="
|
||||
(data, result) => (data.travelFk = result)
|
||||
"
|
||||
data-cy="entry-travel-select"
|
||||
/>
|
||||
</template>
|
||||
</VnTable>
|
||||
|
|
|
@ -132,6 +132,7 @@ entry:
|
|||
showEntryReport: Show entry report
|
||||
entryFilter:
|
||||
params:
|
||||
isExcludedFromAvailable: Exclude from inventory
|
||||
invoiceNumber: Invoice number
|
||||
travelFk: Travel
|
||||
companyFk: Company
|
||||
|
@ -143,8 +144,16 @@ entryFilter:
|
|||
isBooked: Booked
|
||||
isConfirmed: Confirmed
|
||||
isOrdered: Ordered
|
||||
isReceived: Received
|
||||
search: General search
|
||||
reference: Reference
|
||||
landed: Landed
|
||||
id: Id
|
||||
agencyModeId: Agency
|
||||
evaNotes: Notes
|
||||
warehouseOutFk: Origin
|
||||
warehouseInFk: Destiny
|
||||
entryTypeCode: Entry type
|
||||
myEntries:
|
||||
id: ID
|
||||
landed: Landed
|
||||
|
|
|
@ -133,19 +133,22 @@ entry:
|
|||
workerFk: Comprador
|
||||
entryFilter:
|
||||
params:
|
||||
invoiceNumber: Núm. factura
|
||||
travelFk: Envío
|
||||
companyFk: Empresa
|
||||
currencyFk: Moneda
|
||||
supplierFk: Proveedor
|
||||
from: Desde
|
||||
to: Hasta
|
||||
created: Fecha creación
|
||||
isBooked: Asentado
|
||||
isConfirmed: Confirmado
|
||||
isExcludedFromAvailable: Inventario
|
||||
isOrdered: Pedida
|
||||
search: Búsqueda general
|
||||
reference: Referencia
|
||||
isConfirmed: Confirmado
|
||||
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:
|
||||
id: ID
|
||||
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