From 161922da0934ad2a9e57fb5143a374a8e408453d Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 26 Apr 2024 15:17:03 +0200 Subject: [PATCH 001/174] feat: refs #6825 create vnTable and add in CustomerExtendedList --- src/components/common/VnTable.vue | 243 ++++++++ .../ExtendedList/CustomerExtendedList.vue | 121 ++-- .../CustomerExtendedListBackup.vue | 571 ++++++++++++++++++ 3 files changed, 877 insertions(+), 58 deletions(-) create mode 100644 src/components/common/VnTable.vue create mode 100644 src/pages/Customer/ExtendedList/CustomerExtendedListBackup.vue diff --git a/src/components/common/VnTable.vue b/src/components/common/VnTable.vue new file mode 100644 index 000000000..a537c5215 --- /dev/null +++ b/src/components/common/VnTable.vue @@ -0,0 +1,243 @@ + + + diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue index a24d3211a..789e90834 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue @@ -2,6 +2,8 @@ import { ref, computed, onBeforeMount, onMounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; +import VnInput from 'src/components/common/VnInput.vue'; +import VnTable from 'components/common/VnTable.vue'; import { QBtn, QIcon } from 'quasar'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; @@ -266,28 +268,30 @@ const tableColumnComponents = { const columns = computed(() => [ { align: 'left', - field: '', - label: '', + field: 'customerStatus', + label: 'customerStatus', name: 'customerStatus', - format: () => ' ', }, { align: 'left', field: 'id', label: t('customer.extendedList.tableVisibleColumns.id'), name: 'id', + isId: true, }, { align: 'left', field: 'name', label: t('customer.extendedList.tableVisibleColumns.name'), name: 'name', + cardVisible: true, }, { align: 'left', field: 'fi', label: t('customer.extendedList.tableVisibleColumns.fi'), name: 'fi', + cardVisible: true, }, { align: 'left', @@ -494,7 +498,7 @@ const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id); /> - + - - + + + From e0379dd1bc5d2dc565e0052b1e15b7e006c76605 Mon Sep 17 00:00:00 2001 From: alexm Date: Sun, 28 Apr 2024 18:47:44 +0200 Subject: [PATCH 002/174] feat: refs #6825 fix modes --- src/components/common/VnTable.vue | 131 +++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 37 deletions(-) diff --git a/src/components/common/VnTable.vue b/src/components/common/VnTable.vue index a537c5215..2f60fb634 100644 --- a/src/components/common/VnTable.vue +++ b/src/components/common/VnTable.vue @@ -1,14 +1,14 @@ diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue index 789e90834..444726ad2 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue @@ -1,19 +1,15 @@ diff --git a/src/components/common/VnTableFilterMore.vue b/src/components/common/VnTableFilterMore.vue new file mode 100644 index 000000000..fd4880431 --- /dev/null +++ b/src/components/common/VnTableFilterMore.vue @@ -0,0 +1,13 @@ + + diff --git a/src/components/common/VnTableObj.json b/src/components/common/VnTableObj.json new file mode 100644 index 000000000..ceaedd647 --- /dev/null +++ b/src/components/common/VnTableObj.json @@ -0,0 +1,33 @@ +// { +// isId: Boolean +// align: 'left', +// field: 'hasFile', +// label: t('globals.original'), +// name: 'hasFile', +// component: QCheckbox ?? span, +// cardVisible: Boolean +// isId: 1/2 +// color: function +// props: (prop) => ({ +// disable: true, +// 'model-value': Boolean(prop.value), +// }), +// tableActions: { +// field: 'tableActions', +// name: 'tableActions', +// actions: [ +// { +// title: t('Client ticket list'), +// icon: 'vn:ticket', +// action: redirectToCreateView, +// isPrimary: true, +// }, +// { +// title: t('Client ticket list'), +// icon: 'preview', +// action: (row) => viewSummary(row.id, CustomerSummary), +// }, +// ], +// }, +// }, +// tableActions y hacer bucle diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index eb0bbbe66..380bafb03 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -62,6 +62,8 @@ onMounted(() => { if (Object.keys(store.userParams).length > 0) { userParams.value = JSON.parse(JSON.stringify(store.userParams)); } + + console.log('userParams.value: ', userParams.value); emit('init', { params: userParams.value }); }); @@ -165,7 +167,7 @@ function formatValue(value) { - + [ field: 'customerStatus', label: 'customerStatus', name: 'customerStatus', + columnFilter: false, }, { align: 'left', @@ -272,6 +273,9 @@ const columns = computed(() => [ label: t('customer.extendedList.tableVisibleColumns.id'), name: 'id', isId: 1, + columnFilter: { + field: 'search', + }, }, { align: 'left', @@ -279,6 +283,11 @@ const columns = computed(() => [ label: t('customer.extendedList.tableVisibleColumns.name'), name: 'name', isId: 2, + columnFilter: { + inWhere: { + prefix: 'c', + }, + }, }, { align: 'left', From 5ed2a821940bfa6258cc7fe530be34a0d2eb263c Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 6 May 2024 14:50:15 +0200 Subject: [PATCH 006/174] feat: refs #6739 transferInvoice new checkbox and functionality --- src/components/TransferInvoiceForm.vue | 104 ++++++++++++++++++++++--- 1 file changed, 95 insertions(+), 9 deletions(-) diff --git a/src/components/TransferInvoiceForm.vue b/src/components/TransferInvoiceForm.vue index de3196e2c..637ebda64 100644 --- a/src/components/TransferInvoiceForm.vue +++ b/src/components/TransferInvoiceForm.vue @@ -1,5 +1,5 @@ diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 380bafb03..838cdd444 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -67,18 +67,36 @@ onMounted(() => { emit('init', { params: userParams.value }); }); +function setUserParams(params) { + if (!params) { + userParams.value = {}; + } else { + userParams.value = params; + } +} + watch( () => route.query.params, (val) => { - if (!val) { - userParams.value = {}; - } else { - const parsedParams = JSON.parse(val); - userParams.value = { ...parsedParams }; - } + setUserParams(val); } ); +watch( + () => arrayData.store.userParams, + (val) => { + setUserParams(val); + } +); + +watch( + () => arrayData.store.filter, + (val) => { + console.log('watch filter: ', val); + }, + { deep: true } +); + const isLoading = ref(false); async function search() { store.filter.where = {}; @@ -131,14 +149,15 @@ async function clearFilters() { emit('clear'); } -const tagsList = computed(() => - Object.entries(userParams.value) +const tagsList = computed(() => { + console.log('userParams.value: ', userParams.value); + return Object.entries(userParams.value) .filter(([key, value]) => value && !(props.hiddenTags || []).includes(key)) .map(([key, value]) => ({ label: key, value: value, - })) -); + })); +}); const tags = computed(() => tagsList.value.filter((tag) => !(props.customTags || []).includes(tag.label)) diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue index 29aeb97b4..0cacf57d9 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue @@ -275,6 +275,11 @@ const columns = computed(() => [ isId: 1, columnFilter: { field: 'search', + component: 'select', + attrs: { + url: 'Clients', + fields: ['id', 'name'], + }, }, }, { @@ -283,11 +288,6 @@ const columns = computed(() => [ label: t('customer.extendedList.tableVisibleColumns.name'), name: 'name', isId: 2, - columnFilter: { - inWhere: { - prefix: 'c', - }, - }, }, { align: 'left', From 7befca94bda44686025779d90232b53152ee7e19 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 7 May 2024 10:35:48 +0200 Subject: [PATCH 008/174] refactor: refs #6739 new confirmation window --- src/components/TransferInvoiceForm.vue | 41 +++++++++++--------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/components/TransferInvoiceForm.vue b/src/components/TransferInvoiceForm.vue index 637ebda64..b3c40b696 100644 --- a/src/components/TransferInvoiceForm.vue +++ b/src/components/TransferInvoiceForm.vue @@ -2,7 +2,8 @@ import { ref, reactive, onMounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; - +import { useQuasar } from 'quasar'; +import VnConfirm from 'components/ui/VnConfirm.vue'; import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'components/FetchData.vue'; import VnSelect from 'components/common/VnSelect.vue'; @@ -18,6 +19,7 @@ const $props = defineProps({ }, }); +const quasar = useQuasar(); const { t } = useI18n(); const router = useRouter(); const { notify } = useNotify(); @@ -77,35 +79,28 @@ const handleScroll = async () => { await fetchClients(); } }; - const transferInvoice = async () => { try { const clientDetails = await axios.get( `Clients/${transferInvoiceParams.newClientFk}` ); - const hasToInvoiceByAddress = clientDetails.data.hasToInvoiceByAddress; - if (checked.value && hasToInvoiceByAddress) { - const confirmed = confirm(t('confirmationInfo')); + if (checked.value && clientDetails.data.hasToInvoiceByAddress) + quasar.dialog({ + component: VnConfirm, + componentProps: { + title: t('Bill destination client'), + message: t('confirmationInfo'), + }, + }); - if (confirmed) { - const { data } = await axios.post( - 'InvoiceOuts/transferInvoice', - transferInvoiceParams - ); - notify(t('Transferred invoice'), 'positive'); - closeForm(); - router.push('InvoiceOutSummary', { id: data.id }); - } - } else { - const { data } = await axios.post( - 'InvoiceOuts/transferInvoice', - transferInvoiceParams - ); - notify(t('Transferred invoice'), 'positive'); - closeForm(); - router.push('InvoiceOutSummary', { id: data.id }); - } + const { data } = await axios.post( + 'InvoiceOuts/transferInvoice', + transferInvoiceParams + ); + notify(t('Transferred invoice'), 'positive'); + closeForm(); + router.push('InvoiceOutSummary', { id: data.id }); } catch (err) { console.error('Error transfering invoice', err); } From bc1a79ac6853c26a1947db1635121616467cff0c Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 7 May 2024 11:27:39 +0200 Subject: [PATCH 009/174] refactor: refs #6739 updated transferInvoice function --- src/components/TransferInvoiceForm.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/TransferInvoiceForm.vue b/src/components/TransferInvoiceForm.vue index b3c40b696..279ed822d 100644 --- a/src/components/TransferInvoiceForm.vue +++ b/src/components/TransferInvoiceForm.vue @@ -80,6 +80,16 @@ const handleScroll = async () => { } }; const transferInvoice = async () => { + const params = { + id: transferInvoiceParams.id, + cplusRectificationTypeFk: transferInvoiceParams.cplusRectificationTypeFk, + invoiceCorrectionTypeFk: transferInvoiceParams.invoiceCorrectionTypeFk, + newClientFk: transferInvoiceParams.newClientFk, + refFk: transferInvoiceParams.refFk, + siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk, + checked: checked.value, + }; + try { const clientDetails = await axios.get( `Clients/${transferInvoiceParams.newClientFk}` @@ -94,10 +104,7 @@ const transferInvoice = async () => { }, }); - const { data } = await axios.post( - 'InvoiceOuts/transferInvoice', - transferInvoiceParams - ); + const { data } = await axios.post('InvoiceOuts/transferInvoice', params); notify(t('Transferred invoice'), 'positive'); closeForm(); router.push('InvoiceOutSummary', { id: data.id }); From 1ba3a3151ced2b572c27736307b83c773cc6f6bf Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 7 May 2024 14:54:53 +0200 Subject: [PATCH 010/174] feat: refs #6825 scroll for table mode --- src/components/common/VnTable.vue | 32 +++++++++++++++++++++---------- src/components/ui/VnPaginate.vue | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/components/common/VnTable.vue b/src/components/common/VnTable.vue index b18f34779..85d15bec3 100644 --- a/src/components/common/VnTable.vue +++ b/src/components/common/VnTable.vue @@ -45,7 +45,8 @@ const stateStore = useStateStore(); const mode = ref('list'); const selected = ref([]); -const filters = ref({}); +const params = ref({}); +const VnPaginateRef = ref(); const tableModes = computed(() => { const modes = [ { @@ -84,10 +85,11 @@ function columnsCard(cols) {