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

@@ -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