- aggiunto note 'note_ordine_gas'

- corretto bug
This commit is contained in:
Surya Paolo
2024-03-26 15:37:01 +01:00
parent 9be104f605
commit 6856c4cc8e
81 changed files with 565 additions and 214 deletions

View File

@@ -67,7 +67,7 @@ export default defineComponent({
watch(() => cat.value, (newval, oldval) => {
calcArrProducts()
})
watch(() => idGasSel.value, (newval, oldval) => {
calcArrProducts()
})
@@ -88,7 +88,7 @@ export default defineComponent({
function calcArrProducts() {
// console.log('calcArrProducts')
refreshpage.value = true
let arrprod = productStore.getProducts(cosa.value)
let catstr = cat.value;
@@ -102,22 +102,24 @@ export default defineComponent({
} else {
arrprod = arrprod.filter((product: IProduct) => {
let lowerName = product.productInfo.name!.toLowerCase();
let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
if (product && product.productInfo) {
let lowerName = product.productInfo.name!.toLowerCase();
let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
let productgassel = true
if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) {
productgassel = (product.idGasordine === gasselstr)
let productgassel = true
if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) {
productgassel = (product.idGasordine === gasselstr)
}
// Use a regular expression to match whole words
let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
let nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i');
// 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;
}
// Use a regular expression to match whole words
let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
let nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i');
// 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;
});
}
@@ -176,7 +178,7 @@ export default defineComponent({
return riscat
}
function onLoadScroll(index: number, done: any) {
if (index >= 1) {
@@ -184,7 +186,7 @@ export default defineComponent({
const step = 10
let mynrec = numRecLoaded.value + step
if (mynrec > arrProducts.value.length)
mynrec = arrProducts.value.length

View File

@@ -100,7 +100,7 @@
<q-btn
push
dense
:size="tools.isMobile() ? '1rem' : '1.25rem'"
:size="tools.isMobile() ? '0.9rem' : '1.05rem'"
:color="idGasSel === recgas._id ? 'primary' : undefined"
:text-color="idGasSel === recgas._id ? 'white' : 'black'"
:label="recgas.name"