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:
Surya Paolo
2024-06-19 00:21:06 +02:00
parent 2d9c178c1f
commit 49d51712bd
155 changed files with 2510 additions and 5296 deletions

View File

@@ -1,4 +1,4 @@
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor } from 'model'
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd } from 'model'
import { Api } from '@api'
import { serv_constants } from '@src/store/Modules/serv_constants'
@@ -13,6 +13,7 @@ import { useGlobalStore } from './globalStore'
import { ref } from 'vue'
import translate from '@src/globalroutines/util'
import products from '@src/rootgen/admin/products/products'
function getRecordOrdersCartEmpty(): IOrderCart {
return {
@@ -124,6 +125,54 @@ export const useProducts = defineStore('Products', {
},
getCatProdsByGas: (state: IProductsState) => (idGasOrdine: string): ICatProd[] => {
let arrcat = state.catprods_gas
// Ottieni le categorie solo per i "products" che hanno come idGasOrdine il valore passato
if (idGasOrdine) {
arrcat = state.catprods_gas.filter((rec: ICatProd) => {
const arrprod = state.products.filter((prod: IProduct) => {
if (prod.idGasordine === idGasOrdine && prod.productInfo.idCatProds?.includes(rec._id)) {
return true
}
})
return arrprod.length > 0 ? true : false
})
} else {
return []
}
return arrcat
},
getSubCatProdsByGas: (state: IProductsState) => (idGasOrdine: string, idCatProd: string): ISubCatProd[] => {
let arrcat = state.subcatprods
// Ottieni le categorie solo per i "products" che hanno come idGasOrdine il valore passato
if (idGasOrdine) {
arrcat = state.subcatprods.filter((rec: ISubCatProd) => {
const arrprod = state.products.filter((prod: IProduct) => {
if (prod.idGasordine === idGasOrdine
&& prod.productInfo.idSubCatProds?.includes(rec._id)
&& prod.productInfo.idCatProds?.includes(idCatProd)
) {
return true
}
})
return arrprod.length > 0 ? true : false
})
} else {
return []
}
return arrcat
},
getAuthors: (state: IProductsState) => (): any[] => {
// Get the list of authors, for the q-select component using state.authors array
// [{name: xxx, value: _id }]