From b3a4dd3f799c340f73c5e81af8aff7742d5f8bc9 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 19 Jun 2024 08:16:20 -0300 Subject: [PATCH 01/16] 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 02/16] 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 03/16] 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 04/16] 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. + +