Ausweis Prüfen

This commit is contained in:
Moritz Utcke
2024-02-28 14:49:53 +07:00
parent 52786a87f5
commit 438163217f
38 changed files with 744 additions and 463 deletions

View File

@@ -140,8 +140,7 @@
beschreibung: e.stack,
email: user.email ?? "",
metadata: JSON.stringify({
ausweis,
gebaeude
ausweis
})
})
// TODO: Ticket mit Fehldermeldung abschicken.
@@ -664,7 +663,7 @@
dismissable: true,
onUserDismiss: () => {
hidden.add(AuditType.HEIZUNG_GEBAEUDE_BAUJAHR);
gebaeude = gebaeude;
gebaeude_aufnahme_allgemein = gebaeude_aufnahme_allgemein;
},
type: "warning",
}}

View File

@@ -1,30 +0,0 @@
<script lang="ts">
const calculations: Record<string, any> = {};
const ausweis: Record<string, any> = {};
</script>
<div class="list-ausweis" style="border: 1px solid #ccc;">
<div class="flex-row justify-between">
<div class="flex-column">
<table class="table-borderless" style="border:none;">
<tr>
<td title="" width="50px"
><div class="checkTextPreviewButton">
<div
class="checkTextPreview"
style="display:none; position: absolute; background-color: black; color: white; padding: 10px; border-radius: 5px; max-width: 600px; z-index:9999;"
>
{#if ausweis["ausweisart"] == "VA" || ausweis["ausweisart"] == "VANW"}
({calculations["Klimafaktor_1"]} + {calculations["Klimafaktor_2"]} + {calculations["Klimafaktor_3"]}) / 3 &gt;&gt; durchschnittlicher Klimafaktor
{:else}
{/if}
<br />
</div>
</div></td
>
</tr>
</table>
</div>
</div>
</div>

View File

@@ -1,26 +1,104 @@
<script lang="ts">
import {
BenutzerClient,
GebaeudeAufnahmeClient,
GebaeudeClient,
VerbrauchsausweisWohnenClient,
} from "#components/Ausweis/types";
import AusweisPruefenBox from "#components/AusweisPruefenBox.svelte";
import NotificationProvider from "#components/NotificationProvider/NotificationProvider.svelte";
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016";
import AusweisPruefenNotification from "#components/AusweisPruefenNotification.svelte";
export let ausweise: (VerbrauchsausweisWohnenClient &
{
gebaeude_aufnahme_allgemein: GebaeudeAufnahmeClient & {
gebaeude_stammdaten: GebaeudeClient;
};
benutzer: BenutzerClient;
})[];
export let ausweise: VerbrauchsausweisWohnenClient[];
</script>
{#each ausweise as ausweis}
{#await endEnergieVerbrauchVerbrauchsausweis_2016(ausweis)}
<p>Dies ist ein Platzhalter.</p>
{:then calculations}
<AusweisPruefenBox {ausweis} {calculations}></AusweisPruefenBox>
{/await}
{/each}
<div class="gap-4 flex flex-col">
{#each ausweise as ausweis}
{#await endEnergieVerbrauchVerbrauchsausweis_2016(ausweis)}
<div class="rounded-lg border w-full h-20 p-2.5 gap-4 flex flex-row items-center">
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-8 h-8 rounded-full"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="w-1/12 h-full flex flex-col gap-2">
<div class="skeleton w-full h-4"></div>
<div class="skeleton w-full h-4"></div>
</div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
<div class="skeleton w-4 h-4"></div>
</div>
{:then calculations}
<AusweisPruefenBox {ausweis} {calculations}></AusweisPruefenBox>
{/await}
{/each}
</div>
<div class="flex items-center justify-center mt-12">
<div class="join">
<button class="join-item btn btn-ghost shadow-none">1</button>
<button class="join-item btn btn-ghost shadow-none">2</button>
<button class="join-item btn btn-ghost shadow-none">3</button>
<button class="join-item btn btn-ghost shadow-none">4</button>
</div>
</div>
<div class="fixed bottom-8 right-8 flex flex-col gap-4">
<NotificationProvider component={AusweisPruefenNotification}></NotificationProvider>
</div>

View File

@@ -349,17 +349,18 @@
<hr />
<div class="flex flex-row items-center justify-between">
<span class="opacity-75 text-sm">Brutto</span>
<span class="font-semibold text-sm">75$</span>
<span class="font-semibold text-sm">45€</span>
</div>
<div class="flex flex-row items-center justify-between">
<span class="opacity-75 text-sm">Netto</span>
<span class="font-semibold text-sm">75$</span>
<span class="font-semibold text-sm">45€</span>
</div>
<hr />
<div class="flex flex-row items-center justify-between">
<span class="opacity-75 text-sm">Gesamt</span>
<span class="font-semibold text-sm">75$</span>
<span class="font-semibold text-sm">45€</span>
</div>
<p class="mt-8">Mit dem Klick auf "Bestellung Bestätigen" akzeptieren sie unsere <a href="/agb">AGB</a> und <a href="/impressum">Datenschutzbestimmungen</a>. Sie werden zu ihrem ausgewählten Bezahlprovider weitergeleitet, nach Bezahlung werden sie automatisch zu unserem Portal zurückgeleitet.</p>
<button class="btn btn-secondary w-full mt-4" disabled
>Bestellung Bestätigen</button
>

View File

@@ -51,6 +51,13 @@
(acc, service) => (service.selected && acc + service.price) || acc,
0
);
function speichern(e: SubmitEvent) {
e.preventDefault()
console.log("Speichern");
window.location.href = `/kaufabschluss?uid=${ausweis.uid}`;
}
</script>
<div class="w-full px-8">
@@ -61,7 +68,7 @@
</div>
</div>
<form>
<form on:submit={speichern}>
<div class="grid grid-cols-[1.5fr_2fr] gap-4">
<div class="rounded-lg border p-4 border-base-300 bg-base-100 flex flex-col gap-4">
<div class="flex flex-col gap-2 test-box">