- Invia Ris a e Ricevi Ris
- Tutorial Guidato Passi da Compiere - Provincia in cui vivi - Policy aggiornata
This commit is contained in:
0
src/components/CSendRISTo/CSendRISTo.scss
Executable file
0
src/components/CSendRISTo/CSendRISTo.scss
Executable file
87
src/components/CSendRISTo/CSendRISTo.ts
Executable file
87
src/components/CSendRISTo/CSendRISTo.ts
Executable file
@@ -0,0 +1,87 @@
|
||||
import { computed, defineComponent, PropType, ref } from 'vue'
|
||||
|
||||
import { ICalcStat, IOperators } from '../../model'
|
||||
import { useUserStore } from '../../store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '../../store/globalStore'
|
||||
import { useI18n } from '../../boot/i18n'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { costanti, IMainCard } from '@store/Modules/costanti'
|
||||
|
||||
import { CMyUser } from '../CMyUser'
|
||||
import { CMyGroup } from '../CMyGroup'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSendRISTo',
|
||||
props: {},
|
||||
components: { CMyUser, CMyGroup },
|
||||
setup(props) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const { t } = useI18n()
|
||||
const $q = useQuasar()
|
||||
const $router = useRouter()
|
||||
|
||||
const receiveRislist = computed(() => globalStore.datastat ? globalStore.datastat.receiveRislist : [])
|
||||
const receiveRislistgroup = computed(() => globalStore.datastat ? globalStore.datastat.receiveRislistgroup : [])
|
||||
|
||||
const usersList = ref(<any>{ show: false, title: '', list: [], listgroup: [] })
|
||||
|
||||
const tipoConto = ref(costanti.AccountType.USER)
|
||||
const loading = ref(false)
|
||||
|
||||
const arrTypesAccounts = ref(<any>[
|
||||
{
|
||||
label: t('circuit.user'),
|
||||
value: costanti.AccountType.USER,
|
||||
},
|
||||
{
|
||||
label: t('circuit.conticollettivi'),
|
||||
value: costanti.AccountType.COLLECTIVE_ACCOUNT,
|
||||
}
|
||||
])
|
||||
|
||||
function sendCoinsToClick() {
|
||||
if ((receiveRislist.value && receiveRislist.value.length > 0 || (receiveRislistgroup.value && receiveRislistgroup.value.length > 0))) {
|
||||
usersList.value.show = true;
|
||||
usersList.value.title = 'Lista Utenti Riceventi';
|
||||
usersList.value.list = receiveRislist.value;
|
||||
usersList.value.listgroup = receiveRislistgroup.value;
|
||||
} else {
|
||||
$router.push(tools.updateLink('/circuits'))
|
||||
}
|
||||
}
|
||||
|
||||
async function updateUserListRIS() {
|
||||
const userStore = useUserStore()
|
||||
|
||||
loading.value = true
|
||||
|
||||
await globalStore.getStatSite()
|
||||
|
||||
usersList.value.list = globalStore.datastat!.receiveRislist
|
||||
usersList.value.listgroup = globalStore.datastat!.receiveRislistgroup
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
return {
|
||||
userStore,
|
||||
tools,
|
||||
costanti,
|
||||
shared_consts,
|
||||
usersList,
|
||||
receiveRislist,
|
||||
receiveRislistgroup,
|
||||
sendCoinsToClick,
|
||||
arrTypesAccounts,
|
||||
tipoConto,
|
||||
updateUserListRIS,
|
||||
loading,
|
||||
}
|
||||
},
|
||||
})
|
||||
113
src/components/CSendRISTo/CSendRISTo.vue
Executable file
113
src/components/CSendRISTo/CSendRISTo.vue
Executable file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="row text-center justify-evenly items-center">
|
||||
<div class="q-mb-sm">
|
||||
<q-btn
|
||||
icon="fas fa-upload"
|
||||
color="primary"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.sendcoins_toso')"
|
||||
@click="sendCoinsToClick"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
icon="fas fa-download"
|
||||
color="primary"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.receive_coins')"
|
||||
@click="tools.receiveRis($q, $t)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<q-dialog v-model="usersList.show">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ usersList.title }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
|
||||
<q-card-section class="inset-shadow">
|
||||
<div>{{ $t('circuit.lista_ricev_title') }}</div>
|
||||
|
||||
<div class="row centeritems justify-evenly items-center">
|
||||
<q-btn
|
||||
icon="fas fa-wifi"
|
||||
rounded
|
||||
glossy
|
||||
color="primary"
|
||||
:label="$t('dialog.update')"
|
||||
:disable="loading"
|
||||
@click="updateUserListRIS()"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-spinner-radio v-if="loading" class="q-ma-sm" color="brown" />
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="row centeritems">
|
||||
<q-btn-toggle
|
||||
v-if="arrTypesAccounts.length > 0"
|
||||
v-model="tipoConto"
|
||||
class="my-custom-toggle"
|
||||
no-caps
|
||||
rounded
|
||||
unelevated
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="arrTypesAccounts"
|
||||
/>
|
||||
|
||||
<div v-if="tipoConto === costanti.AccountType.USER">
|
||||
<div v-for="(rec, i) in usersList.list" :key="i">
|
||||
<CMyUser
|
||||
:mycontact="rec"
|
||||
:visu="costanti.FIND_PEOPLE"
|
||||
@setCmd="tools.setCmd"
|
||||
>
|
||||
</CMyUser>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT"
|
||||
>
|
||||
|
||||
<div v-for="(grp, i) in usersList.listgroup" :key="i">
|
||||
<CMyGroup :mygrp="grp" :visu="costanti.USER_GROUPS" :noaut="true">
|
||||
</CMyGroup>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
rounded
|
||||
icon="close"
|
||||
v-close-popup
|
||||
:label="$t('dialog.close')"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
rounded
|
||||
:label="$t('circuit.vaialcircuito')"
|
||||
color="primary"
|
||||
:to="tools.updateLink('/circuits')"
|
||||
>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CSendRISTo.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CSendRISTo.scss';
|
||||
</style>
|
||||
1
src/components/CSendRISTo/index.ts
Executable file
1
src/components/CSendRISTo/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CSendRISTo} from './CSendRISTo.vue'
|
||||
Reference in New Issue
Block a user