- fix RIS in pendenti, se troppi msg, non compariva piu

- cataloghi, ricerca pickup
This commit is contained in:
Surya Paolo
2024-05-09 23:36:58 +02:00
parent 58f53f8c52
commit faf0fabfb0
68 changed files with 1776 additions and 188 deletions

View File

@@ -1,4 +1,4 @@
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine } from 'model'
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor } from 'model'
import { Api } from '@api'
import { serv_constants } from '@src/store/Modules/serv_constants'
@@ -107,6 +107,7 @@ export const useProducts = defineStore('Products', {
orders: [],
catprods: [],
catprods_gas: [],
authors: [],
subcatprods: [],
productInfos: [],
userActive: { username: '', name: '', surname: '', _id: '' },
@@ -123,6 +124,24 @@ export const useProducts = defineStore('Products', {
},
getAuthors: (state: IProductsState) => (): any[] => {
// Get the list of authors, for the q-select component using state.authors array
// [{name: xxx, value: _id }]
// add default value for q-select
const options = [
{
label: '[Tutti]',
value: '',
},
...state.authors.map((rec: IAuthor) => {
return { label: rec.name + (rec.surname ? ' ' + rec.surname : ''), value: rec._id }
}),
]
return options
},
getNumProdTot: (state: IProductsState) => (): number => {
return state.products.length
},