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

@@ -87,7 +87,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.showAlways)
if (user.profile.mycircuits && user.profile.mycircuits.length > 0) {
if (user && user.profile && user.profile.mycircuits && user.profile.mycircuits.length > 0) {
for (const circ of circNazionali) {
const trovato = user.profile.mycircuits.findIndex((mycirc: any) => mycirc.circuitname === circ.name) >= 0
if (trovato) {

View File

@@ -1,3 +1,5 @@
import { GROUPSCMD } from "@src/common/shared_nodejs"
export interface IMainCard {
visible: boolean
strsingolo?: string
@@ -260,8 +262,39 @@ export const costanti = {
small: true,
table: '',
},
{
visible: false,
title: ' Attività ',
subtitle: 'Artigiani, Aziende, Società, Negozi',
strsingolo: 'Attivita',
to: '/activities',
icon: 'fas fa-tshirt',
color: 'indigo-6',
hint: '',
table: 'attivitas',
visuonstat: true,
small: false,
showfavorite: true,
},
],
GROUPCARDS: [
{
visible: true,
title: ' Attività ',
subtitle: 'Artigiani, Aziende, Società, Negozi',
strsingolo: 'Attivita',
to: '/activities',
icon: 'fas fa-tshirt',
color: 'indigo-6',
hint: '',
table: 'attivitas',
visuonstat: true,
small: false,
showfavorite: true,
},
],
BINARY_CHECK: 1,

View File

@@ -5,6 +5,7 @@ import { costanti } from './costanti'
import { useGlobalStore } from '@store/globalStore'
import { toolsext } from '@store/Modules/toolsext'
import { static_data } from '@/db/static_data'
import { shared_consts } from '@src/common/shared_vuejs'
const DeleteRec = {
name: 'deleterec',
@@ -1198,6 +1199,158 @@ export const colmyGoods = [
AddCol(DeleteRec),
]
export const colAttivita = [
AddCol({
name: 'tipodiAttivita',
label_trans: 'attivita.tipodiattivita',
fieldtype: costanti.FieldType.select,
required: true,
jointable: toolsext.TABTIPODIATTIVITA,
icon: 'fas fa-balance-scale',
// noshowlabel: true,
// numpag_carousel: 1,
// inline: true,
// typeobj: 'radio',
}),
AddCol({
name: 'nome_attivita',
label_trans: 'attivita.nome_attivita',
fieldtype: costanti.FieldType.string,
maxlength: 100,
required: true,
}),
AddCol({
name: 'descr',
label_trans: 'proj.shortdescr',
fieldtype: costanti.FieldType.string,
maxlength: 300,
required: true,
}),
AddCol({
name: 'idSector',
label_trans: 'sectors.name',
fieldtype: costanti.FieldType.select,
required: true,
jointable: toolsext.TABSECTORS,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
visible: true,
icon: 'category',
numpag_carousel: 4,
}),
AddCol({
name: 'idSkill',
label_trans: 'skill.name',
fieldtype: costanti.FieldType.select,
jointable: 'skills',
addnone: true,
filter_table: toolsext.TABSECTORS,
filter_field: 'idSector',
noshowlabel: true,
icon: 'engineering',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
allowNewValue: false,
required: false,
sortable: false,
}),
AddCol({
name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
required: false,
isadvanced_field: true,
numpag_carousel: 3,
}),
AddCol({
name: 'idCity',
label_trans: 'skill.city',
fieldtype: costanti.FieldType.multiselect_by_server,
jointable: 'cities',
tablesel: 'cities',
noshowlabel: true,
icon: 'fas fa-map-marker-alt',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
remote_table: 'mycities',
remote_key: '_id',
remote_field: 'comune',
required: true,
showonlyif_dipersona: true,
numpag_carousel: 2,
}),
AddCol({
name: 'date_updated', label_trans: 'reg.pub_updated', fieldtype: costanti.FieldType.date,
required: false,
visible: false,
sortable: true,
showWhen: 0
}),
AddCol({
name: 'createdBy',
label_trans: 'reg.username',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '',
noshowlabel: true,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
}),
AddCol({
name: 'date_publishing', label_trans: 'products.date_publishing',
fieldtype: costanti.FieldType.onlydate,
foredit: false,
noshowlabel: true,
}),
AddCol({ name: 'email', label_trans: 'attivita.email', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'cell_phone', label_trans: 'attivita.cell_phone', fieldtype: costanti.FieldType.string }),
AddCol({
name: 'whatsapp',
label_trans: 'attivita.whatsapp',
}),
AddCol({
name: 'telegram_username',
label_trans: 'attivita.telegram_username',
fieldtype: costanti.FieldType.string,
}),
AddCol({ name: 'website', label_trans: 'attivita.website' }),
AddCol({ name: 'coordinate_gps', label_trans: 'attivita.coordinate_gps', fieldtype: costanti.FieldType.string }),
AddCol({
name: 'logo',
label_trans: 'attivita.logo',
fieldtype: costanti.FieldType.image,
jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false,
}),
AddCol({
name: 'photos',
label_trans: 'attivita.foto',
fieldtype: costanti.FieldType.listimages,
jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false,
}),
AddCol({
name: 'date_updated', label_trans: 'reg.pub_updated', fieldtype: costanti.FieldType.date,
required: false,
visible: false,
sortable: true,
showWhen: 0
}),
AddCol(DuplicateRec),
AddCol(ModifRec),
AddCol(DeleteRec),
//++Todo: Aggiungere ORARI di Servizio
]
export const colmySkills = [
AddCol({
name: 'adType',
@@ -2043,7 +2196,7 @@ export const colTableProductInfos = [
AddCol({ name: 'name', label_trans: 'products.name' }),
AddCol({ name: 'description', label_trans: 'products.description', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'icon', label_trans: 'products.icon' }),
AddCol({ name: 'img', label_trans: 'products.img', fieldtype: costanti.FieldType.image_and_filename, path: 'upload/products/' }),
AddCol({ name: 'img', label_trans: 'products.img', fieldtype: costanti.FieldType.image_and_filename, path: 'upload/products/' }),
AddCol({
name: 'department',
label_trans: 'products.department',
@@ -2093,8 +2246,8 @@ export const colTableOrdersCart = [
AddCol({ name: 'totalPrice', label_trans: 'orderscart.totalPrice', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'totalPriceCalc', label_trans: 'orderscart.totalPriceCalc', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'status', label_trans: 'orderscart.status', fieldtype: costanti.FieldType.number }),
]
]
export const colTableProducts = [
AddCol({ name: 'active', label_trans: 'products.active', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'isbn', label_trans: 'products.isbn' }),
@@ -2136,8 +2289,8 @@ export const colTableProducts = [
jointable: 'scontisticas',
}),
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number, required: true }),
// arrvariazioni
/* AddCol({ name: 'sale_price', label_trans: 'products.sale_price', fieldtype: costanti.FieldType.number, required: false }),
AddCol({
@@ -2368,6 +2521,13 @@ const colTablePermission = [
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
const colTableTipoDiAttivita = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
AddCol({ name: 'note', label_trans: 'proj.longdescr' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
const colCalDate = [
AddCol({ name: '_id', label_trans: 'rec.date', fieldtype: costanti.FieldType.number }),
@@ -3527,7 +3687,7 @@ export const colmyUserCircuit = [
AddCol({ name: 'deperibile', label_trans: 'account.deperibile', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'fidoConcesso', label_trans: 'account.fidoConcesso', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'qta_maxConcessa', label_trans: 'account.qta_maxConcessa', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'totCircolante', label_trans: 'circuit.totCircolante', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'totTransato', label_trans: 'circuit.totTransato', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'numtransactions', label_trans: 'circuit.numtransactions', fieldtype: costanti.FieldType.number }),
@@ -4151,6 +4311,15 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: toolsext.TABTIPODIATTIVITA,
label: 'Tipo di Attivita',
columns: colTableTipoDiAttivita,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'accepted',
label: 'Condizioni',
@@ -4180,14 +4349,14 @@ export const fieldsTable = {
collabel: 'key',
},
{
value: toolsext.TABMYSKILLS,
value: shared_consts.TABLES_MYSKILLS,
label: 'Mie Competenze',
columns: colmySkills,
colkey: '_id',
collabel: (rec: any) => `${rec.descr}`,
},
{
value: toolsext.TABMYBACHECAS,
value: shared_consts.TABLES_MYBACHECAS,
label: 'Bacheca',
columns: colmyBachecas,
colkey: '_id',
@@ -4201,12 +4370,26 @@ export const fieldsTable = {
collabel: (rec: any) => `${rec.descr}`,
},
{
value: toolsext.TABMYGOODS,
value: shared_consts.TABLES_MYGOODS,
label: 'Beni',
columns: colmyGoods,
colkey: '_id',
collabel: (rec: any) => `${rec.descr}`,
},
{
value: shared_consts.TABLES_ATTIVITAS,
label: 'Attività',
columns: colAttivita,
colkey: '_id',
collabel: (rec: any) => `${rec.name}`,
},
{
value: toolsext.TABATTIVITA,
label: 'Attivita',
columns: colAttivita,
colkey: '_id',
collabel: (rec: any) => `${rec.descr} - ${rec.note}`,
},
{
value: 'skills',
label: 'Competenze',

View File

@@ -4671,6 +4671,15 @@ export const tools = {
return ''
}
},
getlinkEmail(myemail: string) {
if (myemail) {
return `<a href="${myemail}" >${myemail}</a>`
} else {
return ''
}
},
getNationsByNationality(nat: string) {
@@ -8407,6 +8416,15 @@ export const tools = {
return inputString.replace('\\', '').replace(/"/g, '')
},
removeTrailingBr(str: string) {
// Usa una regex per cercare il tag <br> alla fine della stringa e rimuoverlo
return str.replace(/<br>$/, '');
},
removeescape_e_acapo(inputString: string): string {
return this.removeTrailingBr(inputString.replace('\\', '').replace(/"/g, '').replace(/\r\n/g, '<br>').replace(/\r/g, '<br>'))
},
isObjectEmpty(obj: any) {
return Object.keys(obj).length === 0;
},

View File

@@ -71,6 +71,8 @@ export const toolsext = {
TABPROVINCE: 'provinces',
TABMYSKILLS: 'myskills',
TABMYGOODS: 'mygoods',
TABATTIVITA: 'attivita',
TABTIPODIATTIVITA: 'tipodiattivitas',
TABMYBACHECAS: 'mybachecas',
TABMYHOSPS: 'myhosps',
TABCALDATE: 'caldate',

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 }]

View File

@@ -472,7 +472,7 @@ export const useUserStore = defineStore('UserStore', {
IsAskedCircuitByName(name: string): boolean {
if (this.my.profile.asked_circuits)
if (this.my.profile.asked_circuits && this.my.profile.asked_circuits.length > 0)
return this.my.profile.asked_circuits.findIndex((rec: ICircuit) => rec.name === name) >= 0
else
return false
@@ -482,7 +482,7 @@ export const useUserStore = defineStore('UserStore', {
IsMyCircuitByName(circuitname: string): boolean {
if (this.my.profile.mycircuits)
if (this.my.profile.mycircuits && this.my.profile.mycircuits.length > 0)
return this.my.profile.mycircuits.findIndex((rec: IMyCircuit) => rec.circuitname === circuitname) >= 0
else
return false
@@ -515,10 +515,20 @@ export const useUserStore = defineStore('UserStore', {
else
arrout = tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname')
// controlla che il circuito sia Abilitato!
// controlla che il circuito sia Abilitato e Territoriale !
for (const circuitname of arrout) {
const circuit = circuitStore.getCircuitByName(circuitname)
if (circuit && circuit.transactionsEnabled) {
if (circuit && circuit.transactionsEnabled && !circuit.showAlways) {
arrfinale.push(circuitname)
}
}
// Poi aggiungi i Circuiti ITALIA
for (const circuitname of arrout) {
const circuit = circuitStore.getCircuitByName(circuitname)
if (circuit && circuit.transactionsEnabled && circuit.showAlways) {
arrfinale.push(circuitname)
}
}
@@ -1840,7 +1850,7 @@ export const useUserStore = defineStore('UserStore', {
})
},
async importToServerCmd($q: any, t: any, cmd: number, data: any) {
async importToServerCmd($q: any, t: any, cmd: number, data: any, recorddaimportare: boolean = false) {
return Api.SendReq('/admin/import', 'POST', { cmd, data })
.then((res: any) => {
if (res) {
@@ -1856,9 +1866,17 @@ export const useUserStore = defineStore('UserStore', {
msg += ' ' + t('db.records_updated', { num: res.data.updated })
}
if (!msg) {
msg = t('db.recupdated')
if (recorddaimportare) {
msg += ' ' + t('db.records_imported', { num: 0 })
tools.showNegativeNotif($q, msg)
} else {
msg = t('db.recupdated')
tools.showPositiveNotif($q, msg)
}
} else {
tools.showPositiveNotif($q, msg)
}
tools.showPositiveNotif($q, msg)
}
}).catch((error) => {
tools.showNegativeNotif($q, t('db.recfailed'))

View File

@@ -338,6 +338,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'departments') ris = state.departments
else if (table === 'categorys') ris = state.categories
else if (table === 'catprods') ris = Products.catprods
else if (table === 'subcatprods') ris = Products.subcatprods
else if (table === 'catprods_gas') ris = Products.catprods_gas
else if (table === 'authors') ris = Products.authors
else if (table === 'catais') ris = state.catAI
@@ -1573,6 +1574,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.providers = (res.data.providers) ? [...res.data.providers] : []
Products.catprods = (res.data.catprods) ? [...res.data.catprods] : []
Products.subcatprods = (res.data.subcatprods) ? [...res.data.subcatprods] : []
Products.catprods_gas = (res.data.catprods_gas) ? [...res.data.catprods_gas] : []
Products.authors = (res.data.authors) ? [...res.data.authors] : []
@@ -1907,6 +1909,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABTYPECASH) myarr = shared_consts.TypeCashStr
else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List
else if (table === 'typenotifs') myarr = shared_consts.TypeNotifs_Arr
else if (table === toolsext.TABTIPODIATTIVITA) myarr = shared_consts.TipoDiAttivita
else myarr = this.getListByTable(table, value2)
if (costanti.TABLES_ARRAY.includes(table)) {
@@ -1935,9 +1938,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
obj[mykey] = costanti.FILTER_NESSUNO
obj[collab] = '[Nessuno]'
if (table === toolsext.TABMYGOODS) {
if (table === shared_consts.TABLES_MYGOODS) {
obj.idSectorGood = []
} else if ((table === toolsext.TABMYSKILLS)) {
} else if ((table === shared_consts.TABLES_MYSKILLS)) {
obj.idSector = []
}