From a6a27237341f27db158378a45d064b6458d33139 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 27 Jan 2025 14:21:09 +0100 Subject: [PATCH 01/23] feat: refs #8463 cardDescriptorBeta --- src/components/common/VnCardBeta.vue | 75 +++-- src/components/ui/CardDescriptorBeta.vue | 262 ++++++++++++++++++ src/pages/Order/Card/OrderCard.vue | 30 ++ src/pages/Order/Card/OrderDescriptor.vue | 45 +-- src/pages/Order/Card/OrderDescriptorProxy.vue | 7 +- src/pages/Order/Card/OrderSummary.vue | 3 +- 6 files changed, 358 insertions(+), 64 deletions(-) create mode 100644 src/components/ui/CardDescriptorBeta.vue diff --git a/src/components/common/VnCardBeta.vue b/src/components/common/VnCardBeta.vue index a1f07ff17..2579bf623 100644 --- a/src/components/common/VnCardBeta.vue +++ b/src/components/common/VnCardBeta.vue @@ -1,5 +1,5 @@ diff --git a/src/components/ui/CardDescriptorBeta.vue b/src/components/ui/CardDescriptorBeta.vue new file mode 100644 index 000000000..b2bac234d --- /dev/null +++ b/src/components/ui/CardDescriptorBeta.vue @@ -0,0 +1,262 @@ + + + + + + + diff --git a/src/pages/Order/Card/OrderCard.vue b/src/pages/Order/Card/OrderCard.vue index 823815f59..b371509c6 100644 --- a/src/pages/Order/Card/OrderCard.vue +++ b/src/pages/Order/Card/OrderCard.vue @@ -1,12 +1,42 @@ diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue index 0d5f0146f..4c2384f92 100644 --- a/src/pages/Order/Card/OrderDescriptor.vue +++ b/src/pages/Order/Card/OrderDescriptor.vue @@ -6,10 +6,11 @@ import { toCurrency, toDate } from 'src/filters'; import { useState } from 'src/composables/useState'; import useCardDescription from 'src/composables/useCardDescription'; -import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +import OrderCard from './OrderCard.vue'; +import CardDescriptorBeta from 'src/components/ui/CardDescriptorBeta.vue'; const DEFAULT_ITEMS = 0; @@ -26,37 +27,13 @@ const state = useState(); const { t } = useI18n(); const data = ref(useCardDescription()); const getTotalRef = ref(); +const total = ref(0); const entityId = computed(() => { return $props.id || route.params.id; }); -const filter = { - include: [ - { relation: 'agencyMode', scope: { fields: ['name'] } }, - { - relation: 'address', - scope: { fields: ['nickname'] }, - }, - { relation: 'rows', scope: { fields: ['id'] } }, - { - relation: 'client', - scope: { - fields: [ - 'salesPersonFk', - 'name', - 'isActive', - 'isFreezed', - 'isTaxDataChecked', - ], - include: { - relation: 'salesPersonUser', - scope: { fields: ['id', 'name'] }, - }, - }, - }, - ], -}; +const orderTotal = computed(() => state.get('orderTotal') ?? 0); const setData = (entity) => { if (!entity) return; @@ -68,9 +45,6 @@ const setData = (entity) => { const getConfirmationValue = (isConfirmed) => { return t(isConfirmed ? 'globals.confirmed' : 'order.summary.notConfirmed'); }; - -const orderTotal = computed(() => state.get('orderTotal') ?? 0); -const total = ref(0); diff --git a/src/pages/Order/Card/OrderDescriptorProxy.vue b/src/pages/Order/Card/OrderDescriptorProxy.vue index 04ebb054a..7b3d1a871 100644 --- a/src/pages/Order/Card/OrderDescriptorProxy.vue +++ b/src/pages/Order/Card/OrderDescriptorProxy.vue @@ -12,6 +12,11 @@ const $props = defineProps({ diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue index a289688e4..bef97bc0f 100644 --- a/src/pages/Order/Card/OrderSummary.vue +++ b/src/pages/Order/Card/OrderSummary.vue @@ -13,6 +13,7 @@ import FetchedTags from 'components/ui/FetchedTags.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue'; +import OrderDescriptorProxy from './OrderDescriptorProxy.vue'; const { t } = useI18n(); const route = useRoute(); @@ -106,7 +107,7 @@ async function handleConfirm() { From 4d8fb8eb5beaa82573170c8d278f4c351fff4d2f Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 13 Mar 2025 09:01:15 +0100 Subject: [PATCH 02/23] refactor: refs #8463 simplify creating VnDescriptor --- src/components/common/VnCard.vue | 26 +- src/components/ui/CardDescriptorBeta.vue | 256 ++----------------- src/components/ui/VnDescriptor.vue | 298 +++++++++++++++++++++++ src/pages/Order/Card/OrderDescriptor.vue | 9 +- 4 files changed, 333 insertions(+), 256 deletions(-) create mode 100644 src/components/ui/VnDescriptor.vue diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 620dc2ad2..dfa51c8c4 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,12 +1,15 @@ diff --git a/src/components/ui/CardDescriptorBeta.vue b/src/components/ui/CardDescriptorBeta.vue index b2bac234d..86f756a7b 100644 --- a/src/components/ui/CardDescriptorBeta.vue +++ b/src/components/ui/CardDescriptorBeta.vue @@ -1,262 +1,38 @@ - - - - + " + /> + + + + diff --git a/src/components/ui/VnDescriptor.vue b/src/components/ui/VnDescriptor.vue new file mode 100644 index 000000000..0aad35448 --- /dev/null +++ b/src/components/ui/VnDescriptor.vue @@ -0,0 +1,298 @@ + + + + + + + + + en: + globals: + copyId: Copy ID + es: + globals: + copyId: Copiar ID + diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue index 133d328c0..15e8cf070 100644 --- a/src/pages/Order/Card/OrderDescriptor.vue +++ b/src/pages/Order/Card/OrderDescriptor.vue @@ -4,8 +4,6 @@ import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { toCurrency, toDate } from 'src/filters'; import { useState } from 'src/composables/useState'; -import filter from './OrderFilter.js'; -import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; @@ -57,14 +55,11 @@ const getConfirmationValue = (isConfirmed) => { />