diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index b3216cf08..08301d71b 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -127,6 +127,7 @@ const splittedColumns = ref({ columns: [] }); const columnsVisibilitySkipped = ref(); const createForm = ref(); const tableFilterRef = ref([]); +const tableRef = ref(); const tableModes = [ { @@ -308,6 +309,7 @@ defineExpose({ selected, CrudModelRef, params, + tableRef, }); function handleOnDataSaved(_) { @@ -407,6 +409,7 @@ function handleClick(event, btn, row) { +import VnSelect from './VnSelect.vue'; + +defineProps({ + selectProps: { type: Object, required: true }, + promise: { type: Function, default: () => {} }, +}); + + + + + + diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 7eb3829fe..6ba3f9b58 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -296,6 +296,9 @@ globals: from: From To: To stateFk: State + myTeam: My team + departmentFk: Department + changeState: Change state errors: statusUnauthorized: Access denied statusInternalServerError: An internal server error has ocurred @@ -538,7 +541,6 @@ ticket: package: Package taxClass: Tax class services: Services - changeState: Change state requester: Requester atender: Atender request: Request diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 9d5cd53f3..e058030c0 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -300,6 +300,9 @@ globals: from: Desde To: Hasta stateFk: Estado + myTeam: Mi equipo + departmentFk: Departamento + changeState: Cambiar estado errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor @@ -547,7 +550,6 @@ ticket: package: Embalaje taxClass: Tipo IVA services: Servicios - changeState: Cambiar estado requester: Solicitante atender: Comprador request: Petición de compra diff --git a/src/pages/Claim/Card/ClaimSummary.vue b/src/pages/Claim/Card/ClaimSummary.vue index d77f718c6..edfa52b4b 100644 --- a/src/pages/Claim/Card/ClaimSummary.vue +++ b/src/pages/Claim/Card/ClaimSummary.vue @@ -204,7 +204,7 @@ function claimUrl(section) { top color="black" text-color="white" - :label="t('ticket.summary.changeState')" + :label="t('globals.changeState')" > row.nickname, sortable: true, @@ -172,11 +172,11 @@ const ticketsColumns = ref([ - + {{ value }} - + diff --git a/src/pages/Ticket/Card/TicketExpedition.vue b/src/pages/Ticket/Card/TicketExpedition.vue index c4ab63b39..93749ebec 100644 --- a/src/pages/Ticket/Card/TicketExpedition.vue +++ b/src/pages/Ticket/Card/TicketExpedition.vue @@ -1,201 +1,129 @@ + (expeditionStateTypes = data)" + auto-load + /> - - - + {{ t('Select lines to see the options') }} @@ -322,7 +281,7 @@ onUnmounted(() => (stateStore.rightDrawer = false)); (stateStore.rightDrawer = false)); deleteExpedition ) " - /> + > + {{ t('expedition.removeExpedition') }} + - - - - - - - - - - - - - {{ row.packagingItemFk }} + + + {{ row.packagingItemFk }} - + - - - - {{ row.available }} - - - - - - - - - {{ toCurrency(row.price) }} - - - - - - {{ toCurrency(row.price) }} - - - - - - - {{ toPercentage(row.discount / 100) }} - - - - - - {{ toPercentage(row.discount / 100) }} - - - - - - - {{ t('expedition.historyAction') }} - - - - - + @@ -454,12 +343,23 @@ onUnmounted(() => (stateStore.rightDrawer = false)); data-key="TicketExpeditionLog" :rows="expeditionsLogsData" :columns="logTableColumns" - class="q-pa-sm" + class="q-pa-md full-width" > - - {{ row.name }} - + + + {{ row.name }} + + + + + + + + {{ + row.isScanned === 1 ? t('expedition.yes') : t('expedition.no') + }} + diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 1f2a7ca79..358f74af2 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -105,7 +105,7 @@ async function changeState(value) { ref="stateBtnDropdownRef" color="black" text-color="white" - :label="t('ticket.summary.changeState')" + :label="t('globals.changeState')" :disable="!isEditable()" > { userParams.dateFuture = tomorrow; userParams.dateToAdvance = today; userParams.warehouseFk = user.value.warehouseFk; + userParams.ipt = 'H'; + userParams.futureIpt = 'H'; + userParams.isFullMovable = true; const filter = { limit: 0 }; await arrayData.addFilter({ filter, userParams }); }); diff --git a/src/pages/Ticket/TicketAdvanceFilter.vue b/src/pages/Ticket/TicketAdvanceFilter.vue index 209a1a307..182f715a3 100644 --- a/src/pages/Ticket/TicketAdvanceFilter.vue +++ b/src/pages/Ticket/TicketAdvanceFilter.vue @@ -10,7 +10,7 @@ import VnInputDate from 'src/components/common/VnInputDate.vue'; import axios from 'axios'; import { onMounted } from 'vue'; -const { t } = useI18n(); +const { t, te } = useI18n(); const props = defineProps({ dataKey: { type: String, @@ -42,6 +42,11 @@ const getItemPackingTypes = async () => { } }; +const getLocale = (val) => { + const param = `params.${val}`; + return te(param) ? t(param) : t(`globals.${param}`); +}; + onMounted(async () => await getItemPackingTypes()); @@ -59,7 +64,7 @@ onMounted(async () => await getItemPackingTypes()); > - {{ t(`params.${tag.label}`) }}: + {{ getLocale(tag.label) }}: {{ formatFn(tag.value) }} @@ -126,6 +131,19 @@ onMounted(async () => await getItemPackingTypes()); /> + + + + + + +describe('Ticket expedtion', () => { + const tableContent = '.q-table .q-virtual-scroll__content'; + const stateTd = 'td:nth-child(9)'; + + beforeEach(() => { + cy.login('developer'); + cy.viewport(1920, 1080); + }); + + it('should change the state', () => { + cy.visit('#/ticket/1/expedition'); + cy.intercept('GET', /\/api\/Expeditions\/filter/).as('expeditions'); + cy.intercept('POST', /\/api\/Expeditions\/crud/).as('crud'); + + cy.wait('@expeditions'); + + cy.selectRows([1, 2]); + cy.get('#subToolbar [aria-controls]:nth-child(1)').click(); + cy.get('.q-menu .q-item').contains('Perdida').click(); + cy.wait('@crud'); + + cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => { + cy.wrap($el).contains('Perdida'); + }); + }); +}); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 2ef9e1a74..4ce273444 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -152,6 +152,14 @@ Cypress.Commands.add('notificationHas', (selector, text) => { cy.get(selector).should('have.text', text); }); +Cypress.Commands.add('selectRows', (rows) => { + rows.forEach((row) => { + cy.get('.q-table .q-virtual-scroll__content tr .q-checkbox__inner') + .eq(row - 1) + .click(); + }); +}); + Cypress.Commands.add('fillRow', (rowSelector, data) => { // Usar el selector proporcionado para obtener la fila deseada cy.waitForElement('tbody');