- Creazione pagina Home logout
- Nuovo Gasordine - Visualizzazione GAS / BOTTEGA
This commit is contained in:
@@ -449,7 +449,7 @@ export const colTableGasordine = [
|
||||
AddCol({ name: 'referente', label_trans: 'store.referent' }),
|
||||
AddCol({ name: 'city', label_trans: 'store.city' }),
|
||||
AddCol({ name: 'img', label_trans: 'store.img' }),
|
||||
AddCol({ name: 'dataora_chiusura', label_trans: 'gas.dataora_chiusura', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'dataora_chiusura_ordini', label_trans: 'gas.dataora_chiusura_ordini', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'dataora_ritiro', label_trans: 'gas.dataora_ritiro', fieldtype: costanti.FieldType.date }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
@@ -1957,7 +1957,7 @@ export const colTableIscrittiArcadei = [
|
||||
|
||||
export const colTableProducts = [
|
||||
AddCol({ name: 'active', label_trans: 'products.active', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'code', label_trans: 'products.code' }),
|
||||
AddCol({ name: 'code', label_trans: 'products.code', required: true }),
|
||||
AddCol({ name: 'codice_EAN', label_trans: 'products.codice_EAN' }),
|
||||
AddCol({ name: 'barcode', label_trans: 'products.barcode' }),
|
||||
AddCol({ name: 'name', label_trans: 'products.name' }),
|
||||
@@ -1977,6 +1977,12 @@ export const colTableProducts = [
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'storehouses',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idGasordines',
|
||||
label_trans: 'gasordine.name',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'gasordines',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idProvider',
|
||||
label_trans: 'provider.name',
|
||||
@@ -2002,11 +2008,12 @@ export const colTableProducts = [
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'categorys',
|
||||
}),
|
||||
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number, required: true }),
|
||||
AddCol({ name: 'price_acquistato', label_trans: 'products.price_acquistato', fieldtype: costanti.FieldType.number, required: true }),
|
||||
AddCol({ name: 'after_price', label_trans: 'products.after_price' }),
|
||||
AddCol({ name: 'color', label_trans: 'products.color' }),
|
||||
AddCol({ name: 'size', label_trans: 'products.size' }),
|
||||
AddCol({
|
||||
/*AddCol({
|
||||
name: 'quantityAvailable',
|
||||
label_trans: 'products.quantityAvailable',
|
||||
fieldtype: costanti.FieldType.number
|
||||
@@ -2015,6 +2022,11 @@ export const colTableProducts = [
|
||||
name: 'bookableAvailableQty',
|
||||
label_trans: 'products.bookableAvailableQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}), */
|
||||
AddCol({
|
||||
name: 'minBuyQty',
|
||||
label_trans: 'products.minBuyQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}),
|
||||
AddCol({
|
||||
name: 'stockQty',
|
||||
|
||||
@@ -20,8 +20,18 @@ export const useProducts = defineStore('Products', {
|
||||
}),
|
||||
|
||||
getters: {
|
||||
getProducts: (state: IProductsState) => (): IProduct[] => {
|
||||
return state.products
|
||||
getProducts: (state: IProductsState) => (cosa?: number): IProduct[] => {
|
||||
if (!!cosa) {
|
||||
let ris = null
|
||||
if (cosa === shared_consts.PROD.GAS) {
|
||||
ris = state.products.filter((rec) => (rec.idGasordines && rec.idGasordines.length > 0))
|
||||
} else if (cosa === shared_consts.PROD.BOTTEGA) {
|
||||
ris = state.products.filter((rec) => (!rec.idGasordines || (rec.idGasordines && rec.idGasordines.length === 0)))
|
||||
}
|
||||
return ris ? ris : []
|
||||
} else {
|
||||
return state.products
|
||||
}
|
||||
},
|
||||
|
||||
updateDataProduct: (state: IProductsState) => (res: any) => {
|
||||
@@ -55,14 +65,15 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
getProductById: (state: IProductsState) => (id: string): IProduct => {
|
||||
const prod = state.products.find((prod: IProduct) => prod._id === id)
|
||||
return prod ? prod : { active: false, img: '', code: '', name: '', storehouses: [], scontisticas: [], price: 0, stockQty: 0, bookableQty: 0 }
|
||||
return prod ? prod : { active: false, img: '', code: '', name: '', storehouses: [], scontisticas: [], price: 0, stockQty: 0, bookableQty: 0, gasordines: [], idGasordines: [], minBuyQty: 1 }
|
||||
},
|
||||
|
||||
getProductByCode: (state: IProductsState) => (code: string): IProduct => {
|
||||
const prod = state.products.find((prod: IProduct) => prod.code === code)
|
||||
return prod ? prod : {
|
||||
active: false, img: '', code: '', name: '', storehouses: [], scontisticas: [], price: 0,
|
||||
stockQty: 0, bookableQty: 0
|
||||
gasordines: [], idGasordines: [],
|
||||
stockQty: 0, bookableQty: 0, minBuyQty: 1
|
||||
}
|
||||
},
|
||||
|
||||
@@ -215,8 +226,10 @@ export const useProducts = defineStore('Products', {
|
||||
active: false,
|
||||
idProducer: '',
|
||||
idStorehouses: [],
|
||||
idGasordines: [],
|
||||
idScontisticas: [],
|
||||
scontisticas: [],
|
||||
gasordines: [],
|
||||
idProvider: '',
|
||||
producer: {},
|
||||
storehouses: [],
|
||||
@@ -232,6 +245,7 @@ export const useProducts = defineStore('Products', {
|
||||
quantityAvailable: 0,
|
||||
bookableAvailableQty: 0,
|
||||
stockQty: 0,
|
||||
minBuyQty: 1,
|
||||
bookableQty: 0,
|
||||
canBeShipped: false,
|
||||
QuantitaOrdinateInAttesa: 0,
|
||||
@@ -645,7 +659,7 @@ export const useProducts = defineStore('Products', {
|
||||
if (ris && ris.myord == null) {
|
||||
msg = t('ecomm.prodotto_tolto')
|
||||
tools.showNotif($q, msg)
|
||||
return
|
||||
return
|
||||
}
|
||||
if (ris === null || ris.myord == null) {
|
||||
msg = t('ecomm.error_cart')
|
||||
|
||||
Reference in New Issue
Block a user