Struttura Scheda Prodotti...

This commit is contained in:
Surya Paolo
2023-11-30 14:27:46 +01:00
parent dffcc28690
commit 39e21600ca
16 changed files with 136 additions and 58 deletions

View File

@@ -1949,6 +1949,8 @@ export const colTableProducts = [
AddCol({ name: 'canBeShipped', label_trans: 'products.canBeShipped', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'canBeBuyOnline', label_trans: 'products.canBeBuyOnline', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'weight', label_trans: 'products.weight', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'unit', label_trans: 'products.unit',
fieldtype: costanti.FieldType.select, jointable: 'units', }),
AddCol({ name: 'stars', label_trans: 'products.stars', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'date', label_trans: 'products.date', fieldtype: costanti.FieldType.date }),
AddCol(DeleteRec),
@@ -4052,6 +4054,15 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: toolsext.TABUNITS,
label: 'Unità di Misura',
columns: colTableGeneric,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
],
}

View File

@@ -8227,6 +8227,12 @@ export const tools = {
}
return 0
},
getUnitsMeasure(unit: number, short: boolean) {
const unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
return unitrec ? (short ? unitrec.short : unitrec.label) : ''
},
isPartecipero(myrec: any) {
const userStore = useUserStore()
if (myrec && myrec.mybookings && myrec.mybookings.length > 0) {

View File

@@ -96,6 +96,7 @@ export const toolsext = {
TABPREF: 'hosps_preferences',
TABPEOPLE: 'people',
TABCIRCUITS: 'circuits',
TABUNITS: 'units',
SERVKEY_VERS: 'vers',
ERR_GENERICO: -1,

View File

@@ -79,6 +79,7 @@ export const useProducts = defineStore('Products', {
canBeShipped: false,
canBeBuyOnline: false,
weight: 0,
unit: 0,
stars: 0,
date: tools.getDateNow(),
icon: '',
@@ -214,8 +215,6 @@ export const useProducts = defineStore('Products', {
if (!globalStore.site.confpages.enableEcommerce)
return null
console.log('loadOrders', 'userid=', userStore.my._id)
// if (userStore.my._id === '') {
// return new Types.AxiosError(0, null, 0, '')
// }
@@ -239,7 +238,6 @@ export const useProducts = defineStore('Products', {
})
// ApiTables.aftercalling(ris, checkPending, 'categories')
return ris
},

View File

@@ -1798,6 +1798,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences
else if (table === toolsext.TABUNITS) myarr = shared_consts.Units_Of_Measure_ListBox
else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List
else if (table === 'typenotifs') myarr = shared_consts.TypeNotifs_Arr
else myarr = this.getListByTable(table)