- Entri in Circuito Italia solo se hai il fido nel circuito provinciale

- Aggiunta Zona, oltre alla provincia, per visualizzare i vari circuiti della prov
This commit is contained in:
Surya Paolo
2023-12-06 00:42:02 +01:00
parent 7f716b82b6
commit a0fbddde39
19 changed files with 273 additions and 106 deletions

View File

@@ -212,6 +212,7 @@ export const shared_consts = {
TAB_COUNTRY: 'countries',
TAB_CITIES: 'cities',
TAB_PROVINCES: 'provinces',
TAB_CARDS: 'cards',
TAB_PHONES: 'phones',
TAB_SITES: 'sites',
TAB_SETTINGS: 'settings',

View File

@@ -1,6 +1,5 @@
<template>
<div v-if="tools.isUserOk() || noaut">
<div v-if="circuit">
<q-item
:class="
@@ -108,7 +107,6 @@
@click="naviga(tools.getPathByTableAndRec(table, circuit))"
lines="1"
>
<CSaldo
v-if="tools.isUserOk() && username === myusername() && account"
:account="account"
@@ -120,36 +118,42 @@
</CSaldo>
</q-item-label>
<q-item-label
lines="4"
v-if="
tools.isUserOk() &&
username === myusername() &&
!account &&
visu !== costanti.ENTER_TO_THE_CIRCUIT
"
>
<div class="centermydiv text-center">
<q-banner inline-actions class="bg-blue text-white">
<span v-html="$t('circuit.non_entrato')"></span>
<template v-slot:action>
<q-btn
v-if="
!userStore.IsMyCircuitByName(circuit.name) &&
!userStore.IsAskedCircuitByName(circuit.name) &&
!userStore.IsRefusedCircuitByName(circuit.name)
"
color="positive"
:label="$t('circuit.apri')"
@click="
requestToEnterCircuit = true;
groupnameSel = null;
"
/>
</template>
</q-banner>
</div>
</q-item-label>
lines="4"
v-if="
tools.isUserOk() &&
username === myusername() &&
!account &&
visu !== costanti.ENTER_TO_THE_CIRCUIT
"
>
<div class="centermydiv text-center">
<q-banner
v-if="!circuitStore.SonoDentroAdAlmeno1CircuitoConFido()"
inline-actions
class="bg-blue text-white"
>
<span v-html="$t('circuit.entra_italia_solo_dopo_aver_fido')"></span>
</q-banner>
<q-banner v-else inline-actions class="bg-blue text-white">
<span v-html="$t('circuit.non_entrato')"></span>
<template v-slot:action>
<q-btn
v-if="
!userStore.IsMyCircuitByName(circuit.name) &&
!userStore.IsAskedCircuitByName(circuit.name) &&
!userStore.IsRefusedCircuitByName(circuit.name)
"
color="positive"
:label="$t('circuit.apri')"
@click="
requestToEnterCircuit = true;
groupnameSel = null;
"
/>
</template>
</q-banner>
</div>
</q-item-label>
</q-item-section>
<q-item-section

View File

@@ -1,5 +1,6 @@
import { defineComponent, onMounted, PropType, ref, watch, computed } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
import { ICircuit, IImgGallery, IUserFields, IUserProfile } from 'model'
import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
@@ -53,6 +54,7 @@ export default defineComponent({
const userStore = useUserStore()
const circuitStore = useCircuitStore()
const globalStore = useGlobalStore()
const $q = useQuasar()
const { t } = useI18n()
const $router = useRouter()
@@ -107,6 +109,11 @@ export default defineComponent({
watch(() => strProv.value, (newval: string, oldval: string) => {
mycircuit.value = circuitStore.getCircuitByProvinceAndCard(strProv.value, card.value)
if (!globalStore.isPresenteCardsByProv(strProv.value)) {
if (contact.value && contact.value.profile.resid_card) {
contact.value.profile.resid_card = ''
}
}
})
watch(() => card.value, (newval: string, oldval: string) => {
@@ -432,7 +439,7 @@ export default defineComponent({
if (circuitStore.SonoDentroAdAlmeno1CircuitoConFido())
arrStep.value.push({ ...stepCircItalia, indstep: numindstep.value })
arrStep.value.push({ ...stepFine, indstep: numindstep.value })
// arrStep.value.push({ ...stepFine, indstep: numindstep.value })
if (userStore.isUserOk()) {
updatestart()
@@ -553,6 +560,7 @@ export default defineComponent({
usersList,
userstoverify,
numStepCompleted,
globalStore,
}
},
})

View File

@@ -9,11 +9,14 @@
class="q-pa-none"
:title="
!progressStep
? $t('tutorial.title', { indstep, numindstep }) +
? $t('tutorial.title', { indstep: indstep + 1, numindstep }) +
` (` +
progressLabel +
`)`
: $t('tutorial.title_completed', { indstep, numindstep }) +
: $t('tutorial.title_completed', {
indstep: indstep + 1,
numindstep,
}) +
` (` +
progressLabel +
`)`
@@ -84,6 +87,22 @@
:db_rec="contact"
>
</CMySelectCity>
<CMySelectCity
v-if="globalStore.isPresenteCardsByProv(contact.profile.resid_province)"
:label="$t('reg.resid_card')"
table="users"
jointable="cards"
v-model="contact.profile.resid_card"
myclass="selectorwide text-white"
:db_type="costanti.FieldType.string"
db_field="profile"
db_subfield="resid_card"
:db_id="contact._id"
:db_rec="contact"
:value2="contact.profile.resid_province"
>
</CMySelectCity>
</q-banner>
<div v-else-if="step === STEP_NAME_SURNAME">
<q-banner>
@@ -125,7 +144,7 @@
outlined
v-model="circuitsel"
:options="mylistcircuits"
label="Circuito"
label="SCegli il Circuito della tua Zona:"
>
</q-select>
@@ -250,7 +269,9 @@
<span v-html="$t('tutorial.utenti_da_verificare')"></span>
<template v-slot:action>
<q-btn
:label="userstoverify.length + ' ' + $t('tutorial.utenti_da_verif_btn')"
:label="
userstoverify.length + ' ' + $t('tutorial.utenti_da_verif_btn')
"
class="q-my-sm"
rounded
icon="fas fa-users"
@@ -293,14 +314,19 @@
<q-card-section class="inset-shadow">
<q-list>
<span v-for="(rec, index) in userstoverify" :key="index" class="q-my-sm rounded-borders" clickable>
<CMyUser
:mycontact="rec"
:visu="costanti.ASK_TRUST"
@setCmd="tools.setCmd"
<span
v-for="(rec, index) in userstoverify"
:key="index"
class="q-my-sm rounded-borders"
clickable
>
</CMyUser>
</span>
<CMyUser
:mycontact="rec"
:visu="costanti.ASK_TRUST"
@setCmd="tools.setCmd"
>
</CMyUser>
</span>
</q-list>
</q-card-section>
</q-card>

View File

@@ -72,6 +72,11 @@ export default defineComponent({
required: false,
default: null,
},
value2: {
type: String,
required: false,
default: undefined,
},
},
components: { CMySelect },
setup(props, { emit }) {

View File

@@ -5,13 +5,13 @@
:label="label"
v-model="myvalue"
:pickup="false"
:addnone="true"
:addnone="value2 ? false : true"
:dense="false"
:tablesel="table"
:myclass="myclass"
:optval="fieldsTable.getKeyByTable(jointable)"
:optlab="fieldsTable.getLabelByTable(jointable)"
:options="globalStore.getTableJoinByName(jointable, false, false, '')"
:options="globalStore.getTableJoinByName(jointable, false, !!value2, null, value2)"
:useinput="false"
:dark="$q.dark.isActive"
@update:value="changevalRec"

View File

@@ -40,6 +40,10 @@
><em>{{ contact.profile.qualifica }}</em></q-item-label
>
<q-item-label caption lines="1"></q-item-label>
<div v-if="visu === costanti.ASK_TRUST">
<span class="text-italic">Reg: {{ tools.getstrDateShort(contact.date_reg) }}</span>
</div>
<q-item-label v-if="labelFooter" lines="1"
><em>{{ labelFooter }}</em></q-item-label
>
@@ -431,7 +435,7 @@
<q-icon color="positive" name="fas fa-user-plus" />
</q-item-section>
<q-item-section>
{{ $t('circuit.accept') }}
{{ $t('circuit.add_to_circuit') }}
</q-item-section>
</q-item>
<q-item
@@ -784,7 +788,6 @@
rounded
dense
icon="fas fa-ellipsis-h"
:color="!contact.verified_by_aportador ? 'red' : 'white'"
>
<!-- </q-btn></q-btn>:icon="
userStore.IsMyFriendByUsername(contact.username)

View File

@@ -40,6 +40,7 @@
"
:label="$t('movement.viewpendingtransaction')"
@click="visuTransac = true"
dense
icon="fas fa-info"
>
</q-btn>

View File

@@ -1,16 +1,6 @@
<template>
<div class="row text-center justify-evenly items-center">
<div class="q-mb-sm">
<q-btn
icon="fas fa-upload"
color="positive"
size="md"
rounded
:label="$t('circuit.sendcoins_toso')"
@click="sendCoinsToClick"
>
</q-btn>
&nbsp;
<q-btn
icon="fas fa-download"
color="accent"
@@ -20,6 +10,16 @@
@click="tools.receiveRis($q, $t)"
>
</q-btn>
&nbsp;
<q-btn
icon="fas fa-upload"
color="positive"
size="md"
rounded
:label="$t('circuit.sendcoins_toso')"
@click="sendCoinsToClick"
>
</q-btn>
<div class="q-mb-sm"></div>
<CUserInfoAccount

View File

@@ -116,16 +116,16 @@
size="sm"
icon="fas fa-user-plus"
color="positive" :label="$t('circuit.accept')"
@click="tools.addToMyCircuits(q, notif.sender, notif.extrafield)"
@click="tools.addFidoToMyCircuits(q, notif.sender, notif.extrafield)"
/>
<q-btn
<!--<q-btn
dense
rounded
size="sm"
icon="fas fa-user-minus"
color="negative" :label="$t('shared.refuse_ask')"
@click="tools.refuseReqCircuit(q, notif.sender, notif.extrafield)"
/>
/>-->
</div>
</q-item-label>
<q-item-label caption lines="2"

File diff suppressed because one or more lines are too long

View File

@@ -107,7 +107,24 @@ export const useCircuitStore = defineStore('CircuitStore', {
},
SonoDentroAdAlmeno1CircuitoConFido() {
SonoDentroAdAlmeno1CircuitoConFido(): boolean {
const userStore = useUserStore()
if (userStore.my.profile.useraccounts) {
const accountsConFido = userStore.my.profile.useraccounts.filter((rec: IAccount) => rec.fidoConcesso > 0)
for (const account of accountsConFido) {
const mycircuit = this.listcircuits.find((circ: ICircuit) => circ._id === account.circuitId)
if (mycircuit && !mycircuit.showAlways) {
return true
}
}
}
return false
},
get1CircuitoConFido() {
const userStore = useUserStore()
if (userStore.my.profile.useraccounts) {
@@ -157,9 +174,13 @@ export const useCircuitStore = defineStore('CircuitStore', {
getCircuitsNameByProvince(prov: string): ICircuit[] {
const filterarr = this.listcircuits.filter((rec: ICircuit) => rec.strProv === prov)
return filterarr.map((subArray: any) => {
let arrcirc = filterarr.map((subArray: any) => {
return subArray.name;
})
if (arrcirc.length > 1)
return ['[Nessuno]', ...arrcirc]
else
return arrcirc
},
getCircuitByCircuitId(circuitId: string): ICircuit | null | undefined {

View File

@@ -325,6 +325,11 @@ const colTableWhere = [
AddCol({ name: 'whereicon', label_trans: 'where.whereicon' }),
AddCol(DeleteRec),
]
const colTableCard = [
AddCol({ name: 'label', label_trans: 'label' }),
AddCol({ name: 'card', label_trans: 'card' }),
AddCol(DeleteRec),
]
export const colTableProducer = [
AddCol({ name: 'name', label_trans: 'producer.name' }),
@@ -3944,6 +3949,13 @@ export const fieldsTable = {
collabel: 'descr',
remote: true,
},
{
value: 'cards',
label: 'Zone',
columns: colTableCard,
colkey: 'card',
collabel: 'label',
},
{
value: 'countries',
label: 'Nazione',

View File

@@ -3055,6 +3055,11 @@ export const tools = {
if (mytimestamp) return date.formatDate(mytimestamp, 'DD/MM/YYYY')
return ''
},
getstrDateShort(mytimestamp: Date | number | string | undefined) {
// console.log('getstrDate', mytimestamp)
if (mytimestamp) return date.formatDate(mytimestamp, 'DD/MM/YY')
return ''
},
getstrMonth(mytimestamp: Date | number | string | undefined) {
// console.log('getstrDate', mytimestamp)
if (mytimestamp) return date.formatDate(mytimestamp, 'MMMM YYYY')
@@ -5585,9 +5590,9 @@ export const tools = {
userStore.my.profile.userstoverify = userStore.my.profile.userstoverify.filter((rec: any) => rec.username !== usernameDest)
if (value)
tools.showPositiveNotif($q, t('db.trusted', {username: usernameDest}))
tools.showPositiveNotif($q, t('db.enabled_to_app', {username: usernameDest}))
else
tools.showNegativeNotif($q, t('db.rejected', {username: usernameDest}))
tools.showNegativeNotif($q, t('db.rejected_to_app', {username: usernameDest}))
}
})
})
@@ -7334,6 +7339,9 @@ export const tools = {
if (tablejoin === 'provinces') {
ris = 'profile.resid_province'
}
if (tablejoin === 'cards') {
ris = 'profile.resid_card'
}
if (tablejoin === 'regions') {
ris = 'mycities.reg'
}

View File

@@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import {
ICfgServer, ICity,
ICfgServer, ICity, IProvince,
IColGridTable,
IConfig,
IDataToSet,
@@ -263,12 +263,17 @@ export const useGlobalStore = defineStore('GlobalStore', {
},
isPresenteCardsByProv: (state: IGlobalState) => (myprov: string) => {
const arrprov: any[] = state.provinces.filter((prov: IProvince) => prov.prov === myprov && (!!prov.card))
return arrprov && arrprov.length > 0
},
getRespByUsername: (state: IGlobalState) => (username: string) => {
const rec = state.resps.find((recin: any) => recin.username === username)
return !!rec ? rec.name + ' ' + rec.surname : ''
},
getListByTable: (state: IGlobalState) => (table: string): any => {
getListByTable: (state: IGlobalState) => (table: string, value2?: any): any => {
let ris: any = []
const calendarStore = useCalendarStore()
@@ -345,7 +350,17 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'catgrps')
return state.catgrps
else if (table === 'provinces')
return state.provinces
return state.provinces.filter((prov: IProvince) => (!prov.card))
else if (table === 'cards') {
const arrprov: any[] = state.provinces.filter((prov: IProvince) => prov.prov === value2 && (!!prov.card))
if (arrprov) {
// const idCardArray: { _id: number, card: string }[] = arrprov.map(({ _id, card }) => ({ _id, card }));
const idCardArray: { card: string, label: string }[] = arrprov.map(({ card }) => ({ card, label: card }));
return idCardArray
}
return []
}
else {
return ris
}
@@ -1607,6 +1622,17 @@ export const useGlobalStore = defineStore('GlobalStore', {
return recprov ? recprov.descr : ''
},
getArrCardByProv(provstr: string): string[] {
const recprov = this.provinces.filter((rec: any) => rec.prov === provstr)
const cardArray: string[] = recprov.map((prov: IProvince) => prov.card);
return cardArray
},
async sendEmailTest({ previewonly }: { previewonly: any }) {
@@ -1770,7 +1796,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
return arr
},
getTableJoinByName(table: string, addall?: boolean, addnone?: boolean, filter?: any) {
getTableJoinByName(table: string, addall?: boolean, addnone?: boolean, filter?: any, value2?: any) {
let myarr: any = []
if (table === 'permissions') myarr = [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Facilitatore, shared_consts.Permissions.Editor, shared_consts.Permissions.Zoomeri, shared_consts.Permissions.Department]
@@ -1801,7 +1827,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
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)
else myarr = this.getListByTable(table, value2)
if (costanti.TABLES_ARRAY.includes(table)) {
const newarr = []
@@ -1825,7 +1851,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (addnone) {
const mykey = fieldsTable.getKeyByTable(table)
const collab = fieldsTable.getLabelByTable(table)
const obj: any = {}
let obj: any = {}
obj[mykey] = costanti.FILTER_NESSUNO
obj[collab] = '[Nessuno]'
@@ -1835,6 +1861,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
obj.idSector = []
}
if (table === 'cards') {
obj = {card: '', label: '[Nessuna]'}
}
myarr = [obj, ...myarr]
}

View File

@@ -110,6 +110,7 @@ export default defineComponent({
t,
userStore,
site: globalStore.site,
globalStore,
}
}
})

View File

@@ -178,6 +178,21 @@
:db_rec="userStore.my"
>
</CMySelectCity>
<CMySelectCity
v-if="globalStore.isPresenteCardsByProv(userStore.my.profile.resid_province)"
:label="$t('reg.resid_card')"
table="users"
jointable="cards"
v-model="userStore.my.profile.resid_card"
myclass="selectorwide text-white"
:db_type="costanti.FieldType.string"
db_field="profile"
db_subfield="resid_card"
:db_id="userStore.my._id"
:db_rec="userStore.my"
:value2="userStore.my.profile.resid_province"
>
</CMySelectCity>
</div>
<div class="myrow">

View File

@@ -144,13 +144,16 @@
v-close-popup
></q-btn>
</q-bar>
<q-card-section class="q-px-xs inset-shadow">
<q-card-section class="q-px-xs inset-shadow">
<q-option-group
v-model="showwhommov"
:options="optionsmov"
color="primary"
/>
<q-toggle v-model="tabellare" label="Formato Tabella"></q-toggle>
<q-toggle
v-model="tabellare"
label="Formato Tabella"
></q-toggle>
<CGridTableRec
v-if="tabellare && !loading"
@@ -274,6 +277,41 @@
<br />
<div class="row text-center">
<q-banner
v-if="
circuitStore.isCircuitNational(circuit.name) &&
!circuitStore.SonoDentroAdAlmeno1CircuitoConFido()
"
inline-actions
class="bg-blue text-white"
>
<template v-slot:avatar>
<q-icon name="fas fa-info" color="red" size="sm" />
</template>
<span
v-html="$t('circuit.entra_italia_solo_dopo_aver_fido')"
></span>
</q-banner>
<q-banner
v-if="circuitStore.IsNationalAndNotEnterInLocal(circuit.name)"
rounded
class="bg-red text-white"
style="text-align: center"
>
<template v-slot:avatar>
<q-icon
class="vertical-align center"
name="fas fa-info"
color="white"
size="sm"
/>
</template>
<em style="font-weight: bold">{{
$t('circuit.beforeentertolocalcircuit')
}}</em
><br />
</q-banner>
<q-banner
v-if="
userStore.my.profile &&
@@ -285,7 +323,7 @@
style="text-align: center"
>
<template v-slot:avatar>
<q-icon name="fas fa-info" color="red" size="sm" />
<q-icon name="fas fa-info" color="white" size="sm" />
</template>
<em style="font-weight: bold">{{
@@ -314,33 +352,15 @@
><br />
</q-banner>
<q-banner
v-if="circuitStore.IsNationalAndNotEnterInLocal(circuit.name)"
rounded
class="bg-red text-white"
style="text-align: center"
>
<template v-slot:avatar>
<q-icon
class="vertical-align center"
name="fas fa-info"
color="red"
size="sm"
/>
</template>
<em style="font-weight: bold">{{
$t('circuit.beforeentertolocalcircuit')
}}</em
><br />
</q-banner>
<div class="centermydiv q-mt-md">
<q-btn
v-if="
!userStore.IsMyCircuitByName(circuit.name) &&
!userStore.IsAskedCircuitByName(circuit.name) &&
!userStore.IsRefusedCircuitByName(circuit.name)
!userStore.IsRefusedCircuitByName(circuit.name) &&
(!circuitStore.isCircuitNational(circuit.name) ||
(circuitStore.isCircuitNational(circuit.name) &&
circuitStore.SonoDentroAdAlmeno1CircuitoConFido()))
"
:disable="circuitStore.IsNationalAndNotEnterInLocal(circuit.name)"
icon="fas fa-user-plus"

View File

@@ -689,6 +689,15 @@
"
label="Provincia"
/>
<CLabel
v-if="!!userStore.userprofile.profile.resid_card"
v-bind="$attrs"
:copy="false"
:value="
userStore.userprofile.profile.resid_card
"
label="Zona"
/>
<CDateTime
v-if="
checkifShow('profile.dateofbirth') &&