diff --git a/src/classes/DateController.ts b/src/classes/DateController.ts index 8e7dff2..0f06a23 100755 --- a/src/classes/DateController.ts +++ b/src/classes/DateController.ts @@ -1,8 +1,8 @@ import moment from 'moment' -import 'moment/locale/fr' -moment.locale('fr') +import 'moment/locale/it' +moment.locale('it') -const monthsStrings = ['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'] +const monthsStrings = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'] export class DateMoving { public date: moment.Moment diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 451e2fd..5c722cf 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -67,9 +67,9 @@ export const shared_consts = { icon: 'fas fa-user-tie', color: 'fuchsia' }, - Traduttrici: { + Editor: { value: 16, - label: 'dashboard.traduttrici', + label: 'dashboard.Editor', icon: 'fas fa-user-tie', color: 'orange' }, @@ -163,6 +163,14 @@ export const shared_consts = { CANCELED: 10 }, + OrderStatusView: [ + 2, + 3, + 4, + 6, + 10 + ], + OrderStatusStr: [ { label: 'Nessuno', @@ -173,7 +181,7 @@ export const shared_consts = { value: 1 }, { - label: 'Ordine Inviato', + label: 'Ordine in Lavorazione', value: 2 }, { diff --git a/src/components/CDate/CDate.ts b/src/components/CDate/CDate.ts index 6a3cb53..8ecbbb5 100755 --- a/src/components/CDate/CDate.ts +++ b/src/components/CDate/CDate.ts @@ -16,6 +16,9 @@ export default class CDate extends Vue { @Prop({ required: false, default: false }) public readonly!: boolean @Prop({ required: false, default: false }) public disable!: boolean @Prop({ required: false, default: '' }) public color!: string + @Prop({ required: false, default: false }) public rounded!: boolean + @Prop({ required: false, default: false }) public outlined!: boolean + @Prop({ required: false, default: true }) public dense!: boolean public mystyleicon: string = 'font-size: 1.5rem;' @@ -41,7 +44,7 @@ export default class CDate extends Vue { const datavalida = tools.convertstrtoDate(value) if (!!datavalida) { this.valueInternal = datavalida - console.log('EMIT: changedate', datavalida) + console.log('EMIT: changedate', datavalida.toString()) this.$emit('input', this.getDate()) } else { console.log(' DATA NON VALIDAAAAAAAAAAAAA ', value, datavalida) @@ -50,7 +53,9 @@ export default class CDate extends Vue { } get getdatestring() { - return tools.getstrDate(this.valueInternal) + const mydate = tools.getstrDate(this.valueInternal) + console.log('getdatestring', mydate) + return mydate } get getdateyymmddstring() { return tools.getstrYYMMDDDate(this.valueInternal) diff --git a/src/components/CDate/CDate.vue b/src/components/CDate/CDate.vue index 0d8bda6..6272392 100755 --- a/src/components/CDate/CDate.vue +++ b/src/components/CDate/CDate.vue @@ -1,18 +1,22 @@ diff --git a/src/components/CEventsCalendar/CEventsCalendar.ts b/src/components/CEventsCalendar/CEventsCalendar.ts index 1c98bfb..e320fc6 100755 --- a/src/components/CEventsCalendar/CEventsCalendar.ts +++ b/src/components/CEventsCalendar/CEventsCalendar.ts @@ -76,6 +76,7 @@ export default class CEventsCalendar extends MixinEvents { numpeople: 1, numpeopleLunch: 0, numpeopleDinner: 0, + numpeopleDinnerShared: 0, datebooked: tools.getDateNow(), booked: false, modified: false @@ -347,6 +348,7 @@ export default class CEventsCalendar extends MixinEvents { return (this.bookEventpage.bookedevent.numpeople !== this.bookEventForm.numpeople) || (this.bookEventpage.bookedevent.numpeopleLunch !== this.bookEventForm.numpeopleLunch) || (this.bookEventpage.bookedevent.numpeopleDinner !== this.bookEventForm.numpeopleDinner) || + (this.bookEventpage.bookedevent.numpeopleDinnerShared !== this.bookEventForm.numpeopleDinnerShared) || (this.bookEventpage.bookedevent.msgbooking !== this.bookEventForm.msgbooking) || (this.bookEventpage.bookedevent.booked !== this.bookEventForm.booked) } @@ -470,6 +472,7 @@ export default class CEventsCalendar extends MixinEvents { this.bookEventForm.numpeople = 1 this.bookEventForm.numpeopleLunch = 0 this.bookEventForm.numpeopleDinner = 0 + this.bookEventForm.numpeopleDinnerShared = 0 this.bookEventForm.booked = true this.bookEventpage.state = EState.Creating @@ -696,6 +699,7 @@ export default class CEventsCalendar extends MixinEvents { this.bookEventForm.numpeople = bookedevent.numpeople this.bookEventForm.numpeopleLunch = bookedevent.numpeopleLunch this.bookEventForm.numpeopleDinner = bookedevent.numpeopleDinner + this.bookEventForm.numpeopleDinnerShared = bookedevent.numpeopleDinnerShared this.bookEventForm.infoevent = bookedevent.infoevent this.bookEventForm.msgbooking = bookedevent.msgbooking this.bookEventForm.booked = bookedevent.booked @@ -750,6 +754,7 @@ export default class CEventsCalendar extends MixinEvents { numpeople: self.bookEventForm.numpeople, numpeopleLunch: self.bookEventForm.numpeopleLunch, numpeopleDinner: self.bookEventForm.numpeopleDinner, + numpeopleDinnerShared: self.bookEventForm.numpeopleDinnerShared, infoevent: tools.gettextevent(self, myevent), msgbooking: self.bookEventForm.msgbooking, booked: self.bookEventForm.booked, @@ -758,6 +763,7 @@ export default class CEventsCalendar extends MixinEvents { } this.BookEvent(data).then((ris) => { + console.log('ris uscita di BookEvent', ris) if (ris) tools.showPositiveNotif(self.$q, self.$t('cal.booked') + ' ' + self.$t('cal.event') + ' "' + myevent.title + '"') else diff --git a/src/components/CEventsCalendar/CEventsCalendar.vue b/src/components/CEventsCalendar/CEventsCalendar.vue index 06e8c60..1fbb181 100755 --- a/src/components/CEventsCalendar/CEventsCalendar.vue +++ b/src/components/CEventsCalendar/CEventsCalendar.vue @@ -1,6 +1,6 @@ @@ -52,5 +51,5 @@ diff --git a/src/components/CMyFieldDb/CMyFieldDb.vue b/src/components/CMyFieldDb/CMyFieldDb.vue index 784c212..58602a1 100755 --- a/src/components/CMyFieldDb/CMyFieldDb.vue +++ b/src/components/CMyFieldDb/CMyFieldDb.vue @@ -156,7 +156,7 @@ + o :options="tools.SelectHours">
diff --git a/src/components/CMyPage/CMyPage.ts b/src/components/CMyPage/CMyPage.ts index 148df29..00889a6 100755 --- a/src/components/CMyPage/CMyPage.ts +++ b/src/components/CMyPage/CMyPage.ts @@ -4,13 +4,10 @@ import { GlobalStore, UserStore } from '@store' import { Footer } from '../../components/Footer' -// import VueScrollReveal from 'vue-scroll-reveal' -import { tools } from '@src/store/Modules/tools' -import { toolsext } from '@src/store/Modules/toolsext' -import { Screen } from 'quasar' import { CImgTitle } from '../../components/CImgTitle/index' import { CTitle } from '../../components/CTitle/index' import MixinsMetaTags from '../../mixins/mixin-metatags' +import { IMyPage } from '@src/model' @Component({ name: 'CMyPage', @@ -18,7 +15,8 @@ import MixinsMetaTags from '../../mixins/mixin-metatags' components: { Footer, CImgTitle, CTitle } }) export default class CMyPage extends Vue { - @Prop({ required: true, default: '' }) public title: string + @Prop({ required: false, default: '' }) public title: string + @Prop({ required: false, default: '' }) public mypath: string @Prop({ required: false, default: '' }) public img: string @Prop({ required: false, default: '' }) public imgbackground: string @Prop({ required: false, default: '' }) public sizes: string @@ -26,6 +24,7 @@ export default class CMyPage extends Vue { @Prop({ required: false, default: false }) public nofooter: boolean public $t public $q + public rec: IMyPage = null // public metaInfo() { // return { @@ -40,8 +39,10 @@ export default class CMyPage extends Vue { // } // } - public mounted() { + public async mounted() { // console.log('CMYPage title=', this.title) // console.table(this.meta) + if (this.mypath !== '') + this.rec = await GlobalStore.actions.loadPage(this.mypath) } } diff --git a/src/components/CMyPage/CMyPage.vue b/src/components/CMyPage/CMyPage.vue index 06362e8..e72d854 100755 --- a/src/components/CMyPage/CMyPage.vue +++ b/src/components/CMyPage/CMyPage.vue @@ -1,21 +1,53 @@ diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.ts b/src/components/CMyPopupEdit/CMyPopupEdit.ts index 475fc37..b57ce54 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.ts +++ b/src/components/CMyPopupEdit/CMyPopupEdit.ts @@ -34,6 +34,7 @@ export default class CMyPopupEdit extends Vue { public myvalueprec = 'false' public countryname = '' public visueditor: boolean = false + public showeditor: boolean = true get tools() { return tools diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.vue b/src/components/CMyPopupEdit/CMyPopupEdit.vue index d14c3e7..d420598 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.vue +++ b/src/components/CMyPopupEdit/CMyPopupEdit.vue @@ -236,10 +236,12 @@
- + + - + +
- +
- {{ myproduct.description }} +
@@ -43,7 +43,7 @@
- € {{ myproduct.price.toFixed(2) }} + € {{ myproduct.price.toFixed(2) }}
@@ -82,8 +82,10 @@ + diff --git a/src/components/CSignIn/CSignIn.vue b/src/components/CSignIn/CSignIn.vue index dff2d93..9ab597c 100755 --- a/src/components/CSignIn/CSignIn.vue +++ b/src/components/CSignIn/CSignIn.vue @@ -53,16 +53,19 @@ :disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
-
- - -
+
+
+ Se non sei ancora Registrato:
+ + +
+
diff --git a/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis-validate.ts b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis-validate.ts new file mode 100755 index 0000000..aab1fef --- /dev/null +++ b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis-validate.ts @@ -0,0 +1,47 @@ +import { ISignupIscrizioneConacreisOptions } from 'model' +import { email, minLength, required, sameAs } from 'vuelidate/lib/validators' + +export interface ISignupConacreis { + signup: ISignupIscrizioneConacreisOptions, + validationGroup: string[] +} + +export const validations = { + signup: { + name: { + required + }, + surname: { + required + }, + email: { + email, + required + }, + fiscalcode: { + required, + minLength: minLength(16) + }, + residency_address: { + required + }, + residency_city: { + required + }, + residency_province: { + required + }, + residency_zipcode: { + required + }, + dateofbirth: { + required + }, + cell_phone: { + required + }, + terms: { + required + }, + } +} diff --git a/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.scss b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.scss new file mode 100755 index 0000000..0934865 --- /dev/null +++ b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.scss @@ -0,0 +1,34 @@ +.signup { + width: 100%; + margin: 0 auto; + max-width: 450px; +} + + +.wrapper { + display: flex; + align-items: center; + justify-content: center; +} + +.clCellCode { + border-radius: 32px; + border-right: #2d2260; + height: 50px; + font-size: 1rem; + padding: 8px; +} + +.clCell { + border-radius: 32px; + border-right: #2d2260; + height: 50px; + font-size: 1rem; + padding: 8px; +} + +.vue-country-select{ + border-radius: 32px; +} + + diff --git a/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.ts b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.ts new file mode 100755 index 0000000..ce6bee1 --- /dev/null +++ b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.ts @@ -0,0 +1,189 @@ +import Vue from 'vue' +import { Component, Prop, Watch } from 'vue-property-decorator' +import { UserStore } from '@store' +import { tools } from '../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' + +import { ISignupIscrizioneConacreisOptions } from 'model' +import { validations, ISignupConacreis } from './CSignUpIscrizioneConacreis-validate' + +import { validationMixin } from 'vuelidate' + +import { Logo } from '../../components/logo' +import { DefaultProfile } from '../../store/Modules/UserStore' + +// import 'vue-country-code/dist/vue-country-code.css' +import { serv_constants } from '@src/store/Modules/serv_constants' + +import VueCountryCode from 'vue-country-code' +import { registereduser } from '../../validation' +import MixinBase from '../../mixins/mixin-base' +import { CTitleBanner } from '../CTitleBanner' +import { CDate } from '../../components/CDate' +import { date } from 'quasar' +import { CMyPage } from '@src/components/CMyPage' +import MixinUsers from '@src/mixins/mixin-users' + +Vue.use(VueCountryCode) +// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar' + +@Component({ + name: 'CSignUpIscrizioneConacreis', + mixins: [validationMixin], + validations, + components: { Logo, CTitleBanner, CDate, CMyPage } +}) + +export default class CSignUpIscrizioneConacreis extends MixinUsers { + public $v + public $q + public $t: any + public countryname: string = '' + public iamadult: boolean = false + + public duplicate_email: boolean = false + public duplicate_username: boolean = false + + public signup: ISignupIscrizioneConacreisOptions = { + accetta_carta_costituzionale_on: false, + newsletter_on: false, + terms: false + } + + public created() { + if (!!this.getMyUsername()) { + this.signup.name = UserStore.state.my.name + this.signup.surname = this.mySurname.toString() + this.signup.email = this.Email + this.signup.cell_phone = this.myCell.toString() + } + this.$v.$reset() + } + + get allowSubmit() { + + const error = this.$v.$error || this.$v.$invalid + + // console.log('v', this.$v, 'error', error, 'terms', this.signup.terms, 'carta', this.signup.accetta_carta_costituzionale_on) + return !error && this.signup.terms && this.signup.accetta_carta_costituzionale_on + } + + public env() { + return process.env + } + + public setDateOfBirth(param) { + console.log('param', param) + // this.signup.dateofbirth = tools.convertstrtoDate(arguments[0]) + this.signup.dateofbirth = new Date(arguments[0]) + } + + public errorMsg(cosa: string, item: any) { + try { + if (!item.$error) { + return '' + } + console.log('item', item) + // console.log('errorMsg', cosa, item) + if (item.$params.email && !item.email) { + return this.$t('reg.err.email') + } + + // console.log('item', item) + + if (item.minLength !== undefined) { + if (!item.minLength) { + return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char') + } + } + if (item.complexity !== undefined) { + if (!item.complexity) { + return this.$t('reg.err.complexity') + } + } +// if (!item.maxLength) { return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') } + + if (item.required !== undefined) { + if (!item.required) { + return this.$t('reg.err.required') + } + } + + // console.log(' ....avanti') + if (cosa === 'email') { + // console.log("EMAIL " + item.isUnique); + // console.log(item); + if (!item.isUnique) { + return this.$t('reg.err.duplicate_email') + } + } else if (cosa === 'username') { + // console.log(item); + console.log('username') + console.log(item.$error) + if (!item.isUnique) { + return this.$t('reg.err.duplicate_username') + } + } else if ((cosa === 'name') || (cosa === 'surname')) { + // console.log(item); + } + + return '' + } catch (error) { + // console.log("ERR : " + error); + } + } + + public submitOk() { + this.$v.signup.$touch() + + this.signup.email = tools.removespaces(this.signup.email) + this.signup.email = this.signup.email.toLowerCase() + + this.signup.residency_country = tools.CapitalizeAllWords(this.signup.residency_country) + this.signup.residency_address = tools.CapitalizeAllWords(this.signup.residency_address) + this.signup.residency_city = tools.CapitalizeAllWords(this.signup.residency_city) + this.signup.residency_province = this.signup.residency_province.toUpperCase() + + this.duplicate_email = false + this.duplicate_username = false + + if (!this.signup.terms) { + tools.showNotif(this.$q, this.$t('reg.err.terms')) + return + } + + if (!this.signup.accetta_carta_costituzionale_on) { + tools.showNotif(this.$q, this.$t('reg.err.accetta_carta_costituzionale_on')) + return + } + + if (this.$v.signup.$error) { + tools.showNotif(this.$q, this.$t('reg.err.errore_generico')) + return + } + + this.signup.name = tools.CapitalizeAllWords(this.signup.name) + this.signup.surname = tools.CapitalizeAllWords(this.signup.surname) + this.signup.annoTesseramento = 2021 + + this.$q.loading.show({ message: this.$t('reg.iscrizioneincorso') }) + + console.log(this.signup) + return UserStore.actions.iscrivitiConacreis(tools.clone(this.signup)) + .then((ris) => { + if (tools.SignUpcheckErrors(this, ris.code, ris.msg)) + this.$q.loading.hide() + }).catch((error) => { + console.log('ERROR = ' + error) + this.$q.loading.hide() + }) + + } + + public selectcountry({ name, iso2, dialCode }) { + // console.log(name, iso2, dialCode) + this.signup.residency_country = iso2 + this.countryname = name + } + +} diff --git a/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.vue b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.vue new file mode 100755 index 0000000..e4d0408 --- /dev/null +++ b/src/components/CSignUpIscrizioneConacreis/CSignUpIscrizioneConacreis.vue @@ -0,0 +1,233 @@ + + + + diff --git a/src/components/CSignUpIscrizioneConacreis/index.ts b/src/components/CSignUpIscrizioneConacreis/index.ts new file mode 100755 index 0000000..eb839c7 --- /dev/null +++ b/src/components/CSignUpIscrizioneConacreis/index.ts @@ -0,0 +1 @@ +export {default as CSignUpIscrizioneConacreis} from './CSignUpIscrizioneConacreis.vue' diff --git a/src/components/CSigninNoreg/CSigninNoreg.vue b/src/components/CSigninNoreg/CSigninNoreg.vue index fd7a267..c562340 100755 --- a/src/components/CSigninNoreg/CSigninNoreg.vue +++ b/src/components/CSigninNoreg/CSigninNoreg.vue @@ -3,7 +3,7 @@ diff --git a/src/components/CVideoPromo/CVideoPromo.vue b/src/components/CVideoPromo/CVideoPromo.vue index 215302d..98bdc4b 100755 --- a/src/components/CVideoPromo/CVideoPromo.vue +++ b/src/components/CVideoPromo/CVideoPromo.vue @@ -10,27 +10,12 @@ myclass="myshad" canopen="true" :visible="true">
-
- -
-
- -
+
-
- +
+
-
- -
-
- -
-
- -
-
diff --git a/src/components/Header/Header.scss b/src/components/Header/Header.scss index 87b4fc4..8eb8d70 100755 --- a/src/components/Header/Header.scss +++ b/src/components/Header/Header.scss @@ -213,9 +213,6 @@ canvas { display: none !important; } -.underline { - text-decoration: underline; -} .toolbar { min-height: 43px; diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 0b6ec39..a9299bd 100755 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -71,6 +71,9 @@ export default class Header extends Vue { get isSocioResidente() { return UserStore.state.my.profile.socioresidente } + get isConsiglio() { + return UserStore.state.my.profile.consiglio + } get getcolormenu() { return this.isSocio ? 'green-7' : 'white' @@ -379,7 +382,7 @@ export default class Header extends Vue { }) } - get static_data(){ + get static_data() { return static_data } @@ -412,8 +415,8 @@ export default class Header extends Vue { } get getnumOrdersCart() { - // const arrorderscart = Products.state.orders.filter((rec) => rec.status < shared_consts.OrderStatus.RECEIVED) - const arrorderscart = Products.state.orders + const arrorderscart = Products.state.orders.filter((rec) => rec.status < shared_consts.OrderStatus.RECEIVED) + // const arrorderscart = Products.state.orders if (!!arrorderscart) { return arrorderscart.length } diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue index 8a79273..b5e02c6 100755 --- a/src/components/Header/Header.vue +++ b/src/components/Header/Header.vue @@ -183,9 +183,10 @@
Admin
Socio
Residente
+
Consiglio
Segreteria
Tutor
-
Traduttrici
+
Editor
{{ $t('user.loggati') }} @@ -208,8 +209,9 @@
+
- +
diff --git a/src/components/index.ts b/src/components/index.ts index 4e7c460..b34dbcd 100755 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -26,6 +26,7 @@ export * from './CSignIn' export * from './CSignUp' export * from './CSignUpNotevole' export * from './CSignUpSIP' +export * from './CSignUpIscrizioneConacreis' export * from './CEventsCalendar' export * from './CMySingleEvent' export * from './CDate' diff --git a/src/globalroutines/index.ts b/src/globalroutines/index.ts index 7fdaffa..aac2255 100755 --- a/src/globalroutines/index.ts +++ b/src/globalroutines/index.ts @@ -2,10 +2,12 @@ import indexdb from './indexdb' import { GlobalStore } from '../store/Modules' export default async (context, cmd, table, data = null, id = '') => { - const descr = data !== null ? data.descr : '' + // const descr = data !== null ? data.descr : '' // console.log('globalroutines', cmd, table, descr, id) - return await indexdb(context, cmd, table, data, id) + return indexdb(context, cmd, table, data, id) .then((ris) => { + console.log('GlobalStore.state.connData', GlobalStore.state.connData) + setTimeout(() => { GlobalStore.state.connData.uploading_indexeddb = 0 GlobalStore.state.connData.downloading_indexeddb = 0 diff --git a/src/globalroutines/indexdb.ts b/src/globalroutines/indexdb.ts index c9154ba..4b4eec6 100755 --- a/src/globalroutines/indexdb.ts +++ b/src/globalroutines/indexdb.ts @@ -89,41 +89,46 @@ function testfunc2() { export default async (context, cmd, table, datakey = null, id = '') => { - // console.log('TABLE', table, 'cmd', cmd) - if (cmd === 'loadapp') { - // ****** LOAD APP AL CARICAMENTO ! ******* - return saveConfigIndexDb(context) + try { + // console.log('TABLE', table, 'cmd', cmd) + if (cmd === 'loadapp') { + // ****** LOAD APP AL CARICAMENTO ! ******* + return saveConfigIndexDb(context) - } else if (cmd === 'write') { - if (GlobalStore) { - GlobalStore.state.connData.uploading_indexeddb = 1 + } else if (cmd === 'write') { + if (GlobalStore) { + GlobalStore.state.connData.uploading_indexeddb = 1 + } + return await storage.setdata(table, datakey) + } else if (cmd === 'updatefromIndexedDbToState') { + return await readfromIndexDbToState(context, table) + } else if (cmd === 'readall') { + if (GlobalStore) { + GlobalStore.state.connData.downloading_indexeddb = 1 + console.log('getalldata table', table) + } + return await storage.getalldata(table) + } else if (cmd === 'count') { + return await storage.count(table) + } else if (cmd === 'read') { + if (GlobalStore) { + GlobalStore.state.connData.downloading_indexeddb = 1 + } + return await storage.getdata(table, id) + } else if (cmd === 'delete') { + if (GlobalStore) { + GlobalStore.state.connData.uploading_indexeddb = 1 + } + return await storage.deletedata(table, id) + } else if (cmd === 'clearalldata') { + if (GlobalStore) { + GlobalStore.state.connData.uploading_indexeddb = 1 + } + return await storage.clearalldata(table) + } else if (cmd === 'log') { + consolelogpao(table) } - return await storage.setdata(table, datakey) - } else if (cmd === 'updatefromIndexedDbToState') { - return await readfromIndexDbToState(context, table) - } else if (cmd === 'readall') { - if (GlobalStore) { - GlobalStore.state.connData.downloading_indexeddb = 1 - } - return await storage.getalldata(table) - } else if (cmd === 'count') { - return await storage.count(table) - } else if (cmd === 'read') { - if (GlobalStore) { - GlobalStore.state.connData.downloading_indexeddb = 1 - } - return await storage.getdata(table, id) - } else if (cmd === 'delete') { - if (GlobalStore) { - GlobalStore.state.connData.uploading_indexeddb = 1 - } - return await storage.deletedata(table, id) - } else if (cmd === 'clearalldata') { - if (GlobalStore) { - GlobalStore.state.connData.uploading_indexeddb = 1 - } - return await storage.clearalldata(table) - } else if (cmd === 'log') { - consolelogpao(table) + } catch (e) { + console.error('error INDEXdb', e); } } diff --git a/src/js/storage.js b/src/js/storage.js index 2f30542..7e4a47f 100755 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -17,14 +17,15 @@ export let idbKeyval = (() => { openreq.onupgradeneeded = () => { // First time setup: create an empty object store for (let mytab of ApiTables.MainTables) { - openreq.result.createObjectStore(mytab, { keyPath: '_id' }); + openreq.result.createObjectStore(mytab, { keyPath: 'BOMID', autoIncrement: true }); for (let mymeth of ApiTables.allMethod) { const tab = mymeth + mytab - openreq.result.createObjectStore(tab, { keyPath: '_id' }); + openreq.result.createObjectStore(tab, { keyPath: 'BOMID', autoIncrement: true }); } } for (let mytab of ApiTables.OtherTables) { - openreq.result.createObjectStore(mytab, { keyPath: '_id' }); + console.log('mytab', mytab); + openreq.result.createObjectStore(mytab, { keyPath: 'BOMID', autoIncrement: true }); } }; diff --git a/src/layouts/menuone/menuOne.ts b/src/layouts/menuone/menuOne.ts index 08bac7a..906360f 100755 --- a/src/layouts/menuone/menuOne.ts +++ b/src/layouts/menuone/menuOne.ts @@ -85,12 +85,14 @@ export default class MenuOne extends Vue { menu += ' isManager' if (elem.onlySocioResidente) menu += ' isSocioResidente' + if (elem.onlyConsiglio) + menu += ' isConsiglio' if (elem.onlyDepartment) menu += ' isDepartment' if (elem.onlyTutor) menu += ' isTutor' - if (elem.onlyTraduttrici) - menu += ' isTraduttrici' + if (elem.onlyEditor) + menu += ' isEditor' } diff --git a/src/mixins/mixin-users.ts b/src/mixins/mixin-users.ts index af7269b..d05fe67 100755 --- a/src/mixins/mixin-users.ts +++ b/src/mixins/mixin-users.ts @@ -96,6 +96,10 @@ export default class MixinUsers extends Vue { return UserStore.state.my.surname } + get myCell() { + return UserStore.state.my.profile.cell + } + get Verificato() { return UserStore.state.my.verified_email } diff --git a/src/model/Calendar.ts b/src/model/Calendar.ts index 37f559a..8b1c129 100755 --- a/src/model/Calendar.ts +++ b/src/model/Calendar.ts @@ -26,6 +26,7 @@ export interface IEvents { nobookable?: boolean lunchAvailable?: boolean dinnerAvailable?: boolean + dinnerSharedAvailable?: boolean lunchType?: number dinnerType?: number lunchPrice?: number @@ -45,6 +46,7 @@ export interface IBookedEvent { numpeople: number numpeopleLunch?: number numpeopleDinner?: number + numpeopleDinnerShared?: number infoevent: string msgbooking: string datebooked?: Date diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index b7bec39..5ebeec8 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -69,18 +69,46 @@ export interface IMyPage { path?: string keywords?: string description?: string + img1?: string content?: string + video1?: string + img2?: string + content2?: string + video2?: string + img3?: string + content3?: string + video3?: string + content4?: string active?: boolean inmenu?: boolean color?: string onlyif_logged?: boolean only_residenti?: boolean + only_consiglio?: boolean submenu?: boolean l_par?: number, l_child?: number, infooter?: boolean } +export interface ISites { + _id?: string + attiva?: boolean + idapp?: string + name?: string + adminemail?: string + manageremail?: string + replyTo?: string + host?: string + portapp?: string + dir?: string + email_from?: string + email_pwd?: string + telegram_key?: string + telegram_bot_name?: string + pathreg_add?: string +} + export interface INewsToSent { _id: string idapp?: string @@ -228,10 +256,12 @@ export interface IListRoutes { onlyif_logged?: boolean onlyManager?: boolean onlySocioResidente?: boolean + onlyConsiglio?: boolean + onlyNotSoci?: boolean onlyDepartment?: boolean onlyTutor?: boolean color?: string - onlyTraduttrici?: boolean + onlyEditor?: boolean extraclass?: string meta?: any idelem?: string diff --git a/src/model/Products.ts b/src/model/Products.ts index f83097e..60c304e 100755 --- a/src/model/Products.ts +++ b/src/model/Products.ts @@ -1,5 +1,6 @@ export interface IProduct { _id?: any + active?: boolean idProducer?: string, idStorehouses?: string[], producer?: IProducer, @@ -111,9 +112,11 @@ export interface IOrderCart { totalPrice?: number department?: string items?: IBaseOrder[] + nameSurname?: string status?: number note?: string modify_at?: Date + completed_at?: Date } export interface IShareWithUs { diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts index f79c032..1d96ae4 100755 --- a/src/model/UserStore.ts +++ b/src/model/UserStore.ts @@ -123,7 +123,7 @@ export interface IUserState { isDepartment?: boolean isTutor?: boolean isZoomeri?: boolean - isTraduttrici?: boolean + isEditor?: boolean isTeacher?: boolean usersList?: IUserFields[] countusers?: number diff --git a/src/model/signup-option.ts b/src/model/signup-option.ts index 672ed5f..e66ad56 100755 --- a/src/model/signup-option.ts +++ b/src/model/signup-option.ts @@ -13,3 +13,30 @@ export interface ISignupOptions { profile?: IUserProfile // already_registered: boolean } + +export interface ISignupIscrizioneConacreisOptions { + userId?: string + name?: string + surname?: string + email?: string + fiscalcode?: string + residency_address?: string + residency_city?: string + residency_province?: string + residency_country?: string + residency_zipcode?: string + dateofbirth?: Date + cell_phone?: string + newsletter_on?: boolean + accetta_carta_costituzionale_on?: boolean + iscrizione_compilata?: boolean + annoTesseramento?: number + motivazioni?: string + competenze_professionalita?: string + cosa_potrei_offrire?: string + cosa_vorrei_ricevere?: string + altre_comunicazioni?: string + come_ci_hai_conosciuto?: string + terms?: boolean + note?: string +} diff --git a/src/rootgen/admin/eventlist/eventlist.ts b/src/rootgen/admin/eventlist/eventlist.ts index 84113cd..7d04d87 100755 --- a/src/rootgen/admin/eventlist/eventlist.ts +++ b/src/rootgen/admin/eventlist/eventlist.ts @@ -51,7 +51,7 @@ export default class Eventlist extends Vue { let add = true if (!this.showall) { - add = CalendarStore.getters.getNumParticipants(myevent, this.showall, 0) > 0 + add = CalendarStore.getters.getNumParticipants(myevent, this.showall, tools.peopleWhere.participants) > 0 } if (add) { @@ -78,7 +78,7 @@ export default class Eventlist extends Vue { eventsloc.reverse() } - return eventsloc + return eventsloc.filter((rec) => rec.title !== '') } public getNumEvent() { @@ -96,7 +96,7 @@ export default class Eventlist extends Vue { let add = true if (!this.showall) { - add = CalendarStore.getters.getNumParticipants(myevent, this.showall, 0) > 0 + add = CalendarStore.getters.getNumParticipants(myevent, this.showall, tools.peopleWhere.participants) > 0 } if (add) { diff --git a/src/rootgen/admin/eventlist/eventlist.vue b/src/rootgen/admin/eventlist/eventlist.vue index a275558..7047326 100755 --- a/src/rootgen/admin/eventlist/eventlist.vue +++ b/src/rootgen/admin/eventlist/eventlist.vue @@ -29,6 +29,9 @@ {{ $t('cal.selnumpeopleDinner') }} + + {{ $t('cal.selnumpeopleDinnerShared') }} + {{ $t('cal.peoplebooked') }} @@ -46,16 +49,20 @@
-
{{ getNumParticipants(event, showall, '') }}
+
{{ getNumParticipants(event, showall, tools.peopleWhere.participants) }}
-
{{ getNumParticipants(event, showall, 'lunch') }}
+
{{ getNumParticipants(event, showall, tools.peopleWhere.lunch) }}
-
{{ getNumParticipants(event, showall, 'dinner') }}
+
{{ getNumParticipants(event, showall, tools.peopleWhere.dinner) }}
+ +
{{ getNumParticipants(event, showall, tools.peopleWhere.dinnerShared) }}
+ + - Data Messaggio - Num + Partec Azione @@ -96,13 +103,10 @@ {{ eventbook.msgbooking }} - {{ eventbook.numpeople }} - - - {{ eventbook.numpeopleLunch }} - - - {{ eventbook.numpeopleDinner }} + Partecipanti: {{ eventbook.numpeople }}
+ Pranzo: {{ eventbook.numpeopleLunch }}
+ Cena: {{ eventbook.numpeopleDinner }}
+ Cena Condivisa: {{ eventbook.numpeopleDinnerShared }}
+ + {{ setmeta({ + title: 'Iscritti Conacreis', + description: "", + keywords: '' } ) }} + + + +
+ + + + +
+
+ + + diff --git a/src/rootgen/admin/sites/sites.scss b/src/rootgen/admin/sites/sites.scss new file mode 100755 index 0000000..e69de29 diff --git a/src/rootgen/admin/sites/sites.ts b/src/rootgen/admin/sites/sites.ts new file mode 100755 index 0000000..5a8d01a --- /dev/null +++ b/src/rootgen/admin/sites/sites.ts @@ -0,0 +1,44 @@ +import Vue from 'vue' +import { Component, Prop } from 'vue-property-decorator' +import { GlobalStore, UserStore } from '@store' + +import { tools } from '../../../store/Modules/tools' +import { toolsext } from '../../../store/Modules/toolsext' +import { static_data } from '../../../db/static_data' +import { Screen } from 'quasar' + +import { colTableSites } from '@src/store/Modules/fieldsTable' + +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' + +@Component({ + mixins: [MixinBase], + components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec } +}) +export default class SitesPage extends MixinMetaTags { + public pagination = { + sortBy: 'name', + descending: false, + page: 2, + rowsPerPage: 5 + // rowsNumber: xx if getting data from a server + } + + public selected = [] + public dataPages = [] + + get getcolSites() { + return colTableSites + } + + public meta() { + return tools.metafunc(this) + } + + get static_data() { + return static_data + } +} diff --git a/src/rootgen/admin/sites/sites.vue b/src/rootgen/admin/sites/sites.vue new file mode 100755 index 0000000..e39afa1 --- /dev/null +++ b/src/rootgen/admin/sites/sites.vue @@ -0,0 +1,28 @@ + + + diff --git a/src/statics/lang/es.js b/src/statics/lang/es.js index dbf504f..6e11eff 100755 --- a/src/statics/lang/es.js +++ b/src/statics/lang/es.js @@ -219,7 +219,7 @@ const msg_es = { nave_in_chiusura: 'Cierre Gift Chat', nave_partita: 'partió en', tutor: 'Tutor', - traduttrici: 'Traduttrici', + Editor: 'Editor', /*Cuando te conviertes en Mediador vienes contactado por un TUTOR, con él debes:
    ' + '
  1. Abrir tu Gift Chat (tu como propietario, y el Tutor ' + 'como administrador) con este nombre:
    {nomenave}
  2. ' + diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 9fe4e8a..f514185 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -40,6 +40,7 @@ const msg_it = { eventlist: 'Le tue Prenotazioni', usereventlist: 'Prenotazioni Utenti', userlist: 'Lista Utenti', + iscritticonacreis: "Iscritti Conacreis", zoomlist: 'Calendario Zoom', extralist: 'Lista Extra', dbop: 'Db Operations', @@ -186,6 +187,7 @@ const msg_it = { login: { facebook: 'Facebook' }, + iscrizione_ok: 'Iscrizione Avvenuta Correttamente', email_verification: { title: 'Inizia la tua registrazione', introduce_email: 'inserisci la tua email', @@ -247,7 +249,7 @@ const msg_it = { nave_in_chiusura: 'Chiusura Gift Chat', nave_partita: 'Partita il', tutor: 'Tutor', - traduttrici: 'Traduttrici', + Editor: 'Editor', zoomeri: 'Zoomeri', /* sonomediatore: 'Quando diventi Meditore vieni contattato da un TUTOR, con lui devi:
      ' + '
    1. Aprire la tua Gift Chat (tu come proprietario e il Tutor ' + @@ -324,6 +326,7 @@ const msg_it = { reg: { socio: 'Socio', socioresidente: 'Residente', + consiglio: 'Consiglio', volta: 'volta', volte: 'volte', registered: 'Registrato', @@ -364,10 +367,11 @@ const msg_it = { made_gift: 'Dono', note: 'Note', incorso: 'Registrazione in corso...', + iscrizioneincorso: 'Iscrizione in corso...', richiesto: 'Campo Richiesto', email: 'Email', intcode_cell: 'Prefisso Int.', - cell: 'Cellulare Telegram', + cell: 'Cellulare', cellreg: 'Cellulare con cui ti eri registrato', nationality: 'Nazionalità', email_paypal: 'Email Paypal', @@ -422,6 +426,16 @@ const msg_it = { resp: "Responsabile", viceResp: "Vice Rrsponsabile", userslist: "Lista Persone", + fiscalcode: "Codice Fiscale", + residency_address: "Indirizzo di Residenza", + residency_city: "Città di Residenza", + residency_province: "Provincia", + residency_zipcode: "CAP", + dateofbirth: "Data di Nascita", + newsletter_on: "Aggiungimi alla Newsletter", + accetta_carta_costituzionale_on: "Ho letto ed Approvo il Progetto", + iscriviti: "Iscriviti", + err: { required: 'è richiesto', email: 'inserire una email valida', @@ -442,6 +456,7 @@ const msg_it = { aportador_regalare_not_exist: 'Inserire l\'Username della persona che si vuole regalare l\'invitato', invitante_username_not_exist: 'Inserire l\'Username della persona che fa da invitante', sameaspassword: 'Le password devono essere identiche', + accetta_carta_costituzionale_on: 'Occorre accettare la sintesi della Carta Costituzionale', }, tips: { email: 'inserisci la tua email', @@ -470,7 +485,7 @@ const msg_it = { errato: "Username o password errata. Riprovare", subaccount: "Questo account è stato accorpato con il vostro Principale. Eseguire l'accesso utilizzando l'username (o email) del PRIMO account.", completato: 'Login effettuato!', - needlogin: 'E\' necessario effettuare il login prima di continuare' + needlogin: 'E\' necessario registrarsi al sito ed effettuare l\'Accesso con i propri dati' }, reset: { title_reset_pwd: "Reimposta la tua Password", @@ -594,8 +609,10 @@ const msg_it = { selnumpeople: 'Partecipanti', Lunch: 'Pranzo', Dinner: 'Cena', + DinnerShared: 'Cena Condivisa', selnumpeopleLunch: 'Persone a Pranzo', selnumpeopleDinner: 'Persone a Cena', + selnumpeopleDinnerShared: 'Persone a Cena Condivisa', selnumpeople_short: 'Num', msgbooking: 'Messaggio da inviare', showpdf: 'Vedi PDF', @@ -640,6 +657,7 @@ const msg_it = { internal: 'Evento Interno', lunchAvailable: 'Disponibilità di Pranzare', dinnerAvailable: 'Disponibilità di Cenare', + dinnerSharedAvailable: 'Disponibilità di Cenare Condivisa', lunchType: 'Tipo di Pranzo', dinnerType: 'Tipo di Cena', lunchPrezzo: 'Contributo Pranzo', diff --git a/src/store/Modules/ApiTables.ts b/src/store/Modules/ApiTables.ts index c386c79..300a809 100755 --- a/src/store/Modules/ApiTables.ts +++ b/src/store/Modules/ApiTables.ts @@ -6,7 +6,7 @@ import { serv_constants } from '@src/store/Modules/serv_constants' import { tools } from '@src/store/Modules/tools' import { toolsext } from '@src/store/Modules/toolsext' -export const OtherTables = ['categories', 'config', 'swmsg'] +export const OtherTables = ['config', 'swmsg'] // export const MainTables = ['todos', 'projects'] export const MainTables = [] export const allMethod = ['sync_post_', 'sync_patch_', 'delete_', 'hide_'] diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 14f916a..b21e489 100755 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -769,6 +769,38 @@ namespace Actions { }) } + async function loadPage(context, path: string) { + + path = path.substring(1) + const mypage = GlobalStore.getters.getPage('/' + path) + + // Controlla se l'ho già caricato + if (!!mypage && !!mypage.content) { + return mypage + } + + console.log('loadPage', path) + + return await Api.SendReq('/getpage', 'POST', { path }) + .then((res) => { + // console.table(res) + if (res) { + const index = GlobalStore.state.mypage.findIndex((rec) => rec.path === path) + if (index >= 0) { + GlobalStore.state.mypage[index] = res.data.mypage + } + return res.data.mypage + } else { + return null + } + }) + .catch((error) => { + console.log('error loadTable', error) + UserStore.mutations.setErrorCatch(error) + return null + }) + } + async function saveTable(context, mydata: object) { // console.log('saveTable', mydata) @@ -1228,11 +1260,13 @@ namespace Actions { component: () => import('@/root/mypage/mypage.vue'), inmenu: page.inmenu, onlySocioResidente: page.only_residenti, + onlyConsiglio: page.only_consiglio, color: page.color, infooter: page.infooter, onlyif_logged: page.onlyif_logged, level_child: page.l_child, - level_parent: page.l_par + level_parent: page.l_par, + submenu: page.submenu }) } } @@ -1316,6 +1350,7 @@ namespace Actions { askFunz: b.dispatch(askFunz), sendPushNotif: b.dispatch(sendPushNotif), loadTable: b.dispatch(loadTable), + loadPage: b.dispatch(loadPage), saveTable: b.dispatch(saveTable), DeleteRec: b.dispatch(DeleteRec), DeleteFile: b.dispatch(DeleteFile), diff --git a/src/store/Modules/Products.ts b/src/store/Modules/Products.ts index bf292b5..e865200 100755 --- a/src/store/Modules/Products.ts +++ b/src/store/Modules/Products.ts @@ -73,11 +73,22 @@ namespace Getters { return state.cart }, 'getCart') + const getOrdersAllCart = b.read((stateparamf: IProductsState) => (): IOrderCart[] => { + return state.orders + }, 'getOrdersAllCart') + const getOrdersCart = b.read((stateparamf: IProductsState) => (tipoord: string): IOrderCart[] => { + console.log('state.orders', state.orders) if (tipoord === 'incorso') return state.orders.filter((rec) => rec.status <= shared_consts.OrderStatus.CHECKOUT_SENT) - else - return state.orders.filter((rec) => rec.status < shared_consts.OrderStatus.RECEIVED && rec.status > shared_consts.OrderStatus.CHECKOUT_SENT) + else if (tipoord === 'confermati') + return state.orders.filter((rec) => rec.status === shared_consts.OrderStatus.ORDER_CONFIRMED) + else if (tipoord === 'pagati') + return state.orders.filter((rec) => rec.status === shared_consts.OrderStatus.PAYED) + else if (tipoord === 'completati') + return state.orders.filter((rec) => rec.status === shared_consts.OrderStatus.RECEIVED) + else if (tipoord === 'cancellati') + return state.orders.filter((rec) => rec.status === shared_consts.OrderStatus.CANCELED) }, 'getOrdersCart') const existProductInCart = b.read((stateparamf: IProductsState) => (idproduct): boolean => { @@ -93,6 +104,7 @@ namespace Getters { const objproduct: IProduct = { // _id: tools.getDateNow().toISOString(), // Create NEW + active: false, idProducer: '', idStorehouses: [], producer: null, @@ -130,6 +142,9 @@ namespace Getters { get getOrdersCart() { return getOrdersCart() }, + get getOrdersAllCart() { + return getOrdersAllCart() + }, get existProductInCart() { return existProductInCart() }, @@ -365,12 +380,35 @@ namespace Actions { return ris } + async function UpdateOrderStatus(context, { order_id, status }) { + + if (!static_data.functionality.ENABLE_ECOMMERCE) + return null + + // console.log('addSubQtyToItem', 'userid=', UserStore.state.my._id, order) + + let ris = null + + ris = await Api.SendReq('/cart/' + UserStore.state.my._id + '/orderstatus', 'POST', { order_id, status }) + .then((res) => { + return res.data.status + }) + .catch((error) => { + console.log('error UpdateOrderStatus', error) + UserStore.mutations.setErrorCatch(error) + return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, tools.ERR_GENERICO, error) + }) + + return ris + } + export const actions = { loadProduct: b.dispatch(loadProduct), loadProducts: b.dispatch(loadProducts), addToCart: b.dispatch(addToCart), addSubQtyToItem: b.dispatch(addSubQtyToItem), UpdateStatusCart: b.dispatch(UpdateStatusCart), + UpdateOrderStatus: b.dispatch(UpdateOrderStatus), removeFromCart: b.dispatch(removeFromCart), loadOrders: b.dispatch(loadOrders), } diff --git a/src/store/Modules/Store/calendar/CalendarStore.ts b/src/store/Modules/Store/calendar/CalendarStore.ts index ba1440c..e5cd476 100755 --- a/src/store/Modules/Store/calendar/CalendarStore.ts +++ b/src/store/Modules/Store/calendar/CalendarStore.ts @@ -54,12 +54,24 @@ namespace Getters { return mystate.bookedevent.find((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.userId === UserStore.state.my._id) && ((isconfirmed && bookedevent.booked) || (!isconfirmed))) }, 'findEventBooked') - const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents, showall, tipo) => { - const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.my._id) ) && ((tipo === '') || ((tipo === 'lunch' && bookedevent.numpeopleLunch) || (tipo === 'dinner' && bookedevent.numpeopleDinner) ))) - if (myarr) - return myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0) - else + 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) ))) + if (myarr.length > 0) { + let ris = null + if (tipo === tools.peopleWhere.participants) { + ris = myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0) + }else if (tipo === tools.peopleWhere.lunch) { + ris = myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeopleLunch, 0) + }else if (tipo === tools.peopleWhere.dinner) { + ris = myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeopleDinner, 0) + }else if (tipo === tools.peopleWhere.dinnerShared) { + ris = myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeopleDinnerShared, 0) + } + + return ris + } else { return 0 + } }, 'getNumParticipants') const getEventsBookedByIdEvent = b.read((mystate: ICalendarState) => (idevent, showall) => { @@ -67,8 +79,7 @@ namespace Getters { }, 'getEventsBookedByIdEvent') const getWhereRec = b.read((mystate: ICalendarState) => (wherecode) => { - const whererec = mystate.wheres.find((mywhere) => mywhere.code === wherecode) - return (whererec) + return mystate.wheres.find((mywhere) => mywhere.code === wherecode) }, 'getWhereRec') @@ -159,6 +170,7 @@ namespace Actions { numpeople: bookevent.numpeople, numpeopleLunch: bookevent.numpeopleLunch, numpeopleDinner: bookevent.numpeopleDinner, + numpeopleDinnerShared: bookevent.numpeopleDinnerShared, msgbooking: bookevent.msgbooking, datebooked: bookevent.datebooked, userId: UserStore.state.my._id, @@ -172,9 +184,10 @@ namespace Actions { const param = getparambyevent(bookevent) - return await Api.SendReq('/booking', 'POST', param) + return Api.SendReq('/booking', 'POST', param) .then((res) => { if (res.status === 200) { + console.log('datares', res.data); if (res.data.code === serv_constants.RIS_CODE_OK) { bookevent._id = res.data.id if (bookevent.modified) { diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts index 53ccead..a219d39 100755 --- a/src/store/Modules/UserStore.ts +++ b/src/store/Modules/UserStore.ts @@ -1,5 +1,13 @@ import Api from '@api' -import { ISignupOptions, ISigninOptions, IUserState, IUserFields, IUserProfile, ICalcStat } from 'model' +import { + ISignupOptions, + ISigninOptions, + IUserState, + IUserFields, + IUserProfile, + ICalcStat, + ISignupIscrizioneConacreisOptions +} from 'model' import { ILinkReg, IResult, IIdToken, IToken } from 'model/other' import { storeBuilder } from './Store/Store' import router from '@router' @@ -107,7 +115,7 @@ const state: IUserState = { isDepartment: false, isTutor: false, isZoomeri: false, - isTraduttrici: false, + isEditor: false, usersList: [], countusers: 0, lastparamquery: {} @@ -345,7 +353,7 @@ namespace Mutations { mystate.isZoomeri = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Zoomeri.value) mystate.isDepartment = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Department.value) mystate.isTeacher = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Teacher.value) - mystate.isTraduttrici = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Traduttrici.value) + mystate.isEditor = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Editor.value) // console.log('authUser', 'state.isAdmin', mystate.isAdmin) // console.table(mystate) @@ -764,6 +772,30 @@ namespace Actions { }) } + async function iscrivitiConacreis(context, authData: ISignupIscrizioneConacreisOptions) { + console.log('iscrivitiConacreis') + + // console.log("PASSW: " + authData.password); + + Mutations.mutations.setServerCode(tools.CALLING) + + authData.userId = UserStore.state.my._id + + return Api.SendReq('/iscritti_conacreis', 'POST', authData) + .then((res) => { + if (res.status === 200) { + return { code: serv_constants.RIS_ISCRIZIONE_OK, msg: '' } + } else { + return { code: tools.ERR_GENERICO, msg: '' } + } + }).catch((error) => { + console.log('Err', error) + UserStore.mutations.setErrorCatch(error) + return { code: UserStore.getters.getServerCode, msg: UserStore.getters.getMsg } + }) + + } + async function signin(context, authData: ISigninOptions) { // console.log('LOGIN signin') @@ -791,7 +823,10 @@ namespace Actions { } const options = { - title: tools.translate('notification.title_subscribed', [{strin: 'sitename', strout: translate('ws.sitename')}]), + title: tools.translate('notification.title_subscribed', [{ + strin: 'sitename', + strout: translate('ws.sitename') + }]), content: translate('notification.subscribed'), openUrl: '/' } @@ -1068,6 +1103,7 @@ namespace Actions { resetpwd: b.dispatch(resetpwd), signin: b.dispatch(signin), signup: b.dispatch(signup), + iscrivitiConacreis: b.dispatch(iscrivitiConacreis), vreg: b.dispatch(vreg), unsubscribe: b.dispatch(unsubscribe), importemail: b.dispatch(importemail), diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index 2179d21..5e785b8 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -97,7 +97,19 @@ export const colmsg_templates = [ export const colmypage = [ AddCol({ name: 'title', label_trans: 'pages.title' }), + AddCol({ name: 'img1', label_trans: 'pages.img1' }), AddCol({ name: 'content', label_trans: 'pages.contentfield', fieldtype: tools.FieldType.html }), + AddCol({ name: 'video1', label_trans: 'pages.video1' }), + AddCol({ name: 'ratio1', label_trans: 'pages.ratio1' }), + AddCol({ name: 'img2', label_trans: 'pages.img2' }), + AddCol({ name: 'content2', label_trans: 'pages.content2', fieldtype: tools.FieldType.html }), + AddCol({ name: 'video2', label_trans: 'pages.video2' }), + AddCol({ name: 'ratio2', label_trans: 'pages.ratio2' }), + AddCol({ name: 'img3', label_trans: 'pages.img3' }), + AddCol({ name: 'content3', label_trans: 'pages.content3', fieldtype: tools.FieldType.html }), + AddCol({ name: 'video3', label_trans: 'pages.video3' }), + AddCol({ name: 'ratio3', label_trans: 'pages.ratio3' }), + AddCol({ name: 'content4', label_trans: 'pages.content4', fieldtype: tools.FieldType.html }), AddCol({ name: 'lang', label_trans: 'pages.lang' }), AddCol({ name: 'path', label_trans: 'pages.path' }), AddCol({ name: 'icon', label_trans: 'pages.icon' }), @@ -108,6 +120,7 @@ export const colmypage = [ AddCol({ name: 'color', label_trans: 'pages.color', fieldtype: tools.FieldType.string }), AddCol({ name: 'onlyif_logged', label_trans: 'pages.onlyif_logged', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'only_residenti', label_trans: 'pages.only_residenti', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'only_consiglio', label_trans: 'pages.only_consiglio', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'imgback', label_trans: 'pages.imgback', fieldtype: tools.FieldType.string }), AddCol({ name: 'active', label_trans: 'pages.active', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'inmenu', label_trans: 'pages.inmenu', fieldtype: tools.FieldType.boolean }), @@ -205,8 +218,8 @@ export const colTableHours = [ // AddCol({ name: 'todoId', label_trans: 'hours.todoId' }), AddCol({ name: 'date', label_trans: 'hours.date', fieldtype: tools.FieldType.onlydate }), AddCol({ name: 'hours', label_trans: 'hours.hours', fieldtype: tools.FieldType.hours }), - AddCol({ name: 'time_start', label_trans: 'hours.time_start', fieldtype: tools.FieldType.number }), - AddCol({ name: 'time_end', label_trans: 'hours.time_end', fieldtype: tools.FieldType.number }), + // AddCol({ name: 'time_start', label_trans: 'hours.time_start', fieldtype: tools.FieldType.number }), + // AddCol({ name: 'time_end', label_trans: 'hours.time_end', fieldtype: tools.FieldType.number }), AddCol({ name: 'descr', label_trans: 'hours.note' }), AddCol({ name: 'username', label_trans: 'reg.username_short', notShowInNewRec: true }), AddCol(DeleteRec), @@ -247,10 +260,56 @@ export const colTableStorehouse = [ AddCol(DuplicateRec) ] +export const colTableSites = [ + AddCol({ name: 'active', label_trans: 'sites.active', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'idapp', label_trans: 'sites.idapp', fieldtype: tools.FieldType.string }), + AddCol({ name: 'name', label_trans: 'sites.name', fieldtype: tools.FieldType.string }), + AddCol({ name: 'adminemail', label_trans: 'sites.adminemail', fieldtype: tools.FieldType.string }), + AddCol({ name: 'manageremail', label_trans: 'sites.manageremail', fieldtype: tools.FieldType.string }), + AddCol({ name: 'replyTo', label_trans: 'sites.replyTo', fieldtype: tools.FieldType.string }), + AddCol({ name: 'host', label_trans: 'sites.host', fieldtype: tools.FieldType.string }), + AddCol({ name: 'portapp', label_trans: 'sites.portapp', fieldtype: tools.FieldType.string }), + AddCol({ name: 'dir', label_trans: 'sites.dir', fieldtype: tools.FieldType.string }), + AddCol({ name: 'email_from', label_trans: 'sites.email_from', fieldtype: tools.FieldType.string }), + AddCol({ name: 'email_pwd', label_trans: 'sites.email_pwd', fieldtype: tools.FieldType.string }), + AddCol({ name: 'telegram_key', label_trans: 'sites.telegram_key', fieldtype: tools.FieldType.string }), + AddCol({ name: 'telegram_bot_name', label_trans: 'sites.telegram_bot_name', fieldtype: tools.FieldType.string }), + AddCol({ name: 'pathreg_add', label_trans: 'sites.pathreg_add', fieldtype: tools.FieldType.string }), + AddCol(DeleteRec), + AddCol(DuplicateRec) +] + +export const colTableIscrittiConacreis = [ + AddCol({ name: 'name', label_trans: 'reg.name', fieldtype: tools.FieldType.string }), + AddCol({ name: 'surname', label_trans: 'reg.surname', fieldtype: tools.FieldType.string }), + AddCol({ name: 'email', label_trans: 'reg.email', fieldtype: tools.FieldType.string }), + AddCol({ name: 'fiscalcode', label_trans: 'reg.fiscalcode', fieldtype: tools.FieldType.string }), + AddCol({ name: 'residency_address', label_trans: 'reg.residency_address', fieldtype: tools.FieldType.string }), + AddCol({ name: 'residency_city', label_trans: 'reg.residency_city', fieldtype: tools.FieldType.string }), + AddCol({ name: 'residency_province', label_trans: 'reg.residency_province', fieldtype: tools.FieldType.string }), + 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: '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: 'dateofreg', label_trans: 'reg.dateofreg', 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: '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 }) +] + export const colTableProducts = [ + AddCol({ name: 'active', label_trans: 'products.active', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'code', label_trans: 'products.code' }), AddCol({ name: 'name', label_trans: 'products.name' }), - AddCol({ name: 'description', label_trans: 'products.description' }), + AddCol({ name: 'description', label_trans: 'products.description', fieldtype: tools.FieldType.html }), AddCol({ name: 'icon', label_trans: 'products.icon' }), AddCol({ name: 'img', label_trans: 'products.img' }), // AddCol({ name: 'idProducer', label_trans: 'products.idProducer' }), @@ -592,7 +651,7 @@ export const fieldsTable = { getTableJoinByName(table) { if (table === 'permissions') - return [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Tutor, shared_consts.Permissions.Traduttrici, shared_consts.Permissions.Zoomeri, shared_consts.Permissions.Department] + return [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Tutor, shared_consts.Permissions.Editor, shared_consts.Permissions.Zoomeri, shared_consts.Permissions.Department] else if (table === 'accepted') return [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI] else if (table === 'fieldstype') @@ -841,16 +900,15 @@ export const fieldsTable = { colTableUsersCNM: [ // AddCol({ name: '_id', label_trans: 'reg.id' }), AddCol({ name: 'ind_order', label_trans: 'reg.ind_order' }), - AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: tools.FieldType.boolean }), - AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: tools.FieldType.boolean }), + // AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'username', label_trans: 'reg.username_short' }), AddCol({ name: 'name', label_trans: 'reg.name' }), AddCol({ name: 'surname', label_trans: 'reg.surname' }), AddCol({ name: 'email', label_trans: 'reg.email' }), - AddCol({ name: 'made_gift', label_trans: 'reg.made_gift', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', fieldtype: tools.FieldType.boolean }), + // AddCol({ name: 'made_gift', label_trans: 'reg.made_gift', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'note', label_trans: 'reg.note' }), // AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }), - AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'profile.resplist', field: 'profile', @@ -872,24 +930,9 @@ export const fieldsTable = { label_trans: 'reg.special_req', fieldtype: tools.FieldType.boolean }), - AddCol({ - name: 'profile.saw_and_accepted', - field: 'profile', - subfield: 'saw_and_accepted', - label_trans: 'reg.saw_and_accepted', - fieldtype: tools.FieldType.binary, - jointable: 'accepted' - }), AddCol({ name: 'profile.my_dream', field: 'profile', subfield: 'my_dream', label_trans: 'reg.my_dream' }), AddCol({ name: 'lang', field: 'lang', label_trans: 'reg.lang' }), AddCol({ name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality' }), - AddCol({ - name: 'profile.intcode_cell', - field: 'profile', - subfield: 'intcode_cell', - label_trans: 'reg.intcode_cell' - }), - AddCol({ name: 'profile.iso2_cell', field: 'profile', subfield: 'iso2_cell', label_trans: 'reg.iso2_cell' }), AddCol({ name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell' }), AddCol({ name: 'profile.email_paypal', @@ -897,7 +940,7 @@ export const fieldsTable = { subfield: 'email_paypal', label_trans: 'reg.email_paypal' }), - AddCol({ + /*AddCol({ name: 'profile.payeer_id', field: 'profile', subfield: 'payeer_id', @@ -914,14 +957,9 @@ export const fieldsTable = { field: 'profile', subfield: 'revolut', label_trans: 'revolut' - }), + }), */ AddCol({ name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id' }), - AddCol({ - name: 'profile.teleg_id_old', - field: 'profile', - subfield: 'teleg_id_old', - label_trans: 'reg.teleg_id_old' - }), + AddCol({ name: 'profile.teleg_checkcode', field: 'profile', @@ -949,13 +987,20 @@ export const fieldsTable = { label_trans: 'reg.socioresidente', fieldtype: tools.FieldType.boolean }), - AddCol({ name: 'profile.chisei', field: 'profile', subfield: 'chisei', label_trans: 'reg.chisei' }), AddCol({ - name: 'profile.iltuoimpegno', + name: 'profile.consiglio', field: 'profile', - subfield: 'iltuoimpegno', - label_trans: 'reg.iltuoimpegno' + subfield: 'consiglio', + 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.come_aiutare', field: 'profile', @@ -976,6 +1021,7 @@ export const fieldsTable = { // AddCol({ name: 'idapp', label_trans: 'reg.idapp', fieldtype: tools.FieldType.string }), AddCol({ name: 'perm', label_trans: 'reg.perm', fieldtype: tools.FieldType.binary, jointable: 'permissions' }), AddCol({ name: 'ipaddr', label_trans: 'reg.ipaddr' }), + AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: tools.FieldType.boolean }), AddCol(DeleteRec), AddCol(DuplicateRec) ], diff --git a/src/store/Modules/serv_constants.ts b/src/store/Modules/serv_constants.ts index 391bf6f..505a697 100755 --- a/src/store/Modules/serv_constants.ts +++ b/src/store/Modules/serv_constants.ts @@ -22,6 +22,7 @@ export const serv_constants = { RIS_CODE_OK: 1, RIS_CODE_LOGIN_OK: 1, + RIS_ISCRIZIONE_OK: 5, RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN: 403, RIS_CODE_TOKEN_RESETPASSWORD_NOT_FOUND: -23, diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index b8faf4c..256388b 100755 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -56,7 +56,7 @@ export const tools = { TABBED_HOME: 't-home', TABBED_NAVE: 't-nave', - getprefCountries: ['it', 'si', 'us', 'es', 'pt', 'uk', 'fr', 'de', 'ch', 'br', 'sk'], + getprefCountries: ['it', 'es', 'us'], APORTADOR_NONE: '------', @@ -139,6 +139,13 @@ export const tools = { languageid: 5, + peopleWhere: { + participants: 1, + lunch: 2, + dinner: 3, + dinnerShared: 4 + }, + SERVKEY_VERS: 'vers', localStorage: { @@ -274,6 +281,26 @@ export const tools = { label: '8', value: 8 }, + { + id: 90, + label: '9', + value: 9 + }, + { + id: 100, + label: '10', + value: 10 + }, + { + id: 110, + label: '11', + value: 11 + }, + { + id: 120, + label: '12', + value: 12 + }, ], SelectListNumPeople: [ @@ -1608,10 +1635,13 @@ export const tools = { visumenu(elem) { // : IListRoutes let visu = ((elem.onlyAdmin && UserStore.state.isAdmin) || (elem.onlyManager && UserStore.state.isManager) || (elem.onlySocioResidente && UserStore.state.my.profile.socioresidente) - || (elem.onlyTutor && UserStore.state.isTutor) || (elem.onlyTraduttrici && UserStore.state.isTraduttrici) + || (elem.onlyConsiglio && UserStore.state.my.profile.consiglio) + || (elem.onlyNotSoci && !UserStore.state.my.profile.socio) + || (elem.onlyTutor && UserStore.state.isTutor) + || (elem.onlyEditor && UserStore.state.isEditor) || (elem.onlyDepartment && UserStore.state.isDepartment) - || ((!elem.onlyAdmin) && (!elem.onlyManager) && (!elem.onlyTutor) && (!elem.onlyTraduttrici) && (!elem.onlyDepartment) - && (!elem.onlySocioResidente))) && elem.active + || ((!elem.onlyAdmin) && (!elem.onlyManager) && (!elem.onlyTutor) && (!elem.onlyEditor) && (!elem.onlyDepartment) + && (!elem.onlySocioResidente) && (!elem.onlyConsiglio) && (!elem.onlyNotSoci))) && elem.active if (!tools.isLoggedToSystem()) { if (elem.onlyif_logged) @@ -1997,7 +2027,7 @@ export const tools = { }, showNeutralNotif(q: any, msg) { - tools.showNotif(q, msg, { color: 'info', icon: 'notifications' }) + tools.showNotif(q, msg, { color: 'info', icon: 'notifications' }, 10000) }, showNotif(q: any, msg, data ?: INotify | null, time?) { @@ -2277,6 +2307,14 @@ export const tools = { return !!UserStore.state.my.profile ? UserStore.state.my.profile.socioresidente : false }, + isConsiglio() { + return !!UserStore.state.my.profile ? UserStore.state.my.profile.consiglio : false + }, + + isSocio() { + return !!UserStore.state.my.profile ? UserStore.state.my.profile.socio : false + }, + isResp() { return UserStore.state.my.profile.resplist }, @@ -2301,8 +2339,8 @@ export const tools = { return UserStore.state.isZoomeri }, - isTraduttrici() { - return UserStore.state.isTraduttrici + isEditor() { + return UserStore.state.isEditor }, getstrDate(mytimestamp) { @@ -2313,6 +2351,15 @@ export const tools = { return '' }, + getstrDateLong(mytimestamp) { + // console.log('getstrDate', mytimestamp) + const dayofweek = this.getDayOfWeek(mytimestamp) + if (!!mytimestamp) + return dayofweek + ' ' + date.formatDate(mytimestamp, 'DD/MM/YYYY') + else + return '' + }, + getstrshortDate(mytimestamp) { // console.log('getstrDate', mytimestamp) if (!!mytimestamp) @@ -2406,18 +2453,18 @@ export const tools = { // is same day? if (tools.getstrDate(myevent.dateTimeStart) === tools.getstrDate(myevent.dateTimeEnd)) { if (withhtml) { - mystr += `${tools.getstrDate(myevent.dateTimeStart)} + mystr += `${tools.getstrDateLong(myevent.dateTimeStart)} ${mythis.$t('cal.starttime')} ${tools.getstrTime(myevent.dateTimeStart)} ${mythis.$t('cal.endtime')} ${tools.getstrTime(myevent.dateTimeEnd)}` } else { - mystr = `${tools.getstrDate(myevent.dateTimeStart)} + mystr = `${tools.getstrDateLong(myevent.dateTimeStart)} ${mythis.$t('cal.starttime')} ${tools.getstrTime(myevent.dateTimeStart)} ${mythis.$t('cal.endtime')} ${tools.getstrTime(myevent.dateTimeEnd)}` } } else { - mystr = `${tools.getstrDate(myevent.dateTimeStart)} + mystr = `${tools.getstrDateLong(myevent.dateTimeStart)} ${mythis.$t('cal.starttime')} ${tools.getstrTime(myevent.dateTimeStart)} - ${mythis.$t('cal.enddate')} ${tools.getstrDate(myevent.dateTimeEnd)} + ${mythis.$t('cal.enddate')} ${tools.getstrDateLong(myevent.dateTimeEnd)} ${mythis.$t('cal.endtime')} ${tools.getstrTime(myevent.dateTimeEnd)} ` } @@ -2550,6 +2597,8 @@ export const tools = { return null } + console.log('mystrdate', mystrdate) + const pattern = /(\d{2})\/(\d{2})\/(\d{4})/ const strdate = mystrdate.replace(pattern, '$3-$2-$1') let mydate = null @@ -2616,10 +2665,10 @@ export const tools = { return false }, - getDayOfWeek(date) { - const dayOfWeek = new Date(date).getDay() + getDayOfWeek(mydate) { + const dayOfWeek = new Date(mydate).getDay() - let lang = this.getLocale() + const mylang = this.getLocale() const myday = { it: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], @@ -2631,7 +2680,7 @@ export const tools = { si: ['Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'četrtek', 'Petek', 'Sobota'], } - return isNaN(dayOfWeek) ? '' : myday[lang][dayOfWeek].substring(0, 3) + return isNaN(dayOfWeek) ? '' : myday[mylang][dayOfWeek].substring(0, 3) }, isSunday(mydate) { @@ -3216,8 +3265,10 @@ export const tools = { try { if (riscode === tools.OK) { tools.showNotif(mythis.$q, mythis.$t('login.completato'), { color: 'positive', icon: 'check' }) + console.log('mythis.$router.name', mythis.$router.name) if (ispageLogin) { - mythis.$router.push('/') + if (mythis.$router.name !== '/') + mythis.$router.push('/') } } else if (riscode === serv_constants.RIS_CODE_LOGIN_ERR) { @@ -3310,6 +3361,12 @@ export const tools = { color: 'green', textColor: 'black' }) + } else if (riscode === serv_constants.RIS_ISCRIZIONE_OK) { + mythis.$router.push('/') + tools.showNotif(mythis.$q, mythis.$t('components.authentication.iscrizione_ok', { botname: mythis.$t('ws.botname') }), { + color: 'green', + textColor: 'black' + }) } else { tools.showNotif(mythis.$q, 'Errore num ' + riscode) } diff --git a/src/store/Modules/toolsext.ts b/src/store/Modules/toolsext.ts index b29121b..69204bd 100755 --- a/src/store/Modules/toolsext.ts +++ b/src/store/Modules/toolsext.ts @@ -35,7 +35,7 @@ export const func_tools = { // timeZone: 'UTC' }) try { - console.log('mydate', mydate, DateFormatter) + // console.log('mydate', mydate, DateFormatter) if (DateFormatter) { const date1 = new Date(mydate) return DateFormatter.format(date1) diff --git a/src/views/ecommerce/checkOut/checkOut.ts b/src/views/ecommerce/checkOut/checkOut.ts index a3e1bbc..6b47ca9 100755 --- a/src/views/ecommerce/checkOut/checkOut.ts +++ b/src/views/ecommerce/checkOut/checkOut.ts @@ -36,6 +36,7 @@ export default class CheckOut extends MixinBase { public mycart: ICart = {} public myrec: any[] public note: string = '' + public statusnow: number = shared_consts.OrderStatus.NONE public conferma_carrello: boolean = false public conferma_ordine: boolean = false @@ -50,6 +51,14 @@ export default class CheckOut extends MixinBase { return cart.items || null } + get getNumItems() { + const cart = Products.getters.getCart() + if (!!cart.items) + return cart.items.length || 0 + else + return 0 + } + get getCart() { return Products.getters.getCart() } @@ -88,13 +97,20 @@ export default class CheckOut extends MixinBase { } } - public mounted() { + public async mounted() { + // Products.actions.loadCart() + this.load() + } + + public async load() { this.mycart = this.getCart this.myrec = Object.keys(this.mycart) this.note = this.mycart.note + if (this.mycart) + this.statusnow = await Products.actions.UpdateStatusCart({ cart_id: this.mycart._id, status }) + console.log('myrec', this.myrec) - // Products.actions.loadCart() } public CanBeShipped() { @@ -146,10 +162,13 @@ export default class CheckOut extends MixinBase { title: 'Ordine' }).onOk(async () => { const status = shared_consts.OrderStatus.CHECKOUT_SENT - const statusnow = await Products.actions.UpdateStatusCart({ cart_id: this.mycart._id, status }) + this.statusnow = await Products.actions.UpdateStatusCart({ cart_id: this.mycart._id, status }) - if (statusnow === status) { + if (this.statusnow === status) { tools.showPositiveNotif(this.$q, 'Ordine Confermato') + setTimeout(() => { + this.$router.push('/orderinfo') + }, 2000) } // this.change_field('status') // this.change_field('status') diff --git a/src/views/ecommerce/checkOut/checkOut.vue b/src/views/ecommerce/checkOut/checkOut.vue index 31cfaed..c8ab6b5 100755 --- a/src/views/ecommerce/checkOut/checkOut.vue +++ b/src/views/ecommerce/checkOut/checkOut.vue @@ -15,7 +15,7 @@ class="text-subtitle1 q-mr-sm ">€ {{ myTotalPrice }} - - diff --git a/src/views/ecommerce/orderInfo/orderInfo.scss b/src/views/ecommerce/orderInfo/orderInfo.scss index 9df13d3..ab2a7db 100755 --- a/src/views/ecommerce/orderInfo/orderInfo.scss +++ b/src/views/ecommerce/orderInfo/orderInfo.scss @@ -3,3 +3,12 @@ $heightBtn: 100%; .card .product-image { height: 300px; } + +.mycol{ + color:gray; +} + + +.q-item__label--caption{ + color: blue; +} diff --git a/src/views/ecommerce/orderInfo/orderInfo.ts b/src/views/ecommerce/orderInfo/orderInfo.ts index 1a81dd8..ed023de 100755 --- a/src/views/ecommerce/orderInfo/orderInfo.ts +++ b/src/views/ecommerce/orderInfo/orderInfo.ts @@ -40,6 +40,9 @@ export default class OrderInfo extends MixinBase { public conferma_ordine: boolean = false public taborders: string = 'incorso' + public filter: string = '' + public statusnow: number = 0 + public arrnumstatus: any = [] public columns = [ { name: 'numorder', @@ -49,6 +52,14 @@ export default class OrderInfo extends MixinBase { field: 'numorder', sortable: true }, + { + name: 'nameSurname', + required: true, + align: 'left', + label: 'Nome', + field: 'nameSurname', + sortable: true + }, { name: 'created_at', required: true, @@ -90,6 +101,10 @@ export default class OrderInfo extends MixinBase { return Products.getters.getOrdersCart(this.taborders) } + get getAllOrdersCart() { + return Products.getters.getOrdersAllCart() + } + public change_field(myorderid, fieldname) { if (this.myarrrec[myorderid][fieldname] !== this[fieldname]) { this.myarrrec[myorderid][fieldname] = this[fieldname] @@ -102,12 +117,42 @@ export default class OrderInfo extends MixinBase { tools.saveFieldToServer(this, 'orderscart', myorderid, mydata, aggiorna) } } - - public mounted() { + public updateorders() { this.myorderscart = this.getOrdersCart for (const ordercart of this.myorderscart) { this.myarrrec[ordercart._id] = Object.keys(ordercart) } + + const allorders = this.getAllOrdersCart + for (const status of [ + 2, + 3, + 4, + 6, + 10 + ]) { + this.arrnumstatus[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0) + } + + } + + public mounted() { + + this.updateorders() + + console.log('arrnumstatus;') + console.log(this.arrnumstatus) + + this.columns = [...this.columns, + { + name: 'comandi', + align: 'center', + required: false, + label: 'Comandi', + field: 'comandi', + sortable: false + }] + } public CanBeShipped() { @@ -146,4 +191,37 @@ export default class OrderInfo extends MixinBase { return 0 } + public clickFunz(order, status) { + + if (status === shared_consts.OrderStatus.ORDER_CONFIRMED) { + // Conferma Ordine + } + + const statusStr = shared_consts.getStatusStr(status) + + this.$q.dialog({ + message: 'Impostare l\'ordine n. ' + order.numorder + ' ' + statusStr + ' ?', + ok: { + label: this.$t('dialog.yes'), + push: true + }, + cancel: { + label: this.$t('dialog.cancel') + }, + title: 'Ordine' + }).onOk(async () => { + + this.statusnow = await Products.actions.UpdateOrderStatus({ order_id: order._id, status }) + + if (this.statusnow === status) { + order.status = this.statusnow + this.updateorders() + tools.showPositiveNotif(this.$q, 'Ordine ' + statusStr) + } + // this.change_field('status') + // this.change_field('status') + }) + } + + } diff --git a/src/views/ecommerce/orderInfo/orderInfo.vue b/src/views/ecommerce/orderInfo/orderInfo.vue index b3108f1..7f05022 100755 --- a/src/views/ecommerce/orderInfo/orderInfo.vue +++ b/src/views/ecommerce/orderInfo/orderInfo.vue @@ -7,23 +7,70 @@ inline-label class="text-blue" > - - + + + + +
      -