- Sistemato problema del Circuito ITALIA, quando veniva fatta la richiesta di entrare, ancora non si era entrati nel circuito territoriale.
- Ora pertanto viene inviata la richiesta agli admin solo dopo che l'utente viene abilitato al Circuito provinciale.
This commit is contained in:
@@ -2309,7 +2309,9 @@ export const shared_consts = {
|
|||||||
nome_valuta: 1,
|
nome_valuta: 1,
|
||||||
fido_scoperto_default: 1,
|
fido_scoperto_default: 1,
|
||||||
deperimento: 1,
|
deperimento: 1,
|
||||||
showAlways: 1,
|
circuitiExtraProv: 1,
|
||||||
|
isCircItalia: 1,
|
||||||
|
enableOnlyIf1CircuitExist: 1,
|
||||||
ignoreLimits: 1,
|
ignoreLimits: 1,
|
||||||
askManagerToEnter: 1,
|
askManagerToEnter: 1,
|
||||||
sendEmailAfterAskingToEnter: 1,
|
sendEmailAfterAskingToEnter: 1,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default defineComponent({
|
|||||||
function load() {
|
function load() {
|
||||||
non_hai_circuito_nazionale.value = !circuitStore.sonoDentroAlCircuitoNazionale()
|
non_hai_circuito_nazionale.value = !circuitStore.sonoDentroAlCircuitoNazionale()
|
||||||
if (props.to_user) {
|
if (props.to_user) {
|
||||||
destin_non_ha_circuito_naz.value = !circuitStore.EDentroAlCircuitoNazionale(props.to_user)
|
destin_non_ha_circuito_naz.value = !circuitStore.EDentroAlCircuitoItalia(props.to_user)
|
||||||
if (userStore.getMyCircuitsInCommonByUser(props.to_user).length > 0) {
|
if (userStore.getMyCircuitsInCommonByUser(props.to_user).length > 0) {
|
||||||
destin_non_ha_circuito_naz.value = false
|
destin_non_ha_circuito_naz.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,9 +254,7 @@ export default defineComponent({
|
|||||||
filterextra2: {
|
filterextra2: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: false,
|
required: false,
|
||||||
default: () => {
|
default: () => [] as any[],
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
extraparams: {
|
extraparams: {
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -1472,7 +1472,6 @@
|
|||||||
</q-field>
|
</q-field>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="q-ma-sm q-pa-sm colmodif col-grow popupedit"
|
|
||||||
@click="colclicksel = mycol"
|
@click="colclicksel = mycol"
|
||||||
>
|
>
|
||||||
<CMyPopupEdit
|
<CMyPopupEdit
|
||||||
@@ -1558,7 +1557,6 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="">
|
<div class="">
|
||||||
MODIF_B: {{col.field2}}
|
|
||||||
<CMyPopupEdit
|
<CMyPopupEdit
|
||||||
:table="mytable"
|
:table="mytable"
|
||||||
:canEdit="true"
|
:canEdit="true"
|
||||||
@@ -1651,7 +1649,6 @@
|
|||||||
class="tdclass"
|
class="tdclass"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
MODIF_C: {{col.field2}}
|
|
||||||
<CMyPopupEdit
|
<CMyPopupEdit
|
||||||
:table="mytable"
|
:table="mytable"
|
||||||
:canEdit="true"
|
:canEdit="true"
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (visu === costanti.MY_CIRCUITS) {
|
if (visu === costanti.MY_CIRCUITS) {
|
||||||
const arrtoinsert: any = circuitStore.listcircuits.filter((circ: any) => circ.showAlways)
|
const arrtoinsert: any = circuitStore.listcircuits.filter((circ: any) => circ.isCircItalia)
|
||||||
for (const rec of arrtoinsert) {
|
for (const rec of arrtoinsert) {
|
||||||
if (arr.findIndex(myrec => myrec._id === rec._id) < 0) {
|
if (arr.findIndex(myrec => myrec._id === rec._id) < 0) {
|
||||||
// Se non c'è il circuito Nazionale, glielo aggiungo
|
// Se non c'è il circuito Nazionale, glielo aggiungo
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ export default defineComponent({
|
|||||||
checkOk: function () {
|
checkOk: function () {
|
||||||
if (circuititalia.value) {
|
if (circuititalia.value) {
|
||||||
return ((userStore.IsMyCircuitByName(circuititalia.value.name) ||
|
return ((userStore.IsMyCircuitByName(circuititalia.value.name) ||
|
||||||
userStore.IsAskedCircuitByName(circuititalia.value.name))) || userStore.my.profile.noCircIta
|
userStore.IsAskedCircuitByName(circuititalia.value.name))) || userStore.my.profile.noCircIta || userStore.my.profile.insert_circuito_ita
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1464,7 +1464,9 @@ export interface ICircuit {
|
|||||||
qta_max_default_contocom?: number
|
qta_max_default_contocom?: number
|
||||||
data_costituz?: Date
|
data_costituz?: Date
|
||||||
deperimento: boolean
|
deperimento: boolean
|
||||||
showAlways: boolean
|
circuitiExtraProv: boolean
|
||||||
|
isCircItalia?: boolean
|
||||||
|
enableOnlyIf1CircuitExist?: boolean
|
||||||
ignoreLimits: boolean
|
ignoreLimits: boolean
|
||||||
askManagerToEnter?: boolean
|
askManagerToEnter?: boolean
|
||||||
sendEmailAfterAskingToEnter?: boolean
|
sendEmailAfterAskingToEnter?: boolean
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ export interface IUserProfile {
|
|||||||
noNameSurname: boolean
|
noNameSurname: boolean
|
||||||
noCircuit: boolean
|
noCircuit: boolean
|
||||||
noCircIta: boolean
|
noCircIta: boolean
|
||||||
|
insert_circuito_ita?: boolean
|
||||||
noFoto: boolean
|
noFoto: boolean
|
||||||
reaction: IReaction[]
|
reaction: IReaction[]
|
||||||
// bookmark: IBookmark[]
|
// bookmark: IBookmark[]
|
||||||
|
|||||||
@@ -1,159 +0,0 @@
|
|||||||
import { defineComponent, onMounted, ref } from 'vue'
|
|
||||||
|
|
||||||
import { CImgText } from '../../../components/CImgText/index'
|
|
||||||
import { CCard } from '@src/components/CCard'
|
|
||||||
import { CMyPage } from '@src/components/CMyPage'
|
|
||||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
|
||||||
import { CGridTableRec } from '@src/components/CGridTableRec'
|
|
||||||
|
|
||||||
import { colTableGestoreOrdini } from '@src/store/Modules/fieldsTable'
|
|
||||||
import MixinMetaTags from '@src/mixins/mixin-metatags'
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'Gestoreordini',
|
|
||||||
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
|
|
||||||
setup() {
|
|
||||||
|
|
||||||
const { setmeta } = MixinMetaTags()
|
|
||||||
const filtroOrdini = ref(<any[]>[])
|
|
||||||
const idGasordine = ref(null)
|
|
||||||
|
|
||||||
function mounted() {
|
|
||||||
let queryord = []
|
|
||||||
|
|
||||||
filtroOrdini.value = []
|
|
||||||
|
|
||||||
if (idGasordine.value) {
|
|
||||||
const gasordine = {
|
|
||||||
$match: {
|
|
||||||
idGasordine: idGasordine.value
|
|
||||||
},
|
|
||||||
}
|
|
||||||
queryord.push(gasordine)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const query = [
|
|
||||||
{
|
|
||||||
$lookup: {
|
|
||||||
from: 'products',
|
|
||||||
localField: 'idProduct',
|
|
||||||
foreignField: '_id',
|
|
||||||
as: 'product',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$unwind: {
|
|
||||||
path: '$product',
|
|
||||||
preserveNullAndEmptyArrays: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$unwind: {
|
|
||||||
path: '$productInfo',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$lookup: {
|
|
||||||
from: 'gasordines',
|
|
||||||
localField: 'idGasordine',
|
|
||||||
foreignField: '_id',
|
|
||||||
as: 'gasordine',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$unwind: {
|
|
||||||
path: '$gasordine',
|
|
||||||
preserveNullAndEmptyArrays: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$match: {
|
|
||||||
$or: [
|
|
||||||
{
|
|
||||||
'gasordine.active': true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
gasordine: {
|
|
||||||
$exists: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$match: {
|
|
||||||
$or: [
|
|
||||||
{
|
|
||||||
quantity: {
|
|
||||||
$gt: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
quantitypreordered: {
|
|
||||||
$gt: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$group: {
|
|
||||||
_id: '$product._id',
|
|
||||||
name: {
|
|
||||||
$first: '$product.productInfo.name',
|
|
||||||
},
|
|
||||||
weight: {
|
|
||||||
$first: '$product.productInfo.weight',
|
|
||||||
},
|
|
||||||
price_acquistato: {
|
|
||||||
$first: '$product.price_acquistato',
|
|
||||||
},
|
|
||||||
totalQuantity: {
|
|
||||||
$sum: {
|
|
||||||
$add: [
|
|
||||||
'$quantity',
|
|
||||||
'$quantitypreordered',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
totalPrice_acquistato: {
|
|
||||||
$sum: {
|
|
||||||
$multiply: [
|
|
||||||
'$product.price_acquistato',
|
|
||||||
{
|
|
||||||
$add: [
|
|
||||||
'$quantity',
|
|
||||||
'$quantitypreordered',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
count: {
|
|
||||||
$sum: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$sort: {
|
|
||||||
name: 1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
queryord.push(query)
|
|
||||||
|
|
||||||
filtroOrdini.value = queryord
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(mounted)
|
|
||||||
|
|
||||||
return {
|
|
||||||
colTableGestoreOrdini,
|
|
||||||
setmeta,
|
|
||||||
filtroOrdini,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<template>
|
|
||||||
<CMyPage :title="t('mypages.totaliordini')" imgbackground="/images/prodotti.jpg" sizes="max-height: 120px">
|
|
||||||
<span>{{
|
|
||||||
setmeta({
|
|
||||||
title: t('mypages.totaliordini'),
|
|
||||||
description: '',
|
|
||||||
keywords: '',
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
|
||||||
<CTitleBanner :title="t('mypages.totaliordini')"></CTitleBanner>
|
|
||||||
<CGridTableRec prop_mytable="orders" :prop_mytitle="t('mypages.totaliordini')" :prop_mycolumns="colTableGestoreOrdini"
|
|
||||||
:filtercustom="filtroOrdini" prop_colkey="name" nodataLabel="Nessun Totale Ordine"
|
|
||||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
|
|
||||||
|
|
||||||
</CGridTableRec>
|
|
||||||
</div>
|
|
||||||
</CMyPage>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" src="./gestoreordini.ts">
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import 'gestoreordini.scss';
|
|
||||||
</style>
|
|
||||||
@@ -1550,7 +1550,9 @@ const msg_it = {
|
|||||||
qta_max_default_tips_contocom: 'Rappresenta quanto credito ti è concesso accumulare al Conto Comunitario. Incentiviamo così a frequenti scambi tra i partecipanti',
|
qta_max_default_tips_contocom: 'Rappresenta quanto credito ti è concesso accumulare al Conto Comunitario. Incentiviamo così a frequenti scambi tra i partecipanti',
|
||||||
data_costituz: 'Data Costituzione',
|
data_costituz: 'Data Costituzione',
|
||||||
deperimento: 'Deperimento',
|
deperimento: 'Deperimento',
|
||||||
showAlways: 'Mostra Sempre',
|
circuitiExtraProv: 'Circuito Extra Provinciale (Nazionale o altri)',
|
||||||
|
isCircItalia: 'Circuito Italia',
|
||||||
|
enableOnlyIf1CircuitExist: 'Abilita solo se l\'Utente è stato ammesso ad un Circuito Territoriale',
|
||||||
freq_deper: 'Frequenza Deperimento',
|
freq_deper: 'Frequenza Deperimento',
|
||||||
minuto_deper: 'Minuto Dep.',
|
minuto_deper: 'Minuto Dep.',
|
||||||
ora_deper: 'Ora Dep.',
|
ora_deper: 'Ora Dep.',
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
|||||||
sonoDentroAlCircuitoNazionale() {
|
sonoDentroAlCircuitoNazionale() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.showAlways)
|
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.isCircItalia)
|
||||||
|
|
||||||
for (const circ of circNazionali) {
|
for (const circ of circNazionali) {
|
||||||
const trovato = userStore.my.profile.mycircuits.findIndex((mycirc: any) => mycirc.circuitname === circ.name) >= 0
|
const trovato = userStore.my.profile.mycircuits.findIndex((mycirc: any) => mycirc.circuitname === circ.name) >= 0
|
||||||
@@ -74,7 +74,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
|||||||
|
|
||||||
getCircuitoNazionale(arrCircuiti: any): any {
|
getCircuitoNazionale(arrCircuiti: any): any {
|
||||||
|
|
||||||
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.showAlways)
|
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.isCircItalia)
|
||||||
|
|
||||||
for (const circ of circNazionali) {
|
for (const circ of circNazionali) {
|
||||||
const reccirc = arrCircuiti.find((mycirc: any) => mycirc.circuitname === circ.name)
|
const reccirc = arrCircuiti.find((mycirc: any) => mycirc.circuitname === circ.name)
|
||||||
@@ -87,9 +87,9 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
EDentroAlCircuitoNazionale(user: IUserFields) {
|
EDentroAlCircuitoItalia(user: IUserFields) {
|
||||||
|
|
||||||
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.showAlways)
|
const circNazionali: any = this.listcircuits.filter((circ: any) => circ.isCircItalia)
|
||||||
|
|
||||||
if (user && user.profile && 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) {
|
for (const circ of circNazionali) {
|
||||||
@@ -105,12 +105,12 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isCircuitNational(circuitname: string): boolean {
|
isCircuitNational(circuitname: string): boolean {
|
||||||
return this.listcircuits.findIndex((rec: ICircuit) => rec.name === circuitname && rec.showAlways) >= 0
|
return this.listcircuits.findIndex((rec: ICircuit) => rec.name === circuitname && rec.isCircItalia) >= 0
|
||||||
},
|
},
|
||||||
|
|
||||||
getCircuitsNational(): any[] {
|
getCircuitsNational(): any[] {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
let arrcircnaz = this.listcircuits.filter((rec: ICircuit) => rec.showAlways)
|
let arrcircnaz = this.listcircuits.filter((rec: ICircuit) => rec.isCircItalia)
|
||||||
|
|
||||||
for (const circ of arrcircnaz) {
|
for (const circ of arrcircnaz) {
|
||||||
if (userStore.my.profile.useraccounts)
|
if (userStore.my.profile.useraccounts)
|
||||||
@@ -145,7 +145,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
|||||||
|
|
||||||
for (const account of accountsConFido) {
|
for (const account of accountsConFido) {
|
||||||
const mycircuit = this.listcircuits.find((circ: ICircuit) => circ._id === account.circuitId)
|
const mycircuit = this.listcircuits.find((circ: ICircuit) => circ._id === account.circuitId)
|
||||||
if (mycircuit && !mycircuit.showAlways) {
|
if (mycircuit && !mycircuit.circuitiExtraProv) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
|||||||
|
|
||||||
for (const account of accountsConFido) {
|
for (const account of accountsConFido) {
|
||||||
const mycircuit = this.listcircuits.find((circ: ICircuit) => circ._id === account.circuitId)
|
const mycircuit = this.listcircuits.find((circ: ICircuit) => circ._id === account.circuitId)
|
||||||
if (mycircuit && !mycircuit.showAlways) {
|
if (mycircuit && !mycircuit.circuitiExtraProv) {
|
||||||
return mycircuit
|
return mycircuit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6387,8 +6387,20 @@ export const colTableCircuitComplete = [
|
|||||||
fieldtype: costanti.FieldType.boolean,
|
fieldtype: costanti.FieldType.boolean,
|
||||||
}),
|
}),
|
||||||
AddCol({
|
AddCol({
|
||||||
name: 'showAlways',
|
name: 'circuitiExtraProv',
|
||||||
label_trans: 'circuit.showAlways',
|
label_trans: 'circuit.circuitiExtraProv',
|
||||||
|
fieldtype: costanti.FieldType.boolean,
|
||||||
|
onlyforAdmin: true,
|
||||||
|
}),
|
||||||
|
AddCol({
|
||||||
|
name: 'isCircItalia',
|
||||||
|
label_trans: 'circuit.isCircItalia',
|
||||||
|
fieldtype: costanti.FieldType.boolean,
|
||||||
|
onlyforAdmin: true,
|
||||||
|
}),
|
||||||
|
AddCol({
|
||||||
|
name: 'enableOnlyIf1CircuitExist',
|
||||||
|
label_trans: 'circuit.enableOnlyIf1CircuitExist',
|
||||||
fieldtype: costanti.FieldType.boolean,
|
fieldtype: costanti.FieldType.boolean,
|
||||||
onlyforAdmin: true,
|
onlyforAdmin: true,
|
||||||
}),
|
}),
|
||||||
@@ -6688,8 +6700,20 @@ export const colTableCircuit = [
|
|||||||
disable: true,
|
disable: true,
|
||||||
}),
|
}),
|
||||||
AddCol({
|
AddCol({
|
||||||
name: 'showAlways',
|
name: 'circuitiExtraProv',
|
||||||
label_trans: 'circuit.showAlways',
|
label_trans: 'circuit.circuitiExtraProv',
|
||||||
|
fieldtype: costanti.FieldType.boolean,
|
||||||
|
onlyforAdmin: true,
|
||||||
|
}),
|
||||||
|
AddCol({
|
||||||
|
name: 'isCircItalia',
|
||||||
|
label_trans: 'circuit.isCircItalia',
|
||||||
|
fieldtype: costanti.FieldType.boolean,
|
||||||
|
onlyforAdmin: true,
|
||||||
|
}),
|
||||||
|
AddCol({
|
||||||
|
name: 'enableOnlyIf1CircuitExist',
|
||||||
|
label_trans: 'circuit.enableOnlyIf1CircuitExist',
|
||||||
fieldtype: costanti.FieldType.boolean,
|
fieldtype: costanti.FieldType.boolean,
|
||||||
onlyforAdmin: true,
|
onlyforAdmin: true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -8219,7 +8219,8 @@ export const tools = {
|
|||||||
admins: [],
|
admins: [],
|
||||||
color: '#ff5500',
|
color: '#ff5500',
|
||||||
deperimento: false,
|
deperimento: false,
|
||||||
showAlways: false,
|
circuitiExtraProv: false,
|
||||||
|
isCircItalia: false,
|
||||||
transactionsEnabled: false,
|
transactionsEnabled: false,
|
||||||
status: shared_consts.CIRCUIT_STATUS.FASE1_CREAZIONE_GRUPPO,
|
status: shared_consts.CIRCUIT_STATUS.FASE1_CREAZIONE_GRUPPO,
|
||||||
symbol: 'RIS',
|
symbol: 'RIS',
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ export const DefaultUser: IUserFields = {
|
|||||||
noNameSurname: false,
|
noNameSurname: false,
|
||||||
noCircuit: false,
|
noCircuit: false,
|
||||||
noCircIta: false,
|
noCircIta: false,
|
||||||
|
insert_circuito_ita: false,
|
||||||
noFoto: false,
|
noFoto: false,
|
||||||
asked_circuits: [],
|
asked_circuits: [],
|
||||||
refused_circuits: [],
|
refused_circuits: [],
|
||||||
@@ -186,6 +187,7 @@ export const DefaultProfile: IUserProfile = {
|
|||||||
noNameSurname: false,
|
noNameSurname: false,
|
||||||
noCircuit: false,
|
noCircuit: false,
|
||||||
noCircIta: false,
|
noCircIta: false,
|
||||||
|
insert_circuito_ita: false,
|
||||||
noFoto: false,
|
noFoto: false,
|
||||||
asked_circuits: [],
|
asked_circuits: [],
|
||||||
refused_circuits: [],
|
refused_circuits: [],
|
||||||
@@ -612,15 +614,15 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
// controlla che il circuito sia Abilitato e Territoriale !
|
// controlla che il circuito sia Abilitato e Territoriale !
|
||||||
for (const circuitname of arrout) {
|
for (const circuitname of arrout) {
|
||||||
const circuit = circuitStore.getCircuitByName(circuitname);
|
const circuit = circuitStore.getCircuitByName(circuitname);
|
||||||
if (circuit && circuit.transactionsEnabled && !circuit.showAlways) {
|
if (circuit && circuit.transactionsEnabled && !circuit.circuitiExtraProv) {
|
||||||
arrfinale.push(circuitname);
|
arrfinale.push(circuitname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Poi aggiungi i Circuiti ITALIA
|
// Poi aggiungi i Circuiti Nazionali
|
||||||
for (const circuitname of arrout) {
|
for (const circuitname of arrout) {
|
||||||
const circuit = circuitStore.getCircuitByName(circuitname);
|
const circuit = circuitStore.getCircuitByName(circuitname);
|
||||||
if (circuit && circuit.transactionsEnabled && circuit.showAlways) {
|
if (circuit && circuit.transactionsEnabled && circuit.circuitiExtraProv) {
|
||||||
arrfinale.push(circuitname);
|
arrfinale.push(circuitname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,385 +1,412 @@
|
|||||||
import { CGridTableRec } from '@src/components/CGridTableRec'
|
import { CGridTableRec } from '@src/components/CGridTableRec';
|
||||||
import { CMyFriends } from '@src/components/CMyFriends'
|
import { CMyFriends } from '@src/components/CMyFriends';
|
||||||
import { CMyUser } from '@src/components/CMyUser'
|
import { CMyUser } from '@src/components/CMyUser';
|
||||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
import { CTitleBanner } from '@src/components/CTitleBanner';
|
||||||
import { CProfile } from '@src/components/CProfile'
|
import { CProfile } from '@src/components/CProfile';
|
||||||
import { CCheckIfIsLogged } from '@src/components/CCheckIfIsLogged'
|
import { CCheckIfIsLogged } from '@src/components/CCheckIfIsLogged';
|
||||||
import { CMyFieldRec } from '@src/components/CMyFieldRec'
|
import { CMyFieldRec } from '@src/components/CMyFieldRec';
|
||||||
import { CCurrencyValue } from '@src/components/CCurrencyValue'
|
import { CCurrencyValue } from '@src/components/CCurrencyValue';
|
||||||
import { CSaldo } from '@src/components/CSaldo'
|
import { CSaldo } from '@src/components/CSaldo';
|
||||||
import { CSendCoins } from '@src/components/CSendCoins'
|
import { CSendCoins } from '@src/components/CSendCoins';
|
||||||
import { CUserNonVerif } from '@src/components/CUserNonVerif'
|
import { CUserNonVerif } from '@src/components/CUserNonVerif';
|
||||||
import { CTitleSec } from '@src/components/CTitleSec'
|
import { CTitleSec } from '@src/components/CTitleSec';
|
||||||
import { CSkill } from '@src/components/CSkill'
|
import { CSkill } from '@src/components/CSkill';
|
||||||
import { CFinder } from '@src/components/CFinder'
|
import { CFinder } from '@src/components/CFinder';
|
||||||
import { CDateTime } from '@src/components/CDateTime'
|
import { CDateTime } from '@src/components/CDateTime';
|
||||||
import { tools } from '@tools'
|
import { tools } from '@tools';
|
||||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
import { computed, defineComponent, onMounted, ref, watch } from 'vue';
|
||||||
import { useUserStore } from '@store/UserStore'
|
import { useUserStore } from '@store/UserStore';
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
import { useGlobalStore } from '@store/globalStore';
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toolsext } from '@store/Modules/toolsext'
|
import { toolsext } from '@store/Modules/toolsext';
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar';
|
||||||
import { CNotifAtTop } from '@src/components/CNotifAtTop'
|
import { CNotifAtTop } from '@src/components/CNotifAtTop';
|
||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti';
|
||||||
import type { ICity, IFriends, ICircuit, ISearchList, IAccount, IMyGroup } from 'model';
|
import type { ICity, IFriends, ICircuit, ISearchList, IAccount, IMyGroup } from 'model';
|
||||||
import { IUserFields } from 'model'
|
import { IUserFields } from 'model';
|
||||||
import { shared_consts } from '@src/common/shared_vuejs'
|
import { shared_consts } from '@src/common/shared_vuejs';
|
||||||
import { colmyUserPeople, colmyUserPeopleSaldi, colmyUserCircuit, colmyMovement, colmyMovementTable, colmyUserGroup } from '@store/Modules/fieldsTable'
|
import {
|
||||||
import { useNotifStore } from '@store/NotifStore'
|
colmyUserPeople,
|
||||||
import { useCircuitStore } from '@store/CircuitStore'
|
colmyUserPeopleSaldi,
|
||||||
|
colmyUserCircuit,
|
||||||
|
colmyMovement,
|
||||||
|
colmyMovementTable,
|
||||||
|
colmyUserGroup,
|
||||||
|
} from '@store/Modules/fieldsTable';
|
||||||
|
import { useNotifStore } from '@store/NotifStore';
|
||||||
|
import { useCircuitStore } from '@store/CircuitStore';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'mycircuit',
|
name: 'mycircuit',
|
||||||
components: {
|
components: {
|
||||||
CProfile, CTitleBanner, CMyFieldRec, CSkill, CTitleSec, CDateTime, CMyFriends,
|
CProfile,
|
||||||
CGridTableRec, CMyUser, CCheckIfIsLogged, CCurrencyValue, CSaldo, CNotifAtTop,
|
CTitleBanner,
|
||||||
CSendCoins, CUserNonVerif, CFinder,
|
CMyFieldRec,
|
||||||
|
CSkill,
|
||||||
|
CTitleSec,
|
||||||
|
CDateTime,
|
||||||
|
CMyFriends,
|
||||||
|
CGridTableRec,
|
||||||
|
CMyUser,
|
||||||
|
CCheckIfIsLogged,
|
||||||
|
CCurrencyValue,
|
||||||
|
CSaldo,
|
||||||
|
CNotifAtTop,
|
||||||
|
CSendCoins,
|
||||||
|
CUserNonVerif,
|
||||||
|
CFinder,
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
setup() {
|
setup() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore();
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore();
|
||||||
const notifStore = useNotifStore()
|
const notifStore = useNotifStore();
|
||||||
const circuitStore = useCircuitStore()
|
const circuitStore = useCircuitStore();
|
||||||
const $route = useRoute()
|
const $route = useRoute();
|
||||||
const $q = useQuasar()
|
const $q = useQuasar();
|
||||||
const { t } = useI18n()
|
const { t } = useI18n();
|
||||||
|
|
||||||
const showwhommov = ref(1)
|
const showwhommov = ref(1);
|
||||||
const optionsmov = [
|
const optionsmov = [
|
||||||
{ label: t('movement.onlymymov'), value: 1 },
|
{ label: t('movement.onlymymov'), value: 1 },
|
||||||
{ label: t('movement.allmov'), value: 2 },
|
{ label: t('movement.allmov'), value: 2 },
|
||||||
]
|
];
|
||||||
const tabellare = ref(false)
|
const tabellare = ref(false);
|
||||||
const groupsListAdmin = ref(<IMyGroup[]>[])
|
const groupsListAdmin = ref(<IMyGroup[]>[]);
|
||||||
const groupnameSel = ref(<any>null)
|
const groupnameSel = ref(<any>null);
|
||||||
|
|
||||||
const showsendCoinTo = ref(false)
|
const showsendCoinTo = ref(false);
|
||||||
const showrules = ref(false)
|
const showrules = ref(false);
|
||||||
const showMov = ref(false)
|
const showMov = ref(false);
|
||||||
|
|
||||||
const animation = ref('fade')
|
const animation = ref('fade');
|
||||||
|
|
||||||
const path = computed(() => $route.params.path ? $route.params.path.toString() : '')
|
const path = computed(() =>
|
||||||
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
|
$route.params.path ? $route.params.path.toString() : ''
|
||||||
|
);
|
||||||
|
const idnotif = computed(() =>
|
||||||
|
$route.query.idnotif ? $route.query.idnotif.toString() : ''
|
||||||
|
);
|
||||||
|
|
||||||
const circuitpath_loaded = ref('')
|
const circuitpath_loaded = ref('');
|
||||||
|
|
||||||
const filtroutente = ref([] as any[])
|
const filtroutente = ref([] as any[]);
|
||||||
const showPic = ref(false)
|
const showPic = ref(false);
|
||||||
const loadSaldo = ref(false)
|
const loadSaldo = ref(false);
|
||||||
|
|
||||||
const card = ref(<any>{})
|
const card = ref(<any>{});
|
||||||
|
|
||||||
const circuit = ref(<ICircuit | undefined>undefined)
|
const circuit = ref(<ICircuit | undefined>undefined);
|
||||||
const account = ref(<IAccount | null>null)
|
const account = ref(<IAccount | null>null);
|
||||||
const mystatus = ref(0 as number)
|
const mystatus = ref(0 as number);
|
||||||
const users_in_circuit = ref([] as IFriends[])
|
const users_in_circuit = ref([] as IFriends[]);
|
||||||
|
|
||||||
const qtarem = ref(0)
|
const qtarem = ref(0);
|
||||||
const saldo = ref(0)
|
const saldo = ref(0);
|
||||||
const saldo_pend = ref(0)
|
const saldo_pend = ref(0);
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
const requestToEnterCircuit = ref(false)
|
const requestToEnterCircuit = ref(false);
|
||||||
|
|
||||||
const tabcircuit = ref('info')
|
const tabcircuit = ref('info');
|
||||||
const tabmembers = ref('all')
|
const tabmembers = ref('all');
|
||||||
const showsaldi = ref(false)
|
const showsaldi = ref(false);
|
||||||
const tab = ref('membri')
|
const tab = ref('membri');
|
||||||
|
|
||||||
const arrfilterand: any = ref([])
|
const arrfilterand: any = ref([]);
|
||||||
const filterextra: any = ref([])
|
const filterextra: any = ref([]);
|
||||||
const filterextra_group: any = ref([])
|
const filterextra_group: any = ref([]);
|
||||||
const filterextra2: any = ref([])
|
const filterextra2: any = ref([]);
|
||||||
const filtercustom: any = ref([])
|
const filtercustom: any = ref([]);
|
||||||
const filtercustom_rich: any = ref([])
|
const filtercustom_rich: any = ref([]);
|
||||||
const searchList = ref([] as ISearchList[])
|
const searchList = ref([] as ISearchList[]);
|
||||||
|
|
||||||
const cities = ref([] as ICity[])
|
const cities = ref([] as ICity[]);
|
||||||
|
|
||||||
const fidoConcesso = ref(<any>0)
|
const fidoConcesso = ref(<any>0);
|
||||||
const qtaMax = ref(<any>0)
|
const qtaMax = ref(<any>0);
|
||||||
|
|
||||||
const mycards_annunci = computed(() => {
|
const mycards_annunci = computed(() => {
|
||||||
return costanti.MAINCARDS.filter((rec: any) => rec.table && rec.annuncio)
|
return costanti.MAINCARDS.filter((rec: any) => rec.table && rec.annuncio);
|
||||||
})
|
});
|
||||||
|
|
||||||
watch(() => path.value, (to: any, from: any) => {
|
watch(
|
||||||
if (circuitpath_loaded.value !== path.value)
|
() => path.value,
|
||||||
loadCircuit()
|
(to: any, from: any) => {
|
||||||
})
|
if (circuitpath_loaded.value !== path.value) loadCircuit();
|
||||||
|
|
||||||
watch(() => tabcircuit.value, (to: any, from: any) => {
|
|
||||||
tools.setCookie(tools.COOK_TAB_CIRCUIT + path.value, tabcircuit.value)
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(() => circuit.value, (to: any, from: any) => {
|
|
||||||
if (to) {
|
|
||||||
loadAccount()
|
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => tabcircuit.value,
|
||||||
|
(to: any, from: any) => {
|
||||||
|
tools.setCookie(tools.COOK_TAB_CIRCUIT + path.value, tabcircuit.value);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => circuit.value,
|
||||||
|
(to: any, from: any) => {
|
||||||
|
if (to) {
|
||||||
|
loadAccount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function getParamCircuitsToView() {
|
function getParamCircuitsToView() {
|
||||||
return {
|
return {
|
||||||
'circuit.name': 1,
|
'circuit.name': 1,
|
||||||
'circuit._id': 1,
|
'circuit._id': 1,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadAccount() {
|
function loadAccount() {
|
||||||
// console.log('loadAccount')
|
// console.log('loadAccount')
|
||||||
account.value = circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null
|
account.value = circuit.value
|
||||||
|
? userStore.getAccountByCircuitId(circuit.value._id)
|
||||||
|
: null;
|
||||||
// console.log('saldo', account.value!.saldo)
|
// console.log('saldo', account.value!.saldo)
|
||||||
|
|
||||||
fidoConcesso.value = account.value ? account.value.fidoConcesso : (circuit.value ? circuit.value.fido_scoperto_default : 0)
|
fidoConcesso.value = account.value
|
||||||
qtaMax.value = account.value ? account.value.qta_maxConcessa : (circuit.value ? circuit.value.qta_max_default : 0)
|
? account.value.fidoConcesso
|
||||||
qtarem.value = account.value ? circuitStore.getRemainingCoinsToSend(account.value) : 0
|
: circuit.value
|
||||||
saldo.value = account.value ? account.value.saldo : 0
|
? circuit.value.fido_scoperto_default
|
||||||
saldo_pend.value = account.value ? account.value.saldo_pend : 0
|
: 0;
|
||||||
|
qtaMax.value = account.value
|
||||||
|
? account.value.qta_maxConcessa
|
||||||
|
: circuit.value
|
||||||
|
? circuit.value.qta_max_default
|
||||||
|
: 0;
|
||||||
|
qtarem.value = account.value
|
||||||
|
? circuitStore.getRemainingCoinsToSend(account.value)
|
||||||
|
: 0;
|
||||||
|
saldo.value = account.value ? account.value.saldo : 0;
|
||||||
|
saldo_pend.value = account.value ? account.value.saldo_pend : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function profile() {
|
function profile() {
|
||||||
return userStore.my.profile
|
return userStore.my.profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadCircuit() {
|
async function loadCircuit() {
|
||||||
console.log(' *** INIZIO loadCircuit')
|
console.log(' *** INIZIO loadCircuit');
|
||||||
|
|
||||||
if (!loading.value) {
|
if (!loading.value) {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
// Carica il profilo di quest'utente
|
// Carica il profilo di quest'utente
|
||||||
if (path.value) {
|
if (path.value) {
|
||||||
circuitpath_loaded.value = path.value
|
circuitpath_loaded.value = path.value;
|
||||||
circuit.value = null
|
circuit.value = null;
|
||||||
users_in_circuit.value = []
|
users_in_circuit.value = [];
|
||||||
await userStore.loadCircuit(path.value, idnotif.value).then(({ data, status }: { data: any, status: number }) => {
|
await userStore
|
||||||
// console.log('data', data)
|
.loadCircuit(path.value, idnotif.value)
|
||||||
if (data) {
|
.then(({ data, status }: { data: any; status: number }) => {
|
||||||
notifStore.setAsRead(idnotif.value)
|
// console.log('data', data)
|
||||||
users_in_circuit.value = data.users_in_circuit
|
if (data) {
|
||||||
circuit.value = data.circuit
|
notifStore.setAsRead(idnotif.value);
|
||||||
|
users_in_circuit.value = data.users_in_circuit;
|
||||||
|
circuit.value = data.circuit;
|
||||||
|
|
||||||
if (circuit.value!.circuitoIndipendente) {
|
if (circuit.value!.circuitoIndipendente) {
|
||||||
showrules.value = true
|
showrules.value = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
circuit.value = null;
|
||||||
|
users_in_circuit.value = [];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
circuit.value = null
|
|
||||||
users_in_circuit.value = []
|
|
||||||
}
|
|
||||||
|
|
||||||
loadAccount()
|
loadAccount();
|
||||||
|
|
||||||
mystatus.value = status
|
mystatus.value = status;
|
||||||
|
|
||||||
searchList.value = []
|
searchList.value = [];
|
||||||
if (circuit.value) {
|
if (circuit.value) {
|
||||||
const addquerysingle = [
|
const addquerysingle = [];
|
||||||
|
|
||||||
];
|
filterextra.value = [
|
||||||
|
{
|
||||||
filterextra.value = [{
|
$match: {
|
||||||
$match: {
|
idapp: tools.getEnv('VITE_APP_ID'),
|
||||||
idapp: tools.getEnv('VITE_APP_ID'),
|
'profile.mycircuits': {
|
||||||
'profile.mycircuits': {
|
$elemMatch: { circuitname: { $eq: circuit.value.name } },
|
||||||
$elemMatch: { circuitname: { $eq: circuit.value.name } },
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$lookup: {
|
$lookup: {
|
||||||
from: 'circuits',
|
from: 'circuits',
|
||||||
as: 'circuit',
|
as: 'circuit',
|
||||||
let: { circuitname: circuit.value.name, idapp: '$idapp' },
|
let: { circuitname: circuit.value.name, idapp: '$idapp' },
|
||||||
pipeline: [
|
pipeline: [
|
||||||
{
|
|
||||||
$match:
|
|
||||||
{
|
|
||||||
$expr:
|
|
||||||
{
|
{
|
||||||
$and:
|
$match: {
|
||||||
[
|
$expr: {
|
||||||
{ $eq: ['$name', '$$circuitname'] },
|
$and: [
|
||||||
{ $eq: ['$idapp', '$$idapp'] },
|
{ $eq: ['$name', '$$circuitname'] },
|
||||||
|
{ $eq: ['$idapp', '$$idapp'] },
|
||||||
],
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ $unwind: '$circuit' },
|
||||||
|
{
|
||||||
|
$project: {
|
||||||
|
username: 1,
|
||||||
|
verified_by_aportador: 1,
|
||||||
|
name: 1,
|
||||||
|
surname: 1,
|
||||||
|
date_reg: 1,
|
||||||
|
profile: 1,
|
||||||
|
idapp: 1,
|
||||||
|
...getParamCircuitsToView(),
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
{ $unwind: '$circuit' },
|
|
||||||
{
|
|
||||||
$project: {
|
|
||||||
username: 1,
|
|
||||||
verified_by_aportador: 1,
|
|
||||||
name: 1,
|
|
||||||
surname: 1,
|
|
||||||
date_reg: 1,
|
|
||||||
profile: 1,
|
|
||||||
idapp: 1,
|
|
||||||
...getParamCircuitsToView(),
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
$lookup: {
|
|
||||||
from: 'accounts',
|
|
||||||
as: 'account',
|
|
||||||
let: { username: '$username', idapp: '$idapp', circuitId: '$circuit._id' },
|
|
||||||
pipeline: [
|
|
||||||
{
|
|
||||||
$match:
|
|
||||||
{
|
|
||||||
$expr:
|
|
||||||
{
|
|
||||||
$and:
|
|
||||||
[
|
|
||||||
{ $eq: ['$$username', '$username'] },
|
|
||||||
{ $eq: ['$$idapp', '$idapp'] },
|
|
||||||
{ $eq: ['$$circuitId', '$circuitId'] },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ $unwind: '$account' },
|
|
||||||
]
|
|
||||||
|
|
||||||
filterextra_group.value = [{
|
|
||||||
$match: {
|
|
||||||
idapp: tools.getEnv('VITE_APP_ID'),
|
|
||||||
'mycircuits': {
|
|
||||||
$elemMatch: { circuitname: { $eq: circuit.value.name } },
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$lookup: {
|
$lookup: {
|
||||||
from: 'circuits',
|
from: 'accounts',
|
||||||
as: 'circuit',
|
as: 'account',
|
||||||
let: { circuitname: circuit.value.name, idapp: '$idapp' },
|
let: {
|
||||||
pipeline: [
|
username: '$username',
|
||||||
{
|
idapp: '$idapp',
|
||||||
$match:
|
circuitId: '$circuit._id',
|
||||||
{
|
},
|
||||||
$expr:
|
pipeline: [
|
||||||
{
|
{
|
||||||
$and:
|
$match: {
|
||||||
[
|
$expr: {
|
||||||
{ $eq: ['$name', '$$circuitname'] },
|
$and: [
|
||||||
{ $eq: ['$idapp', '$$idapp'] },
|
{ $eq: ['$$username', '$username'] },
|
||||||
|
{ $eq: ['$$idapp', '$idapp'] },
|
||||||
],
|
{ $eq: ['$$circuitId', '$circuitId'] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ $unwind: '$account' },
|
||||||
|
];
|
||||||
|
|
||||||
|
filterextra_group.value = [
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
idapp: tools.getEnv('VITE_APP_ID'),
|
||||||
|
mycircuits: {
|
||||||
|
$elemMatch: { circuitname: { $eq: circuit.value.name } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
},
|
|
||||||
|
|
||||||
},
|
{
|
||||||
{ $unwind: '$circuit' },
|
$lookup: {
|
||||||
{
|
from: 'circuits',
|
||||||
$project: {
|
as: 'circuit',
|
||||||
groupname: 1,
|
let: { circuitname: circuit.value.name, idapp: '$idapp' },
|
||||||
title: 1,
|
pipeline: [
|
||||||
descr: 1,
|
|
||||||
photos: 1,
|
|
||||||
surname: 1,
|
|
||||||
verified_by_aportador: 1,
|
|
||||||
admins: 1,
|
|
||||||
idapp: 1,
|
|
||||||
...getParamCircuitsToView(),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$lookup: {
|
|
||||||
from: 'accounts',
|
|
||||||
as: 'account',
|
|
||||||
let: { groupname: '$groupname', idapp: '$idapp', circuitId: '$circuit._id' },
|
|
||||||
pipeline: [
|
|
||||||
{
|
|
||||||
$match:
|
|
||||||
{
|
|
||||||
$expr:
|
|
||||||
{
|
{
|
||||||
$and:
|
$match: {
|
||||||
[
|
$expr: {
|
||||||
{ $eq: ['$groupname', '$$groupname'] },
|
$and: [
|
||||||
{ $eq: ['$idapp', '$$idapp'] },
|
{ $eq: ['$name', '$$circuitname'] },
|
||||||
{ $eq: ['$circuitId', '$$circuitId'] },
|
{ $eq: ['$idapp', '$$idapp'] },
|
||||||
|
],
|
||||||
],
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
},
|
{ $unwind: '$circuit' },
|
||||||
|
{
|
||||||
|
$project: {
|
||||||
|
groupname: 1,
|
||||||
|
title: 1,
|
||||||
|
descr: 1,
|
||||||
|
photos: 1,
|
||||||
|
surname: 1,
|
||||||
|
verified_by_aportador: 1,
|
||||||
|
admins: 1,
|
||||||
|
idapp: 1,
|
||||||
|
...getParamCircuitsToView(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: 'accounts',
|
||||||
|
as: 'account',
|
||||||
|
let: {
|
||||||
|
groupname: '$groupname',
|
||||||
|
idapp: '$idapp',
|
||||||
|
circuitId: '$circuit._id',
|
||||||
|
},
|
||||||
|
pipeline: [
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
$expr: {
|
||||||
|
$and: [
|
||||||
|
{ $eq: ['$groupname', '$$groupname'] },
|
||||||
|
{ $eq: ['$idapp', '$$idapp'] },
|
||||||
|
{ $eq: ['$circuitId', '$$circuitId'] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$unwind: '$account',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$match: { 'account.groupname': { $exists: true, $ne: '' } },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
arrfilterand.value = [];
|
||||||
|
filtercustom_rich.value = [];
|
||||||
|
|
||||||
},
|
if (userStore.my.username && circuit.value)
|
||||||
{
|
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin();
|
||||||
$unwind: '$account',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$match: { 'account.groupname': { $exists: true, $ne: '' } }
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
arrfilterand.value = []
|
|
||||||
filtercustom_rich.value = []
|
|
||||||
|
|
||||||
if (userStore.my.username && circuit.value)
|
|
||||||
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin()
|
|
||||||
|
|
||||||
// filtroutente.value = [{ userId: userStore.my._id }]
|
|
||||||
})
|
|
||||||
|
|
||||||
|
// filtroutente.value = [{ userId: userStore.my._id }]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
console.log(' ___ FINE loadCircuit')
|
console.log(' ___ FINE loadCircuit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mounted() {
|
function mounted() {
|
||||||
tabcircuit.value = tools.getCookie(tools.COOK_TAB_CIRCUIT + path.value, 'info')
|
tabcircuit.value = tools.getCookie(tools.COOK_TAB_CIRCUIT + path.value, 'info');
|
||||||
|
|
||||||
loadCircuit()
|
loadCircuit();
|
||||||
|
|
||||||
if (mycards_annunci.value)
|
|
||||||
card.value = mycards_annunci.value[0]
|
|
||||||
|
|
||||||
|
if (mycards_annunci.value) card.value = mycards_annunci.value[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getImgCircuit() {
|
function getImgCircuit() {
|
||||||
if (circuit.value)
|
if (circuit.value) return userStore.getImgByCircuit(circuit.value);
|
||||||
return userStore.getImgByCircuit(circuit.value)
|
else return '';
|
||||||
else
|
|
||||||
return ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkifShow(col: string) {
|
function checkifShow(col: string) {
|
||||||
// ++Todo: checkifShow Permessi !
|
// ++Todo: checkifShow Permessi !
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function extraparams() {
|
function extraparams() {
|
||||||
const lk_tab = 'users'
|
const lk_tab = 'users';
|
||||||
const lk_LF = 'userId'
|
const lk_LF = 'userId';
|
||||||
const lk_FF = '_id'
|
const lk_FF = '_id';
|
||||||
const lk_as = 'user'
|
const lk_as = 'user';
|
||||||
const af_objId_tab = 'myId'
|
const af_objId_tab = 'myId';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
lookup1: {
|
lookup1: {
|
||||||
@@ -411,17 +438,17 @@ export default defineComponent({
|
|||||||
username_who_report: 1,
|
username_who_report: 1,
|
||||||
namecomplete: 1,
|
namecomplete: 1,
|
||||||
date_reg: 1,
|
date_reg: 1,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function extraparams_groups() {
|
function extraparams_groups() {
|
||||||
const lk_tab = 'mygroups'
|
const lk_tab = 'mygroups';
|
||||||
const lk_LF = 'userId'
|
const lk_LF = 'userId';
|
||||||
const lk_FF = '_id'
|
const lk_FF = '_id';
|
||||||
const lk_as = 'group'
|
const lk_as = 'group';
|
||||||
const af_objId_tab = 'myId'
|
const af_objId_tab = 'myId';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
lookup1: {
|
lookup1: {
|
||||||
@@ -435,90 +462,93 @@ export default defineComponent({
|
|||||||
title: 1,
|
title: 1,
|
||||||
descr: 1,
|
descr: 1,
|
||||||
photos: 1,
|
photos: 1,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function extraparams_rich() {
|
function extraparams_rich() {
|
||||||
return {
|
return {
|
||||||
querytype: shared_consts.QUERYTYPE_CIRCUIT,
|
querytype: shared_consts.QUERYTYPE_CIRCUIT,
|
||||||
myid: circuit.value ? circuit.value._id : '',
|
myid: circuit.value ? circuit.value._id : '',
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function extraparams_rich_groups() {
|
function extraparams_rich_groups() {
|
||||||
return {
|
return {
|
||||||
querytype: shared_consts.QUERYTYPE_GROUP_CIRCUIT,
|
querytype: shared_consts.QUERYTYPE_GROUP_CIRCUIT,
|
||||||
myid: circuit.value ? circuit.value._id : '',
|
myid: circuit.value ? circuit.value._id : '',
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const extraparams_movs = (() => {
|
const extraparams_movs = () => {
|
||||||
if (showwhommov.value === 1) {
|
if (showwhommov.value === 1) {
|
||||||
return {
|
return {
|
||||||
querytype: shared_consts.QUERYTYPE_LIST_MOVEMENTS,
|
querytype: shared_consts.QUERYTYPE_LIST_MOVEMENTS,
|
||||||
myid: circuit.value ? circuit.value._id : '',
|
myid: circuit.value ? circuit.value._id : '',
|
||||||
username: userStore.my.username,
|
username: userStore.my.username,
|
||||||
}
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
querytype: shared_consts.QUERYTYPE_LIST_ALLMOVEMENTS,
|
querytype: shared_consts.QUERYTYPE_LIST_ALLMOVEMENTS,
|
||||||
myid: circuit.value ? circuit.value._id : '',
|
myid: circuit.value ? circuit.value._id : '',
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
};
|
||||||
|
|
||||||
function extraparams_refused() {
|
function extraparams_refused() {
|
||||||
return {
|
return {
|
||||||
querytype: shared_consts.QUERYTYPE_REFUSED_USER_CIRCUIT,
|
querytype: shared_consts.QUERYTYPE_REFUSED_USER_CIRCUIT,
|
||||||
myid: circuit.value ? circuit.value._id : '',
|
myid: circuit.value ? circuit.value._id : '',
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
function extraparams_refused_groups() {
|
function extraparams_refused_groups() {
|
||||||
return {
|
return {
|
||||||
querytype: shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT,
|
querytype: shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT,
|
||||||
myid: circuit.value ? circuit.value._id : '',
|
myid: circuit.value ? circuit.value._id : '',
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function numUsers() {
|
function numUsers() {
|
||||||
return users_in_circuit.value ? users_in_circuit.value.length : 0
|
return users_in_circuit.value ? users_in_circuit.value.length : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function numAdmins() {
|
function numAdmins() {
|
||||||
let quanti = (circuit.value && circuit.value.admins) ? circuit.value.admins.length : 0
|
let quanti =
|
||||||
if (quanti === 0)
|
circuit.value && circuit.value.admins ? circuit.value.admins.length : 0;
|
||||||
quanti = 1
|
if (quanti === 0) quanti = 1;
|
||||||
|
|
||||||
return quanti
|
return quanti;
|
||||||
}
|
}
|
||||||
|
|
||||||
function listaAdmins() {
|
function listaAdmins() {
|
||||||
return (circuit.value && circuit.value.admins) ? circuit.value.admins.map((rec) => rec.username).join(', ') : ''
|
return circuit.value && circuit.value.admins
|
||||||
|
? circuit.value.admins.map((rec) => rec.username).join(', ')
|
||||||
|
: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegulation(reg: string) {
|
function getRegulation(reg: string) {
|
||||||
const strreg = reg + ''
|
const strreg = reg + '';
|
||||||
if (!reg) {
|
if (!reg) {
|
||||||
const mystringa = t('circuit.regolamento', { nomecircuito: circuit.value!.name })
|
const mystringa = t('circuit.regolamento', { nomecircuito: circuit.value!.name });
|
||||||
return mystringa
|
return mystringa;
|
||||||
} else {
|
} else {
|
||||||
return reg
|
return reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function aggiornaSaldo() {
|
async function aggiornaSaldo() {
|
||||||
loadSaldo.value = true
|
loadSaldo.value = true;
|
||||||
await circuitStore.aggiornaSaldo(circuit.value!._id, '');
|
await circuitStore.aggiornaSaldo(circuit.value!._id, '');
|
||||||
loadAccount()
|
loadAccount();
|
||||||
loadSaldo.value = false
|
loadSaldo.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function myusername() {
|
||||||
|
return userStore.my.username;
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
profile,
|
profile,
|
||||||
@@ -589,6 +619,7 @@ export default defineComponent({
|
|||||||
saldo_pend,
|
saldo_pend,
|
||||||
mycards_annunci,
|
mycards_annunci,
|
||||||
card,
|
card,
|
||||||
}
|
myusername,
|
||||||
}
|
};
|
||||||
})
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -647,7 +647,7 @@
|
|||||||
shared_consts.GROUPSCMD.REQGROUP,
|
shared_consts.GROUPSCMD.REQGROUP,
|
||||||
myusername(),
|
myusername(),
|
||||||
true,
|
true,
|
||||||
grp.groupname
|
groupnameSel ? groupnameSel.groupname : ''
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
></q-item>
|
></q-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user