diff --git a/src/components/CMyChipList/CMyChipList.ts b/src/components/CMyChipList/CMyChipList.ts index 13eac9fb..ebbde3e8 100755 --- a/src/components/CMyChipList/CMyChipList.ts +++ b/src/components/CMyChipList/CMyChipList.ts @@ -20,6 +20,11 @@ export default defineComponent({ type: Number, required: false, }, + dense: { + type: Boolean, + required: false, + default: true, + }, optlab: { type: [String, Function], required: true, @@ -53,6 +58,11 @@ export default defineComponent({ required: false, default: null, }, + label: { + type: String, + required: false, + default: '', + } }, components: {}, setup(props, { emit }) { diff --git a/src/components/CMyChipList/CMyChipList.vue b/src/components/CMyChipList/CMyChipList.vue index db43321c..43662ef3 100755 --- a/src/components/CMyChipList/CMyChipList.vue +++ b/src/components/CMyChipList/CMyChipList.vue @@ -1,18 +1,15 @@ + + + + + + + + + + {{ getFieldValue(element, field) }} + + + + + + + + Modifica + + + + + Elimina + + + + + + + + > diff --git a/src/components/CSearchProduct/CSearchProduct.ts b/src/components/CSearchProduct/CSearchProduct.ts index 5affaa51..d2ba2990 100755 --- a/src/components/CSearchProduct/CSearchProduct.ts +++ b/src/components/CSearchProduct/CSearchProduct.ts @@ -242,15 +242,25 @@ export default defineComponent({ } + function naviga(path: string) { router.push(path) } function collabel(rec: any) { - // console.log('Record:', rec) + console.log('Record:', rec) let label = '' if (rec && rec.productInfo) { - label = `${rec.productInfo.name} - ${rec.productInfo.authors.map((a: any) => a.name + ' ' + a.surname).join(', ')}` + if (productStore.isNovitaById(rec.productInfo.date_pub)) + label += `🌟 ` + + label += `${rec.productInfo.name}`; + if (Array.isArray(rec.productInfo.authors)) { + const authors = rec.productInfo.authors.map((a: any) => `${a.name} ${a.surname}`).join(', '); + label += ` - (${authors})`; + } else { + label += rec.productInfo.authors ? ` - (${rec.productInfo.authors.name} ${rec.productInfo.authors.surname}) ` : ''; + } if (rec.productInfo.idStatoProdotto) { if (!productStore.isPubblicatoById(rec.productInfo.idStatoProdotto)) label += ' (' + productStore.getDescrStatiProdottoByIdStatoProdotto(rec.productInfo.idStatoProdotto || '') + ')' @@ -258,83 +268,83 @@ export default defineComponent({ if (productStore.isEsaurito(rec)) { label += ' (Attualmente non disponibile)' } - // console.log('Computed label:', label) + // console.log('Computed label:', label) + } + return label } - return label - } function insertProd() { - // console.log('insertProd') - emit('insert', myproduct.value) + // console.log('insertProd') + emit('insert', myproduct.value) } -function clickClose() { - searchList.value[0].value = '' - myproduct.value = null - emit('close') -} - -function updateproductmodif(element: IProduct) { - console.log('CSEARCHPRODUCT: updateproductmodif') - emit('updateproductmodif', element) -} - -async function searchOnGM(mystr: string) { - // refreshSingleBookFromGM({usaDBGMLocale: false}) - const options = { - - } - const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: '', isbn: mystr, ...options }) - if (ris) { - - const id = getSearchId() - loadProduct(id) - updateproductmodif(myproduct.value) - - // await updateproduct(false) - if (ris.error) { - tools.showNegativeNotif($q, ris.error) - } else { - tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK')) + function clickClose() { + searchList.value[0].value = '' + myproduct.value = null + emit('close') } - // updatefromgm.value = false - } + function updateproductmodif(element: IProduct) { + console.log('CSEARCHPRODUCT: updateproductmodif') + emit('updateproductmodif', element) + } -} + async function searchOnGM(mystr: string) { + // refreshSingleBookFromGM({usaDBGMLocale: false}) + const options = { -onMounted(mounted) + } + const ris = await globalStore.updateAllBookFromGM_T_Web_Articoli({ sku: '', isbn: mystr, ...options }) + if (ris) { -return { - userStore, - costanti, - tools, - toolsext, - search, - shared_consts, - productStore, - t, - loadpage, - refreshpage, - show_hide, - searchList, - fieldsTable, - mycolumns, - naviga, - myproduct, - optcatalogo, - idPage, - selauthor, - valoriopt, - labelcombo, - searchText, - insertProd, - focus, - clickClose, - saveSearch, - updateproductmodif, - searchOnGM, -} + const id = getSearchId() + loadProduct(id) + updateproductmodif(myproduct.value) + + // await updateproduct(false) + if (ris.error) { + tools.showNegativeNotif($q, ris.error) + } else { + tools.showPositiveNotif($q, t('dbgm.updateLocalDb_OK')) + } + + // updatefromgm.value = false + } + + } + + onMounted(mounted) + + return { + userStore, + costanti, + tools, + toolsext, + search, + shared_consts, + productStore, + t, + loadpage, + refreshpage, + show_hide, + searchList, + fieldsTable, + mycolumns, + naviga, + myproduct, + optcatalogo, + idPage, + selauthor, + valoriopt, + labelcombo, + searchText, + insertProd, + focus, + clickClose, + saveSearch, + updateproductmodif, + searchOnGM, + } } }) diff --git a/src/css/app.scss b/src/css/app.scss index d90ed5f8..cc55bc27 100755 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -2034,6 +2034,19 @@ h3 { /* Assicurati che sia sopra gli altri elementi */ } +.btn-edit-floating { + position: relative; + top: 4px; + right: 0px; + z-index: 10; + opacity: 0.5; + transition: opacity 0.3s ease; +} + +.btn-edit-floating:hover { + opacity: 1; +} + .marker-mini-icon { position: absolute; top: 5px; diff --git a/src/mixins/mixin-base.ts b/src/mixins/mixin-base.ts index 1769af21..53e24419 100755 --- a/src/mixins/mixin-base.ts +++ b/src/mixins/mixin-base.ts @@ -5,12 +5,13 @@ import { i18n } from 'src/boot/i18n' // Importa l'istanza di i18n configurata in import { useUserStore } from '@store/UserStore' import { useGlobalStore } from '@store/globalStore' import { useQuasar } from 'quasar' -import type { IDataPass, IProduct, IProductInfo, ISpecialField, IVariazione } from '@model'; +import type { ICatalog, IDataPass, IProduct, IProductInfo, ISpecialField, IVariazione } from '@model'; import { tools } from '../store/Modules/tools' import { costanti } from '@costanti' import { fieldsTable } from '@store/Modules/fieldsTable' import { useProducts } from '@store/Products' +import { useCatalogStore } from '@store/CatalogStore' const { t } = i18n.global; @@ -203,6 +204,13 @@ export default function () { const myfield = key as keyof IVariazione productStore.products[idprod].arrvariazioni[0][myfield] = value } + } else if (table === 'catalogs') { + const catalogStore = useCatalogStore() + const idcat = catalogStore.catalogs.findIndex((rec: ICatalog) => rec._id === id) + if (idcat >= 0 && key) { + const myfield = key as keyof ICatalog + catalogStore.catalogs[idcat][myfield] = value + } } console.log('mydatatosave', mydatatosave) diff --git a/src/model/CatalogStore.ts b/src/model/CatalogStore.ts index 57ae9888..e3bc7e4b 100755 --- a/src/model/CatalogStore.ts +++ b/src/model/CatalogStore.ts @@ -8,7 +8,7 @@ export interface ICatalog { active?: boolean title: string foto_collana?: IImg, - idCollane?: number[] + idCollane?: string[] argomenti?: string[] editore?: string[] collana_info?: ICollana diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 41cbd8fb..33ea6def 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -811,7 +811,7 @@ export interface IMyScheda { idTipologie?: number[] editore?: string[] argomenti?: string[] - idCollane?: number[] + idCollane?: string[] author?: string sort_field?: string sort_dir?: number @@ -860,7 +860,7 @@ export interface IOptCatalogo { Categoria?: string[] editore?: string[] argomenti?: string[] - idCollane?: number[] + idCollane?: string[] sort_field?: string sort_dir?: number pdf?: boolean diff --git a/src/model/Products.ts b/src/model/Products.ts index a35291b0..a00ff390 100755 --- a/src/model/Products.ts +++ b/src/model/Products.ts @@ -38,9 +38,8 @@ export interface IProductInfo { note?: string idAuthors?: string[] authors?: string[] - idCollana?: number + idCollana?: string collana?: ICollana - collezione?: string idPublisher?: string ListaArgomenti?: string publisher?: IPublisher @@ -83,7 +82,6 @@ export interface IVariazione { availability?: number formato?: string misure?: string - edizione?: string ristampa?: string pagine?: number tipologia?: string @@ -200,6 +198,7 @@ export interface IProductsState { isPubblicatoById?: (idStatoProdotto: number) => boolean; isProssimaUscitaById?: (idStatoProdotto: number) => boolean; isPrevenditaById?: (idStatoProdotto: number) => boolean; + isNovitaById?: (date_pub: Date) => boolean; } export interface IProducer { diff --git a/src/store/Modules/costanti.ts b/src/store/Modules/costanti.ts index 43ebe27d..784239bc 100755 --- a/src/store/Modules/costanti.ts +++ b/src/store/Modules/costanti.ts @@ -533,6 +533,14 @@ export const costanti = { SOLO_PROSSIMA_USCITA: '2', PREVENDITA: '3', NON_VENDIBILE: '4', - } + }, + + NO_CATEGORY: '__NOCATEGORY__', + + VISUCAMPI: { + PER_TUTTI: 0, + PER_EDITORE: 1, + PER_ADMIN: 16, + }, } diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index ff9e3758..7f8b49cc 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -667,6 +667,7 @@ export const colTableTipologie = [ AddCol(DuplicateRec), ] export const colTableCollane = [ + AddCol({ name: '_id', label_trans: 'catalogo.id', fieldtype: costanti.FieldType.string }), AddCol({ name: 'idCollana', label_trans: 'collane.idCollana', fieldtype: costanti.FieldType.number }), AddCol({ name: 'title', label_trans: 'collane.title' }), AddCol(DeleteRec), diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index b58f4b49..895d5616 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -9145,6 +9145,8 @@ export const tools = { }, arrotonda2Dec(number: any): string { let num = '' + if (!number) + return '' try { if (number) num = number.toFixed(2) @@ -9881,7 +9883,7 @@ export const tools = { .join(", "); }, - formatCollane(collane: number[] | number | undefined | null): string { + formatCollane(collane: string[] | string): string { if (!collane) { return ""; } @@ -9891,13 +9893,13 @@ export const tools = { // Estrai le collane e uniscile con ', ' return collane .map((idcollana) => { - const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll.idCollana === idcollana) + const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll._id === idcollana) return reccoll ? `${reccoll.title ?? ""}`.trim() : "" }) .filter((name) => name.length > 0) // Filtra eventuali nomi vuoti .join(", "); } else { - const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll.idCollana === collane) + const reccoll: ICollana | undefined = products.collane!.find((coll: ICollana) => coll._id === collane) return reccoll ? `${reccoll.title}` : '' } diff --git a/src/store/Products.ts b/src/store/Products.ts index 3882fd77..ac5c336c 100755 --- a/src/store/Products.ts +++ b/src/store/Products.ts @@ -1,4 +1,4 @@ -import type { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd, IText, IOptCatalogo, ICatalog, ICatPrTotali, ISingleProductOrdered, ISchedaSingola, IMyScheda, IElementiScheda, T_Web_StatiProdotto, T_Web_Tipologie, T_WEB_TipiFormato } from 'model' +import type { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd, IText, IOptCatalogo, ICatalog, ICatPrTotali, ISingleProductOrdered, ISchedaSingola, IMyScheda, IElementiScheda, T_Web_StatiProdotto, T_Web_Tipologie, T_WEB_TipiFormato, IPublisher } from 'model' import { Api } from '@api' import { serv_constants } from '@src/store/Modules/serv_constants' @@ -198,11 +198,21 @@ export const useProducts = defineStore('Products', { // 34 - In Prevendita return (idStatoProdotto === 34) }, + isNovitaById: (state: IProductsState) => (date_pub: Date): boolean => { + const sixMonthsAgo = new Date(); + sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() - 6); + return new Date(date_pub).getTime() > sixMonthsAgo.getTime(); + + }, isPubblicato: (state: IProductsState) => (productInfo: IProductInfo): boolean => { return state.isPubblicatoById(productInfo.idStatoProdotto) }, + isNovita: (state: IProductsState) => (productInfo: IProductInfo): boolean => { + return state.isNovitaById(productInfo.date_pub) + }, + isNonVendibile: (state: IProductsState) => (productInfo: IProductInfo): boolean => { return !state.isPubblicatoById(productInfo.idStatoProdotto) && !state.isProssimaUscitaById(productInfo.idStatoProdotto) }, @@ -220,6 +230,11 @@ export const useProducts = defineStore('Products', { return (ctrec) ? ctrec.Descrizione : '' }, + getCasaEditriceByIdPublisher: (state: IProductsState) => (idPublisher: string): string => { + const rectrovato: IPublisher = state.publishers.find((editore: IPublisher) => editore._id === idPublisher) + return (rectrovato) ? rectrovato.name : '' + }, + getDescrByIdTipologia: (state: IProductsState) => (idTipologia: number): string => { const ctrec = state.tipologie.find((mystatus: T_Web_Tipologie) => mystatus.IdTipologia === idTipologia) @@ -1548,8 +1563,8 @@ export const useProducts = defineStore('Products', { } if (testo.contenuto.includes('{prezzo}') || testo.contenuto.includes('{prezzo_scontato}')) { - const prezzo = tools.arrotonda2Dec(myproduct.arrvariazioni![0].price) || ''; - const prezzo_scontato = tools.arrotonda2Dec(myproduct.arrvariazioni![0].sale_price) || ''; + const prezzo = tools.arrotonda2Dec(myproduct.arrvariazioni?.[0]?.price) || ''; + const prezzo_scontato = tools.arrotonda2Dec(myproduct.arrvariazioni?.[0]?.sale_price) || ''; replacements['{prezzo}'] = prezzo; replacements['{prezzo_scontato}'] = prezzo_scontato; } @@ -1557,9 +1572,9 @@ export const useProducts = defineStore('Products', { // Additional replacements based on the content const keysToCheck = [ '{titolo}', '{sottotitolo}', '{categoria}', '{sottocategoria}', '{descr_categoria}', - '{pagine}', '{isbn}', '{misure}', '{edizione', '{ristampa}', '{argomento}', '{date_pub}', '{date_updated_fromGM}', '{ranking_globale}', + '{pagine}', '{isbn}', '{misure}', '{edizione}', '{ristampa}', '{argomento}', '{date_pub}', '{date_updated_fromGM}', '{ranking_globale}', '{venduti}', '{formato}', '{tipologia}', '{stato}', '{scale}', '{descr_trafiletto_catalogo}', - '{link_macro}', '{qta}', '{image_link}', '{imagefile}', '{debug}' + '{link_macro}', '{qta}', '{image_link}', '{imagefile}', '{casaeditrice}', '{debug}' ]; for (const key of keysToCheck) { @@ -1578,19 +1593,22 @@ export const useProducts = defineStore('Products', { replacements[key] = myproduct.productInfo.catprods && myproduct.productInfo.catprods.length > 0 ? this.getCatProdDescrStrByIdCatProd(myproduct.productInfo.catprods![0].name) : ''; break; case '{pagine}': - replacements[key] = myproduct.arrvariazioni![0].pagine || ''; + replacements[key] = myproduct.arrvariazioni?.[0]?.pagine || ''; break; case '{isbn}': replacements[key] = myproduct.productInfo.code || ''; break; case '{misure}': - replacements[key] = myproduct.arrvariazioni![0].misure || ''; + replacements[key] = myproduct.arrvariazioni?.[0]?.misure || ''; + break; + case '{casaeditrice}': + replacements[key] = this.getCasaEditriceByIdPublisher(myproduct.productInfo.idPublisher) break; case '{edizione}': - replacements[key] = myproduct.arrvariazioni![0].edizione || ''; + replacements[key] = myproduct.arrvariazioni?.[0]?.edizione || ''; break; case '{ristampa}': - replacements[key] = myproduct.arrvariazioni![0].ristampa || ''; + replacements[key] = myproduct.arrvariazioni?.[0]?.ristampa || ''; break; case '{argomento}': replacements[key] = this.getCatProdsStrByCatProds(myproduct.productInfo.catprods!) || ''; @@ -1608,10 +1626,10 @@ export const useProducts = defineStore('Products', { replacements[key] = myproduct.productInfo.totVen! || '0'; break; case '{formato}': - replacements[key] = this.getDescrByIdTipoFormato(myproduct.arrvariazioni[0].idTipoFormato || 0) + replacements[key] = this.getDescrByIdTipoFormato(myproduct.arrvariazioni?.[0]?.idTipoFormato || 0) break; case '{tipologia}': - replacements[key] = this.getDescrByIdTipologia(myproduct.arrvariazioni[0].idTipologia || 0); + replacements[key] = this.getDescrByIdTipologia(myproduct.arrvariazioni?.[0]?.idTipologia || 0); break; case '{stato}': replacements[key] = this.getDescrStatiProdottoByIdStatoProdotto(myproduct.productInfo.idStatoProdotto || ''); @@ -1623,7 +1641,7 @@ export const useProducts = defineStore('Products', { replacements[key] = myproduct.productInfo.link_macro || ''; break; case '{qta}': - replacements[key] = myproduct.arrvariazioni![0].quantita || ''; + replacements[key] = myproduct.arrvariazioni?.[0]?.quantita || ''; break; case '{image_link}': replacements[key] = myproduct.productInfo.image_link || ''; diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index 5a9c00a1..b42f0689 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -440,6 +440,7 @@ export const useGlobalStore = defineStore('GlobalStore', { else if (table === 'departments') ris = state.departments else if (table === 'categorys') ris = state.categories else if (table === 'catprods') ris = Products.catprods + else if (table === 'collanas') ris = Products.collane else if (table === 'subcatprods') ris = Products.subcatprods else if (table === 'catprods_gas') ris = Products.catprods_gas else if (table === 'authors') ris = Products.authors @@ -494,8 +495,6 @@ export const useGlobalStore = defineStore('GlobalStore', { return state.sectorgoods else if (table === 'catgrps') return state.catgrps - else if (table === 'collanas') - return Products.collane else if (table === 'schedeopt') return Products.getSchedeOpt(state.myschedas) else if (table === 'provinces') diff --git a/src/views/admin/dbopmacro/dbopmacro.vue b/src/views/admin/dbopmacro/dbopmacro.vue index 548ea69b..1dfda7b4 100755 --- a/src/views/admin/dbopmacro/dbopmacro.vue +++ b/src/views/admin/dbopmacro/dbopmacro.vue @@ -17,7 +17,7 @@ @click="EseguiFunz('MigrateMSSQLToMongoDb')" > diff --git a/src/views/ecommerce/catalogo/catalogo.ts b/src/views/ecommerce/catalogo/catalogo.ts index ec7627a1..614cb685 100755 --- a/src/views/ecommerce/catalogo/catalogo.ts +++ b/src/views/ecommerce/catalogo/catalogo.ts @@ -15,6 +15,7 @@ import { CProductCard } from '@src/components/CProductCard' import { CMyDialog } from '@src/components/CMyDialog' import { CMySelect } from '@src/components/CMySelect' +import { CMyValueDb } from '@src/components/CMyValueDb' import { CProductTable } from '@src/components/CProductTable' import { CSearchProduct } from '@src/components/CSearchProduct' import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard' @@ -40,6 +41,7 @@ export default defineComponent({ components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect, CProductTable, CSearchProduct, CMyDialog, + CMyValueDb, }, emits: ['update:modelValue', 'updateCatalogo'], props: { @@ -105,11 +107,16 @@ export default defineComponent({ }, { deep: false }); watch(optrigenera.value, (newVal) => { - tools.setCookie(showListaArgomenti.value ? 'INC_ES' : 'VIS_DISP', newVal.visibilitaDisp); + tools.setCookie((showListaArgomenti.value ? 'INC_ES_' : '') +'VIS_DISP', newVal.visibilitaDisp); + tools.setCookie((showListaArgomenti.value ? 'INC_ES_' : '') +'VIS_STATO', newVal.stato); if (showListaArgomenti.value) calcArrProducts() }, { deep: true }); + const getCatalogoByMyPage = computed(() => { + return catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage) + }) + /*watch(optcatalogo, (newValue) => { emit('update:modelValue', newValue); }, { deep: true });*/ @@ -210,10 +217,6 @@ export default defineComponent({ }) - const getCatalogoByMyPage = computed(() => { - return catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage) - }) - const lista_prodotti = computed(() => { const arr = catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage) return arr?.lista_prodotti @@ -331,6 +334,15 @@ export default defineComponent({ return trovatocatalogo ? trovatocatalogo.title : 'Catalogo' } + function getReferentiCatalogo(): string { + const trovatocatalogo = getCatalogoByMyPage.value + + if (trovatocatalogo && trovatocatalogo.referenti && trovatocatalogo.referenti.length > 0) { + return trovatocatalogo.referenti.join(', '); + } else { + return '[Nessun Referente]'; + } + } function getImgIntroCatalogo(scheda: IMyScheda): IImg { const trovatocatalogo = getCatalogoByMyPage.value @@ -396,8 +408,8 @@ export default defineComponent({ return { imagefile, fit } } - function getIdCollaneDaFiltrare(def_idCollane?: number[]) { - let idCollane: number[] = [] + function getIdCollaneDaFiltrare(def_idCollane?: string[]) { + let idCollane: string[] = [] // Cerca se nella lista cataloghi c'è la Collana di questa Pagina ! const trovatocatalogo = getCatalogoByMyPage.value @@ -475,7 +487,7 @@ export default defineComponent({ filtroExcludeProductTypes: number[], filtroidTipologie: number[], editore: string[], - idCollane: ICollana[], + idCollane: string[], arrargomstr: any[], catstr: string, gasselstr: string, @@ -531,7 +543,11 @@ export default defineComponent({ hasArgomentiCat = (product.productInfo.idCatProds || []).some((idCat: any) => arrargomstr.includes(idCat)); hasCategoria = true; } else { - hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr)); + if (catstr === costanti.NO_CATEGORY) { + hasCategoria = product.productInfo.idCatProds?.length === 0 + } else { + hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr)); + } } // Filtri per autore @@ -559,7 +575,7 @@ export default defineComponent({ // Filtri per collana const hasCollana = boolfiltroVuotoCollane ? true - : (idCollane || []).some((item: ICollana) => product.productInfo.idCollana === item.idCollana) + : (idCollane || []).includes(product.productInfo.idCollana?.toString()) // Filtri per GAS const productgassel = !gasselstr || (cosaValue === shared_consts.PROD.GAS && product.idGasordine === gasselstr); @@ -1035,11 +1051,14 @@ export default defineComponent({ async function mounted() { // console.log('mounted Catalogo') + generatinglist.value = true + cat.value = tools.getCookie(getKeyCatAtLoad(), '') tabcatalogo.value = tools.getCookie('TAB_CAT', 'visu') - optrigenera.value.visibilitaDisp = tools.getCookie(showListaArgomenti.value ? 'INC_ES' : 'VIS_DISP', 'tutti') + optrigenera.value.visibilitaDisp = tools.getCookie((showListaArgomenti.value ? 'INC_ES_' : '') + 'VIS_DISP', costanti.DISP.DISPONIBILI) + optrigenera.value.stato = tools.getCookie((showListaArgomenti.value ? 'INC_ES_' : '') +'VIS_STATO', costanti.STATO.IN_COMMERCIO) loadpage.value = false await productStore.loadProducts() @@ -1097,7 +1116,7 @@ export default defineComponent({ value: rec._id, icon: rec.icon, color: rec.color, - })), + })).concat({ label: '[Senza Argomento]', value: costanti.NO_CATEGORY, icon: undefined, color: undefined }), ); } @@ -1451,6 +1470,8 @@ export default defineComponent({ generatinglist, optDisp, optStato, + getCatalogoByMyPage, + getReferentiCatalogo, } } }) diff --git a/src/views/ecommerce/catalogo/catalogo.vue b/src/views/ecommerce/catalogo/catalogo.vue index efac84f5..0c04c1ce 100755 --- a/src/views/ecommerce/catalogo/catalogo.vue +++ b/src/views/ecommerce/catalogo/catalogo.vue @@ -1,85 +1,88 @@