Aggiornamento APP RISO:
✅ Inviando i RIS, deve comparire prima il Circuito della Provincia, e poi quello Nazionale ✅ Risolto problema per vecchie registrazioni, la provincia compariva "undefined".
This commit is contained in:
@@ -67,6 +67,12 @@ export default defineComponent({
|
||||
return lab
|
||||
})
|
||||
|
||||
const getlist = computed(() => {
|
||||
const mylist = searchList.value.find((rec: any) => rec.table === 'products')
|
||||
|
||||
return mylist
|
||||
})
|
||||
|
||||
|
||||
const arrLoaded = computed(() => {
|
||||
if (arrProducts.value && numRecLoaded.value)
|
||||
@@ -88,6 +94,12 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
watch(() => cat.value, (newval, oldval) => {
|
||||
|
||||
if (cat.value) {
|
||||
filter.value.author = '' // disattivo il filtro autore
|
||||
search.value = '' // disattivo anche la ricerca per testo
|
||||
}
|
||||
|
||||
calcArrProducts()
|
||||
})
|
||||
|
||||
@@ -103,6 +115,12 @@ export default defineComponent({
|
||||
})
|
||||
watch(() => filter.value.author, (newval, oldval) => {
|
||||
|
||||
// Se filtroAuthor attivato, allora evito il filtro per Categoria
|
||||
if (filter.value.author) {
|
||||
cat.value = '' // disattivo il filtro categoria
|
||||
search.value = '' // disattivo anche la ricerca per testo
|
||||
}
|
||||
|
||||
calcArrProducts()
|
||||
if (tools.scrollTop() > 300) {
|
||||
tools.scrollToTopValue(300)
|
||||
@@ -121,8 +139,10 @@ export default defineComponent({
|
||||
|
||||
refreshpage.value = true
|
||||
let arrprod = productStore.getProducts(cosa.value) || [];
|
||||
let catstr = cat.value || '';
|
||||
let filtroAuthor = filter.value.author || '';
|
||||
|
||||
let catstr = cat.value || '';
|
||||
|
||||
let gasselstr = ''
|
||||
if (cosa.value === shared_consts.PROD.GAS) {
|
||||
gasselstr = idGasSel.value || '';
|
||||
@@ -281,8 +301,8 @@ export default defineComponent({
|
||||
console.log('REFRR searchval', newval, table, 'tablesel', tablesel)
|
||||
if (newval === '') {
|
||||
search.value = ''
|
||||
} else {
|
||||
search.value = newval.name
|
||||
} else {
|
||||
search.value = newval.name
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ export default defineComponent({
|
||||
|
||||
const cosa = ref(0)
|
||||
const cat = ref('')
|
||||
const subcat = ref('')
|
||||
const idGasSel = ref('')
|
||||
const loadpage = ref(false)
|
||||
const refreshpage = ref(false)
|
||||
@@ -68,6 +69,10 @@ export default defineComponent({
|
||||
calcArrProducts()
|
||||
})
|
||||
|
||||
watch(() => subcat.value, (newval, oldval) => {
|
||||
calcArrProducts()
|
||||
})
|
||||
|
||||
watch(() => idGasSel.value, (newval, oldval) => {
|
||||
calcArrProducts()
|
||||
})
|
||||
@@ -81,8 +86,11 @@ export default defineComponent({
|
||||
|
||||
watch(() => cosa.value, (newval, oldval) => {
|
||||
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString())
|
||||
if (cosa.value !== shared_consts.PROD.TUTTI)
|
||||
if (cosa.value !== shared_consts.PROD.TUTTI) {
|
||||
cat.value = ''
|
||||
subcat.value = ''
|
||||
}
|
||||
|
||||
calcArrProducts()
|
||||
})
|
||||
|
||||
@@ -92,19 +100,21 @@ export default defineComponent({
|
||||
refreshpage.value = true
|
||||
let arrprod = productStore.getProducts(cosa.value)
|
||||
let catstr = cat.value;
|
||||
let subcatstr = subcat.value;
|
||||
let gasselstr = ''
|
||||
if (cosa.value === shared_consts.PROD.GAS) {
|
||||
gasselstr = idGasSel.value
|
||||
}
|
||||
let lowerSearchText = search.value.toLowerCase().trim();
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && !subcatstr && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
|
||||
} else {
|
||||
|
||||
arrprod = arrprod.filter((product: IProduct) => {
|
||||
if (product && product.productInfo) {
|
||||
if (product && product.productInfo && !!product.productInfo.name) {
|
||||
let lowerName = product.productInfo.name!.toLowerCase();
|
||||
let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
|
||||
let hasSubCategoria = !subcatstr || (subcatstr && product.productInfo.idSubCatProds?.includes(subcatstr));
|
||||
|
||||
let productgassel = true
|
||||
if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) {
|
||||
@@ -118,7 +128,7 @@ export default defineComponent({
|
||||
// Check if any word in lowerName starts with lowerSearchText
|
||||
let anyWordStartsWithSearch = lowerName.split(/\s+/).some(word => nameMatch.test(word));
|
||||
|
||||
return (codeMatch.test(product.productInfo.code!) || anyWordStartsWithSearch) && hasCategoria && productgassel;
|
||||
return (codeMatch.test(product.productInfo.code!) || anyWordStartsWithSearch) && hasCategoria && hasSubCategoria && productgassel;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -171,9 +181,36 @@ export default defineComponent({
|
||||
|
||||
function getCatProds() {
|
||||
let arrcat = productStore.getCatProds(cosa.value)
|
||||
let riscat: any = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
|
||||
for (const rec of arrcat) {
|
||||
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })
|
||||
let riscat: any = []
|
||||
if (arrcat && arrcat.length > 0) {
|
||||
riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
|
||||
for (const rec of arrcat) {
|
||||
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })
|
||||
}
|
||||
}
|
||||
|
||||
return riscat
|
||||
}
|
||||
function getCatProdsByGas(idGasOrdine: string): any {
|
||||
let arrcat = productStore.getCatProdsByGas(idGasOrdine)
|
||||
let riscat: any = []
|
||||
if (arrcat && arrcat.length > 0) {
|
||||
riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
|
||||
for (const rec of arrcat) {
|
||||
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })
|
||||
}
|
||||
}
|
||||
|
||||
return riscat
|
||||
}
|
||||
function getSubCatProdsByGas(idGasOrdine: string, idCatProd: string): any {
|
||||
let arrcat = productStore.getSubCatProdsByGas(idGasOrdine, idCatProd)
|
||||
let riscat: any = []
|
||||
if (arrcat && arrcat.length > 0) {
|
||||
riscat = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
|
||||
for (const rec of arrcat) {
|
||||
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })
|
||||
}
|
||||
}
|
||||
|
||||
return riscat
|
||||
@@ -210,7 +247,9 @@ export default defineComponent({
|
||||
cosa,
|
||||
shared_consts,
|
||||
getCatProds,
|
||||
getCatProdsByGas,
|
||||
cat,
|
||||
subcat,
|
||||
idGasSel,
|
||||
productStore,
|
||||
t,
|
||||
@@ -223,6 +262,7 @@ export default defineComponent({
|
||||
onLoadScroll,
|
||||
numRecLoaded,
|
||||
arrLoaded,
|
||||
getSubCatProdsByGas,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -96,19 +96,65 @@
|
||||
<div class="text-center text-h6 text-red">Ordini Attivi:</div>
|
||||
</div>
|
||||
<div class="row q-gutter-xs justify-center q-mx-auto">
|
||||
<div v-for="(recgas, index) in productStore.getGasordinesActives()" :key="index">
|
||||
<div
|
||||
v-for="(recgas, index) in productStore.getGasordinesActives()"
|
||||
:key="index"
|
||||
>
|
||||
<q-btn
|
||||
push
|
||||
dense
|
||||
:size="tools.isMobile() ? '0.9rem' : '1.05rem'"
|
||||
:color="idGasSel === recgas._id ? 'primary' : undefined"
|
||||
:text-color="idGasSel === recgas._id ? 'white' : 'black'"
|
||||
:text-color="idGasSel === recgas._id ? 'white' : 'black'"
|
||||
:label="recgas.name"
|
||||
@click="idGasSel = recgas._id"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-gutter-xs justify-center q-mx-auto">
|
||||
<div
|
||||
v-for="(reccat, index) in getCatProdsByGas(idGasSel)"
|
||||
:key="index"
|
||||
>
|
||||
<q-btn
|
||||
:push="cat === reccat.value"
|
||||
dense
|
||||
:size="tools.isMobile() ? '0.70rem' : '0.85rem'"
|
||||
:icon="reccat.icon ? reccat.icon : undefined"
|
||||
:color="cat === reccat.value ? 'primary' : undefined"
|
||||
:text-color="cat === reccat.value ? 'white' : 'black'"
|
||||
rounded
|
||||
:label="reccat.label"
|
||||
@click="cat = reccat.value"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator class="q-ma-md"> </q-separator>
|
||||
<div
|
||||
v-if="getSubCatProdsByGas(idGasSel, cat)"
|
||||
class="row q-gutter-xs justify-center q-mx-auto"
|
||||
>
|
||||
<div
|
||||
v-for="(recsubcat, index) in getSubCatProdsByGas(idGasSel, cat)"
|
||||
:key="index"
|
||||
>
|
||||
<q-btn
|
||||
:push="subcat === recsubcat.value"
|
||||
dense
|
||||
:size="tools.isMobile() ? '0.70rem' : '0.85rem'"
|
||||
:icon="recsubcat.icon ? recsubcat.icon : undefined"
|
||||
:color="subcat === recsubcat.value ? 'positive' : undefined"
|
||||
:text-color="subcat === recsubcat.value ? 'white' : 'blue'"
|
||||
rounded
|
||||
:label="recsubcat.label"
|
||||
@click="subcat = recsubcat.value"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<span
|
||||
v-show="productStore.getNumProdTot() !== arrProducts.length"
|
||||
|
||||
Reference in New Issue
Block a user