From 78561c5f42e1660333c28a85618fbc199f2390b8 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 22 Apr 2024 08:34:38 -0300 Subject: [PATCH 01/28] Item types --- src/i18n/locale/en.yml | 19 ++++ src/i18n/locale/es.yml | 24 +++++ src/pages/Item/ItemTypeCreate.vue | 91 ++++++++++++++++ src/pages/Item/ItemTypeList.vue | 86 +++++++++++++++ src/pages/ItemType/Card/ItemTypeBasicData.vue | 79 ++++++++++++++ src/pages/ItemType/Card/ItemTypeCard.vue | 26 +++++ .../ItemType/Card/ItemTypeDescriptor.vue | 82 ++++++++++++++ src/pages/ItemType/Card/ItemTypeSummary.vue | 102 ++++++++++++++++++ src/router/modules/index.js | 2 + src/router/modules/item.js | 21 +++- src/router/modules/itemType.js | 45 ++++++++ src/router/routes.js | 2 + 12 files changed, 577 insertions(+), 2 deletions(-) create mode 100644 src/pages/Item/ItemTypeCreate.vue create mode 100644 src/pages/Item/ItemTypeList.vue create mode 100644 src/pages/ItemType/Card/ItemTypeBasicData.vue create mode 100644 src/pages/ItemType/Card/ItemTypeCard.vue create mode 100644 src/pages/ItemType/Card/ItemTypeDescriptor.vue create mode 100644 src/pages/ItemType/Card/ItemTypeSummary.vue create mode 100644 src/router/modules/itemType.js diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 3ac3d18a0..2962bbe44 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1119,6 +1119,8 @@ item: tags: Tags wasteBreakdown: Waste breakdown itemCreate: New item + itemTypeCreate: New item type + family: Item Type descriptor: item: Item buyer: Buyer @@ -1153,6 +1155,23 @@ item: type: Type intrastat: Intrastat origin: Origin +itemType: + pageTitles: + itemType: Item type + basicData: Basic data + summary: Summary + shared: + code: Code + name: Name + worker: Worker + category: Category + temperature: Temperature + summary: + id: id + life: Life + promo: Promo + itemPackingType: Item packing type + isUnconventionalSize: Is unconventional size components: topbar: {} userPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 4ecbcdbc0..d52240bf4 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1118,6 +1118,8 @@ item: tags: Etiquetas wasteBreakdown: Deglose de mermas itemCreate: Nuevo artículo + itemTypeCreate: Nueva familia + family: Familia descriptor: item: Artículo buyer: Comprador @@ -1152,6 +1154,28 @@ item: type: Tipo intrastat: Intrastat origin: Origen +itemType: + pageTitles: + itemType: Familia + basicData: Datos básicos + summary: Resumen + shared: + code: Código + name: Nombre + worker: Trabajador + category: Reino + temperature: Temperatura + summary: + id: id + code: Código + name: Nombre + worker: Trabajador + category: Reino + temperature: Temperatura + life: Vida + promo: Promoción + itemPackingType: Tipo de embalaje + isUnconventionalSize: Es de tamaño no convencional components: topbar: {} userPanel: diff --git a/src/pages/Item/ItemTypeCreate.vue b/src/pages/Item/ItemTypeCreate.vue new file mode 100644 index 000000000..3540fc5af --- /dev/null +++ b/src/pages/Item/ItemTypeCreate.vue @@ -0,0 +1,91 @@ + + + diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue new file mode 100644 index 000000000..b0b4de540 --- /dev/null +++ b/src/pages/Item/ItemTypeList.vue @@ -0,0 +1,86 @@ + + + + + +es: + New item type: Nueva familia + Name: Nombre + Search item type: Buscar familia + Search itemType by id, name or code: Buscar familia por id, nombre o código + diff --git a/src/pages/ItemType/Card/ItemTypeBasicData.vue b/src/pages/ItemType/Card/ItemTypeBasicData.vue new file mode 100644 index 000000000..ff2719896 --- /dev/null +++ b/src/pages/ItemType/Card/ItemTypeBasicData.vue @@ -0,0 +1,79 @@ + + diff --git a/src/pages/ItemType/Card/ItemTypeCard.vue b/src/pages/ItemType/Card/ItemTypeCard.vue new file mode 100644 index 000000000..bff91de06 --- /dev/null +++ b/src/pages/ItemType/Card/ItemTypeCard.vue @@ -0,0 +1,26 @@ + + diff --git a/src/pages/ItemType/Card/ItemTypeDescriptor.vue b/src/pages/ItemType/Card/ItemTypeDescriptor.vue new file mode 100644 index 000000000..cb0cb333b --- /dev/null +++ b/src/pages/ItemType/Card/ItemTypeDescriptor.vue @@ -0,0 +1,82 @@ + + + + + +es: + Go to module index: Ir al índice del módulo + diff --git a/src/pages/ItemType/Card/ItemTypeSummary.vue b/src/pages/ItemType/Card/ItemTypeSummary.vue new file mode 100644 index 000000000..b71b2acf5 --- /dev/null +++ b/src/pages/ItemType/Card/ItemTypeSummary.vue @@ -0,0 +1,102 @@ + + + diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 302ba7fe0..0b9d10d98 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -15,6 +15,7 @@ import Department from './department'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; +import ItemType from './itemType'; export default [ Item, @@ -34,4 +35,5 @@ export default [ Entry, roadmap, Parking, + ItemType, ]; diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 41f3ec92a..17e9b7673 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -10,7 +10,7 @@ export default { component: RouterView, redirect: { name: 'ItemMain' }, menus: { - main: ['ItemList', 'WasteBreakdown'], + main: ['ItemList', 'WasteBreakdown', 'ItemTypeList'], card: ['ItemBasicData'], }, children: [ @@ -33,7 +33,7 @@ export default { path: 'create', name: 'ItemCreate', meta: { - title: 'create', + title: 'itemCreate', }, component: () => import('src/pages/Item/ItemCreate.vue'), }, @@ -50,6 +50,23 @@ export default { 'https://grafana.verdnatura.es/d/TTNXQAxVk'; }, }, + { + path: 'item-type-list', + name: 'ItemTypeList', + meta: { + title: 'family', + icon: 'contact_support', + }, + component: () => import('src/pages/Item/ItemTypeList.vue'), + }, + { + path: 'item-type-list/create', + name: 'ItemTypeCreate', + meta: { + title: 'itemTypeCreate', + }, + component: () => import('src/pages/Item/ItemTypeCreate.vue'), + }, ], }, { diff --git a/src/router/modules/itemType.js b/src/router/modules/itemType.js new file mode 100644 index 000000000..0d966c32c --- /dev/null +++ b/src/router/modules/itemType.js @@ -0,0 +1,45 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/item-type', + name: 'ItemType', + meta: { + title: 'itemType', + icon: 'contact_support', + }, + component: RouterView, + redirect: { name: 'ItemTypeCard' }, + menus: { + main: [], + card: ['ItemTypeBasicData'], + }, + children: [ + { + name: 'ItemTypeCard', + path: ':id', + component: () => import('src/pages/ItemType/Card/ItemTypeCard.vue'), + redirect: { name: 'ItemTypeSummary' }, + children: [ + { + name: 'ItemTypeSummary', + path: 'summary', + meta: { + title: 'summary', + }, + component: () => + import('src/pages/ItemType/Card/ItemTypeSummary.vue'), + }, + { + name: 'ItemTypeBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => + import('src/pages/ItemType/Card/ItemTypeBasicData.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/routes.js b/src/router/routes.js index 51e726a62..198f1d8f2 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -10,6 +10,7 @@ import supplier from './modules/Supplier'; import route from './modules/route'; import travel from './modules/travel'; import department from './modules/department'; +import ItemType from './modules/itemType'; import shelving from 'src/router/modules/shelving'; import order from 'src/router/modules/order'; import entry from 'src/router/modules/entry'; @@ -71,6 +72,7 @@ const routes = [ roadmap, entry, parking, + ItemType, { path: '/:catchAll(.*)*', name: 'NotFound', From 42fe189e9f6b222cb6a1c81d916dfd82cbec5601 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 23 Apr 2024 16:45:28 -0300 Subject: [PATCH 02/28] Add module name in Item router file --- src/router/modules/item.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 17e9b7673..70d49c56c 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -6,6 +6,7 @@ export default { meta: { title: 'items', icon: 'vn:item', + moduleName: 'Item', }, component: RouterView, redirect: { name: 'ItemMain' }, From 82300fd292307a89a5397397db44add3f1ca6b17 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 24 Apr 2024 11:31:37 +0200 Subject: [PATCH 03/28] refactor: refs #7239 changed french translations --- src/components/common/VnSmsDialog.vue | 39 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/src/components/common/VnSmsDialog.vue b/src/components/common/VnSmsDialog.vue index 59021cef4..4306beb4c 100644 --- a/src/components/common/VnSmsDialog.vue +++ b/src/components/common/VnSmsDialog.vue @@ -21,7 +21,8 @@ const props = defineProps({ }, template: { type: String, - required: true, + required: false, + default: '', }, locale: { type: String, @@ -49,7 +50,7 @@ updateMessage(); function updateMessage() { const params = props.data; - const key = `templates['${props.template}']`; + const key = props.template ? `templates['${props.template}']` : ''; message.value = t(key, params, { locale: locale.value }); } @@ -104,15 +105,14 @@ async function send() { map-options :input-debounce="0" rounded - outlined dense /> - + - + + + From ccc68851728ab8cea17699c581ff7442924419c9 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 04:41:44 +0000 Subject: [PATCH 06/28] Fix: minor bugs, layout & vnlocation --- .../components/CustomerAddressEdit.vue | 65 ++++++++++--------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index 8f4be1342..c3c5c82ae 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -169,21 +169,9 @@ function handleLocation(data, location) {
-
- -
-
- -
-
- -
-
- -
-
- - -
- -
+ +
+ +
+
+ +
+
+ + +
+ +
+
+ +
+
+ +
+
+

{{ t('Notes') }}

Date: Thu, 25 Apr 2024 14:44:32 +0200 Subject: [PATCH 07/28] fix: CustomerAdress layout --- .../components/CustomerAddressEdit.vue | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index c3c5c82ae..dd2717694 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -169,6 +169,21 @@ function handleLocation(data, location) {
+
+ +
+
+ + +
+ +
@@ -183,6 +198,24 @@ function handleLocation(data, location) { v-model="data.agencyModeFk" />
+
+ +
+
+ +
+
+ +
+ +
- - -
- -
-
- -
-
- - -
- -
-
- -
-
- -
-
-

{{ t('Notes') }}

Date: Fri, 26 Apr 2024 07:49:28 +0200 Subject: [PATCH 08/28] refactor: refs #7239 changed spanish translations --- src/components/common/VnSmsDialog.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnSmsDialog.vue b/src/components/common/VnSmsDialog.vue index 4306beb4c..833f54942 100644 --- a/src/components/common/VnSmsDialog.vue +++ b/src/components/common/VnSmsDialog.vue @@ -199,8 +199,9 @@ es: templates: pendingPayment: 'Su pedido está pendiente de pago. Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.' - minAmount: 'Es necesario un importe mínimo de 50€ (Sin IVA) en su pedido - { orderId } con llegada { landing } para recibirlo sin portes adicionales.' + minAmount: 'Te recordamos que tu pedido {orderId} es inferior a 50€. + Te recomendamos amplíes para no generar costes extra provocarán un incremento de tu tarifa. + ¡Un saludo!' orderChanges: 'Pedido {orderId} con llegada estimada día { landing }: { changes }' en: Inglés es: Español From c56b6b2dbc5a2b6983cab7461836de2bd530d8cd Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 26 Apr 2024 08:22:08 +0200 Subject: [PATCH 09/28] refactor: better syntax --- src/components/common/VnSmsDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/VnSmsDialog.vue b/src/components/common/VnSmsDialog.vue index 833f54942..5b192f95d 100644 --- a/src/components/common/VnSmsDialog.vue +++ b/src/components/common/VnSmsDialog.vue @@ -200,7 +200,7 @@ es: pendingPayment: 'Su pedido está pendiente de pago. Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.' minAmount: 'Te recordamos que tu pedido {orderId} es inferior a 50€. - Te recomendamos amplíes para no generar costes extra provocarán un incremento de tu tarifa. + Te recomendamos amplíes para no generar costes extra, provocarán un incremento de tu tarifa. ¡Un saludo!' orderChanges: 'Pedido {orderId} con llegada estimada día { landing }: { changes }' en: Inglés From 88e1e577c4f7970a80fee568142539b839b918a6 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 26 Apr 2024 13:10:29 +0200 Subject: [PATCH 10/28] hotFix: refs #6636 fix ref optionsList --- src/pages/Claim/Card/ClaimBasicData.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 56717c628..47d1ac1c6 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -41,6 +41,7 @@ const workers = ref([]); const workersCopy = ref([]); const claimStates = ref([]); const claimStatesCopy = ref([]); +const optionsList = ref([]); function setWorkers(data) { workers.value = data; @@ -51,9 +52,9 @@ function setClaimStates(data) { claimStates.value = data; claimStatesCopy.value = data; } -let optionsList; + async function getEnumValues() { - optionsList = [{ id: null, description: t('claim.basicData.null') }]; + optionsList.value = [{ id: null, description: t('claim.basicData.null') }]; const { data } = await axios.get(`Applications/get-enum-values`, { params: { schema: 'vn', @@ -62,8 +63,9 @@ async function getEnumValues() { }, }); for (let value of data) - optionsList.push({ id: value, description: t(`claim.basicData.${value}`) }); + optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) }); } + getEnumValues(); const workerFilter = { From 127567898da40f416db6d3fcc3da7231dba59a3d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 26 Apr 2024 13:27:58 +0200 Subject: [PATCH 11/28] fix: add filter panel --- src/pages/Item/ItemTypeList.vue | 22 +++++++++++- src/pages/ItemType/ItemTypeFilter.vue | 49 +++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 src/pages/ItemType/ItemTypeFilter.vue diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index b0b4de540..5b106916d 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -6,6 +6,7 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import CardList from 'src/components/ui/CardList.vue'; import ItemTypeSummary from 'src/pages/ItemType/Card/ItemTypeSummary.vue'; +import ItemTypeFilter from 'src/pages/ItemType/ItemTypeFilter.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import { useStateStore } from 'stores/useStateStore'; @@ -31,12 +32,31 @@ const redirectToCreateView = () => { + +
+ + + {{ t('globals.collapseMenu') }} + + +
+
+ + + + +
+import { useI18n } from 'vue-i18n'; +import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; +import VnInput from 'src/components/common/VnInput.vue'; +const { t } = useI18n(); + +const props = defineProps({ + dataKey: { + type: String, + required: true, + }, +}); + + + + + +en: + params: + name: Name + code: Code +es: + params: + name: Nombre + code: Código + Name: Nombre + Code: Código + From c1ed4ab03280b8125c92e8587e9a8bd4ca626abd Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 26 Apr 2024 14:49:54 +0200 Subject: [PATCH 12/28] fix: add exprBuilder --- src/components/ui/VnFilterPanel.vue | 3 ++- src/components/ui/VnSearchbar.vue | 2 ++ src/pages/Item/ItemTypeList.vue | 17 +++++++++++++++-- src/pages/ItemType/ItemTypeFilter.vue | 8 +++++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 96d097191..cde48e9b3 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -145,7 +145,8 @@ const customTags = computed(() => ); async function remove(key) { - userParams.value[key] = null; + // userParams.value[key] = null; + if (userParams.value[key]) delete userParams.value[key]; await search(); emit('remove', key); } diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index fc8475ace..da8d43c95 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -81,8 +81,10 @@ async function search() { const staticParams = Object.entries(store.userParams).filter( ([key, value]) => value && (props.staticParams || []).includes(key) ); + // const filter =props?.where? { where: JSON.parse(props.where) }: {} await arrayData.applyFilter({ params: { + // filter , ...Object.fromEntries(staticParams), search: searchText.value, }, diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index 5b106916d..1e21c1719 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -24,6 +24,17 @@ const redirectToItemTypeSummary = (id) => { const redirectToCreateView = () => { router.push({ name: 'ItemTypeCreate' }); }; +const exprBuilder = (param, value) => { + switch (param) { + case 'name': + case 'code': + case 'search': + return { + name: { like: `%${value}%` }, + code: { like: `%${value}%` }, + }; + } +}; - + diff --git a/src/pages/ItemType/ItemTypeFilter.vue b/src/pages/ItemType/ItemTypeFilter.vue index 33238545f..2a86795c2 100644 --- a/src/pages/ItemType/ItemTypeFilter.vue +++ b/src/pages/ItemType/ItemTypeFilter.vue @@ -10,10 +10,16 @@ const props = defineProps({ required: true, }, }); + +const emit = defineEmits(['search']);