From 7ef16a69f291b65e76e378592c7d360031fbc2e6 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 15 Jun 2023 11:37:54 +0200 Subject: [PATCH 001/196] refs #5608 fix: redirect cuando dice 'Authorization Required' --- src/boot/axios.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/boot/axios.js b/src/boot/axios.js index cbd5e7213..64a6dac5f 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -1,7 +1,7 @@ import axios from 'axios'; import { Notify } from 'quasar'; import { useSession } from 'src/composables/useSession'; -import { Router } from 'src/router'; +// import { Router } from 'src/router'; import { i18n } from './i18n'; const session = useSession(); @@ -60,9 +60,11 @@ const onResponseError = (error) => { if (session.isLoggedIn() && response.status === 401) { session.destroy(); - Router.push({ path: '/login' }); - } else if(!session.isLoggedIn()) - { + const hash = window.location.hash; + const url = hash.slice(1); + window.location.href = url; + // Router.push({ path: url }); + } else if (!session.isLoggedIn()) { message = 'login.loginError'; } @@ -77,7 +79,4 @@ const onResponseError = (error) => { axios.interceptors.request.use(onRequest, onRequestError); axios.interceptors.response.use(onResponse, onResponseError); -export { - onRequest, - onResponseError -} +export { onRequest, onResponseError }; From 1895e4ff980ad69fa2528ccf94288de1205615c6 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 15 Jun 2023 11:46:15 +0200 Subject: [PATCH 002/196] refs #5608 fix: use Router --- src/boot/axios.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/boot/axios.js b/src/boot/axios.js index 64a6dac5f..f8f27278c 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -1,7 +1,7 @@ import axios from 'axios'; import { Notify } from 'quasar'; import { useSession } from 'src/composables/useSession'; -// import { Router } from 'src/router'; +import { Router } from 'src/router'; import { i18n } from './i18n'; const session = useSession(); @@ -62,8 +62,7 @@ const onResponseError = (error) => { session.destroy(); const hash = window.location.hash; const url = hash.slice(1); - window.location.href = url; - // Router.push({ path: url }); + Router.push({ path: url }); } else if (!session.isLoggedIn()) { message = 'login.loginError'; } From dcfc5f87c1d3f6fb112647aad17759d50d0f33c6 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 10 Jul 2023 06:04:05 +0200 Subject: [PATCH 003/196] refs #5930 mod component --- src/components/FormModel.vue | 6 +++++- src/composables/getUrl.js | 13 ++++--------- src/pages/Claim/Card/ClaimBasicData.vue | 14 +++++++++++++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 0a4580289..9d0916a8e 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -25,6 +25,10 @@ const $props = defineProps({ type: Object, default: null, }, + urlUpdate: { + type: String, + default: null, + }, }); const emit = defineEmits(['onFetch']); @@ -66,7 +70,7 @@ async function save() { }); } isLoading.value = true; - await axios.patch($props.url, formData.value); + await axios.patch($props.urlUpdate || $props.url, formData.value); originalData.value = formData.value; hasChanges.value = false; diff --git a/src/composables/getUrl.js b/src/composables/getUrl.js index 63eb63c0b..e020d7f18 100644 --- a/src/composables/getUrl.js +++ b/src/composables/getUrl.js @@ -2,18 +2,13 @@ import axios from 'axios'; export async function getUrl(route, appName = 'salix') { let url; - const env = process.env.NODE_ENV === 'development' ? 'dev' : process.env.NODE_ENV; const filter = { - where: {and: [ - {appName: appName}, - {environment: env} - ]} + where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] }, }; - await axios.get('Urls/findOne', {params: {filter}}) - .then(res => { - url = res.data.url + route; - }); + await axios.get('Urls/findOne', { params: { filter } }).then((res) => { + url = res.data.url + route; + }); return url; } diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 87a5dd8bb..ddf669dd0 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -13,6 +13,16 @@ const session = useSession(); const token = session.getToken(); const claimFilter = { + fields: [ + 'id', + 'clientFk', + 'created', + 'workerFk', + 'claimStateFk', + 'packages', + 'rma', + 'hasToPickUp', + ], include: [ { relation: 'client', @@ -85,6 +95,7 @@ const statesFilter = { @@ -180,9 +191,10 @@ const statesFilter = {
From 2b08924a61d9e21c9e656dd33f6c16df83679cbe Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 20 Jul 2023 10:03:07 +0200 Subject: [PATCH 004/196] refs #6011 change version in package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 705e26640..d9702c895 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "0.0.1", + "version": "23.30.01", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", From 352e65c5296307927970e0e0e642839cff6f8d81 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 26 Jul 2023 15:17:00 +0200 Subject: [PATCH 005/196] refs #5673 feat(claim): add development section --- src/composables/useArrayData.js | 14 +- src/i18n/es/index.js | 9 +- src/pages/Claim/Card/ClaimCard.vue | 1 - src/pages/Claim/Card/ClaimDevelopment.vue | 199 ++++++++++++++++++++++ src/router/modules/claim.js | 18 +- 5 files changed, 228 insertions(+), 13 deletions(-) create mode 100644 src/pages/Claim/Card/ClaimDevelopment.vue diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index c7808f9a8..4535cde0f 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -38,11 +38,11 @@ export function useArrayData(key, userOptions) { 'limit', 'skip', 'userParams', - 'userFilter' + 'userFilter', ]; if (typeof userOptions === 'object') { for (const option in userOptions) { - const isEmpty = userOptions[option] == null || userOptions[option] == '' + const isEmpty = userOptions[option] == null || userOptions[option] == ''; if (isEmpty || !allowedOptions.includes(option)) continue; if (Object.prototype.hasOwnProperty.call(store, option)) { @@ -73,7 +73,7 @@ export function useArrayData(key, userOptions) { Object.assign(params, store.userParams); - store.isLoading = true + store.isLoading = true; const response = await axios.get(store.url, { signal: canceller.signal, params, @@ -94,7 +94,7 @@ export function useArrayData(key, userOptions) { updateStateParams(); } - store.isLoading = false + store.isLoading = false; canceller = null; } @@ -153,8 +153,8 @@ export function useArrayData(key, userOptions) { }); } - const totalRows = computed(() => store.data && store.data.length || 0); - const isLoading = computed(() => store.isLoading || false) + const totalRows = computed(() => (store.data && store.data.length) || 0); + const isLoading = computed(() => store.isLoading || false); return { fetch, @@ -167,6 +167,6 @@ export function useArrayData(key, userOptions) { hasMoreData, totalRows, updateStateParams, - isLoading + isLoading, }; } diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6328c8f5d..91a05685c 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -63,7 +63,7 @@ export default { webPayments: 'Pagos Web', createCustomer: 'Crear cliente', basicData: 'Datos básicos', - summary: 'Resumen' + summary: 'Resumen', }, list: { phone: 'Teléfono', @@ -243,6 +243,7 @@ export default { lines: 'Líneas', rma: 'RMA', photos: 'Fotos', + development: 'Trazabilidad', log: 'Registros de auditoría', }, list: { @@ -294,7 +295,7 @@ export default { result: 'Consecuencias', responsible: 'Responsable', worker: 'Trabajador', - redelivery: 'Devolución' + redelivery: 'Devolución', }, basicData: { customer: 'Cliente', @@ -411,7 +412,7 @@ export default { wagonEdit: 'Editar tipo', typesList: 'Listado tipos', typeCreate: 'Crear tipo', - typeEdit: 'Editar tipo' + typeEdit: 'Editar tipo', }, type: { name: 'Nombre', @@ -444,7 +445,7 @@ export default { minHeightBetweenTrays: 'La distancia mínima entre bandejas es ', maxWagonHeight: 'La altura máxima del vagón es ', uncompleteTrays: 'Hay bandejas sin completar', - } + }, }, components: { topbar: {}, diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 2691bbc51..3d22747c0 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -23,7 +23,6 @@ const entityId = computed(() => { }); const claimSections = [ { name: 'Notes', url: '/note/index', icon: 'draft' }, - { name: 'Development', url: '/development', icon: 'vn:traceability' }, { name: 'Action', url: '/action', icon: 'vn:actions' }, ]; diff --git a/src/pages/Claim/Card/ClaimDevelopment.vue b/src/pages/Claim/Card/ClaimDevelopment.vue new file mode 100644 index 000000000..b9626b444 --- /dev/null +++ b/src/pages/Claim/Card/ClaimDevelopment.vue @@ -0,0 +1,199 @@ + + + + + + +en: + You are about to remove {count} rows: ' + You are about to remove {count} row | + You are about to remove {count} rows' +es: + Claimed lines: Líneas reclamadas + Delivered: Entregado + Quantity: Cantidad + Claimed: Reclamada + Description: Descripción + Price: Precio + Discount: Descuento + Actions: Acciones + Amount: Total + Amount Claimed: Cantidad reclamada + Delete claimed sales: Eliminar ventas reclamadas + Discount updated: Descuento actualizado + Claimed quantity: Cantidad reclamada + You are about to remove {count} rows: ' + Vas a eliminar {count} línea | + Vas a eliminar {count} líneas' + diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index c43ed5012..a39e60d8a 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -11,7 +11,14 @@ export default { redirect: { name: 'ClaimMain' }, menus: { main: ['ClaimList', 'ClaimRmaList'], - card: ['ClaimBasicData', 'ClaimLines', 'ClaimRma', 'ClaimPhotos', 'ClaimLog'], + card: [ + 'ClaimBasicData', + 'ClaimLines', + 'ClaimPhotos', + 'ClaimDevelopment', + 'ClaimRma', + 'ClaimLog', + ], }, children: [ { @@ -94,6 +101,15 @@ export default { }, component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'), }, + { + name: 'ClaimDevelopment', + path: 'development', + meta: { + title: 'development', + icon: 'vn:traceability', + }, + component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'), + }, { name: 'ClaimLog', path: 'log', From b7bbb4ba417cb0cc0d8462fcb79c99ecb0123296 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 27 Jul 2023 16:05:23 +0200 Subject: [PATCH 006/196] refs #5673 feat(claim_development): add translation --- src/i18n/en/index.js | 9 +++++---- src/i18n/es/index.js | 2 +- src/pages/Claim/Card/ClaimCard.vue | 1 - src/pages/Claim/Card/ClaimDevelopment.vue | 6 ++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index a43c5fe7c..67c552b5a 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -244,6 +244,7 @@ export default { lines: 'Lines', rma: 'RMA', photos: 'Photos', + development: 'Development', log: 'Audit logs', }, list: { @@ -295,7 +296,7 @@ export default { result: 'Result', responsible: 'Responsible', worker: 'Worker', - redelivery: 'Redelivery' + redelivery: 'Redelivery', }, basicData: { customer: 'Customer', @@ -411,7 +412,7 @@ export default { wagonEdit: 'Edit wagon', typesList: 'Types List', typeCreate: 'Create type', - typeEdit: 'Edit type' + typeEdit: 'Edit type', }, type: { name: 'Name', @@ -431,7 +432,7 @@ export default { plate: 'Plate', volume: 'Volume', type: 'Type', - label: 'Label' + label: 'Label', }, warnings: { noData: 'No data available', @@ -444,7 +445,7 @@ export default { minHeightBetweenTrays: 'The minimum height between trays is ', maxWagonHeight: 'The maximum height of the wagon is ', uncompleteTrays: 'There are incomplete trays', - } + }, }, components: { topbar: {}, diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 91a05685c..b9a344ccf 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -242,8 +242,8 @@ export default { basicData: 'Datos básicos', lines: 'Líneas', rma: 'RMA', - photos: 'Fotos', development: 'Trazabilidad', + photos: 'Fotos', log: 'Registros de auditoría', }, list: { diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 3d22747c0..2b6e275f9 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -76,6 +76,5 @@ es: You can search by claim id or customer name: Puedes buscar por id de la reclamación o nombre del cliente Details: Detalles Notes: Notas - Development: Trazabilidad Action: Acción diff --git a/src/pages/Claim/Card/ClaimDevelopment.vue b/src/pages/Claim/Card/ClaimDevelopment.vue index b9626b444..0e247b581 100644 --- a/src/pages/Claim/Card/ClaimDevelopment.vue +++ b/src/pages/Claim/Card/ClaimDevelopment.vue @@ -106,11 +106,10 @@ const columns = computed(() => [ selection="multiple" hide-pagination > -