Added Styling to Balance in Account Table

This commit is contained in:
2024-07-04 19:04:34 +02:00
parent 669f50de6c
commit 101b8d3361
2 changed files with 32 additions and 25 deletions

View File

@@ -11,6 +11,7 @@ const toast = useToast()
const showAddBankRequisition = ref(false) const showAddBankRequisition = ref(false)
const bicBankToAdd = ref("") const bicBankToAdd = ref("")
const bankData = ref({}) const bankData = ref({})
const showAlert = ref(false)
const reqData = ref({}) const reqData = ref({})
const axiosBaseUrl = "https://backend.fedeo.de" const axiosBaseUrl = "https://backend.fedeo.de"
@@ -34,21 +35,26 @@ const setupPage = async () => {
} }
const checkBIC = async () => { const checkBIC = async () => {
const {data,error} = await axios({
url:`${axiosBaseUrl}/banking/institutions/${bicBankToAdd.value}`,
method: "GET",
auth: {
username: "frontend",
password: "Xt9Zn9RDSpdbr"
}
})
if(data) { try {
const {data} = await axios({
url:`${axiosBaseUrl}/banking/institutions/${bicBankToAdd.value}`,
method: "GET",
auth: {
username: "frontend",
password: "Xt9Zn9RDSpdbr"
}
})
bankData.value = data bankData.value = data
} } catch ( error) {
}
showAlert.value = true
console.log(data)
console.log(error)
} }
@@ -125,6 +131,7 @@ setupPage()
<UInput <UInput
v-model="bicBankToAdd" v-model="bicBankToAdd"
class="flex-auto" class="flex-auto"
@keydown.enter="checkBIC"
/> />
<UButton <UButton
@click="checkBIC" @click="checkBIC"
@@ -135,19 +142,22 @@ setupPage()
</UFormGroup> </UFormGroup>
<UAlert <UAlert
v-if="bankData.id && bankData.countries.includes('DE')" v-if="showAlert && bankData.id && bankData.countries.includes('DE')"
title="Bank gefunden" title="Bank gefunden"
icon="i-heroicons-check" icon="i-heroicons-check-circle"
color="primary" color="primary"
variant="outline" variant="outline"
class="mt-3" class="mt-3"
:actions="[{ variant: 'solid', color: 'primary', label: 'Verbinden',click: generateLink }]"
/> />
<UButton <UAlert
@click="generateLink" v-else-if="showAlert && !bankData.id"
title="Bank nicht gefunden"
icon="i-heroicons-x-circle"
color="rose"
variant="outline"
class="mt-3" class="mt-3"
> />
Verbinden
</UButton>
</UCard> </UCard>
</USlideover> </USlideover>
@@ -194,7 +204,9 @@ setupPage()
}, },
]" ]"
> >
<template #balance-data="{row}">
{{row.balance.toFixed(2).replace(".",",")}}
</template>
</UTable> </UTable>
</template> </template>

View File

@@ -283,19 +283,16 @@ export const useDataStore = defineStore('data', () => {
]) ])
async function initializeData (userId) { async function initializeData (userId) {
console.log("init")
let profileconnections = (await supabase.from("profileconnections").select()).data let profileconnections = (await supabase.from("profileconnections").select()).data
let profiles = (await supabase.from("profiles").select()).data let profiles = (await supabase.from("profiles").select()).data
let activeProfileConnection = profileconnections.find(i => i.active) let activeProfileConnection = profileconnections.find(i => i.active)
if(activeProfileConnection) { if(activeProfileConnection) {
console.log("Active Profile Selected")
activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id) activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id)
currentTenant.value = activeProfile.value.tenant currentTenant.value = activeProfile.value.tenant
await fetchData() await fetchData()
} else { } else {
console.log("No Profile Active")
await fetchOwnProfiles() await fetchOwnProfiles()
await fetchTenants() await fetchTenants()
showProfileSelection.value = true showProfileSelection.value = true
@@ -335,7 +332,6 @@ export const useDataStore = defineStore('data', () => {
} }
async function fetchData () { async function fetchData () {
console.log("Fetch Start")
await fetchOwnProfiles() await fetchOwnProfiles()
await fetchProfiles() await fetchProfiles()
@@ -383,7 +379,6 @@ export const useDataStore = defineStore('data', () => {
await fetchResources() await fetchResources()
loaded.value = true loaded.value = true
console.log("Data Fetched")
} }