From c807b5feb278c6918bec7f02189d226c5810f9ee Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 17 Jun 2024 08:21:43 -0300 Subject: [PATCH 01/21] Weekly tickets --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/TicketWeekly.vue | 327 ++++++++++++++++++++++++++++++ src/pages/Ticket/locale/en.yml | 9 + src/pages/Ticket/locale/es.yml | 9 + src/router/modules/ticket.js | 11 +- 6 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 src/pages/Ticket/TicketWeekly.vue create mode 100644 src/pages/Ticket/locale/en.yml diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 5ef3a5472..7f212ca30 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -442,6 +442,7 @@ ticket: sms: Sms notes: Notes sale: Sale + weeklyTickets: Weekly tickets list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index cfadd57b3..ff357492b 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -440,6 +440,7 @@ ticket: sms: Sms notes: Notas sale: Lineas del pedido + weeklyTickets: Tickets programados list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue new file mode 100644 index 000000000..50b4c0451 --- /dev/null +++ b/src/pages/Ticket/TicketWeekly.vue @@ -0,0 +1,327 @@ + + + + + +es: + You are going to delete this weekly ticket: Vas a eliminar este ticket programado + This ticket will be removed from weekly tickets! Continue anyway?: Este ticket se eliminará de tickets programados! ¿Continuar de todas formas? + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml new file mode 100644 index 000000000..a4c5b78ac --- /dev/null +++ b/src/pages/Ticket/locale/en.yml @@ -0,0 +1,9 @@ +weeklyTickets: + id: Ticket ID + client: Client + shipment: Shipment + agency: Agency + warehouse: Warehouse + salesperson: Salesperson + search: Search weekly tickets + searchInfo: Search weekly tickets by id or client id diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 5348b29b9..0e2f77d73 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -1,2 +1,11 @@ +weeklyTickets: + id: ID Ticket + client: Cliente + shipment: Salida + agency: Agencia + warehouse: Almacén + salesperson: Comercial + search: Buscar por tickets programados + searchInfo: Buscar tickets programados por el identificador o el identificador del cliente Search ticket: Buscar ticket 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 6cb7291dc..e92ba6650 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -11,7 +11,7 @@ export default { component: RouterView, redirect: { name: 'TicketMain' }, menus: { - main: ['TicketList'], + main: ['TicketList', 'TicketWeekly'], card: ['TicketBoxing', 'TicketSms', 'TicketSale'], }, children: [ @@ -40,6 +40,15 @@ export default { }, component: () => import('src/pages/Ticket/TicketCreate.vue'), }, + { + name: 'TicketWeekly', + path: 'weekly', + meta: { + title: 'weeklyTickets', + icon: 'access_time', + }, + component: () => import('src/pages/Ticket/TicketWeekly.vue'), + }, ], }, { From d488a2d52391e12f4d1f89ddfdf5a86ba6ab1b4f Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 18 Jun 2024 11:50:15 -0300 Subject: [PATCH 02/21] small change --- src/pages/Ticket/TicketWeekly.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue index 50b4c0451..022f1bb30 100644 --- a/src/pages/Ticket/TicketWeekly.vue +++ b/src/pages/Ticket/TicketWeekly.vue @@ -67,7 +67,7 @@ const applyColumnFilter = async (col) => { } }; -const getInputEvents = (col) => ({ 'update:modelValue': () => applyColumnFilter(col) }); +const getInputEvents = (col) => ({ 'keyup.enter': () => applyColumnFilter(col) }); const columns = computed(() => [ { From de0ef06d926b01293350fe5a4ce76ad16307464e Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 18 Jun 2024 19:28:05 -0300 Subject: [PATCH 03/21] remove console.log --- src/pages/Ticket/TicketWeekly.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue index 022f1bb30..5dbc99d22 100644 --- a/src/pages/Ticket/TicketWeekly.vue +++ b/src/pages/Ticket/TicketWeekly.vue @@ -60,7 +60,6 @@ const applyColumnFilter = async (col) => { try { const paramKey = col.columnFilter?.filterParamKey || col.field; params[paramKey] = col.columnFilter.filterValue; - console.log('paramKey', paramKey, 'params', params); await paginateRef.value.addFilter(null, params); } catch (err) { console.error('Error applying column filter', err); From b3a4dd3f799c340f73c5e81af8aff7742d5f8bc9 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 19 Jun 2024 08:16:20 -0300 Subject: [PATCH 04/21] Ticket purchase request --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/Card/TicketCard.vue | 24 +- src/pages/Ticket/Card/TicketCreateRequest.vue | 69 +++++ .../Ticket/Card/TicketPurchaseRequest.vue | 261 ++++++++++++++++++ src/pages/Ticket/locale/en.yml | 14 + src/pages/Ticket/locale/es.yml | 14 + src/router/modules/ticket.js | 12 +- 8 files changed, 389 insertions(+), 7 deletions(-) create mode 100644 src/pages/Ticket/Card/TicketCreateRequest.vue create mode 100644 src/pages/Ticket/Card/TicketPurchaseRequest.vue create mode 100644 src/pages/Ticket/locale/en.yml diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index b3a85eefa..3ebf23b3c 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -443,6 +443,7 @@ ticket: sms: Sms notes: Notes sale: Sale + purchaseRequest: Purchase request list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d03ee9d5c..620b67a0a 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -441,6 +441,7 @@ ticket: sms: Sms notes: Notas sale: Lineas del pedido + purchaseRequest: Petición de compra list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue index 04363b506..ecea3aab2 100644 --- a/src/pages/Ticket/Card/TicketCard.vue +++ b/src/pages/Ticket/Card/TicketCard.vue @@ -1,17 +1,29 @@ diff --git a/src/pages/Ticket/Card/TicketCreateRequest.vue b/src/pages/Ticket/Card/TicketCreateRequest.vue new file mode 100644 index 000000000..6b436621f --- /dev/null +++ b/src/pages/Ticket/Card/TicketCreateRequest.vue @@ -0,0 +1,69 @@ + + + + + es: + Create request: Crear petición de compra + diff --git a/src/pages/Ticket/Card/TicketPurchaseRequest.vue b/src/pages/Ticket/Card/TicketPurchaseRequest.vue new file mode 100644 index 000000000..387a5baf1 --- /dev/null +++ b/src/pages/Ticket/Card/TicketPurchaseRequest.vue @@ -0,0 +1,261 @@ + + + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml new file mode 100644 index 000000000..5930e3487 --- /dev/null +++ b/src/pages/Ticket/locale/en.yml @@ -0,0 +1,14 @@ +card: + search: Search tickets + searchInfo: You can search by ticket id or alias +purchaseRequest: + id: Id + description: Description + created: Created + requester: Requester + atender: Atender + quantity: Quantity + price: Price + saleFk: Item id + state: State + newRequest: New request diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 5348b29b9..80d32b4a5 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -1,2 +1,16 @@ +card: + search: Buscar tickets + searchInfo: Buscar tickets por identificador o alias +purchaseRequest: + Id: Id + description: Descripción + created: Fecha creación + requester: Solicitante + atender: Comprador + quantity: Cantidad + price: Precio + saleFk: Id artículo + state: Estado + newRequest: Crear petición Search ticket: Buscar ticket 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 6cb7291dc..584fb9dc5 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'TicketMain' }, menus: { main: ['TicketList'], - card: ['TicketBoxing', 'TicketSms', 'TicketSale'], + card: ['TicketBoxing', 'TicketSms', 'TicketSale', 'TicketPurchaseRequest'], }, children: [ { @@ -93,6 +93,16 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketSms.vue'), }, + { + path: 'request', + name: 'TicketPurchaseRequest', + meta: { + title: 'purchaseRequest', + icon: 'vn:buyrequest', + }, + component: () => + import('src/pages/Ticket/Card/TicketPurchaseRequest.vue'), + }, ], }, ], From 9f1dd4d74d7e89d890fce2be00cc385a49c78fb9 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 20 Jun 2024 09:41:53 -0300 Subject: [PATCH 05/21] WIP --- src/pages/Ticket/Card/TicketBasicData.vue | 47 ++++++++++++++++++++++- src/pages/Ticket/locale/en.yml | 4 ++ src/pages/Ticket/locale/es.yml | 4 ++ src/router/modules/ticket.js | 2 +- 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 src/pages/Ticket/locale/en.yml diff --git a/src/pages/Ticket/Card/TicketBasicData.vue b/src/pages/Ticket/Card/TicketBasicData.vue index 0c9a8b042..70382d0fb 100644 --- a/src/pages/Ticket/Card/TicketBasicData.vue +++ b/src/pages/Ticket/Card/TicketBasicData.vue @@ -1,3 +1,48 @@ + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml new file mode 100644 index 000000000..4016973cc --- /dev/null +++ b/src/pages/Ticket/locale/en.yml @@ -0,0 +1,4 @@ +basicData: + next: Next + back: Back + finalize: Finalize diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 5348b29b9..da7c45cc0 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -1,2 +1,6 @@ +basicData: + next: Siguiente + back: Anterior + finalize: Finalizar Search ticket: Buscar ticket 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 6cb7291dc..3c60f40ab 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'TicketMain' }, menus: { main: ['TicketList'], - card: ['TicketBoxing', 'TicketSms', 'TicketSale'], + card: ['TicketBasicData', 'TicketBoxing', 'TicketSms', 'TicketSale'], }, children: [ { From 633b13b07668366436b4cf66ba9c53c39303f7da Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 20 Jun 2024 16:51:07 -0300 Subject: [PATCH 06/21] Basic data form --- src/components/FormModel.vue | 2 +- src/pages/Ticket/Card/TicketBasicData.vue | 522 +++++++++++++++++++++- src/pages/Ticket/locale/en.yml | 13 + src/pages/Ticket/locale/es.yml | 13 + 4 files changed, 528 insertions(+), 22 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 336ea281e..11542ed65 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -246,7 +246,7 @@ function updateAndEmit(evt, val, res) { emit(evt, state.get(modelValue), res); } -defineExpose({ save, isLoading, hasChanges }); +defineExpose({ save, isLoading, hasChanges, formData }); diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml index 4016973cc..643421ad4 100644 --- a/src/pages/Ticket/locale/en.yml +++ b/src/pages/Ticket/locale/en.yml @@ -2,3 +2,16 @@ basicData: next: Next back: Back finalize: Finalize + client: Client + warehouse: Warehouse + address: Address + inactive: (Inactive) + noDeliveryZoneAvailable: No delivery zone available for this landing date + editAddress: Edit address + alias: Alias + company: Company + agency: Agency + zone: Zone + shipped: Shipped + landed: Landed + shippedHour: Shipped hour diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index da7c45cc0..913d1935d 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -2,5 +2,18 @@ basicData: next: Siguiente back: Anterior finalize: Finalizar + client: Cliente + warehouse: Almacén + address: Consignatario + inactive: (Inactivo) + noDeliveryZoneAvailable: No hay una zona de reparto disponible para la fecha de envío seleccionada + editAddress: Editar dirección + alias: Alias + company: Empresa + agency: Agencia + zone: Zona + shipped: F. Envío + landed: F. Entrega + shippedHour: Hora de envío Search ticket: Buscar ticket You can search by ticket id or alias: Puedes buscar por id o alias del ticket From 5cf183607de779f485d50258e15aa3c592ef27d0 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 21 Jun 2024 09:20:03 -0300 Subject: [PATCH 07/21] WIP --- .../Ticket/Card/BasicData/BasicDataTable.vue | 245 ++++++++++++++++++ .../Card/BasicData/TicketBasicDataForm.vue | 0 .../TicketBasicDataView.vue} | 46 +++- src/pages/Ticket/locale/en.yml | 17 ++ src/pages/Ticket/locale/es.yml | 17 ++ src/router/modules/ticket.js | 3 +- 6 files changed, 323 insertions(+), 5 deletions(-) create mode 100644 src/pages/Ticket/Card/BasicData/BasicDataTable.vue create mode 100644 src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue rename src/pages/Ticket/Card/{TicketBasicData.vue => BasicData/TicketBasicDataView.vue} (93%) diff --git a/src/pages/Ticket/Card/BasicData/BasicDataTable.vue b/src/pages/Ticket/Card/BasicData/BasicDataTable.vue new file mode 100644 index 000000000..37c51fadf --- /dev/null +++ b/src/pages/Ticket/Card/BasicData/BasicDataTable.vue @@ -0,0 +1,245 @@ + + + diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataForm.vue new file mode 100644 index 000000000..e69de29bb diff --git a/src/pages/Ticket/Card/TicketBasicData.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue similarity index 93% rename from src/pages/Ticket/Card/TicketBasicData.vue rename to src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue index e4bf52a94..bba90a35a 100644 --- a/src/pages/Ticket/Card/TicketBasicData.vue +++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue @@ -10,6 +10,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputTime from 'components/common/VnInputTime.vue'; +import BasicDataTable from './BasicDataTable.vue'; import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; @@ -289,6 +290,43 @@ const redirectToCustomerAddress = () => { params: { id: clientId.value, addressId: addressId.value }, }); }; + +const isFormInvalid = (formData) => { + return ( + !formData.clientFk || + !formData.addressFk || + !formData.agencyModeFk || + !formData.companyFk || + !formData.shipped || + !formData.landed || + !formData.zoneFk + ); +}; + +const onNextStep = async () => { + if (step.value === 1) { + const formData = formModelRef.value.formData; + if (isFormInvalid(formData)) + return notify(t('basicData.someFieldsAreInvalid'), 'negative'); + + if (!formData.sale || formModelRef.value.hasChanges) { + const params = { + landed: formData.landed, + addressId: formData.addressFk, + agencyModeId: formData.agencyModeFk, + zoneId: formData.zoneFk, + warehouseId: formData.warehouseFk, + shipped: formData.shipped, + }; + const { data } = await axios.post( + `tickets/${formData.id}/priceDifference`, + params + ); + formData.sale = data; + stepperRef.value.next(); + } + } +}; - - An ad group contains one or more ads which target a shared set of keywords. + +