From 9179dc7432f9b19761cdf95cdb25a4d2c528775a Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 2 Jul 2024 09:35:18 -0300 Subject: [PATCH 1/7] Ticket package --- src/pages/Ticket/Card/TicketPackage.vue | 121 ++++++++++++++++++++++++ src/pages/Ticket/locale/en.yml | 6 ++ src/pages/Ticket/locale/es.yml | 6 ++ src/router/modules/ticket.js | 10 ++ 4 files changed, 143 insertions(+) create mode 100644 src/pages/Ticket/Card/TicketPackage.vue diff --git a/src/pages/Ticket/Card/TicketPackage.vue b/src/pages/Ticket/Card/TicketPackage.vue new file mode 100644 index 000000000..959f45b81 --- /dev/null +++ b/src/pages/Ticket/Card/TicketPackage.vue @@ -0,0 +1,121 @@ + + + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml index 39aed4af7..1b9619fd3 100644 --- a/src/pages/Ticket/locale/en.yml +++ b/src/pages/Ticket/locale/en.yml @@ -164,3 +164,9 @@ tracking: worker: Worker created: Created addState: Add state +package: + package: Package + quantity: Quantity + added: Added + addPackage: Add package + removePackage: Remove package diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index d5b50efc5..32744e557 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -164,5 +164,11 @@ ticketSale: shipped: F. Envío agency: Agencia address: Consignatario +package: + package: Package + quantity: Cantidad + added: Añadido + addPackage: Añadir embalaje + removePackage: Quitar embalaje Search ticket: Buscar tickets You can search by ticket id or alias: Puedes buscar por id o alias del ticket diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 1e635470b..e14fe7908 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -23,6 +23,7 @@ export default { 'TicketTracking', 'TicketVolume', 'TicketNotes', + 'TicketPackage', ], }, children: [ @@ -188,6 +189,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketNotes.vue'), }, + { + path: 'package', + name: 'TicketPackage', + meta: { + title: 'packages', + icon: 'vn:bin', + }, + component: () => import('src/pages/Ticket/Card/TicketPackage.vue'), + }, ], }, ], From decf33c0b7efe2220afb945ff462bad632306491 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 4 Jul 2024 09:46:10 -0300 Subject: [PATCH 2/7] small changes --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/router/modules/ticket.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 59cd1170a..5a009a7ab 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -452,6 +452,7 @@ ticket: weeklyTickets: Weekly tickets services: Service tracking: Tracking + packages: Packages list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index e35e3d41c..a5f501d51 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -451,6 +451,7 @@ ticket: weeklyTickets: Tickets programados services: Servicios tracking: Estados + packages: Bultos list: nickname: Alias state: Estado diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index e14fe7908..cc0199b49 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -194,7 +194,7 @@ export default { name: 'TicketPackage', meta: { title: 'packages', - icon: 'vn:bin', + icon: 'vn:bucket', }, component: () => import('src/pages/Ticket/Card/TicketPackage.vue'), }, From 273641cd981ce7c4bda2c4391dc1d16f239d5158 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 4 Jul 2024 13:02:24 -0300 Subject: [PATCH 3/7] Change translation --- src/pages/Ticket/locale/es.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 32744e557..1e13220e6 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -165,7 +165,7 @@ ticketSale: agency: Agencia address: Consignatario package: - package: Package + package: Embalaje quantity: Cantidad added: Añadido addPackage: Añadir embalaje From 4ebcb420c3ba4c07c995e633ea8d39f0f91a3ca9 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 5 Jul 2024 09:31:05 +0200 Subject: [PATCH 4/7] test: fix myEntry --- .../cypress/integration/entry/myEntry.spec.js | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/cypress/integration/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js index fc80c93f8..bd0e55c37 100644 --- a/test/cypress/integration/entry/myEntry.spec.js +++ b/test/cypress/integration/entry/myEntry.spec.js @@ -1,20 +1,20 @@ -// describe('WagonTypeCreate', () => { -// beforeEach(() => { -// cy.viewport(1920, 1080); -// cy.login('customer'); -// cy.visit(`/#/entry/my`, { -// onBeforeLoad(win) { -// cy.stub(win, 'open'); -// }, -// }); -// cy.waitForElement('.q-page', 6000); -// }); +describe('My entry when is supplier', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('supplier'); + cy.visit(`/#/entry/my`, { + onBeforeLoad(win) { + cy.stub(win, 'open'); + }, + }); + cy.waitForElement('.q-page', 6000); + }); -// it('should create edit and remove new dms', () => { -// cy.get( -// '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' -// ).click(); -// cy.get('.q-card__actions > .q-btn').click(); -// cy.window().its('open').should('be.called'); -// }); -// }); + it('should open buyLabel when is supplier', () => { + cy.get( + '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' + ).click(); + cy.get('.q-card__actions > .q-btn').click(); + cy.window().its('open').should('be.called'); + }); +}); From 3490ba1a8c929942cf6099eb8bc29ce3babfa1ab Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 5 Jul 2024 11:36:37 -0300 Subject: [PATCH 5/7] Add input type number --- src/pages/Ticket/Card/TicketPackage.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/Ticket/Card/TicketPackage.vue b/src/pages/Ticket/Card/TicketPackage.vue index 959f45b81..8a8f688d1 100644 --- a/src/pages/Ticket/Card/TicketPackage.vue +++ b/src/pages/Ticket/Card/TicketPackage.vue @@ -89,6 +89,8 @@ watch( :label="t('package.quantity')" v-model="row.quantity" class="col" + type="number" + min="1" /> Date: Fri, 5 Jul 2024 12:04:18 -0300 Subject: [PATCH 6/7] Handle quantity empty value --- src/pages/Ticket/Card/TicketPackage.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pages/Ticket/Card/TicketPackage.vue b/src/pages/Ticket/Card/TicketPackage.vue index 8a8f688d1..9583d6662 100644 --- a/src/pages/Ticket/Card/TicketPackage.vue +++ b/src/pages/Ticket/Card/TicketPackage.vue @@ -30,6 +30,10 @@ const crudModelRequiredData = computed(() => ({ ticketFk: route.params.id, })); +const handleInputQuantityClear = (row) => { + if (row.quantity === null || row.quantity === undefined) row.quantity = 0; +}; + watch( () => route.params.id, async () => { @@ -59,7 +63,7 @@ watch( auto-load style="max-width: 800px" > -