From 9f1dd4d74d7e89d890fce2be00cc385a49c78fb9 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 20 Jun 2024 09:41:53 -0300 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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. + +