agiornamento, sistemazioni varie PCB

This commit is contained in:
Surya Paolo
2024-01-23 00:10:52 +01:00
parent fbebd925b1
commit 8a5a2bd79a
38 changed files with 174 additions and 104 deletions

View File

@@ -68,7 +68,7 @@ export const tools = {
COOK_SEARCH: 'SEARCH_',
COOK_SELCART: 'SELCART_',
COOK_TAB_CIRCUIT: 'TAB_CIRC',
COOK_COSA_PRODOTTI: 'PROD',
COOK_COSA_PRODOTTI: 'PROD_N',
FRIENDS_SEARCH: 'FR_SE',
GROUP_SEARCH: 'GR_SE',
@@ -4313,6 +4313,10 @@ export const tools = {
scrollToTopAll() {
window.scrollTo(0, 0);
},
scrollToTopValue(val: number) {
window.scrollTo(0, val);
},
scrollToTop() {
const element = document.getElementById('mypage')
this.scrollToElement(element)
@@ -4331,6 +4335,10 @@ export const tools = {
}
},
scrollTop() {
return window.scrollY || document.documentElement.scrollTop;
},
getCellForWhatsapp(numbercell: string) {
if (!numbercell) return ''
let mynum = numbercell.replace(/-/g, '')

View File

@@ -105,14 +105,21 @@ export const useProducts = defineStore('Products', {
cart: { items: [], totalPrice: 0, totalQty: 0, userId: '' },
orders: [],
catprods: [],
catprods_gas: [],
subcatprods: [],
productInfos: [],
userActive: { username: '', name: '', surname: '', _id: '' },
}),
getters: {
getCatProds: (state: IProductsState) => (): ICatProd[] => {
return state.catprods
getCatProds: (state: IProductsState) => (cosa: number): ICatProd[] => {
if (cosa === shared_consts.PROD.GAS)
return state.catprods_gas
else if (cosa === shared_consts.PROD.GAS)
return state.catprods
else
return [...state.catprods, ...state.catprods_gas]
},
getNumProdTot: (state: IProductsState) => (): number => {
@@ -125,7 +132,7 @@ export const useProducts = defineStore('Products', {
const hasGasOrdines = rec.idGasordine
if ((cosa === shared_consts.PROD.GAS && hasGasOrdines) ||
(cosa === shared_consts.PROD.BOTTEGA && ((!hasGasOrdines || (hasGasOrdines && rec.idGasordine))))) {
(cosa === shared_consts.PROD.BOTTEGA && (!hasGasOrdines))) {
return true;
}
@@ -1026,6 +1033,11 @@ export const useProducts = defineStore('Products', {
return arrprod.length
},
getNumQtaTutti() {
const arrprod = this.getProducts(shared_consts.PROD.TUTTI)
return arrprod.length
},
getNumQtaBottega() {
const arrprod = this.getProducts(shared_consts.PROD.BOTTEGA)
return arrprod.length

View File

@@ -327,6 +327,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 === 'catprods_gas') ris = Products.catprods_gas
else if (table === 'sharewithus') ris = state.sharewithus
else if (table === 'paymenttypes') ris = state.paymenttypes
else if (table === 'circuits') ris = circuitStore.listcircuits
@@ -1553,6 +1554,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.providers = (res.data.providers) ? [...res.data.providers] : []
Products.catprods = (res.data.catprods) ? [...res.data.catprods] : []
Products.catprods_gas = (res.data.catprods_gas) ? [...res.data.catprods_gas] : []
this.gasordines = (res.data.gasordines) ? [...res.data.gasordines] : []
this.scontisticas = (res.data.scontisticas) ? [...res.data.scontisticas] : []