- aggiornato scheda e rigenera lista
- corretto filtro sulla Collana
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
@click="EseguiFunz('MigrateMSSQLToMongoDb')"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
label="Aggiorna Statistiche Fatturato"
|
||||
label="Aggiorna Statistiche Fatturato e Vendite"
|
||||
color="positive"
|
||||
@click="EseguiFunz('UpdateStatFatturato')"
|
||||
></q-btn>
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user