- Iscrizione Conacreis

This commit is contained in:
Paolo Arena
2021-05-10 01:51:18 +02:00
parent 0a0ed62e27
commit 7c8c970a9e
21 changed files with 452 additions and 86 deletions

View File

@@ -42,6 +42,12 @@ export const shared_consts = {
REPORT_FILT_RESP: 1,
REPORT_FILT_ATTIVITA: 2,
CashType: {
None: 0,
Incoming: 1,
Outcoming: 2,
},
Permissions: {
Admin: {
value: 1,

View File

@@ -52,7 +52,7 @@ export default class CGeoChart extends Vue {
for (const rec of this.mydata) {
alldata = []
alldata.push(tools.getNationsByNationality(rec._id, true))
alldata.push(tools.getNationsByNationality(rec._id))
alldata.push(rec.count)
this.mydatafixed.push(alldata)

View File

@@ -18,7 +18,7 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ tools.getNationsByNationality(nat._id, false) }}</q-item-label>
<q-item-label>{{ tools.getNationsByNationality(nat._id) }}</q-item-label>
</q-item-section>
<q-item-section side>

View File

@@ -37,7 +37,16 @@ export const validations = {
dateofbirth: {
required
},
cell_phone: {
born_city: {
required
},
born_province: {
required
},
born_country: {
required
},
metodo_pagamento: {
required
},
terms: {

View File

@@ -39,6 +39,7 @@ export default class CSignUpIscrizioneConacreis extends MixinUsers {
public $q
public $t: any
public countryname: string = ''
public countryborn: string = ''
public iamadult: boolean = false
public duplicate_email: boolean = false
@@ -51,7 +52,7 @@ export default class CSignUpIscrizioneConacreis extends MixinUsers {
}
public created() {
if (!!this.getMyUsername()) {
if (!!this.getMyUsername() && (!UserStore.state.my.profile.socio)) {
this.signup.name = UserStore.state.my.name
this.signup.surname = this.mySurname.toString()
this.signup.email = this.Email
@@ -186,4 +187,11 @@ export default class CSignUpIscrizioneConacreis extends MixinUsers {
this.countryname = name
}
public selectcountryborn({ name, iso2, dialCode }) {
// console.log(name, iso2, dialCode)
this.signup.born_country = iso2
this.countryborn = name
}
}

View File

@@ -6,6 +6,14 @@
<div class="q-gutter-xs">
<p class="q-ml-md text-center">
Leggi
<span class="underline"> <router-link to="/il-nostro-progetto" custom v-slot="{ navigate }">
<span class="footer_link" @click="navigate" @keypress.enter="navigate" role="link">Il Nostro Progetto</span>
</router-link></span>
</p>
<q-input
v-model="signup.name"
rounded outlined
@@ -92,7 +100,7 @@
:error="$v.signup.residency_city.$error"
maxlength="60"
debounce="1000"
:error-message="errorMsg('residency_address', $v.signup.residency_city)"
:error-message="errorMsg('residency_city', $v.signup.residency_city)"
:label="$t('reg.residency_city')">
<template v-slot:prepend>
@@ -108,7 +116,7 @@
:error="$v.signup.residency_province.$error"
maxlength="3"
debounce="1000"
:error-message="errorMsg('residency_address', $v.signup.residency_province)"
:error-message="errorMsg('residency_province', $v.signup.residency_province)"
:label="$t('reg.residency_province')">
<template v-slot:prepend>
@@ -133,28 +141,6 @@
</q-input>
<q-input
v-model="signup.dateofbirth"
debounce="1000"
@blur="$v.signup.dateofbirth.$touch"
:error="$v.signup.dateofbirth.$error"
:error-message="errorMsg('dateofbirth', $v.signup.dateofbirth)"
stack-label
:label="$t('reg.dateofbirth')"
rounded
type="date"
mask="date"
fill-mask
outlined>
</q-input>
<!--<CDate :mydate="signup.dateofbirth" @input="setDateOfBirth(arguments[0])"
:rounded="true" :outlined="true"
:dense="false"
:label="$t('reg.dateofbirth')">
</CDate>-->
<q-input
v-model="countryname"
:readonly="true"
@@ -175,7 +161,7 @@
</q-input>
<!--<div v-if="!tools.isMobile()"><br></div>-->
<br>
<vue-tel-input
v-model="signup.cell_phone"
@@ -187,12 +173,92 @@
wrapperClasses="clCellCode">
</vue-tel-input>
<p class="q-ml-md text-center">
Leggi
<span class="underline"> <router-link to="/il-nostro-progetto" custom v-slot="{ navigate }">
<span class="footer_link" @click="navigate" @keypress.enter="navigate" role="link">Il Nostro Progetto</span>
</router-link></span>
</p>
<br>
<q-input
v-model="signup.dateofbirth"
debounce="1000"
@blur="$v.signup.dateofbirth.$touch"
:error="$v.signup.dateofbirth.$error"
:error-message="errorMsg('dateofbirth', $v.signup.dateofbirth)"
stack-label
:label="$t('reg.dateofbirth')"
rounded
type="date"
mask="date"
fill-mask
outlined>
</q-input>
<q-input
v-model="signup.born_city"
rounded outlined
@blur="$v.signup.born_city.$touch"
:error="$v.signup.born_city.$error"
maxlength="60"
debounce="1000"
:error-message="errorMsg('born_city', $v.signup.born_city)"
:label="$t('reg.born_city')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<q-input
v-model="signup.born_province"
rounded outlined
@blur="$v.signup.born_province.$touch"
:error="$v.signup.born_province.$error"
maxlength="3"
debounce="1000"
:error-message="errorMsg('born_province', $v.signup.born_province)"
:label="$t('reg.born_province')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<!--<CDate :mydate="signup.dateofbirth" @input="setDateOfBirth(arguments[0])"
:rounded="true" :outlined="true"
:dense="false"
:label="$t('reg.dateofbirth')">
</CDate>-->
<q-input
v-model="countryborn"
:readonly="true"
rounded outlined
debounce="1000"
:label="$t('reg.nationality_born')">
<template v-slot:prepend>
<vue-country-code
@onSelect="selectcountryborn"
:preferredCountries="tools.getprefCountries"
:dropdownOptions="{ disabledDialCode: true }"
>
</vue-country-code>
</template>
</q-input>
<br>
<!--<div v-if="!tools.isMobile()"><br></div>-->
<q-select
rounded outlined v-model="signup.metodo_pagamento"
:options="tools.SelectMetodiPagamento"
:label="$t('reg.metodopagamento')" emit-value map-options>
</q-select>
<q-checkbox
v-model="signup.accetta_carta_costituzionale_on"

View File

@@ -6,7 +6,7 @@ export default async (context, cmd, table, data = null, id = '') => {
// console.log('globalroutines', cmd, table, descr, id)
return indexdb(context, cmd, table, data, id)
.then((ris) => {
console.log('GlobalStore.state.connData', GlobalStore.state.connData)
// console.log('GlobalStore.state.connData', GlobalStore.state.connData)
setTimeout(() => {
GlobalStore.state.connData.uploading_indexeddb = 0

View File

@@ -32,6 +32,7 @@ export interface IEvents {
lunchPrice?: number
dinnerPrice?: number
internal?: boolean
note?: string
news?: boolean
canceled?: boolean
deleted?: boolean

View File

@@ -26,10 +26,17 @@ export interface ISignupIscrizioneConacreisOptions {
residency_country?: string
residency_zipcode?: string
dateofbirth?: Date
dateofreg?: Date
dateofapproved?: Date
born_city?: string
born_province?: string
born_country?: string
cell_phone?: string
newsletter_on?: boolean
accetta_carta_costituzionale_on?: boolean
metodo_pagamento?: number
iscrizione_compilata?: boolean
codiceConacreis?: string
annoTesseramento?: number
motivazioni?: string
competenze_professionalita?: string

View File

@@ -10,6 +10,7 @@ import { Getter } from 'vuex-class'
import { lists } from '@src/store/Modules/lists'
import MixinUsers from '@src/mixins/mixin-users'
import MixinOperator from '@src/mixins/mixin-operator'
import MixinEvents from '@src/mixins/mixin-events'
const namespace = 'CalendarModule'
@@ -18,10 +19,11 @@ const namespace = 'CalendarModule'
name: 'EventList',
components: { CTitle, CMyPage }
})
export default class Eventlist extends Vue {
export default class Eventlist extends MixinEvents {
public $t: any
public $q
public showpeople: boolean = false
public shownote: boolean = false
public eventsel: IEvents = null
public showPrev = false
public numrec = 0
@@ -154,4 +156,8 @@ export default class Eventlist extends Vue {
this.getNumEvent()
}
public change_rec(eventparam) {
this.UpdateDbByFields(this, eventparam)
}
}

View File

@@ -63,16 +63,46 @@
<td class="text-center">
<q-btn v-if="getNumParticipants(event, showall, tools.peopleWhere.participants) > 0"
flat
dense
round
color="positive"
rounded
icon="fas fa-user-check"
@click="showpeople = true; eventsel = event"
aria-label="Menu">
<q-icon name="info"/>
>
</q-btn>
<q-btn dense
flat
rounded
:color="!!event.note ? 'positive' : 'dark'"
icon="fas fa-pencil-alt"
@click="shownote = true; eventsel = event"
>
</q-btn>
</td>
</tr>
</tbody>
</q-markup-table>
<q-dialog v-model="shownote">
<q-card v-if="eventsel" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
Note: {{ eventsel.title }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="q-pa-xs inset-shadow">
<q-input v-model="eventsel.note" style="min-height: 50px; " label="Note:"
filled dense
autogrow
type="textarea" debounce="500"
input-class="myinput-area"
@input="change_rec(eventsel)">
</q-input>
</q-card-section>
</q-card>
</q-dialog>
<q-dialog v-model="showpeople">
<q-card v-if="eventsel" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">

View File

@@ -9,6 +9,9 @@ import { CImgText } from '../../../components/CImgText/index'
import { CCard, CGridTableRec, CMyPage, CTitleBanner } from '@components'
import MixinMetaTags from '../../../mixins/mixin-metatags'
import MixinBase from '@src/mixins/mixin-base'
import { IParamsQuery, ISignupIscrizioneConacreisOptions } from '@src/model'
import { GlobalStore, UserStore } from '@store'
import { ISignupConacreis } from '@src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis-validate'
@Component({
mixins: [MixinBase],
@@ -37,4 +40,71 @@ export default class SitesPage extends MixinMetaTags {
get static_data() {
return static_data
}
public loadrec(): ISignupIscrizioneConacreisOptions[] {
const sortBy = 'numshared'
const descending = 1
const myobj = {}
if (descending)
myobj[sortBy] = -1
else
myobj[sortBy] = 1
const params: IParamsQuery = {
table: 'iscritticonacreis',
startRow: 0,
endRow: 10000,
filter: '',
filterand: '',
sortBy: myobj,
descending,
userId: UserStore.state.my._id
}
console.log('myload', params)
return GlobalStore.actions.loadTable(params).then((data) => {
return data.rows
})
}
public async exportLista() {
const myrec = await this.loadrec()
const sep = ';'
let mystr = ''
mystr += 'anno' + sep + 'Num' + sep + 'Conacreis' + sep + 'data_richiesta_iscrizione' + sep + 'data_approvazione_iscrizione' + sep + 'nome' + sep + 'cognome' + sep + 'codice_fiscale' + sep + 'nazione' + sep + 'indirizzo' + sep + 'localita' + sep + 'Prov' + sep + 'cap' + sep + 'data_nascita' + sep + 'nazione_nascita' + sep + 'luogo_nascita' + sep + 'provincia_nascita' + sep + 'email' + sep + 'telefono' + sep + 'quota_versata' + '\n';
let index = 1
for (const rec of myrec) {
mystr += rec.annoTesseramento + sep
mystr += index + sep
mystr += rec.codiceConacreis + sep
mystr += tools.getstrDate(rec.dateofreg) + sep
mystr += tools.getstrDate(rec.dateofapproved) + sep
mystr += rec.name + sep
mystr += rec.surname + sep
mystr += rec.fiscalcode + sep
mystr += tools.getNationsByNationality(rec.residency_country) + sep
mystr += rec.residency_address + sep
mystr += rec.residency_city + sep
mystr += rec.residency_province + sep
mystr += rec.residency_zipcode + sep
mystr += tools.getstrDate(rec.dateofbirth) + sep
mystr += tools.getNationsByNationality(rec.born_country) + sep
mystr += rec.born_city + sep
mystr += rec.born_province + sep
mystr += rec.email + sep
mystr += rec.cell_phone + sep
// mystr += 'si' + sep
// mystr += 'si' + sep
mystr += '\n'
index++
}
tools.copyStringToClipboard(this, mystr, false)
}
}

View File

@@ -9,7 +9,19 @@
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CTitleBanner title="Iscritti Conacreis"></CTitleBanner>
<CGridTableRec prop_mytable="iscritticonacreis"
<q-btn
rounded
dense
color="primary"
size="md"
label="Copia questa Lista negli appunti"
@click="exportLista()">
</q-btn>
<CGridTableRec prop_mytable="iscritticonacreis"
prop_mytitle="Iscritti Conacreis"
:prop_mycolumns="getcolIscrittiConacreis"
prop_colkey="name"

View File

@@ -413,6 +413,7 @@ const msg_it = {
password: 'Password',
repeatPassword: 'Ripeti password',
terms: "Accetto i termini della privacy",
metodopagamento: "Metodo di Pagamento",
onlyadult: "Confermo di essere Maggiorenne",
submit: "Registrati",
title_verif_reg: "Verifica Registrazione",
@@ -432,6 +433,9 @@ const msg_it = {
residency_province: "Provincia",
residency_zipcode: "CAP",
dateofbirth: "Data di Nascita",
born_city: "Città di Nascita",
born_province: "Provincia di Nascita",
nationality_born: "Paese di Nascita",
newsletter_on: "Aggiungimi alla Newsletter",
accetta_carta_costituzionale_on: "Ho letto ed Approvo il Progetto",
iscriviti: "Iscriviti",
@@ -556,6 +560,7 @@ const msg_it = {
endwork_estimate: 'Data fine lavori stimata',
privacyread: 'Chi lo puo vedere:',
privacywrite: 'Chi lo puo modificare:',
createdby: 'Creato da:',
tipovisu: 'Visualizzazione:',
totalphases: 'Totale Fasi',
themecolor: 'Tema Colore',
@@ -610,16 +615,16 @@ const msg_it = {
Lunch: 'Pranzo',
Dinner: 'Cena',
DinnerShared: 'Cena Condivisa',
selnumpeopleLunch: 'Persone a Pranzo',
selnumpeopleDinner: 'Persone a Cena',
selnumpeopleDinnerShared: 'Persone a Cena Condivisa',
selnumpeopleLunch: 'A Pranzo',
selnumpeopleDinner: 'A Cena',
selnumpeopleDinnerShared: 'Cena Condiv.',
selnumpeople_short: 'Num',
msgbooking: 'Messaggio da inviare',
showpdf: 'Vedi PDF',
bookingtextdefault: 'Prenoto per',
bookingtextdefault_of: 'di',
data: 'Data',
teachertitle: 'Insegnante',
teachertitle: 'Relatore',
peoplebooked: 'Prenotaz.',
showlastschedule: 'Vedi tutto il Calendario',
},

View File

@@ -1144,7 +1144,7 @@ namespace Actions {
CalendarStore.state.editable = false
return await Api.SendReq('/loadsite/' + myuserid + '/' + process.env.APP_ID + '/' + showall, 'GET', null)
return await Api.SendReq('/loadsite/' + myuserid + '/' + process.env.APP_ID, 'GET', null)
.then((res) => {
// console.log('____________________________ res', res)
if (res.status === 200) {

View File

@@ -93,6 +93,8 @@ function getproj(projects, idproj, tipoproj: string) {
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.my._id) && (proj.privacyread !== Privacy.onlyme))
else if (tipoproj === RouteNames.projectsall)
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.my._id))
else
ris = projects.filter((proj) => (proj.id_parent === idproj))
if (ris)
ris = ris.sort((a, b) => a.pos - b.pos)

View File

@@ -55,7 +55,7 @@ namespace Getters {
}, 'findEventBooked')
const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents, showall, tipo = 0): number => {
const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.my._id) ) && ( ((tipo === tools.peopleWhere.participants) && bookedevent.numpeople) || ((tipo === tools.peopleWhere.lunch && bookedevent.numpeopleLunch) || (tipo === tools.peopleWhere.dinner && bookedevent.numpeopleDinner) || (tipo === tools.peopleWhere.dinnerShared && bookedevent.numpeopleDinnerShared) )))
const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.my._id) ) && ( ((tipo === tools.peopleWhere.participants) && bookedevent.numpeople > 0) || ((tipo === tools.peopleWhere.lunch && bookedevent.numpeopleLunch > 0) || (tipo === tools.peopleWhere.dinner && bookedevent.numpeopleDinner > 0) || (tipo === tools.peopleWhere.dinnerShared && bookedevent.numpeopleDinnerShared > 0) )))
if (myarr.length > 0) {
let ris = null
if (tipo === tools.peopleWhere.participants) {

View File

@@ -290,19 +290,34 @@ export const colTableIscrittiConacreis = [
AddCol({ name: 'residency_country', label_trans: 'reg.residency_country', fieldtype: tools.FieldType.string }),
AddCol({ name: 'residency_zipcode', label_trans: 'reg.residency_zipcode', fieldtype: tools.FieldType.string }),
AddCol({ name: 'dateofbirth', label_trans: 'reg.dateofbirth', fieldtype: tools.FieldType.onlydate }),
AddCol({ name: 'born_city', label_trans: 'reg.born_city', fieldtype: tools.FieldType.string }),
AddCol({ name: 'born_province', label_trans: 'reg.born_province', fieldtype: tools.FieldType.string }),
AddCol({ name: 'born_country', label_trans: 'reg.born_country', fieldtype: tools.FieldType.string }),
AddCol({ name: 'cell_phone', label_trans: 'reg.cell_phone', fieldtype: tools.FieldType.string }),
AddCol({ name: 'newsletter_on', label_trans: 'reg.newsletter_on', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'iscrizione_compilata', label_trans: 'reg.iscrizione_compilata', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'metodo_pagamento', label_trans: 'reg.metodo_pagamento', fieldtype: tools.FieldType.number }),
AddCol({ name: 'dateofreg', label_trans: 'reg.dateofreg', fieldtype: tools.FieldType.onlydate }),
AddCol({ name: 'dateofapproved', label_trans: 'reg.dateofapproved', fieldtype: tools.FieldType.onlydate }),
AddCol({ name: 'codiceConacreis', label_trans: 'reg.codiceConacreis', fieldtype: tools.FieldType.string }),
AddCol({ name: 'annoTesseramento', label_trans: 'reg.annoTesseramento', fieldtype: tools.FieldType.number }),
AddCol({ name: 'motivazioni', label_trans: 'reg.motivazioni', fieldtype: tools.FieldType.string }),
AddCol({ name: 'competenze_professionalita', label_trans: 'reg.competenze_professionalita', fieldtype: tools.FieldType.string }),
AddCol({
name: 'competenze_professionalita',
label_trans: 'reg.competenze_professionalita',
fieldtype: tools.FieldType.string
}),
AddCol({ name: 'cosa_potrei_offrire', label_trans: 'reg.cosa_potrei_offrire', fieldtype: tools.FieldType.string }),
AddCol({ name: 'cosa_vorrei_ricevere', label_trans: 'reg.cosa_vorrei_ricevere', fieldtype: tools.FieldType.string }),
AddCol({ name: 'altre_comunicazioni', label_trans: 'reg.altre_comunicazioni', fieldtype: tools.FieldType.string }),
AddCol({ name: 'come_ci_hai_conosciuto', label_trans: 'reg.come_ci_hai_conosciuto', fieldtype: tools.FieldType.string }),
AddCol({ name: 'note', label_trans: 'reg.note', fieldtype: tools.FieldType.string })
AddCol({
name: 'come_ci_hai_conosciuto',
label_trans: 'reg.come_ci_hai_conosciuto',
fieldtype: tools.FieldType.string
}),
AddCol({ name: 'note', label_trans: 'reg.note', fieldtype: tools.FieldType.string }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTableProducts = [
@@ -543,6 +558,7 @@ const colTableEvents = [
AddCol({ name: 'infoextra', label_trans: 'event.infoextra' }),
AddCol({ name: 'linkpage', label_trans: 'event.linkpage' }),
AddCol({ name: 'linkpdf', label_trans: 'event.linkpdf' }),
AddCol({ name: 'note', label_trans: 'event.note' }),
AddCol({ name: 'nobookable', label_trans: 'event.nobookable', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'internal', label_trans: 'event.internal', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'news', label_trans: 'event.news', fieldtype: tools.FieldType.boolean }),
@@ -994,13 +1010,37 @@ export const fieldsTable = {
label_trans: 'reg.consiglio',
fieldtype: tools.FieldType.boolean
}),
AddCol({ name: 'profile.chisei', field: 'profile', subfield: 'chisei', label_trans: 'reg.chisei' }),
AddCol({ name: 'profile.motivazioni', field: 'profile', subfield: 'motivazioni', label_trans: 'reg.motivazioni' }),
AddCol({ name: 'profile.competenze_professionalita', field: 'profile', subfield: 'competenze_professionalita', label_trans: 'reg.competenze_professionalita' }),
AddCol({ name: 'profile.cosa_offrire', field: 'profile', subfield: 'cosa_offrire', label_trans: 'reg.cosa_offrire' }),
AddCol({ name: 'profile.cosa_ricevere', field: 'profile', subfield: 'cosa_ricevere', label_trans: 'reg.cosa_ricevere' }),
AddCol({ name: 'profile.altre_comunicazioni', field: 'profile', subfield: 'altre_comunicazioni', label_trans: 'reg.altre_comunicazioni' }),
AddCol({ name: 'profile.come_ci_hai_conosciuto', field: 'profile', subfield: 'come_ci_hai_conosciuto', label_trans: 'reg.come_ci_hai_conosciuto' }),
AddCol({
name: 'profile.competenze_professionalita',
field: 'profile',
subfield: 'competenze_professionalita',
label_trans: 'reg.competenze_professionalita'
}),
AddCol({
name: 'profile.cosa_offrire',
field: 'profile',
subfield: 'cosa_offrire',
label_trans: 'reg.cosa_offrire'
}),
AddCol({
name: 'profile.cosa_ricevere',
field: 'profile',
subfield: 'cosa_ricevere',
label_trans: 'reg.cosa_ricevere'
}),
AddCol({
name: 'profile.altre_comunicazioni',
field: 'profile',
subfield: 'altre_comunicazioni',
label_trans: 'reg.altre_comunicazioni'
}),
AddCol({
name: 'profile.come_ci_hai_conosciuto',
field: 'profile',
subfield: 'come_ci_hai_conosciuto',
label_trans: 'reg.come_ci_hai_conosciuto'
}),
AddCol({
name: 'profile.come_aiutare',
field: 'profile',
@@ -1059,6 +1099,20 @@ export const fieldsTable = {
AddCol(DuplicateRec)
],
colTableCash:
[],
colTableCashCategory: [
AddCol({ name: 'descr', label_trans: 'pages.description' }),
AddCol({ name: 'notes', label_trans: 'reg.note' })
],
colTableSubCashCategory: [
AddCol({ name: 'idCashCategory', label_trans: 'Category.idCashCategory', fieldtype: tools.FieldType.select, jointable: 'cashcategory' }),
AddCol({ name: 'descr', label_trans: 'pages.description' }),
AddCol({ name: 'notes', label_trans: 'reg.note' })
],
tablesList: [
{
value: 'operators',

View File

@@ -303,6 +303,29 @@ export const tools = {
},
],
SelectMetodiPagamento: [
{
id: 0,
label: '[Nessuno]',
value: 0
},
{
id: 1,
label: 'Bonifico Bancario',
value: 1
},
{
id: 2,
label: 'Paypal',
value: 2
},
{
id: 3,
label: 'In Contanti alla CNM',
value: 3
},
],
SelectListNumPeople: [
{
id: 0,
@@ -333,7 +356,32 @@ export const tools = {
id: 5,
label: '5',
value: 5
}
},
{
id: 6,
label: '6',
value: 6
},
{
id: 7,
label: '7',
value: 7
},
{
id: 8,
label: '8',
value: 8
},
{
id: 9,
label: '9',
value: 9
},
{
id: 10,
label: '10',
value: 10
},
]
,
@@ -2560,20 +2608,17 @@ export const tools = {
return date.formatDate(mytimestamp, 'DD/MM/YYYY') + ' ' + mythis.$t('cal.starttime') + ' ' + date.formatDate(mytimestamp, 'HH:mm')
else
return ''
}
,
},
getstrMMMDate(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
return date.formatDate(mytimestamp, 'DD MMM YYYY')
else
return ''
}
,
},
getstrYYMMDDDate(mytimestamp) {
return date.formatDate(mytimestamp, 'YYYY-MM-DD')
}
,
},
getstrYYMMDDDateTime(mytimestamp) {
return date.formatDate(mytimestamp, 'YYYY-MM-DD HH:mm')
},
@@ -2609,8 +2654,7 @@ export const tools = {
}
// console.log('mystrdate', mystrdate, strdate, mydate)
return mydate
}
,
},
capitalize(value) {
if (!value) {
@@ -2618,8 +2662,7 @@ export const tools = {
}
value = value.toString()
return value.charAt(0).toUpperCase() + value.slice(1)
}
,
},
firstchars(value, numchars = 200) {
if (!value) {
@@ -2693,12 +2736,10 @@ export const tools = {
},
getDateNull() {
return new Date(0)
}
,
},
getTimeNow() {
return new Date().getTime()
}
,
},
getTimestampsNow() {
return new Date().valueOf()
},
@@ -2709,8 +2750,7 @@ export const tools = {
isMainProject(idproj) {
return idproj === process.env.PROJECT_ID_MAIN
}
,
},
getUrlByTipoProj(tipoproj, name ?: string) {
if (!!name)
@@ -3857,7 +3897,12 @@ export const tools = {
return '<a href="' + mylink + '" target="_blank">' + text + '</a>'
},
getNationsByNationality(nat, code) {
getNationsByNationality(nat) {
if (!nat)
return ''
nat = nat.toUpperCase()
if (nat === 'IT') {
return 'Italy'
} else if (nat === 'SI') {

View File

@@ -55,6 +55,9 @@ const namespaceGS: string = 'GlobalState'
export default class ProjList extends Vue {
public tabproj: string = 'lista'
public shownewsubproj: boolean = false
public newSubProj: string = ''
get TipoVisu() {
return TipoVisu
@@ -361,7 +364,7 @@ export default class ProjList extends Vue {
} else if (cmd === 'stat') {
this.tabproj = 'stat'
} else if (cmd === 'nuovo') {
this.clickMenuProjList(lists.MenuAction.ADD_PROJECT)
}
GlobalStore.state.clickcmd = ''
@@ -369,6 +372,16 @@ export default class ProjList extends Vue {
}
public async insertSubProj() {
console.log('insertSubProj', this.newSubProj)
const idnewelem = await this.addProject(this.newSubProj, this.gettipoProj)
this.newSubProj = ''
this.shownewsubproj = false
}
// @Watch('projs_dacompletare')
// public changeitems() {
// this.updateindexProj()
@@ -413,7 +426,6 @@ export default class ProjList extends Vue {
this.updateclasses()
}
@Watch('itemselproj._id')
public changeidproj() {
this.aggiornastat()
@@ -609,15 +621,7 @@ export default class ProjList extends Vue {
public async clickMenuProjList(action) {
console.log('clickMenuProjList: ', action)
if (action === lists.MenuAction.ADD_PROJECT) {
const idnewelem = await this.addProject('inserisci qui...', this.gettipoProj)
// console.log('idnewelem', idnewelem)
// get element by id
const elem = this.getCompProjectById(idnewelem)
if (!!elem) {
// @ts-ignore
elem.activeEdit()
}
this.shownewsubproj = true
// console.log('idnewelem', idnewelem, 'Elem Trovato', elem)
} else if (action === lists.MenuAction.SHOW_POSIZ) {
@@ -877,6 +881,12 @@ export default class ProjList extends Vue {
ApiTables.waitAndRefreshData()
}
public getCreatedBy(item) {
console.log('item.userid', item.userid)
return UserStore.getters.getNameSurnameByUserId(item.userid)
}
private updateindexProj() {
// console.log('idProjAtt', this.idProjAtt)
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
@@ -1006,4 +1016,5 @@ export default class ProjList extends Vue {
}
}

View File

@@ -1,6 +1,34 @@
<template>
<q-page>
<div class="panel">
<q-dialog v-model="shownewsubproj">
<q-card :style="`min-width: `+ tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
Nuovo
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<q-input color="blue-12" v-model="newSubProj" label="Inserisci il Nuovo sotto Progetto:"
style="margin-left: 6px;"
autofocus
:after="[{icon: 'arrow_forward', content: true, handler () {}}]">
<template v-slot:prepend>
<q-icon name="add"/>
</template>
</q-input>
</q-card-section>
<q-card-actions align="center">
<q-btn rounded color="primary" v-close-popup label="Aggiungi"
@click="insertSubProj()"></q-btn>
<q-btn flat rounded color="negative" v-close-popup label="Annulla"></q-btn>
</q-card-actions>
</q-card>
</q-dialog>
<div>
<div class="flex-container clMain">
@@ -175,7 +203,6 @@
</div>
<div v-if="CanISeeProjectSel" class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="fas fa-sort-amount-up-alt"/>
<div class="flex-item itemdescr">
@@ -260,6 +287,13 @@
</q-select>
</div>
</div>
<div v-if="CanISeeProjectSel" class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="edit"/>
<div class="flex-item itemstatus">
{{ $t('proj.createdby') }} {{ getCreatedBy(itemselproj) }}
</div>
</div>
</div>