agiornamento, sistemazioni varie PCB
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user