tRPC Hinzugefügt
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
import { auditBedarfsausweisBenoetigt } from "#components/Verbrauchsausweis/audits/BedarfsausweisBenoetigt";
|
||||
import { auditVerbrauchAbweichung } from "#components/Verbrauchsausweis/audits/VerbrauchAbweichung";
|
||||
import { GebaeudeStammdaten, VerbrauchsausweisWohnen } from "@ibcornelsen/database";
|
||||
import trpc from "src/trpc";
|
||||
|
||||
export let uid: string = "";
|
||||
|
||||
@@ -58,8 +59,24 @@
|
||||
gebaeude = gebaeude;
|
||||
ausweis = ausweis;
|
||||
}
|
||||
|
||||
|
||||
async function ausweisAbschicken() {
|
||||
overlay.ariaHidden = "false";
|
||||
const response = await trpc.v1.verbrauchsausweisWohnen[2016].erstellen.mutate({
|
||||
...ausweis,
|
||||
gebaeude_stammdaten: gebaeude
|
||||
})
|
||||
}
|
||||
|
||||
let overlay: HTMLDivElement;
|
||||
|
||||
</script>
|
||||
|
||||
<div bind:this={overlay} aria-hidden="true" class="aria-hidden:hidden fixed top-0 left-0 w-[100vw] h-[100vh] flex items-center justify-center bg-[rgba(0,0,0,0.8)] z-50">
|
||||
<p class="text-white font-semibold text-4xl">Bitte warten sie, ihr Ausweis wird nun erstellt.</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row gap-8 items-center mb-8">
|
||||
<div class="flex flex-col w-full">
|
||||
<h1>Verbrauchsausweis erstellen - 45€</h1>
|
||||
@@ -69,8 +86,8 @@
|
||||
<PerformanceScore bind:ausweis bind:gebaeude />
|
||||
</div>
|
||||
|
||||
<form method="post" action="/verbrauchsausweis/erstellen">
|
||||
<fieldset
|
||||
<div>
|
||||
<div
|
||||
class="bg-[rgba(252,234,187,0.2)] border-2 p-4 rounded-lg border-[#ffcc03]"
|
||||
>
|
||||
<div class="flex flex-row justify-between">
|
||||
@@ -107,8 +124,7 @@
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<input
|
||||
name="IGstrasse"
|
||||
class=" strasse"
|
||||
name="adresse"
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
required
|
||||
@@ -128,14 +144,13 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- IGort: readonly entfernt - Nelson -->
|
||||
<div class="form-group col-md-4">
|
||||
<HelpLabel title="Ort *">
|
||||
Ort des Gebäudes wird automatisch ermittelt.
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<input
|
||||
name="IGort"
|
||||
name="ort"
|
||||
readonly={true}
|
||||
bind:value={gebaeude.ort}
|
||||
type="text"
|
||||
@@ -152,7 +167,7 @@
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<input
|
||||
name="IGflaeche"
|
||||
name="flaeche"
|
||||
maxlength="4"
|
||||
type="number"
|
||||
required
|
||||
@@ -169,7 +184,7 @@
|
||||
<Label>Keller *</Label>
|
||||
<div>
|
||||
<select
|
||||
name="IGkeller"
|
||||
name="keller_beheizt"
|
||||
required
|
||||
bind:value={ausweis.keller_beheizt}
|
||||
>
|
||||
@@ -185,7 +200,7 @@
|
||||
<div class="form-group col-md-4">
|
||||
<Label>Dachgeschoss *</Label>
|
||||
<div>
|
||||
<select name="IGdach" class="" required>
|
||||
<select name="dachgeschoss" required>
|
||||
<option>Bitte auswählen</option>
|
||||
<option value="dnein">nicht vorhanden</option>
|
||||
<option value="dub">unbeheizt</option>
|
||||
@@ -217,8 +232,7 @@
|
||||
<label class="radio-inline"
|
||||
><input
|
||||
type="checkbox"
|
||||
class="IGwwbool"
|
||||
name="IGwwbool"
|
||||
name="warmwasser_enthalten"
|
||||
bind:checked={ausweis
|
||||
.warmwasser_enthalten}
|
||||
/>Warmwasser im Verbrauch enthalten</label
|
||||
@@ -234,7 +248,7 @@
|
||||
</HelpLabel>
|
||||
|
||||
<input
|
||||
name="IGwarmwasser"
|
||||
name="anteil_warmwasser_1"
|
||||
maxlength="2"
|
||||
type="number"
|
||||
bind:value={ausweis.anteil_warmwasser_1}
|
||||
@@ -250,7 +264,7 @@
|
||||
ein Anteil von 18% angenommen.
|
||||
</HelpLabel>
|
||||
<input
|
||||
name="IGwarmwasser2"
|
||||
name="anteil_warmwasser_2"
|
||||
maxlength="3"
|
||||
type="number"
|
||||
autocomplete="off"
|
||||
@@ -273,7 +287,7 @@
|
||||
<label class="checkbox-inline"
|
||||
><input
|
||||
type="checkbox"
|
||||
name="IGversorgungssysteme1"
|
||||
name="alternative_heizung"
|
||||
bind:checked={ausweis.alternative_heizung}
|
||||
value="Heizung"
|
||||
/>Heizung</label
|
||||
@@ -281,7 +295,7 @@
|
||||
<label class="checkbox-inline"
|
||||
><input
|
||||
type="checkbox"
|
||||
name="IGversorgungssysteme2"
|
||||
name="alternative_warmwasser"
|
||||
bind:checked={ausweis.alternative_warmwasser}
|
||||
value="Warmwasser"
|
||||
/>Warmwasser</label
|
||||
@@ -289,7 +303,7 @@
|
||||
<label class="checkbox-inline"
|
||||
><input
|
||||
type="checkbox"
|
||||
name="IGversorgungssysteme3"
|
||||
name="alternative_lueftung"
|
||||
bind:checked={ausweis.alternative_lueftung}
|
||||
value="Lüftung"
|
||||
/>Lüftung</label
|
||||
@@ -297,7 +311,7 @@
|
||||
<label class="checkbox-inline"
|
||||
><input
|
||||
type="checkbox"
|
||||
name="IGversorgungssysteme4"
|
||||
name="alternative_kuehlung "
|
||||
bind:checked={ausweis.alternative_kuehlung}
|
||||
value="Kühlung"
|
||||
/>Kühlung</label
|
||||
@@ -320,7 +334,7 @@
|
||||
Bitte wählen Sie hier den Gebäudetyp aus.
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<select name="IGtyp" class="" required autocomplete="off">
|
||||
<select name="gebaeudetyp" required autocomplete="off">
|
||||
<option>Bitte auswählen</option>
|
||||
<option value="Einfamilienhaus">Einfamilienhaus</option>
|
||||
<option value="Freistehendes Einfamilienhaus"
|
||||
@@ -359,7 +373,7 @@
|
||||
'Gewerbe'.
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<select name="IGteil" class="" required autocomplete="off">
|
||||
<select name="gebaeudeteil" class="" required autocomplete="off">
|
||||
<option>Bitte auswählen</option>
|
||||
<option value="Gesamtgebäude">Gesamtgebäude</option>
|
||||
<option value="Wohnen">Wohnen</option>
|
||||
@@ -375,10 +389,10 @@
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<select
|
||||
name="IGlueftung"
|
||||
class=""
|
||||
name="lueftung"
|
||||
required
|
||||
autocomplete="off"
|
||||
bind:value={gebaeude.lueftung}
|
||||
>
|
||||
<option>Bitte auswählen</option>
|
||||
<option value="Fensterlüftung">Fensterlüftung</option>
|
||||
@@ -401,10 +415,11 @@
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<select
|
||||
name="IGkuehlung"
|
||||
name="kuehlung"
|
||||
class=""
|
||||
required
|
||||
autocomplete="off"
|
||||
bind:value={gebaeude.kuehlung}
|
||||
>
|
||||
<option>Bitte auswählen</option>
|
||||
<option value="1">vorhanden</option>
|
||||
@@ -422,10 +437,11 @@
|
||||
</HelpLabel>
|
||||
<div>
|
||||
<input
|
||||
name="IGleer"
|
||||
name="leerstand"
|
||||
maxlength="2"
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
bind:value={gebaeude.leerstand}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -441,10 +457,10 @@
|
||||
<hr />
|
||||
<div class="flex flex-row justify-between">
|
||||
<Hilfe />
|
||||
<button class="button">Weiter</button>
|
||||
<button class="button" on:click={ausweisAbschicken}>Weiter</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<RawNotificationWrapper>
|
||||
Reference in New Issue
Block a user