From a2bbf4474d4a801ece1cb52d57f61f55ecfe2ebb Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 6 Nov 2024 13:52:59 +0100 Subject: [PATCH 1/3] fix(InvoiceOutGlobal): parallelism --- src/pages/InvoiceOut/InvoiceOutGlobalForm.vue | 7 ++-- src/stores/invoiceOutGlobal.js | 37 +++++++++---------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue index 5bcb21001..e85f1f44c 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue @@ -13,7 +13,7 @@ const { t } = useI18n(); const invoiceOutGlobalStore = useInvoiceOutGlobalStore(); // invoiceOutGlobalStore state and getters -const { initialDataLoading, formInitialData, invoicing, status } = +const { initialDataLoading, formInitialData, status } = storeToRefs(invoiceOutGlobalStore); // invoiceOutGlobalStore actions @@ -151,9 +151,8 @@ onMounted(async () => { rounded /> - { dense /> = 400 && err?.response?.status < 500) { @@ -205,13 +202,16 @@ export const useInvoiceOutGlobalStore = defineStore({ return; } else { this.invoicing = false; - this.status = 'done'; notify( 'invoiceOut.globalInvoices.errors.criticalInvoiceError', 'negative' ); throw new Error('Critical invoicing error, process stopped'); } + } finally { + this.addressIndex++; + if (this.status != 'stopping') + await this.invoiceClient(formData, this.addressIndex); } }, @@ -234,7 +234,6 @@ export const useInvoiceOutGlobalStore = defineStore({ handleError(err) { this.invoicing = false; - this.status = null; throw err; }, @@ -279,7 +278,7 @@ export const useInvoiceOutGlobalStore = defineStore({ return 0; } let porcentaje = (state.addressIndex / this.getNAddresses) * 100; - return porcentaje; + return porcentaje?.toFixed(2); }, getAddressNumber(state) { return state.addressIndex; From ead241e7daa826608dfe522349f4691a06dbc2c9 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 6 Nov 2024 13:53:58 +0100 Subject: [PATCH 2/3] chore: remove console.log --- src/stores/invoiceOutGlobal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js index b17f41564..35f834f3d 100644 --- a/src/stores/invoiceOutGlobal.js +++ b/src/stores/invoiceOutGlobal.js @@ -179,7 +179,6 @@ export const useInvoiceOutGlobalStore = defineStore({ this.invoicing = false; return; } - console.log('address: ', address); try { const params = { clientId: address.clientId, From 6c9627c6c51c5dfeb6d61906e0193165a11e5fe3 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 6 Nov 2024 17:51:21 +0100 Subject: [PATCH 3/3] fix(worker): add searchurls --- src/pages/Worker/Card/WorkerBalance.vue | 19 ++++++++++++++++--- src/pages/Worker/Card/WorkerFormation.vue | 1 + src/pages/Worker/Card/WorkerMedical.vue | 1 + .../Card/WorkerNotificationsManager.vue | 1 + src/pages/Worker/Card/WorkerPda.vue | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBalance.vue b/src/pages/Worker/Card/WorkerBalance.vue index c5367a281..25ab92c9b 100644 --- a/src/pages/Worker/Card/WorkerBalance.vue +++ b/src/pages/Worker/Card/WorkerBalance.vue @@ -3,11 +3,12 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; +import FetchData from 'src/components/FetchData.vue'; const tableRef = ref(); +const payrollComponents = ref([]); const { t } = useI18n(); const route = useRoute(); const entityId = computed(() => route.params.id); - const columns = computed(() => [ { align: 'left', @@ -25,8 +26,9 @@ const columns = computed(() => [ create: true, component: 'select', attrs: { - url: 'payrollComponents', - fields: ['id', 'name'], + options: payrollComponents, + optionLabel: 'name', + optionValue: 'id', }, cardVisible: true, }, @@ -73,6 +75,16 @@ const columns = computed(() => [ ]); diff --git a/src/pages/Worker/Card/WorkerFormation.vue b/src/pages/Worker/Card/WorkerFormation.vue index c11dd019e..596691d2e 100644 --- a/src/pages/Worker/Card/WorkerFormation.vue +++ b/src/pages/Worker/Card/WorkerFormation.vue @@ -134,6 +134,7 @@ const columns = computed(() => [ :is-editable="true" :use-model="true" :default-remove="false" + search-url="formation" />