- aggiunto anche nei beni, servizi e ospitalità la possibilità di aggiungerli come "Gruppo"
This commit is contained in:
@@ -164,6 +164,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
'profile.note': 1,
|
||||
'profile.resid_province': 1,
|
||||
'mycities.reg': 1,
|
||||
}
|
||||
|
||||
@@ -939,46 +939,59 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
} else if (item.table === shared_consts.TABFILTRI_UTENTE) {
|
||||
if (item.value === shared_consts.FILTER_USER_SENZA_PROVINCE) {
|
||||
filtercustom.push({ 'profile.resid_province': { $exists: false } });
|
||||
} else if (item.value === shared_consts.FILTER_USER_CON_CIRCUITO) {
|
||||
filtercustom.push({
|
||||
'profile.mycircuits': { $exists: true, $ne: [] }
|
||||
});
|
||||
} else if (item.value === shared_consts.FILTER_USER_ONLINE_6_MESI) {
|
||||
const numgiorni_attivi = 30 * 6
|
||||
let daytocheck = new Date();
|
||||
daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi);
|
||||
daytocheck.setHours(0, 0, 0, 0)
|
||||
|
||||
filtercustom.push({ lasttimeonline: { $gt: daytocheck } })
|
||||
} else if (item.value === shared_consts.FILTER_USER_SENZA_CIRCUITO) {
|
||||
filtercustom.push({
|
||||
$or: [
|
||||
{ 'profile.mycircuits': { $exists: false } },
|
||||
{ 'profile.mycircuits': { $eq: [] } }
|
||||
]
|
||||
});
|
||||
} else if (item.value === shared_consts.FILTER_USER_PROVINCE) {
|
||||
filtercustom.push({ 'profile.resid_province': { $exists: true, $ne: '' } });
|
||||
} else if (item.value === shared_consts.FILTER_USER_TELEGRAM_BLOCKED) {
|
||||
filtercustom.push({ 'profile.teleg_id_old': { $gt: 1 } });
|
||||
} else if (item.value === shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM) {
|
||||
filtercustom.push({
|
||||
$or: [
|
||||
{ 'profile.username_telegram': { $exists: false } },
|
||||
{ 'profile.username_telegram': { $exists: true, $eq: '' } }],
|
||||
item.arrvalue.forEach((myitemsingle: any) => {
|
||||
if (myitemsingle === shared_consts.FILTER_USER_SENZA_PROVINCE) {
|
||||
filtercustom.push({ 'profile.resid_province': { $exists: false } });
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_CON_CIRCUITO) {
|
||||
filtercustom.push({
|
||||
'profile.mycircuits': { $exists: true, $ne: [] }
|
||||
});
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_ONLINE_6_MESI) {
|
||||
const numgiorni_attivi = 30 * 6
|
||||
let daytocheck = new Date();
|
||||
daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi);
|
||||
daytocheck.setHours(0, 0, 0, 0)
|
||||
|
||||
});
|
||||
filtercustom.push({ lasttimeonline: { $gt: daytocheck } })
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_SENZA_CIRCUITO) {
|
||||
filtercustom.push({
|
||||
$or: [
|
||||
{ 'profile.mycircuits': { $exists: false } },
|
||||
{ 'profile.mycircuits': { $eq: [] } }
|
||||
]
|
||||
});
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_PROVINCE) {
|
||||
filtercustom.push({ 'profile.resid_province': { $exists: true, $ne: '' } });
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_TELEGRAM_BLOCKED) {
|
||||
filtercustom.push({ 'profile.teleg_id_old': { $gt: 1 } });
|
||||
} else if (myitemsingle === shared_consts.FILTER_NOTE) {
|
||||
filtercustom.push({ 'profile.note': { $exists: true, $ne: '' } });
|
||||
} else if (myitemsingle === shared_consts.FILTER_SENZA_NOTE) {
|
||||
filtercustom.push({
|
||||
$or: [
|
||||
{ 'profile.note': { $exists: false } },
|
||||
{ 'profile.note': { $exists: true, $eq: '' } }],
|
||||
|
||||
} else if (item.value === shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR) {
|
||||
filtercustom.push({
|
||||
verified_by_aportador: { $exists: false },
|
||||
});
|
||||
} else if (item.value === shared_consts.FILTER_USER_NO_TELEGRAM_ID) {
|
||||
filtercustom.push({ 'profile.teleg_id': { $lt: 1 } });
|
||||
});
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM) {
|
||||
filtercustom.push({
|
||||
$or: [
|
||||
{ 'profile.username_telegram': { $exists: false } },
|
||||
{ 'profile.username_telegram': { $exists: true, $eq: '' } }],
|
||||
|
||||
});
|
||||
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR) {
|
||||
filtercustom.push({
|
||||
verified_by_aportador: { $exists: false },
|
||||
});
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_NO_TELEGRAM_ID) {
|
||||
filtercustom.push({ 'profile.teleg_id': { $lt: 1 } });
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
} else if (item.table === 'cities') {
|
||||
|
||||
if (item.value && item.value.hasOwnProperty('_id')) {
|
||||
|
||||
@@ -41,6 +41,11 @@ export default defineComponent({
|
||||
CTimeAgo, CContactUser
|
||||
},
|
||||
props: {
|
||||
username: {
|
||||
type: String,
|
||||
required: true,
|
||||
default : '',
|
||||
},
|
||||
introUser: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -63,7 +68,8 @@ export default defineComponent({
|
||||
const animation = ref('fade')
|
||||
const mytab = ref('my')
|
||||
|
||||
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
|
||||
// const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
|
||||
const username = ref('')
|
||||
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
|
||||
|
||||
const filtroutente = ref(<any[]>[])
|
||||
@@ -110,7 +116,7 @@ export default defineComponent({
|
||||
if (myuser.value) {
|
||||
// filtro_eventi.value = [{ userId: myuser.value._id }, { dateTimeStart: { $gte: today } }]
|
||||
let mydate = tools.addDays(tools.getDateNow(), -1)
|
||||
let mydateend = tools.addDays(mydate, 30)
|
||||
let mydateend = tools.addDays(mydate, 180)
|
||||
mydate = tools.getstrYYMMDDDate(mydate)
|
||||
filtro_eventi.value = [{ userId: myuser.value._id }, { dateTimeStart: { $gte: mydate, $lte: mydateend } }]
|
||||
filtroutente.value = [{ userId: myuser.value._id }]
|
||||
@@ -163,6 +169,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
username.value = props.username || userStore.my.username
|
||||
loadProfile()
|
||||
}
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
|
||||
<q-item v-if="getSectorByRec(myrec)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="blue" name="category" />
|
||||
@@ -580,7 +580,6 @@
|
||||
</q-item>
|
||||
<q-card
|
||||
v-if="
|
||||
table === 'mybachecas' &&
|
||||
myrec.mygrp &&
|
||||
myrec.mygrp.groupname
|
||||
"
|
||||
|
||||
@@ -407,7 +407,7 @@ export default defineComponent({
|
||||
return changevalRecOrig(newval)
|
||||
}
|
||||
function changevalRec(newval: any) {
|
||||
return changevalRecOrig(newval, '')
|
||||
return changevalRecOrig(newval, props.subfield)
|
||||
}
|
||||
|
||||
function changevalRecOrig(newval: any, subcol: string = '') {
|
||||
@@ -428,16 +428,30 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
if (subcol) {
|
||||
if (!myrow.value[col.value.name]) {
|
||||
myrow.value[col.value.name] = {}
|
||||
const arrcol = col.value.name.split('.')
|
||||
if (arrcol.length > 0) {
|
||||
const primo = arrcol[0]
|
||||
let sec = null
|
||||
if (arrcol.length > 1)
|
||||
sec = arrcol[1]
|
||||
if (sec) {
|
||||
if (!myrow.value[primo]) {
|
||||
myrow.value[primo] = {}
|
||||
}
|
||||
myrow.value[primo][sec] = newval
|
||||
} else {
|
||||
myrow.value[primo] = newval
|
||||
}
|
||||
/*if (!myrow.value[col.value.name]) {
|
||||
myrow.value[col.value.name] = {}
|
||||
}
|
||||
myrow.value[col.value.name][subcol] = newval*/
|
||||
// console.log('myrow.value[col.value.name]', myrow.value[col.value.name])
|
||||
}
|
||||
myrow.value[col.value.name][subcol] = newval
|
||||
// console.log('myrow.value[col.value.name]', myrow.value[col.value.name])
|
||||
} else {
|
||||
myrow.value[col.value.name] = newval
|
||||
}
|
||||
|
||||
|
||||
// console.log('changevalRec update:row', myrow.value)
|
||||
// emit('update:row', myrow.value)
|
||||
emit('update_col', col.value.name, newval)
|
||||
|
||||
@@ -99,7 +99,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getNameToShow(user: IUserFields, col = null) {
|
||||
if (props.table === shared_consts.TABLES_MYBACHECAS && myrec.value.groupname)
|
||||
if (myrec.value.groupname)
|
||||
return myrec.value.groupname
|
||||
else
|
||||
return userStore.getNameToShow(user, col)
|
||||
|
||||
@@ -37,7 +37,10 @@
|
||||
}}</em></q-item-label
|
||||
>
|
||||
<q-item-label v-if="contact.profile" caption lines="3"
|
||||
><em>{{ contact.profile.qualifica }}</em></q-item-label
|
||||
>
|
||||
<em>{{ contact.profile.qualifica }}</em>
|
||||
<span v-if="contact.profile.note"><span v-if="contact.profile.qualifica"><br></span><em style="color: blue;">Note: {{ contact.profile.note }}</em></span>
|
||||
</q-item-label
|
||||
>
|
||||
<q-item-label caption lines="1"></q-item-label>
|
||||
<div v-if="visu === costanti.ASK_TRUST">
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
:labelBtnAddExtra="`Aggiungi ` + title"
|
||||
:prop_pagination="tools.getPagination()"
|
||||
:groupname="groupname"
|
||||
:extrafield="groupname"
|
||||
:margin_right="30">
|
||||
|
||||
</CGridTableRec>
|
||||
|
||||
0
src/components/CUserNote/CUserNote.scss
Executable file
0
src/components/CUserNote/CUserNote.scss
Executable file
77
src/components/CUserNote/CUserNote.ts
Executable file
77
src/components/CUserNote/CUserNote.ts
Executable file
@@ -0,0 +1,77 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { IColGridTable, IOperators, ISpecialField, IUserFields } from 'model'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
import { useCalendarStore } from '@src/store/CalendarStore'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CUserNote',
|
||||
emits: ['closenote', 'save'],
|
||||
props: {
|
||||
username: String,
|
||||
userprofile_param: {
|
||||
type: Object as PropType<IUserFields>,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
components: { CMyFieldDb, CMyFieldRec },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const shownote = ref(false)
|
||||
const userprofile = ref(<IUserFields>{})
|
||||
|
||||
function mounted() {
|
||||
shownote.value = true
|
||||
userprofile.value = props.userprofile_param
|
||||
}
|
||||
|
||||
function UpdateDbNote() {
|
||||
const calendarStore = useCalendarStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
const mydatatosave = {
|
||||
id: userprofile.value._id,
|
||||
table: 'users',
|
||||
fieldsvalue: { 'profile.note': userprofile.value.profile.note }
|
||||
}
|
||||
|
||||
globalStore.saveFieldValue(mydatatosave).then((esito) => {
|
||||
if (esito) {
|
||||
emit('save', userprofile.value)
|
||||
tools.showPositiveNotif($q, t('db.recupdated'))
|
||||
shownote.value = false
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
fieldsTable,
|
||||
globalStore,
|
||||
shownote,
|
||||
userprofile,
|
||||
UpdateDbNote,
|
||||
t,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
60
src/components/CUserNote/CUserNote.vue
Executable file
60
src/components/CUserNote/CUserNote.vue
Executable file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div v-if="shownote" class="text-center q-ma-sm">
|
||||
<q-dialog v-model="shownote" maximized>
|
||||
<q-card>
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Note per {{ username }}: </q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
icon="close"
|
||||
@click="
|
||||
$emit('closenote');
|
||||
shownote = false;
|
||||
"
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section>
|
||||
Note per {{ username }} da parte del Facilitatore:
|
||||
<br />
|
||||
|
||||
<CMyFieldRec
|
||||
table="users"
|
||||
:id="userprofile._id"
|
||||
:rec="userprofile"
|
||||
field="profile.note"
|
||||
class="cursor-pointer"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
filled
|
||||
:label="t('dialog.save')"
|
||||
color="primary"
|
||||
@click="UpdateDbNote"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
filled
|
||||
:label="$t('dialog.close')"
|
||||
icon="close"
|
||||
@click="
|
||||
$emit('closenote');
|
||||
shownote = false;
|
||||
"
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CUserNote.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CUserNote.scss';
|
||||
</style>
|
||||
1
src/components/CUserNote/index.ts
Executable file
1
src/components/CUserNote/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CUserNote} from './CUserNote.vue'
|
||||
Reference in New Issue
Block a user