From 4effba1580c4afa70c1fe2c01e3685a0b8e5b420 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:38:41 -0300 Subject: [PATCH 01/70] Ticket dms --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/Card/TicketDms.vue | 13 +++++++++++++ src/router/modules/ticket.js | 11 ++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/pages/Ticket/Card/TicketDms.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index b3a85eefa..63d5f630a 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -443,6 +443,7 @@ ticket: sms: Sms notes: Notes sale: Sale + dms: File management list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d03ee9d5c..92b77a351 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 + dms: Gestión documental list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/Card/TicketDms.vue b/src/pages/Ticket/Card/TicketDms.vue new file mode 100644 index 000000000..ae44fb795 --- /dev/null +++ b/src/pages/Ticket/Card/TicketDms.vue @@ -0,0 +1,13 @@ + + diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 6cb7291dc..05e323d50 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', 'TicketDms'], }, children: [ { @@ -93,6 +93,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketSms.vue'), }, + { + path: 'dms', + name: 'TicketDms', + meta: { + title: 'dms', + icon: 'cloud_upload', + }, + component: () => import('src/pages/Ticket/Card/TicketDms.vue'), + }, ], }, ], From c500dd6346479852457472558403e5bdfcf6a1d1 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:58:26 -0300 Subject: [PATCH 02/70] Add allow import feature in VnDmsList --- src/components/common/VnDmsImportForm.vue | 81 +++++++++++++++++++++++ src/components/common/VnDmsList.vue | 12 ++++ src/pages/Ticket/Card/TicketDms.vue | 1 + 3 files changed, 94 insertions(+) create mode 100644 src/components/common/VnDmsImportForm.vue diff --git a/src/components/common/VnDmsImportForm.vue b/src/components/common/VnDmsImportForm.vue new file mode 100644 index 000000000..b31197bbc --- /dev/null +++ b/src/components/common/VnDmsImportForm.vue @@ -0,0 +1,81 @@ + + + + + +es: + Select document id: Introduzca id de gestion documental + Document: Documento + The document indentifier can't be empty: El número de documento no puede estar vacío + diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 769ba9959..0576ba266 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -3,6 +3,7 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; +import VnDmsImportForm from 'src/components/common/VnDmsImportForm.vue'; import axios from 'axios'; import VnPaginate from 'components/ui/VnPaginate.vue'; @@ -18,6 +19,7 @@ const { t } = useI18n(); const rows = ref(); const dmsRef = ref(); const formDialog = ref({}); +const showImportDialog = ref(false); const $props = defineProps({ model: { @@ -45,6 +47,10 @@ const $props = defineProps({ type: String, required: true, }, + allowImport: { + type: Boolean, + default: false, + }, }); const dmsFilter = { @@ -373,9 +379,15 @@ function shouldRenderButton(button, isExternal = false) { :description="$props.description" /> + + + + + + From 2340aaba0b48f8114d9c64ce4feb4d21a3d26585 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 3 Jul 2024 14:39:15 +0200 Subject: [PATCH 10/70] feat: list use vnTable, fix descriptor --- src/components/ui/CardDescriptor.vue | 7 +- src/i18n/locale/en.yml | 63 ----- src/i18n/locale/es.yml | 63 ----- src/pages/Claim/Card/ClaimAction.vue | 8 +- src/pages/Claim/Card/ClaimActionTable.vue | 99 ++++++++ src/pages/Claim/Card/ClaimBasicData.vue | 17 +- src/pages/Claim/Card/ClaimDescriptor.vue | 27 +-- src/pages/Claim/Card/ClaimPhoto.vue | 8 +- src/pages/Claim/ClaimFilter.vue | 277 +++++++++------------- src/pages/Claim/ClaimList.vue | 174 +++++++------- src/pages/Claim/locale/en.yml | 46 ++++ src/pages/Claim/locale/es.yml | 46 ++++ src/pages/Order/Card/OrderDescriptor.vue | 2 +- 13 files changed, 419 insertions(+), 418 deletions(-) create mode 100644 src/pages/Claim/Card/ClaimActionTable.vue create mode 100644 src/pages/Claim/locale/en.yml diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 2bb5234ad..e4e007567 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -56,7 +56,12 @@ onBeforeMount(async () => { skip: 0, }); store = arrayData.store; - entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data)); + entity = computed(() => { + const data = Array.isArray(store.data) ? store.data[0] : store.data; + emit('onFetch', data); + return data; + }); + // It enables to load data only once if the module is the same as the dataKey if (!isSameDataKey.value || !route.params.id) await getData(); watch( diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e4ef31f8e..766463c1e 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -627,69 +627,6 @@ ticket: landed: Landed warehouse: Warehouse agency: Agency -claim: - list: - customer: Customer - assignedTo: Assigned - created: Created - state: State - rmaList: - code: Code - records: records - card: - claimId: Claim ID - attendedBy: Attended by - created: Created - state: State - ticketId: Ticket ID - customerSummary: Customer summary - claimedTicket: Claimed ticket - saleTracking: Sale tracking - ticketTracking: Ticket tracking - commercial: Commercial - province: Province - zone: Zone - customerId: client ID - summary: - customer: Customer - assignedTo: Assigned - attendedBy: Attended by - created: Created - state: State - details: Details - item: Item - landed: Landed - quantity: Quantity - claimed: Claimed - price: Price - discount: Discount - total: Total - actions: Actions - responsibility: Responsibility - company: Company - person: Employee/Customer - notes: Notes - photos: Photos - development: Development - reason: Reason - result: Result - responsible: Responsible - worker: Worker - redelivery: Redelivery - changeState: Change state - basicData: - customer: Customer - assignedTo: Assigned - created: Created - state: State - pickup: Pick up - null: No - agency: Agency - delivery: Delivery - photo: - fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}' - noData: 'There are no images/videos, click here or drag and drop the file' - dragDrop: Drag and drop it here invoiceOut: list: ref: Reference diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d02f47afd..585ced8b5 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -625,69 +625,6 @@ ticket: landed: F. entrega warehouse: Almacén agency: Agencia -claim: - list: - customer: Cliente - assignedTo: Asignada a - created: Creada - state: Estado - rmaList: - code: Código - records: registros - card: - claimId: ID reclamación - attendedBy: Atendida por - created: Creada - state: Estado - ticketId: ID ticket - customerSummary: Resumen del cliente - claimedTicket: Ticket reclamado - saleTracking: Líneas preparadas - ticketTracking: Estados del ticket - commercial: Comercial - province: Provincia - zone: Zona - customerId: ID del cliente - summary: - customer: Cliente - assignedTo: Asignada a - attendedBy: Atendida por - created: Creada - state: Estado - details: Detalles - item: Artículo - landed: Entregado - quantity: Cantidad - claimed: Reclamado - price: Precio - discount: Descuento - total: Total - actions: Acciones - responsibility: Responsabilidad - company: Empresa - person: Comercial/Cliente - notes: Observaciones - photos: Fotos - development: Trazabilidad - reason: Motivo - result: Consecuencias - responsible: Responsable - worker: Trabajador - redelivery: Devolución - changeState: Cambiar estado - basicData: - customer: Cliente - assignedTo: Asignada a - created: Creada - state: Estado - pickup: Recogida - null: No - agency: Agencia - delivery: Reparto - photo: - fileDescription: 'Reclamacion ID {claimId} del cliente {clientName} id {clientId}' - noData: No hay imágenes/videos haz click aquí o arrastra y suelta el archivo - dragDrop: Arrástralo y sueltalo aquí invoiceOut: list: ref: Referencia diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index a24a2a15e..e64eab81d 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -33,8 +33,8 @@ const DEFAULT_MAX_RESPONSABILITY = 5; const DEFAULT_MIN_RESPONSABILITY = 1; const arrayData = useArrayData('claimData'); const marker_labels = [ - { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') }, - { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') }, + { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.company') }, + { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.person') }, ]; const multiplicatorValue = ref(); const loading = ref(false); @@ -209,12 +209,12 @@ async function post(query, params) {

- {{ t('claim.summary.actions') }} + {{ t('claim.actions') }}

+import { ref, computed, onMounted } from 'vue'; +import { useQuasar } from 'quasar'; +import { useI18n } from 'vue-i18n'; +import { useRoute } from 'vue-router'; +import axios from 'axios'; +import { useStateStore } from 'src/stores/useStateStore'; +import { toDate, toPercentage, toCurrency } from 'filters/index'; +import VnTable from 'src/components/VnTable/VnTable.vue'; +import FetchData from 'src/components/FetchData.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; +import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; +import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; +import { useArrayData } from 'composables/useArrayData'; + +const { t } = useI18n(); +const quasar = useQuasar(); + +const $props = defineProps({ + id: { + type: Number, + required: true, + }, +}); + +const columns = computed(() => [ + { + name: 'id', + label: t('Id item'), + field: (row) => row.itemFk, + }, + { + name: 'ticketFk', + label: t('Ticket'), + align: 'center', + }, + { + name: 'destination', + label: t('Destination'), + field: (row) => row.claimDestinationFk, + align: 'left', + }, + { + name: 'Landed', + label: t('Landed'), + field: (row) => toDate(row.landed), + }, + { + name: 'quantity', + label: t('Quantity'), + field: (row) => row.quantity, + }, + { + name: 'concept', + label: t('Description'), + field: (row) => row.concept, + align: 'left', + }, + { + name: 'price', + label: t('Price'), + field: (row) => row.price, + format: (value) => value, + align: 'center', + }, + { + name: 'discount', + label: t('Discount'), + field: (row) => row.discount, + format: (value) => toPercentage(value / 100), + align: 'left', + }, + { + name: 'total', + label: t('Total'), + field: (row) => row.total, + format: (value) => value, + align: 'center', + }, + { + name: 'delete', + }, +]); + + diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 4656980d9..de0dc50c3 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -30,7 +30,7 @@ function setClaimStates(data) { } async function getEnumValues() { - optionsList.value = [{ id: null, description: t('claim.basicData.null') }]; + optionsList.value = [{ id: null, description: t('claim.null') }]; const { data } = await axios.get(`Applications/get-enum-values`, { params: { schema: 'vn', @@ -39,7 +39,7 @@ async function getEnumValues() { }, }); for (let value of data) - optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) }); + optionsList.value.push({ id: value, description: t(`claim.${value}`) }); } getEnumValues(); @@ -77,17 +77,14 @@ const statesFilter = { - + { From 4a01f1d930b750c82b7ed6979b28a3aa2ad589c4 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 4 Jul 2024 10:40:11 +0200 Subject: [PATCH 11/70] perf: cleancode --- src/pages/Ticket/Card/TicketSaleTracking.vue | 66 +++++++------------- 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSaleTracking.vue b/src/pages/Ticket/Card/TicketSaleTracking.vue index 823fe762f..858a35e61 100644 --- a/src/pages/Ticket/Card/TicketSaleTracking.vue +++ b/src/pages/Ticket/Card/TicketSaleTracking.vue @@ -246,9 +246,9 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => { try { const params = { saleFk: sale.saleFk, - isChecked: isChecked, + isChecked, quantity: sale.quantity, - stateCode: stateCode, + stateCode, }; await axios.post(`SaleTrackings/new`, params); notify(t('globals.dataSaved'), 'positive'); @@ -257,10 +257,10 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => { } }; -const saleTrackingDel = async (sale, stateCode) => { +const saleTrackingDel = async ({ saleFk }, stateCode) => { try { const params = { - saleFk: sale.saleFk, + saleFk, stateCodes: [stateCode], }; await axios.post(`SaleTrackings/delete`, params); @@ -284,14 +284,8 @@ const clickSaleGroupDetail = async (sale) => { const clickPreviousSelected = (sale) => { try { - if (!sale.isPreviousSelected) { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false); - sale.isPreviousSelected = true; - } else { - saleTrackingDel(sale, 'PREVIOUS_PREPARATION'); - sale.isPreviousSelected = false; - sale.isPrevious = false; - } + qCheckBoxController(sale, 'isPreviousSelected'); + if (!sale.isPreviousSelected) sale.isPrevious = false; } catch (error) { console.error(error); } @@ -299,41 +293,28 @@ const clickPreviousSelected = (sale) => { const clickPrevious = (sale) => { try { - if (!sale.isPrevious) { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', true); - sale.isPrevious = true; - sale.isPreviousSelected = true; - } else { - saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false); - sale.isPrevious = false; - } + qCheckBoxController(sale, 'isPrevious'); + if (sale.isPrevious) sale.isPreviousSelected = true; } catch (error) { console.error(error); } }; -const clickPrepared = (sale) => { +const qCheckBoxController = (sale, action) => { + const STATE_CODES = { + isControled: 'CHECKED', + isPrepared: 'PREPARED', + isPrevious: 'PREVIOUS_PREPARATION', + isPreviousSelected: 'PREVIOUS_PREPARATION', + }; + const stateCode = STATE_CODES[action]; try { - if (!sale.isPrepared) { - saleTrackingNew(sale, 'PREPARED', true); - sale.isPrepared = true; + if (!sale[action]) { + saleTrackingNew(sale, stateCode, true); + sale[action] = true; } else { - saleTrackingDel(sale, 'PREPARED'); - sale.isPrepared = false; - } - } catch (error) { - console.error(error); - } -}; - -const clickControled = (sale) => { - try { - if (!sale.isControled) { - saleTrackingNew(sale, 'CHECKED', true); - sale.isControled = true; - } else { - saleTrackingDel(sale, 'CHECKED'); - sale.isControled = false; + saleTrackingDel(sale, stateCode); + sale[action] = false; } } catch (error) { console.error(error); @@ -403,7 +384,7 @@ const clickControled = (sale) => { color="warning" class="warning" :toggle-indeterminate="false" - @update:model-value="clickPrepared(row)" + @update:model-value="qCheckBoxController(row, 'isPrepared')" > {{ t('ticketSaleTracking.prepared') }} @@ -413,9 +394,8 @@ const clickControled = (sale) => { :model-value="!!row.isControled" color="yellow" class="yellow" - style="stroke: red" :toggle-indeterminate="false" - @update:model-value="clickControled(row)" + @update:model-value="qCheckBoxController(row, 'isControled')" > {{ t('ticketSaleTracking.checked') }} From 1b839a89f78f4367efb1d01f9f23b0d410fdfbc9 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 4 Jul 2024 13:35:27 +0200 Subject: [PATCH 12/70] refactor: refs #6896 Order migration --- src/components/VnTable/VnTable.vue | 2 + src/components/common/VnCard.vue | 2 +- src/components/ui/VnPaginate.vue | 5 + src/composables/useArrayData.js | 10 +- src/pages/Order/Card/OrderForm.vue | 42 +--- src/pages/Order/Card/OrderSummary.vue | 2 +- src/pages/Order/OrderLines.vue | 285 ++++++++++++++------------ src/pages/Order/OrderList.vue | 268 +++++++++++++----------- src/pages/Order/locale/en.yml | 22 ++ src/pages/Order/locale/es.yml | 22 ++ src/router/modules/order.js | 2 +- 11 files changed, 377 insertions(+), 285 deletions(-) create mode 100644 src/pages/Order/locale/en.yml create mode 100644 src/pages/Order/locale/es.yml diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 1610735a4..f2084aeb9 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -210,6 +210,7 @@ defineExpose({ v-model="params" :disable-submit-event="true" :search-url="searchUrl" + :redirect="!!redirect" >