From 78561c5f42e1660333c28a85618fbc199f2390b8 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 22 Apr 2024 08:34:38 -0300 Subject: [PATCH 01/18] 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/18] 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 e6c9a692f54b610016d32b68db20e1c42185bf6c Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 24 Apr 2024 14:33:10 +0200 Subject: [PATCH 03/18] feat moduleName --- src/router/modules/department.js | 1 + src/router/modules/itemType.js | 1 + src/router/modules/roadmap.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/router/modules/department.js b/src/router/modules/department.js index aaffc3460..dfd5e64ba 100644 --- a/src/router/modules/department.js +++ b/src/router/modules/department.js @@ -6,6 +6,7 @@ export default { meta: { title: 'department', icon: 'vn:greuge', + moduleName: 'Department', }, component: RouterView, redirect: { name: 'DepartmentCard' }, diff --git a/src/router/modules/itemType.js b/src/router/modules/itemType.js index 0d966c32c..32bd63690 100644 --- a/src/router/modules/itemType.js +++ b/src/router/modules/itemType.js @@ -6,6 +6,7 @@ export default { meta: { title: 'itemType', icon: 'contact_support', + moduleName: 'ItemType', }, component: RouterView, redirect: { name: 'ItemTypeCard' }, diff --git a/src/router/modules/roadmap.js b/src/router/modules/roadmap.js index 02edf94be..6b2aa6a13 100644 --- a/src/router/modules/roadmap.js +++ b/src/router/modules/roadmap.js @@ -6,6 +6,7 @@ export default { meta: { title: 'roadmap', icon: 'vn:troncales', + moduleName: 'Roadmap', }, component: RouterView, redirect: { name: 'RouteMain' }, From e1f50f5daf3d017c6b8a04470822f061368b1340 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 24 Apr 2024 15:05:10 +0200 Subject: [PATCH 04/18] fix: minorchanges --- src/i18n/locale/es.yml | 2 +- src/pages/ItemType/Card/ItemTypeSummary.vue | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 6d2e5c8c2..6634b6f07 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1234,7 +1234,7 @@ itemType: life: Vida promo: Promoción itemPackingType: Tipo de embalaje - isUnconventionalSize: Es de tamaño no convencional + isUnconventionalSize: Es de tamaño poco convencional components: topbar: {} itemsFilterPanel: diff --git a/src/pages/ItemType/Card/ItemTypeSummary.vue b/src/pages/ItemType/Card/ItemTypeSummary.vue index b71b2acf5..393675a30 100644 --- a/src/pages/ItemType/Card/ItemTypeSummary.vue +++ b/src/pages/ItemType/Card/ItemTypeSummary.vue @@ -93,6 +93,7 @@ async function setItemTypeData(data) { :value="itemType.itemPackingType?.description" /> @@ -100,3 +101,9 @@ async function setItemTypeData(data) { + + From 127567898da40f416db6d3fcc3da7231dba59a3d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 26 Apr 2024 13:27:58 +0200 Subject: [PATCH 05/18] 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 06/18] 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']);