Lista Doni Navi
This commit is contained in:
@@ -28,5 +28,4 @@ export default class Allnavi extends MixinBase {
|
||||
public async mounted() {
|
||||
this.ris = await GlobalStore.actions.GetArrNavi()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,3 +9,24 @@
|
||||
.DoniConfermati{
|
||||
color: green;
|
||||
}
|
||||
|
||||
.cont_donatore {
|
||||
border: solid 2px #4198ef;
|
||||
padding: 2px 8px;
|
||||
margin: 2px 4px;
|
||||
font-size: 1rem;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.donatore, .mediatore, .sognatore, .title-nave, .intermedio2, .intermedio3 {
|
||||
padding: 2px 4px;
|
||||
margin: 2px 4px;
|
||||
color: white;
|
||||
font-size: 1rem;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.donatore {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { CTitle } from '../../../components/CTitle'
|
||||
import { CMyPage } from '../../../components/CMyPage'
|
||||
import MixinBase from '../../../mixins/mixin-base'
|
||||
import { CMyNave } from '../../../components/CMyNave'
|
||||
import { lists } from '../../../store/Modules/lists'
|
||||
|
||||
const namespace = 'CalendarModule'
|
||||
|
||||
@@ -23,15 +24,31 @@ export default class Listadoninavi extends MixinBase {
|
||||
public $t: any
|
||||
public $q
|
||||
public incaricamento: boolean = false
|
||||
public myloadingload: boolean = false
|
||||
public loading: boolean = false
|
||||
public showdonatori: boolean = false
|
||||
public showmsguser: boolean = false
|
||||
public arrdoninavi = []
|
||||
public MyPagination: {
|
||||
sortBy: string,
|
||||
descending: boolean,
|
||||
page: number,
|
||||
rowsNumber: number, // specifying this determines pagination is server-side
|
||||
rowsPerPage: number
|
||||
} = { sortBy: 'index', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 }
|
||||
public selrec = null
|
||||
public seluser = null
|
||||
public seldonatore = null
|
||||
public msg_tosend: string = ''
|
||||
public msg_tosend_user: string = ''
|
||||
public pagination = {
|
||||
sortBy: 'desc',
|
||||
descending: false,
|
||||
page: 2,
|
||||
rowsPerPage: 10
|
||||
// rowsNumber: xx if getting data from a server
|
||||
}
|
||||
|
||||
public pagination2 = {
|
||||
sortBy: 'desc',
|
||||
descending: false,
|
||||
page: 2,
|
||||
rowsPerPage: 8
|
||||
// rowsNumber: xx if getting data from a server
|
||||
}
|
||||
|
||||
public coldoninavi: any[] = [
|
||||
{
|
||||
name: 'index',
|
||||
@@ -42,27 +59,162 @@ export default class Listadoninavi extends MixinBase {
|
||||
sortable: true
|
||||
},
|
||||
{ name: 'rigacol', align: 'center', label: 'Nave', field: 'riga', sortable: true },
|
||||
{ name: 'date_gift_chat_open', align: 'center', label: '⏰ Gift Chat', field: 'date_gift_chat_open', sortable: true },
|
||||
{
|
||||
name: 'date_gift_chat_open',
|
||||
align: 'center',
|
||||
label: '⏰ Gift Chat',
|
||||
field: 'date_gift_chat_open',
|
||||
sortable: true
|
||||
},
|
||||
{ name: 'date_start', align: 'center', label: '⏰ Partenza', field: 'date_start', sortable: true },
|
||||
{ name: 'mediatore', align: 'center', label: '🌀 Mediatore', field: '', sortable: true },
|
||||
{ name: 'sognatore', align: 'center', label: 'Sognatore', field: '', sortable: true },
|
||||
{ name: 'donatori', align: 'center', label: 'Donatori', field: '', sortable: true },
|
||||
{ name: 'DoniAttesaDiConferma', align: 'center', label: '🎁 Wait', field: 'DoniAttesaDiConferma', sortable: true },
|
||||
{ name: 'DoniMancanti', align: 'center', label: '🎁 Mancano', field: 'DoniMancanti', sortable: true },
|
||||
{ name: 'DoniConfermati', align: 'center', label: '🎁 OK', field: 'DoniConfermati', sortable: true },
|
||||
{ name: 'note', align: 'left', label: 'Note', field: 'note', sortable: true },
|
||||
{ name: 'note_interne', align: 'left', label: 'Note Interne', field: 'note_interne', sortable: true },
|
||||
]
|
||||
|
||||
public coldonatori: any[] = [
|
||||
{
|
||||
name: 'index',
|
||||
required: true,
|
||||
label: 'Num',
|
||||
align: 'left',
|
||||
field: 'index',
|
||||
sortable: true
|
||||
},
|
||||
{ name: 'rigacol', align: 'center', label: 'Posizione', field: '', sortable: true },
|
||||
{ name: 'name', align: 'center', label: 'Nome', field: 'name', sortable: true },
|
||||
{ name: 'num_tess', align: 'center', label: 'Tessitura', field: 'num_tess', sortable: true },
|
||||
{ name: 'date_made_gift', align: 'center', label: 'Inviato', field: 'date_made_gift', sortable: true },
|
||||
{ name: 'made_gift', align: 'center', label: 'Dono', field: 'made_gift', sortable: true },
|
||||
]
|
||||
|
||||
public async mounted() {
|
||||
this.incaricamento = true
|
||||
this.$q.loading.show({ message: this.$t('otherpages.update') })
|
||||
this.loading = true
|
||||
// this.$q.loading.show({ message: this.$t('otherpages.update') })
|
||||
|
||||
const ris = await GlobalStore.actions.GetArrDoniNavi()
|
||||
console.log('ris', ris)
|
||||
this.arrdoninavi = ris.arrnavi
|
||||
|
||||
this.$q.loading.hide()
|
||||
// this.$q.loading.hide()
|
||||
|
||||
this.incaricamento = false
|
||||
this.loading = false
|
||||
|
||||
}
|
||||
|
||||
public deveDonare(rec) {
|
||||
return (rec.ind_order !== this.selrec.donatore.recmediatore.ind_order && rec.num_tess === 2)
|
||||
}
|
||||
|
||||
public clickdonatori(rec) {
|
||||
this.selrec = rec
|
||||
this.showdonatori = true
|
||||
}
|
||||
|
||||
public clickseluser(rec) {
|
||||
this.seluser = rec
|
||||
this.showmsguser = true
|
||||
}
|
||||
|
||||
public HoRicevutoIlDono(rec) {
|
||||
this.seldonatore = rec
|
||||
const msgtitle = this.$t('dashboard.dono_ricevuto_2')
|
||||
const msginvia = this.$t('dashboard.confermi_dono_ricevuto', {
|
||||
donatore: rec.name + ' ' + rec.surname
|
||||
})
|
||||
|
||||
tools.askConfirm(this.$q, msgtitle, msginvia + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.DONO_RICEVUTO, 0, {
|
||||
param1: {
|
||||
_id: rec._id,
|
||||
made_gift: true
|
||||
},
|
||||
param2: '',
|
||||
param3: ''
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public Chiudi() {
|
||||
this.showdonatori = false
|
||||
this.seldonatore = null
|
||||
}
|
||||
|
||||
public ActionAfterYes(action, item, data) {
|
||||
console.log('ActionAfterYes...')
|
||||
if (action === lists.MenuAction.DONO_RICEVUTO) {
|
||||
if (!!this.seldonatore) {
|
||||
this.seldonatore.made_gift = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async InviaMsgANave(msgobj, navemediatore) {
|
||||
|
||||
const msgtitle = translate('dialog.sendmsg')
|
||||
|
||||
tools.askConfirm(this.$q, msgtitle, msgobj.msgpar1 + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.INVIA_MSG_A_DONATORI, 0, {
|
||||
param1: msgobj,
|
||||
param2: navemediatore,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public async InviaMsgAUserConfirm(msgobj, navemediatore) {
|
||||
|
||||
const msgtitle = translate('dialog.sendmsg')
|
||||
|
||||
tools.askConfirm(this.$q, msgtitle, msgobj.msgpar1 + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.INVIA_MSG_A_SINGOLO, 0, {
|
||||
param1: msgobj,
|
||||
param2: navemediatore,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public InviaMsgADonatori() {
|
||||
|
||||
if (!this.msg_tosend)
|
||||
return
|
||||
|
||||
const msgobj = {
|
||||
tipomsg: tools.TipoMsg.SEND_MSG,
|
||||
msgpar1: this.msg_tosend,
|
||||
inviareale: true,
|
||||
}
|
||||
|
||||
const navemediatore = this.selrec.donatore.recmediatore
|
||||
|
||||
this.InviaMsgANave(msgobj, navemediatore)
|
||||
}
|
||||
|
||||
public InviaMsgAUser() {
|
||||
|
||||
if (!this.msg_tosend_user)
|
||||
return
|
||||
|
||||
const msgobj = {
|
||||
tipomsg: tools.TipoMsg.SEND_MSG_SINGOLO,
|
||||
msgpar1: this.msg_tosend_user,
|
||||
username: this.seluser.username,
|
||||
inviareale: true,
|
||||
}
|
||||
|
||||
const naveuser = this.seluser
|
||||
|
||||
this.InviaMsgAUserConfirm(msgobj, naveuser)
|
||||
}
|
||||
|
||||
public SaveField(rec, myfield) {
|
||||
if (!!rec) {
|
||||
const mydata = {}
|
||||
mydata[myfield] = rec[myfield]
|
||||
console.log('mydata', mydata, 'id', rec.id)
|
||||
tools.saveFieldToServer(this, 'navi', rec.id, mydata)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
title="Doni Navi"
|
||||
:data="arrdoninavi"
|
||||
:columns="coldoninavi"
|
||||
:Pagination.sync="MyPagination"
|
||||
:loading="loading"
|
||||
:Pagination.sync="pagination"
|
||||
row-key="index">
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
@@ -23,49 +24,204 @@
|
||||
<q-td key="rigacol" :props="props">
|
||||
{{ props.row.riga }}.{{ props.row.col }}
|
||||
</q-td>
|
||||
<q-td key="col" :props="props">
|
||||
{{ props.row.col }}
|
||||
</q-td>
|
||||
<q-td key="date_gift_chat_open" :props="props">
|
||||
|
||||
<div v-if="!!props.row.rec.mediatore.arrdonatori">
|
||||
{{ tools.getstrshortDate(props.row.rec.mediatore.arrdonatori[0].date_gift_chat_open)
|
||||
<div v-if="!!props.row.rec.donatore.arrdonatori">
|
||||
{{ tools.getstrshortDate(props.row.rec.donatore.arrdonatori[0].date_gift_chat_open)
|
||||
}}
|
||||
</div>
|
||||
|
||||
<a v-if="!!props.row.rec.mediatore.recmediatore.link_chat" :href="props.row.rec.mediatore.recmediatore.link_chat" target="_blank">Link</a>
|
||||
<a v-if="!!props.row.rec.donatore.recmediatore.link_chat"
|
||||
:href="props.row.rec.donatore.recmediatore.link_chat" target="_blank">Link</a>
|
||||
|
||||
<div v-if="props.row.rec.donatore.recmediatore.sent_msg_howto_make_gift">(Link Inviato)</div>
|
||||
</q-td>
|
||||
<q-td key="date_start" :props="props">
|
||||
<div v-if="!!props.row.rec.mediatore.arrdonatori">
|
||||
{{ tools.getstrshortDate(props.row.rec.mediatore.arrdonatori[0].date_start) }}
|
||||
<div v-if="!!props.row.rec.donatore.arrdonatori">
|
||||
{{ tools.getstrshortDate(props.row.rec.donatore.arrdonatori[0].date_start) }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="mediatore" :props="props">
|
||||
<div v-if="!!props.row.rec.mediatore.recmediatore">
|
||||
{{ props.row.rec.mediatore.recmediatore.name }} {{
|
||||
props.row.rec.mediatore.recmediatore.surname }}
|
||||
</div>
|
||||
<q-btn v-if="!!props.row.rec.donatore.recmediatore" flat rounded color="blue"
|
||||
:label="props.row.rec.donatore.recmediatore.name + ` ` + props.row.rec.donatore.recmediatore.surname"
|
||||
@click="clickseluser(props.row.rec.donatore.recmediatore)">
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td key="sognatore" :props="props">
|
||||
<div v-if="!!props.row.rec.mediatore.recsognatori[0]">
|
||||
{{ props.row.rec.mediatore.recsognatori[0].name }} {{
|
||||
props.row.rec.mediatore.recsognatori[0].surname }}
|
||||
<q-btn v-if="!!props.row.rec.donatore.recsognatori[0]" flat rounded color="blue"
|
||||
:label="props.row.rec.donatore.recsognatori[0].name + ` ` + props.row.rec.donatore.recsognatori[0].surname"
|
||||
@click="clickseluser(props.row.rec.donatore.recsognatori[0])">
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td key="donatori" :props="props">
|
||||
<q-btn flat rounded color="blue"
|
||||
:label="$t('dashboard.donatori')"
|
||||
@click="clickdonatori(props.row.rec)">
|
||||
</q-btn>
|
||||
</q-td>
|
||||
|
||||
<q-td key="DoniAttesaDiConferma" :props="props">
|
||||
<div v-if="props.row.DoniAttesaDiConferma > 0" class="DoniAttesaDiConferma">{{
|
||||
props.row.DoniAttesaDiConferma }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="DoniAttesaDiConferma" :props="props">
|
||||
<div v-if="props.row.DoniAttesaDiConferma > 0" class="DoniAttesaDiConferma">{{ props.row.DoniAttesaDiConferma }} </div>
|
||||
</q-td>
|
||||
<q-td key="DoniMancanti" :props="props">
|
||||
<div v-if="props.row.DoniMancanti > 0" class="DoniMancanti">{{ props.row.DoniMancanti }}</div>
|
||||
<div v-if="props.row.DoniMancanti > 0" class="DoniMancanti">{{ props.row.DoniMancanti
|
||||
}}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="DoniConfermati" :props="props">
|
||||
<div v-if="props.row.DoniConfermati > 0" class="DoniConfermati">{{ props.row.DoniConfermati }}</div>
|
||||
<div v-if="props.row.DoniConfermati > 0" class="DoniConfermati">{{
|
||||
props.row.DoniConfermati }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="note" :props="props">
|
||||
<div class="Note">
|
||||
<div v-if="props.row.note">{{ props.row.note }}</div>
|
||||
<div v-else>---</div>
|
||||
<q-popup-edit v-model="props.row.note" buttons @save="SaveField(props.row, 'note')">
|
||||
<q-field>
|
||||
<q-input v-model="props.row.note" />
|
||||
</q-field>
|
||||
</q-popup-edit>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="note_interne" :props="props">
|
||||
<div class="Note">
|
||||
<div v-if="props.row.note_interne">{{ props.row.note_interne }}</div>
|
||||
<div v-else>---</div>
|
||||
<q-popup-edit v-model="props.row.note_interne" buttons @save="SaveField(props.row, 'note_interne')">
|
||||
<q-field>
|
||||
<q-input v-model="props.row.note_interne" />
|
||||
</q-field>
|
||||
</q-popup-edit>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
|
||||
</CTitleBanner>
|
||||
|
||||
<q-dialog v-model="showdonatori">
|
||||
<q-card v-if="selrec" :style="`min-width: `+ tools.myheight_dialog() + `px;` ">
|
||||
<q-toolbar class="bg-primary text-white" style="min-height: 30px;">
|
||||
<q-toolbar-title>
|
||||
{{$t('dashboard.donatori')}}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup clickable @click="Chiudi"></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="inset-shadow" style="padding: 4px !important;">
|
||||
<div class="row justify-center q-gutter-md">
|
||||
<div>
|
||||
<q-table
|
||||
dense
|
||||
color="primary"
|
||||
title="Donatori"
|
||||
:data="selrec.donatore.arrdonatori"
|
||||
:columns="coldonatori"
|
||||
:Pagination="pagination2"
|
||||
row-key="index">
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td key="index" :props="props">
|
||||
D{{ props.row.index }}
|
||||
</q-td>
|
||||
<q-td key="rigacol" :props="props">
|
||||
{{ props.row.riga }}.{{ props.row.col }}
|
||||
</q-td>
|
||||
<q-td key="name" :props="props">
|
||||
<q-btn flat rounded color="blue"
|
||||
:label="props.row.name + ` ` + props.row.surname"
|
||||
@click="clickseluser(props.row)">
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td key="num_tess" :props="props">
|
||||
{{ props.row.num_tess }}
|
||||
</q-td>
|
||||
<q-td key="date_made_gift" :props="props">
|
||||
{{ tools.getstrshortDateTime(props.row.date_made_gift) }}
|
||||
</q-td>
|
||||
<q-td key="made_gift" :props="props">
|
||||
|
||||
<div v-if="deveDonare(props.row)">
|
||||
<div class="row justify-center">
|
||||
<q-btn v-if="!props.row.made_gift"
|
||||
push
|
||||
rounded
|
||||
color="primary"
|
||||
size="md"
|
||||
:label="$t('dashboard.dono_ricevuto_3', {donatore: props.row.name })"
|
||||
|
||||
@click="HoRicevutoIlDono(props.row)">
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-icon v-if="props.row.made_gift" color="green" inverted size="sm"
|
||||
name="fas fa-gift" class="gift"></q-icon>
|
||||
</div>
|
||||
<div v-else>
|
||||
--------
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
|
||||
<div class="q-ma-sm text-center">
|
||||
<div>Invia un Messaggio a tutti questi Donatori:</div>
|
||||
<q-input type="textarea"
|
||||
autogrow
|
||||
v-model="msg_tosend" :label="$t('cal.msgbooking')"
|
||||
input-class="myinput-area">
|
||||
|
||||
</q-input>
|
||||
|
||||
<div class="row justify-center centermydiv q-gutter-sm" style="max-width: 420px;">
|
||||
<q-btn rounded text-color="secondary" icon="fab fa-telegram"
|
||||
:label="$t('dialog.sendmsg')"
|
||||
@click="InviaMsgADonatori()"></q-btn>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog v-model="showmsguser">
|
||||
<q-card v-if="seluser" :style="`min-width: `+ tools.myheight_dialog() + `px;` ">
|
||||
<q-toolbar class="bg-primary text-white" style="min-height: 30px;">
|
||||
<q-toolbar-title>
|
||||
{{$t('dashboard.donatori')}}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup clickable @click="Chiudi"></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="inset-shadow" style="padding: 4px !important;">
|
||||
<div class="row justify-center q-gutter-md">
|
||||
<div>
|
||||
<div class="q-ma-sm text-center">
|
||||
<div>Invia un Messaggio a {{seluser.name }} {{ seluser.surname }}:</div>
|
||||
<q-input type="textarea"
|
||||
autogrow
|
||||
v-model="msg_tosend_user" :label="$t('cal.msgbooking')"
|
||||
input-class="myinput-area">
|
||||
|
||||
</q-input>
|
||||
|
||||
<div class="row justify-center centermydiv q-gutter-sm" style="max-width: 420px;">
|
||||
<q-btn rounded text-color="secondary" icon="fab fa-telegram"
|
||||
:label="$t('dialog.sendmsg') + ` a ` + seluser.name + ` ` + seluser.surname"
|
||||
@click="InviaMsgAUser()"></q-btn>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user