Verbrauchsausweis Klasse
This commit is contained in:
@@ -12,11 +12,10 @@
|
||||
import AusweisPreviewContainer from "~/components/Ausweis/AusweisPreviewContainer.svelte";
|
||||
import { calculateEnergyPerformanceScore } from "./energyPerformanceCalculation";
|
||||
import ZipSearch from "../ZIPSearch.svelte";
|
||||
import { Verbrauchsausweis } from "src/lib/Ausweis/Verbrauchsausweis";
|
||||
|
||||
const ausweis = new Verbrauchsausweis();
|
||||
|
||||
let additionalHeating: boolean = false;
|
||||
let heatedWaterIncluded: boolean = false;
|
||||
let heatedWaterPortion: number = 18;
|
||||
let hasCellar: boolean = false;
|
||||
let conversionFactor: number = 0;
|
||||
let calorificValueFactor: number = 0;
|
||||
|
||||
@@ -26,55 +25,42 @@
|
||||
|
||||
let area = 0;
|
||||
let energyPerformance = 0;
|
||||
let zip: string = "";
|
||||
let city: string = "";
|
||||
|
||||
$: {
|
||||
energyPerformance = calculateEnergyPerformanceScore(
|
||||
energyConsumption,
|
||||
additionalEnergyConsumption,
|
||||
heatedWaterPortion,
|
||||
ausweis.anteil_warmwasser_1,
|
||||
climateFactors,
|
||||
area * (hasCellar ? 1.35 : 1.2),
|
||||
area * (ausweis.keller_beheizt ? 1.35 : 1.2),
|
||||
conversionFactor,
|
||||
calorificValueFactor
|
||||
);
|
||||
}
|
||||
|
||||
let baujahrGebaeude: number;
|
||||
let baujahrHeizungsAnlage: number;
|
||||
let apartmentCount: number;
|
||||
let certificateReason:
|
||||
| "Vermietung"
|
||||
| "Neubau"
|
||||
| "Verkauf"
|
||||
| "Modernisierung"
|
||||
| "Sonstiges";
|
||||
let sanitationStatus: boolean;
|
||||
|
||||
let needsRequirementCertificate: boolean = false;
|
||||
|
||||
$: needsRequirementCertificate =
|
||||
(baujahrGebaeude < 1978 &&
|
||||
apartmentCount <= 4 &&
|
||||
sanitationStatus == false &&
|
||||
(certificateReason == "Vermietung" ||
|
||||
certificateReason == "Sonstiges")) ||
|
||||
certificateReason == "Neubau" ||
|
||||
certificateReason == "Modernisierung" ||
|
||||
certificateReason == "Verkauf";
|
||||
(ausweis.baujahr_gebaeude < 1978 &&
|
||||
ausweis.anzahl_einheiten <= 4 &&
|
||||
ausweis.objekt_saniert == false &&
|
||||
(ausweis.ausstellgrund == "Vermietung" ||
|
||||
ausweis.ausstellgrund == "Sonstiges")) ||
|
||||
ausweis.ausstellgrund == "Neubau" ||
|
||||
ausweis.ausstellgrund == "Modernisierung" ||
|
||||
ausweis.ausstellgrund == "Verkauf";
|
||||
|
||||
function automatischAusfüllen() {
|
||||
baujahrGebaeude = 1962;
|
||||
baujahrHeizungsAnlage = 1974;
|
||||
sanitationStatus = true;
|
||||
apartmentCount = 1;
|
||||
certificateReason = "Vermietung";
|
||||
ausweis.baujahr_gebaeude = 1962;
|
||||
ausweis.baujahr_anlage = 1974;
|
||||
ausweis.objekt_saniert = true;
|
||||
ausweis.anzahl_einheiten = 1;
|
||||
ausweis.ausstellgrund = "Vermietung";
|
||||
energyConsumption = [15000, 14000, 16000]
|
||||
area = 152;
|
||||
hasCellar = true;
|
||||
heatedWaterIncluded = true;
|
||||
heatedWaterPortion = 18;
|
||||
ausweis.keller_beheizt = true;
|
||||
ausweis.warmwasser_enthalten = true;
|
||||
ausweis.anteil_warmwasser_1 = 18;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -106,11 +92,11 @@
|
||||
</div>
|
||||
|
||||
<Ausweisart
|
||||
bind:baujahrGebaeude
|
||||
bind:apartmentCount
|
||||
bind:certificateReason
|
||||
bind:sanitationStatus
|
||||
bind:baujahrHeizungsAnlage
|
||||
bind:baujahrGebaeude={ausweis.baujahr_gebaeude}
|
||||
bind:apartmentCount={ausweis.anzahl_einheiten}
|
||||
bind:certificateReason={ausweis.ausstellgrund}
|
||||
bind:sanitationStatus={ausweis.objekt_saniert}
|
||||
bind:baujahrHeizungsAnlage={ausweis.baujahr_anlage}
|
||||
/>
|
||||
|
||||
<div
|
||||
@@ -166,7 +152,7 @@
|
||||
|
||||
<!-- PLZ -->
|
||||
<div class="form-group col-md-4 PLZ">
|
||||
<ZipSearch bind:zip bind:city name="zip" />
|
||||
<ZipSearch bind:zip={ausweis.objekt_plz} bind:city={ausweis.objekt_ort} name="zip" />
|
||||
</div>
|
||||
|
||||
<!-- IGort: readonly entfernt - Nelson -->
|
||||
@@ -179,7 +165,7 @@
|
||||
name="IGort"
|
||||
class="input-md buchstaben"
|
||||
readonly={true}
|
||||
bind:value={city}
|
||||
bind:value={ausweis.objekt_ort}
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
@@ -210,7 +196,7 @@
|
||||
<div class="form-group col-md-4">
|
||||
<Label>Keller *</Label>
|
||||
<div>
|
||||
<select name="IGkeller" required bind:value={hasCellar}>
|
||||
<select name="IGkeller" required bind:value={ausweis.keller_beheizt}>
|
||||
<option>Bitte auswählen</option>
|
||||
<option value={false}>nicht vorhanden</option>
|
||||
<option value={false}>unbeheizt</option>
|
||||
@@ -241,7 +227,7 @@
|
||||
|
||||
<div class="GRB">
|
||||
<Verbrauch
|
||||
bind:additionalHeating
|
||||
bind:additionalHeating={ausweis.zusaetzliche_heizquelle}
|
||||
bind:energyConsumption
|
||||
bind:additionalEnergyConsumption
|
||||
bind:climateFactors
|
||||
@@ -268,7 +254,7 @@
|
||||
type="checkbox"
|
||||
class="IGwwbool"
|
||||
name="IGwwbool"
|
||||
bind:checked={heatedWaterIncluded}
|
||||
bind:checked={ausweis.warmwasser_enthalten}
|
||||
/>Warmwasser im Verbrauch enthalten</label
|
||||
>
|
||||
</div>
|
||||
@@ -285,8 +271,8 @@
|
||||
name="IGwarmwasser"
|
||||
maxlength="2"
|
||||
type="text"
|
||||
bind:value={heatedWaterPortion}
|
||||
disabled={!heatedWaterIncluded}
|
||||
bind:value={ausweis.anteil_warmwasser_1}
|
||||
disabled={!ausweis.warmwasser_enthalten}
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
@@ -302,7 +288,7 @@
|
||||
maxlength="3"
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
disabled={!additionalHeating}
|
||||
disabled={!ausweis.zusaetzliche_heizquelle}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user