Lista Doni Navi 3

This commit is contained in:
Paolo Arena
2020-03-25 18:28:39 +01:00
parent c25d103a0c
commit 411acf2f70
9 changed files with 151 additions and 85 deletions

View File

@@ -7,32 +7,3 @@
min-width: 200px;
}
.my-sticky-header-table {
/* max height is important */
/* this is when the loading indicator appears */
}
.my-sticky-header-table .q-table__middle {
max-height: 650px !important;
@media (max-width: 718px) {
// PER VERSIONE MOBILE
max-height: 400px !important;
}
}
.my-sticky-header-table .q-table__top,
.my-sticky-header-table .q-table__bottom,
.my-sticky-header-table thead tr:first-child th {
/* bg color is important for th; just specify one */
background-color: #f0ffff;
}
.my-sticky-header-table thead tr th {
position: sticky;
z-index: 1;
}
.my-sticky-header-table thead tr:first-child th {
top: 0;
}
.my-sticky-header-table.q-table--loading thead tr:last-child th {
/* height of all previous header rows */
top: 48px;
}

View File

@@ -32,6 +32,8 @@ export default class CMyNave extends MixinNave {
public coldoni: number = 1
public mediatore: any = {}
public donatore: any = {}
public donatore_navepers: any = {}
public mediatore_navepers: any = {}
public iodonatore: any = {}
public iosognatore: any = {}
public donoinviato: boolean = false
@@ -115,15 +117,21 @@ export default class CMyNave extends MixinNave {
this.mediatore = this.getmediatore()
this.donatore = this.getdonatore()
if (!!this.nave.rec.donatore)
this.donatore_navepers = this.nave.rec.donatore.navepersistente
if (!!this.nave.rec.mediatore)
this.mediatore_navepers = this.nave.rec.mediatore.navepersistente
this.iodonatore = this.getIoDonatore()
this.iosognatore = this.getIoSognatore()
this.donoinviato = this.getDonoInviato
// console.log('this.mediatore', this.mediatore)
// console.log('this.donatore', this.donatore)
if (!!this.mediatore) {
this.link_chat = this.mediatore.link_chat
if (!!this.mediatore_navepers) {
this.link_chat = this.mediatore_navepers.link_chat
}
this.arrdonatori = this.creaarrDonatori()
@@ -194,11 +202,8 @@ export default class CMyNave extends MixinNave {
public partenza_primo_donatore() {
if (!!this.nave) {
if (!!this.nave.rec.mediatore) {
for (const rec of this.nave.rec.mediatore.arrdonatori) {
if (!!rec)
return rec.date_start
}
if (!!this.mediatore_navepers) {
return this.mediatore_navepers.date_start
}
}
return ''
@@ -206,13 +211,13 @@ export default class CMyNave extends MixinNave {
public getGiornoDelDono() {
if (!!this.nave) {
return tools.getstrDate(this.nave.date_start)
return tools.getstrDate(this.donatore_navepers.date_start)
}
}
get GiornoDelDonoArrivato() {
if (!!this.nave) {
return tools.isDateArrived(this.nave.date_start)
return tools.isDateArrived(this.donatore_navepers.date_start)
}
return false
}
@@ -379,21 +384,21 @@ export default class CMyNave extends MixinNave {
}
public change_link_chat() {
const recmed = this.getmediatore()
if (!!recmed) {
if (recmed.link_chat !== this.link_chat) {
recmed.link_chat = this.link_chat
const recmedpers = this.mediatore_navepers
if (!!recmedpers) {
if (recmedpers.link_chat !== this.link_chat) {
recmedpers.link_chat = this.link_chat
const mydata = {
link_chat: recmed.link_chat
link_chat: recmedpers.link_chat
}
tools.saveFieldToServer(this, 'navi', recmed._id, mydata)
tools.saveFieldToServer(this, 'navepersistente', recmedpers._id, mydata)
}
}
}
get linkchatopen() {
return this.donatore.link_chat
return this.donatore_navepers.link_chat
}
public getclassSelect(rec) {
@@ -453,7 +458,7 @@ export default class CMyNave extends MixinNave {
public async InviaMsgANave(msgobj, navemediatore) {
let msgtitle = translate('dashboard.controlla_donatori')
let msgtitle = translate('dashboard.invia_link_chat')
let msginvia = msgtitle
if (msgobj.inviareale) {
msgtitle = translate('dashboard.invia_link_chat')
@@ -505,7 +510,7 @@ export default class CMyNave extends MixinNave {
}
public gettitledonatore() {
return this.getdatastr(this.donatore.date_start) + ' ' + 'NAVE' + ' ' + this.donatore.riga + '.' + this.donatore.col + ' ' + '🎁' + 'AYNI'
return this.getdatastr(this.donatore_navepers.date_start) + ' ' + 'NAVE' + ' ' + this.donatore_navepers.riga + '.' + this.donatore_navepers.col + ' ' + '🎁' + 'AYNI'
}
public gettesto() {
@@ -513,8 +518,8 @@ export default class CMyNave extends MixinNave {
}
public getisProvvisoriaStr() {
if (!!this.iodonatore) {
if (this.iodonatore.provvisoria) {
if (!!this.donatore_navepers) {
if (this.donatore_navepers.provvisoria) {
return ' Temporanea '
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div>
<CTitleBanner v-if="nave" class="q-pa-xs"
:title="$t('pages.nave') + ` ` + getisProvvisoriaStr() + getRiganave(nave.riga) + `.`+getColnave(nave.col) + ` ` + $t('dashboard.nave_in_partenza') + ` ` + tools.getstrDate(nave.date_start)"
:title="$t('pages.nave') + ` ` + getisProvvisoriaStr() + getRiganave(nave.riga) + `.`+getColnave(nave.col) + ` ` + $t('dashboard.nave_in_partenza') + ` ` + tools.getstrDate(nave.rec.donatore.navepersistente.date_start)"
bgcolor="bg-primary"
clcolor="text-white"
mystyle="" myclass="myshad" canopen="true">
@@ -133,9 +133,9 @@
</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"
<!--<q-btn rounded text-color="secondary" icon="fab fa-telegram"
:label="$t('dashboard.controlla_donatori')"
@click="InviaLinkChatADonatori(false)"></q-btn>
@click="InviaLinkChatADonatori(false)"></q-btn>-->
<q-btn rounded text-color="primary" icon="fab fa-telegram"
:disable="!linkchatesiste"