Ansichtsausweis
This commit is contained in:
@@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
<button class="border-2 rounded-lg bg-white text-center hover:shadow-md no-underline p-3 cursor-pointer" type="button" on:click={() => {
|
<button class="border-2 rounded-lg bg-white text-center hover:shadow-md no-underline p-3 cursor-pointer" type="button" on:click={() => {
|
||||||
openWindowWithPost("/pdf/ansichtsausweis", {
|
openWindowWithPost("/pdf/ansichtsausweis", {
|
||||||
ausweis: JSON.stringify(ausweis),
|
ausweis: ausweis,
|
||||||
aufnahme: JSON.stringify(aufnahme),
|
aufnahme: aufnahme,
|
||||||
objekt: JSON.stringify(objekt),
|
objekt: objekt,
|
||||||
bilder: JSON.stringify(bilder),
|
bilder: bilder,
|
||||||
ausweisart
|
ausweisart
|
||||||
})
|
})
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
<button class="border-2 rounded-lg bg-white text-center hover:shadow-md no-underline p-3 cursor-pointer" type="button" on:click={() => {
|
<button class="border-2 rounded-lg bg-white text-center hover:shadow-md no-underline p-3 cursor-pointer" type="button" on:click={() => {
|
||||||
openWindowWithPost("/pdf/datenblatt", {
|
openWindowWithPost("/pdf/datenblatt", {
|
||||||
ausweis: JSON.stringify(ausweis),
|
ausweis: ausweis,
|
||||||
aufnahme: JSON.stringify(aufnahme),
|
aufnahme: aufnahme,
|
||||||
objekt: JSON.stringify(objekt),
|
objekt: objekt,
|
||||||
bilder: JSON.stringify(bilder),
|
bilder: bilder,
|
||||||
ausweisart
|
ausweisart
|
||||||
})
|
})
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function getEmpfehlungen(ausweis: VerbrauchsausweisWohnenClient | Verbrau
|
|||||||
let Keller = aufnahme.keller;
|
let Keller = aufnahme.keller;
|
||||||
let Kellerdecke_Kalraeume_gedaemmt = aufnahme.keller_decke_gedaemmt;
|
let Kellerdecke_Kalraeume_gedaemmt = aufnahme.keller_decke_gedaemmt;
|
||||||
let Brennwertkessel = aufnahme.brennwert_kessel;
|
let Brennwertkessel = aufnahme.brennwert_kessel;
|
||||||
let baujahr_anlagesanlage = aufnahme.baujahr_heizung[0];
|
let baujahr_anlagesanlage = aufnahme.baujahr_heizung && aufnahme.baujahr_heizung[0];
|
||||||
let Zentralheizung = aufnahme.zentralheizung;
|
let Zentralheizung = aufnahme.zentralheizung;
|
||||||
let photovoltaik = aufnahme.photovoltaik;
|
let photovoltaik = aufnahme.photovoltaik;
|
||||||
let Brennstoff = aufnahme.brennstoff_1;
|
let Brennstoff = aufnahme.brennstoff_1;
|
||||||
|
|||||||
@@ -29,6 +29,34 @@
|
|||||||
export let bilder: UploadedGebaeudeBild[] = [];
|
export let bilder: UploadedGebaeudeBild[] = [];
|
||||||
export let ausweisart = Enums.Ausweisart.VerbrauchsausweisGewerbe;
|
export let ausweisart = Enums.Ausweisart.VerbrauchsausweisGewerbe;
|
||||||
|
|
||||||
|
if (Object.keys(ausweis).length === 0) {
|
||||||
|
const localStorageAusweis = localStorage.getItem("ausweis");
|
||||||
|
if (localStorageAusweis) {
|
||||||
|
ausweis = JSON.parse(localStorageAusweis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(aufnahme).length === 0) {
|
||||||
|
const localStorageAufnahme = localStorage.getItem("aufnahme");
|
||||||
|
if (localStorageAufnahme) {
|
||||||
|
aufnahme = JSON.parse(localStorageAufnahme)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(objekt).length === 0) {
|
||||||
|
const localStorageObjekt = localStorage.getItem("objekt");
|
||||||
|
if (localStorageObjekt) {
|
||||||
|
objekt = JSON.parse(localStorageObjekt)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(bilder).length === 0) {
|
||||||
|
const localStorageBilder = localStorage.getItem("bilder");
|
||||||
|
if (localStorageBilder) {
|
||||||
|
bilder = JSON.parse(localStorageBilder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function automatischAusfüllen() {
|
function automatischAusfüllen() {
|
||||||
aufnahme.baujahr_gebaeude = [1952];
|
aufnahme.baujahr_gebaeude = [1952];
|
||||||
aufnahme.baujahr_heizung = [1952];
|
aufnahme.baujahr_heizung = [1952];
|
||||||
@@ -62,7 +90,12 @@
|
|||||||
ausweis = ausweis;
|
ausweis = ausweis;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function spaeterWeitermachen() {
|
|
||||||
|
$: {
|
||||||
|
localStorage.setItem("ausweis", JSON.stringify(ausweis))
|
||||||
|
localStorage.setItem("aufnahme", JSON.stringify(aufnahme))
|
||||||
|
localStorage.setItem("objekt", JSON.stringify(objekt))
|
||||||
|
localStorage.setItem("bilder", JSON.stringify(bilder))
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -84,7 +117,7 @@
|
|||||||
<div id="progress-box" class="w-full box relative px-4 py-3 text-center order-1 2xl:order-2 self-stretch">
|
<div id="progress-box" class="w-full box relative px-4 py-3 text-center order-1 2xl:order-2 self-stretch">
|
||||||
|
|
||||||
<h1 class="text-secondary text-3xl m-0">Energiesausweis erstellen</h1>
|
<h1 class="text-secondary text-3xl m-0">Energiesausweis erstellen</h1>
|
||||||
<h2 class="text-primary text-xl">Verbrauchsausweis Gewerbe {PRICES.VerbrauchsausweisGewerbe[0]} €</h2>
|
<h2 class="text-primary text-xl">Verbrauchsausweis Gewerbe {PRICES.VerbrauchsausweisGewerbe[Enums.AusweisTyp.Standard]} €</h2>
|
||||||
<Progressbar active={0} />
|
<Progressbar active={0} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -97,7 +130,16 @@
|
|||||||
<form id="formInput-1" data-cy="ausweis" name="ausweis">
|
<form id="formInput-1" data-cy="ausweis" name="ausweis">
|
||||||
<div id="formular-box" class="formular-boxen ring-0">
|
<div id="formular-box" class="formular-boxen ring-0">
|
||||||
|
|
||||||
<ButtonSpaeterHilfe {automatischAusfüllen} />
|
<ButtonWeiterHilfe
|
||||||
|
bind:ausweis
|
||||||
|
bind:bilder
|
||||||
|
bind:user
|
||||||
|
bind:objekt
|
||||||
|
bind:aufnahme
|
||||||
|
ausweisart={Enums.Ausweisart.VerbrauchsausweisWohnen}
|
||||||
|
showWeiter={false}
|
||||||
|
>
|
||||||
|
</ButtonWeiterHilfe>
|
||||||
|
|
||||||
<!-- A Prüfung der Ausweisart -->
|
<!-- A Prüfung der Ausweisart -->
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Object.keys(bilder).length === 0) {
|
||||||
|
const localStorageBilder = localStorage.getItem("bilder");
|
||||||
|
if (localStorageBilder) {
|
||||||
|
bilder = JSON.parse(localStorageBilder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function automatischAusfüllen() {
|
function automatischAusfüllen() {
|
||||||
aufnahme.baujahr_gebaeude = [1962];
|
aufnahme.baujahr_gebaeude = [1962];
|
||||||
aufnahme.baujahr_heizung = [1952];
|
aufnahme.baujahr_heizung = [1952];
|
||||||
@@ -118,15 +125,10 @@
|
|||||||
let speichernOverlayHidden = true;
|
let speichernOverlayHidden = true;
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if (ausweis.uid && objekt.uid && aufnahme.uid) {
|
localStorage.setItem("ausweis", JSON.stringify(ausweis))
|
||||||
localStorage.setItem(ausweis.uid, JSON.stringify(ausweis))
|
localStorage.setItem("aufnahme", JSON.stringify(aufnahme))
|
||||||
localStorage.setItem(objekt.uid, JSON.stringify(objekt))
|
localStorage.setItem("objekt", JSON.stringify(objekt))
|
||||||
localStorage.setItem(aufnahme.uid, JSON.stringify(aufnahme))
|
localStorage.setItem("bilder", JSON.stringify(bilder))
|
||||||
} else {
|
|
||||||
localStorage.setItem("ausweis", JSON.stringify(ausweis))
|
|
||||||
localStorage.setItem("aufnahme", JSON.stringify(aufnahme))
|
|
||||||
localStorage.setItem("objekt", JSON.stringify(objekt))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
@@ -141,7 +143,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ausweisart: Enums.Ausweisart = "VerbrauchsausweisWohnen"
|
const ausweisart = Enums.Ausweisart.VerbrauchsausweisWohnen
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -79,5 +79,5 @@ if (uid) {
|
|||||||
---
|
---
|
||||||
|
|
||||||
<AusweisLayout title="Verbrauchsausweis Gewerbe erstellen | IBCornelsen">
|
<AusweisLayout title="Verbrauchsausweis Gewerbe erstellen | IBCornelsen">
|
||||||
<VerbrauchsausweisGewerbeModule client:load {ausweis} {objekt} {aufnahme} {bilder} />
|
<VerbrauchsausweisGewerbeModule client:only {ausweis} {objekt} {aufnahme} {bilder} />
|
||||||
</AusweisLayout>
|
</AusweisLayout>
|
||||||
@@ -95,8 +95,9 @@ export const POST: APIRoute = async (Astro) => {
|
|||||||
const ausweis = JSON.parse(params.get("ausweis") || "{}");
|
const ausweis = JSON.parse(params.get("ausweis") || "{}");
|
||||||
const aufnahme = JSON.parse(params.get("aufnahme") || "{}");
|
const aufnahme = JSON.parse(params.get("aufnahme") || "{}");
|
||||||
const objekt = JSON.parse(params.get("objekt") || "{}");
|
const objekt = JSON.parse(params.get("objekt") || "{}");
|
||||||
const bilder = JSON.parse(params.get("bilder") || "{}");
|
const bilder = JSON.parse(params.get("bilder") || "[]");
|
||||||
const ausweisart: Enums.Ausweisart = params.get("ausweisart")
|
const ausweisart: Enums.Ausweisart = JSON.parse(params.get("ausweisart") || "")
|
||||||
|
|
||||||
|
|
||||||
let user: BenutzerClient = {};
|
let user: BenutzerClient = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user