From 48f10707400afd1ddedb843f236dd6fc28d5b8bd Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 5 Nov 2024 12:52:53 +0100 Subject: [PATCH 001/558] feat(VnLog): add descriptors --- src/components/common/VnJsonValue.vue | 63 ++++++++++++++++++--------- src/components/common/VnLog.vue | 59 +++++++++++-------------- src/stores/useDescriptorStore.js | 29 ++++++++++++ 3 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 src/stores/useDescriptorStore.js diff --git a/src/components/common/VnJsonValue.vue b/src/components/common/VnJsonValue.vue index a2e858d0d..408d16d1a 100644 --- a/src/components/common/VnJsonValue.vue +++ b/src/components/common/VnJsonValue.vue @@ -1,67 +1,86 @@ @@ -85,4 +104,8 @@ updateValue(); color: #cd7c7c; font-style: italic; } +.json-link { + text-decoration: underline; + cursor: pointer; +} diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 8c71c0997..7b65a8a88 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -598,33 +598,17 @@ watch( /> - - - {{ prop.nameI18n }}: - - - ,  - - - -
+ - {{ prop.nameI18n }}: + v-if=" + prop2Index < log.props.length + " + class="q-mr-xs" + >, - #{{ prop.val.id }} - + { + const descriptors = ref({}); + const loaded = ref(false); + + function set() { + const files = import.meta.glob(`src/**/*DescriptorProxy.vue`); + for (const file in files) { + descriptors.value[file.split('/').at(-1).slice(0, -19).toLowerCase() + 'Fk'] = + defineAsyncComponent(() => import(file)); + } + loaded.value = true; + } + + function get() { + if (!loaded.value) set(); + } + + function has(name) { + get(); + return descriptors.value[name]; + } + + return { + has, + }; +}); From dd0917a57daa6404570965dfb61ae3b06dd57cbd Mon Sep 17 00:00:00 2001 From: provira Date: Fri, 3 Jan 2025 07:37:47 +0100 Subject: [PATCH 002/558] refactor: refs #8322 changed Wagon component to use VnSection/VnCardBeta --- src/pages/Wagon/Card/WagonCard.vue | 4 +- src/pages/Wagon/WagonList.vue | 161 ++++++++++++++++------------- src/router/modules/wagon.js | 47 ++++++--- 3 files changed, 123 insertions(+), 89 deletions(-) diff --git a/src/pages/Wagon/Card/WagonCard.vue b/src/pages/Wagon/Card/WagonCard.vue index ed6c83778..8dadca85c 100644 --- a/src/pages/Wagon/Card/WagonCard.vue +++ b/src/pages/Wagon/Card/WagonCard.vue @@ -1,6 +1,6 @@ diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue index f306c4c8d..9ee68bcf0 100644 --- a/src/pages/Wagon/WagonList.vue +++ b/src/pages/Wagon/WagonList.vue @@ -8,6 +8,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue'; import { computed, ref } from 'vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; +import VnSection from 'src/components/common/VnSection.vue'; const quasar = useQuasar(); const arrayData = useArrayData('WagonList'); @@ -15,6 +16,7 @@ const store = arrayData.store; const router = useRouter(); const { t } = useI18n(); const tableRef = ref(); +const dataKey = 'WagonList'; const filter = { include: { relation: 'type', @@ -92,79 +94,90 @@ async function remove(row) { diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js index 4a322d305..d0f4b2281 100644 --- a/src/router/modules/wagon.js +++ b/src/router/modules/wagon.js @@ -1,34 +1,55 @@ import { RouterView } from 'vue-router'; +const wagonCard = { + + name: 'WagonCard', + path: ':id', + component: () => import('src/pages/Ticket/Card/WagonCard.vue'), + redirect: { name: 'WagonSummary' }, + meta: { + //main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'], + menu: [], + }, + children: [ + {}, + ], +}; + export default { - path: '/wagon', name: 'Wagon', + path: '/wagon', meta: { title: 'wagons', icon: 'vn:trolley', moduleName: 'Wagon', + keyBinding: 'w', + menu: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'], }, component: RouterView, redirect: { name: 'WagonMain' }, - menus: { - main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'], - card: [], - }, children: [ { - path: '/wagon', + path: '', name: 'WagonMain', component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'WagonList' }, + redirect: { name: 'WagonIndexMain' }, children: [ { - path: 'list', - name: 'WagonList', - meta: { - title: 'list', - icon: 'vn:trolley', - }, + path: '', + name: 'WagonIndexMain', + redirect: { name: 'WagonList' }, component: () => import('src/pages/Wagon/WagonList.vue'), + children: [ + { + name: 'WagonList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + }, + + ] }, { path: 'create', From a6a27237341f27db158378a45d064b6458d33139 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 27 Jan 2025 14:21:09 +0100 Subject: [PATCH 003/558] 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 ac8e9cbfd25e2391627943e0ab50990438886b87 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 29 Jan 2025 12:43:02 +0100 Subject: [PATCH 004/558] refactor: refs #7414 update VnLog component to change display order value changes on update action --- src/components/common/VnLog.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index fdf2e52ee..d1d8d8360 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -641,16 +641,7 @@ watch( > {{ prop.nameI18n }}: - - - #{{ prop.val.id }} - - - ← - #{{ prop.old.id }} + + → + + + #{{ prop.val.id }} +
From 71a8e72f20a4be49a3da8c40b9363d1c6b3d2ed0 Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 31 Jan 2025 12:26:20 +0100 Subject: [PATCH 005/558] refactor: refs #6802 replace 'salesPerson' terminology with 'team' across multiple locales and components --- src/components/ItemsFilterPanel.vue | 2 - src/components/__tests__/Leftmenu.spec.js | 10 +- src/i18n/locale/en.yml | 5 +- src/i18n/locale/es.yml | 7 +- src/pages/Claim/Card/ClaimDescriptor.vue | 6 +- src/pages/Claim/Card/ClaimFilter.js | 2 +- src/pages/Claim/Card/ClaimSummary.vue | 2 +- src/pages/Customer/Card/CustomerBasicData.vue | 20 +-- .../Customer/Card/CustomerDescriptor.vue | 14 +- src/pages/Customer/Card/CustomerSummary.vue | 17 +- src/pages/Customer/CustomerCreate.vue | 146 ------------------ src/pages/Customer/CustomerFilter.vue | 26 +--- src/pages/Customer/CustomerList.vue | 47 +----- .../Customer/Defaulter/CustomerDefaulter.vue | 26 ---- .../Defaulter/CustomerDefaulterFilter.vue | 33 ---- .../Notifications/CustomerNotifications.vue | 18 +-- src/pages/Customer/locale/en.yml | 3 +- src/pages/Customer/locale/es.yml | 3 +- src/pages/Entry/EntryLatestBuysFilter.vue | 7 +- .../InvoiceOut/InvoiceOutNegativeBases.vue | 12 +- src/pages/Monitor/MonitorClients.vue | 30 ++-- src/pages/Monitor/MonitorOrders.vue | 37 ++--- .../Monitor/Ticket/MonitorTicketFilter.vue | 15 +- src/pages/Monitor/Ticket/MonitorTickets.vue | 35 ++--- src/pages/Monitor/locale/en.yml | 1 - src/pages/Monitor/locale/es.yml | 1 - src/pages/Order/Card/OrderBasicData.vue | 14 +- src/pages/Order/Card/OrderDescriptor.vue | 12 +- src/pages/Order/Card/OrderFilter.vue | 19 +-- src/pages/Order/OrderList.vue | 35 ++--- src/pages/Order/locale/en.yml | 3 - src/pages/Order/locale/es.yml | 3 - .../Card/BasicData/TicketBasicDataView.vue | 11 +- src/pages/Ticket/Card/TicketDescriptor.vue | 17 +- src/pages/Ticket/Card/TicketSale.vue | 12 +- src/pages/Ticket/Card/TicketSummary.vue | 14 +- src/pages/Ticket/TicketFilter.vue | 17 +- src/pages/Ticket/TicketList.vue | 42 +++-- src/pages/Ticket/TicketWeekly.vue | 32 ++-- src/pages/Ticket/locale/en.yml | 4 +- src/pages/Ticket/locale/es.yml | 4 +- src/pages/Worker/Card/WorkerDescriptor.vue | 2 +- src/pages/Worker/Card/WorkerSummary.vue | 2 +- src/router/modules/customer.js | 58 ++----- .../integration/client/clientList.spec.js | 2 +- 45 files changed, 228 insertions(+), 600 deletions(-) delete mode 100644 src/pages/Customer/CustomerCreate.vue diff --git a/src/components/ItemsFilterPanel.vue b/src/components/ItemsFilterPanel.vue index dc2a34435..15d65a140 100644 --- a/src/components/ItemsFilterPanel.vue +++ b/src/components/ItemsFilterPanel.vue @@ -328,7 +328,6 @@ en: active: Is active visible: Is visible floramondo: Is floramondo - salesPersonFk: Buyer categoryFk: Category es: @@ -339,7 +338,6 @@ es: active: Activo visible: Visible floramondo: Floramondo - salesPersonFk: Comprador categoryFk: Categoría Plant: Planta natural Flower: Flor fresca diff --git a/src/components/__tests__/Leftmenu.spec.js b/src/components/__tests__/Leftmenu.spec.js index 10d9d66fb..dde4fe806 100644 --- a/src/components/__tests__/Leftmenu.spec.js +++ b/src/components/__tests__/Leftmenu.spec.js @@ -14,7 +14,7 @@ vi.mock('src/router/modules', () => ({ icon: 'vn:client', }, menus: { - main: ['CustomerList', 'CustomerCreate'], + main: ['CustomerList'], card: ['CustomerBasicData'], }, children: [ @@ -30,14 +30,6 @@ vi.mock('src/router/modules', () => ({ icon: 'view_list', }, }, - { - path: 'create', - name: 'CustomerCreate', - meta: { - title: 'createCustomer', - icon: 'vn:addperson', - }, - }, ], }, ], diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 3cce2a853..810fbde0f 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -97,7 +97,6 @@ globals: file: File selectFile: Select a file copyClipboard: Copy on clipboard - salesPerson: SalesPerson send: Send code: Code since: Since @@ -155,6 +154,7 @@ globals: changeState: Change state raid: 'Raid {daysInForward} days' isVies: Vies + department: Department pageTitles: logIn: Login addressEdit: Update address @@ -336,7 +336,6 @@ globals: subtitle: Are you sure exit without saving? params: clientFk: Client id - salesPersonFk: Sales person warehouseFk: Warehouse provinceFk: Province stateFk: State @@ -510,7 +509,6 @@ department: departmentRemoved: Department removed worker: list: - department: Department schedule: Schedule newWorker: New worker summary: @@ -736,7 +734,6 @@ components: mine: For me hasMinPrice: Minimum price # LatestBuysFilter - salesPersonFk: Buyer supplierFk: Supplier from: From to: To diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 897edd9fe..6532bf522 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -97,7 +97,6 @@ globals: file: Fichero selectFile: Seleccione un fichero copyClipboard: Copiar en portapapeles - salesPerson: Comercial send: Enviar code: Código since: Desde @@ -155,6 +154,7 @@ globals: changeState: Cambiar estado raid: 'Redada {daysInForward} días' isVies: Vies + department: Departamento pageTitles: logIn: Inicio de sesión addressEdit: Modificar consignatario @@ -336,7 +336,6 @@ globals: subtitle: ¿Seguro que quiere salir sin guardar? params: clientFk: Id cliente - salesPersonFk: Comercial warehouseFk: Almacén provinceFk: Provincia stateFk: Estado @@ -452,8 +451,6 @@ ticket: create: address: Dirección order: - field: - salesPersonFk: Comercial form: clientFk: Cliente addressFk: Dirección @@ -482,7 +479,6 @@ department: departmentRemoved: Departamento eliminado worker: list: - department: Departamento schedule: Horario newWorker: Nuevo trabajador summary: @@ -707,7 +703,6 @@ components: hasMinPrice: Precio mínimo wareHouseFk: Almacén # LatestBuysFilter - salesPersonFk: Comprador supplierFk: Proveedor visible: Visible active: Activo diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index 02b63dd8e..e70929f5f 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -75,11 +75,11 @@ onMounted(async () => { - + diff --git a/src/pages/Claim/Card/ClaimFilter.js b/src/pages/Claim/Card/ClaimFilter.js index 50cabe228..4f119544c 100644 --- a/src/pages/Claim/Card/ClaimFilter.js +++ b/src/pages/Claim/Card/ClaimFilter.js @@ -14,7 +14,7 @@ export default { relation: 'client', scope: { include: [ - { relation: 'salesPersonUser' }, + { relation: 'department' }, { relation: 'claimsRatio', scope: { diff --git a/src/pages/Claim/Card/ClaimSummary.vue b/src/pages/Claim/Card/ClaimSummary.vue index 66fb151e5..d20757785 100644 --- a/src/pages/Claim/Card/ClaimSummary.vue +++ b/src/pages/Claim/Card/ClaimSummary.vue @@ -246,7 +246,7 @@ function claimUrl(section) { - + - + + + + + -import { reactive, ref } from 'vue'; -import { useI18n } from 'vue-i18n'; - -import FetchData from 'components/FetchData.vue'; -import FormModel from 'components/FormModel.vue'; -import VnRow from 'components/ui/VnRow.vue'; -import VnSelect from 'src/components/common/VnSelect.vue'; -import VnLocation from 'src/components/common/VnLocation.vue'; -import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; - -const { t } = useI18n(); - -const initialData = reactive({ - active: true, - isEqualizated: false, -}); - -const workersOptions = ref([]); -const businessTypesOptions = ref([]); - -function handleLocation(data, location) { - const { town, code, provinceFk, countryFk } = location ?? {}; - data.postcode = code; - data.city = town; - data.provinceFk = provinceFk; - data.countryFk = countryFk; -} - - - - - - - -es: - Comercial name: Nombre comercial - Salesperson: Comercial - Business type: Tipo de negocio - Tax number: NIF / CIF - Business name: Razón social - Street: Dirección fiscal - Postcode: Código postal - City: Población - Province: Provincia - Country: País - Web user: Usuario web - Email: Email - Is equalizated: Recargo de equivalencia - diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue index eae97d1be..c7757a7d4 100644 --- a/src/pages/Customer/CustomerFilter.vue +++ b/src/pages/Customer/CustomerFilter.vue @@ -1,10 +1,8 @@ - -