From 77cb0ed7a8f64fce14eea6a9bbc99a2af4bec3f8 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 29 Aug 2024 16:02:39 +0200 Subject: [PATCH 01/10] feat: refs #7909 add scroll --- src/components/common/VnLog.vue | 510 +++++++++++++++++--------------- 1 file changed, 274 insertions(+), 236 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 2163d54d49..640be2c0af 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -14,6 +14,7 @@ import VnJsonValue from '../common/VnJsonValue.vue'; import FetchData from '../FetchData.vue'; import VnSelect from './VnSelect.vue'; import VnUserLink from '../ui/VnUserLink.vue'; +import VnPaginate from '../ui/VnPaginate.vue'; const stateStore = useStateStore(); const validationsStore = useValidator(); @@ -68,7 +69,6 @@ const filter = { ], }; -const workers = ref(); const actions = ref(); const changeInput = ref(); const searchInput = ref(); @@ -235,9 +235,9 @@ async function openPointRecord(id, modelLog) { const locale = validations[modelLog.model]?.locale || {}; pointRecord.value = parseProps(propNames, locale, data); } -async function setLogTree() { +async function setLogTree(data) { filter.where = { and: [{ originFk: route.params.id }] }; - const { data } = await getLogs(filter); + // const { data } = await getLogs(filter); logTree.value = getLogTree(data); } @@ -377,8 +377,6 @@ async function clearFilter() { await applyFilter(); } -setLogTree(); - onUnmounted(() => { stateStore.rightDrawer = false; }); @@ -391,16 +389,6 @@ watch( ); + @@ -691,17 +730,16 @@ watch( - - - - + From c7bb0333bd055a01dd8d39a7239c0485979cc074 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 29 Aug 2024 16:28:59 +0200 Subject: [PATCH 02/10] refactor: refs #7909 improve applyFilter --- src/components/common/VnLog.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 640be2c0af..1d5b2c1820 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -69,6 +69,7 @@ const filter = { ], }; +const paginate = ref(); const actions = ref(); const changeInput = ref(); const searchInput = ref(); @@ -237,7 +238,6 @@ async function openPointRecord(id, modelLog) { } async function setLogTree(data) { filter.where = { and: [{ originFk: route.params.id }] }; - // const { data } = await getLogs(filter); logTree.value = getLogTree(data); } @@ -266,15 +266,7 @@ async function applyFilter() { filter.where.and.push(selectedFilters.value); } - const { data } = await getLogs(filter); - - logTree.value = getLogTree(data); -} - -async function getLogs(filter) { - return axios.get(props.url ?? `${props.model}Logs`, { - params: { filter: JSON.stringify(filter) }, - }); + paginate.value.fetch(filter); } function setDate(type) { @@ -407,6 +399,7 @@ watch( auto-load /> Date: Wed, 4 Sep 2024 14:37:39 +0200 Subject: [PATCH 03/10] refs #6943 remake, refactor, clean code Samples --- .../components/CustomerSamplesCreate.vue | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index 0470dc176d..50a2c17d5f 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import axios from 'axios'; +import { usePrintService } from 'composables/usePrintService'; import { useQuasar } from 'quasar'; import { useState } from 'src/composables/useState'; @@ -27,7 +28,7 @@ const router = useRouter(); const state = useState(); const user = state.getUser(); const stateStore = useStateStore(); - +const { sendEmail } = usePrintService(); const client = ref({}); const hasChanged = ref(false); const isLoading = ref(false); @@ -156,22 +157,25 @@ const onSubmit = async () => { } }; -const onDataSaved = async ({ - addressId, - companyFk, - companyId, - from, - recipient, - replyTo, -}) => { - await axios.post(`Clients/${route.params.id}/incoterms-authorization-email`, { - addressId, - companyFk, - companyId, - from, - recipient, - replyTo, +const getSamples = async () => { + const filter = { where: { id: initialData.typeFk } }; + let { data } = await axios.get('Samples', { + params: { filter: JSON.stringify(filter) }, }); + return data[0]; +}; + +getSamples(); +const onDataSaved = async () => { + const params = { + recipientId: initialData.recipientId, + recipient: initialData.recipient, + replyTo: initialData.replyTo, + }; + setParams(params); + const samplesData = await getSamples(); + const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`; + await sendEmail(path, params); toCustomerSamples(); }; @@ -327,7 +331,6 @@ const toCustomerSamples = () => { option-value="id" required="true" v-model="initialData.addressId" - v-if="sampleType.id === 20" >