- Invia Ris a e Ricevi Ris
- Tutorial Guidato Passi da Compiere - Provincia in cui vivi - Policy aggiornata
This commit is contained in:
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,
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user