GEG Nachweis und Gebäudeliste
This commit is contained in:
@@ -4,7 +4,7 @@ import { exclude } from "#lib/exclude.js";
|
||||
import Cookies from "js-cookie";
|
||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
|
||||
import { AufnahmeClient, BedarfsausweisWohnenClient, BildClient, ObjektClient, UnterlageClient, UploadedGebaeudeBild, VerbrauchsausweisGewerbeClient, VerbrauchsausweisWohnenClient, } from "#components/Ausweis/types.js";
|
||||
import { Enums } from "#lib/client/prisma";
|
||||
import { Enums } from "#lib/client/prisma.js";
|
||||
|
||||
export async function nachweisSpeichern(
|
||||
nachweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient | BedarfsausweisWohnenClient,
|
||||
|
||||
111
src/components/Dashboard/DashboardNachweis.svelte
Normal file
111
src/components/Dashboard/DashboardNachweis.svelte
Normal file
@@ -0,0 +1,111 @@
|
||||
<script lang="ts">
|
||||
import { AufnahmeKomplettClient, GEGNachweisWohnenClient, getAusweisartFromUUID } from "#components/Ausweis/types.js";
|
||||
import {
|
||||
CrossCircled,
|
||||
DotsVertical,
|
||||
Pencil2,
|
||||
QuestionMarkCircled,
|
||||
} from "radix-svelte-icons";
|
||||
import { Enums, Objekt } from "#lib/client/prisma.js";
|
||||
|
||||
export let nachweis: GEGNachweisWohnenClient;
|
||||
export let aufnahme: AufnahmeKomplettClient;
|
||||
export let objekt: Objekt;
|
||||
|
||||
const ausweisart = getAusweisartFromUUID(nachweis.uid);
|
||||
|
||||
let hilfeModal: HTMLDialogElement;
|
||||
</script>
|
||||
|
||||
<div class="relative bg-base-200 border border-base-300 rounded-lg p-4">
|
||||
{#if nachweis.storniert}
|
||||
<div
|
||||
class="absolute top-0 left-0 w-full h-full bg-[rgba(0,0,0,0.7)] z-[5] rounded-lg select-none"
|
||||
>
|
||||
<h1
|
||||
class="absolute -rotate-[25deg] text-5xl md:text-7xl tracking-wide uppercase text-red-500 border-4 border-red-500 rounded-lg top-[50%] translate-y-[-50%] left-[50%] translate-x-[-50%]"
|
||||
>
|
||||
Storniert
|
||||
</h1>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="card-body">
|
||||
<div
|
||||
class="flex justify-end mb-2 dropdown dropdown-bottom absolute top-4 right-4"
|
||||
>
|
||||
<button class="rounded-full p-2.5 hover:bg-base-100">
|
||||
<DotsVertical size={15} />
|
||||
</button>
|
||||
<ul
|
||||
tabindex="-1"
|
||||
class="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-64 gap-2"
|
||||
>
|
||||
<li>
|
||||
<button><Pencil2 size={15} /> Als Vorlage benutzen</button>
|
||||
</li>
|
||||
<li>
|
||||
<button on:click={() => hilfeModal.showModal()}
|
||||
><QuestionMarkCircled size={15} /> Hilfe Erhalten</button
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex flex-row flex-wrap items-center gap-2">
|
||||
{#if ausweisart == Enums.Ausweisart.GEGNachweisWohnen}
|
||||
<div class="text-lg font-semibold">
|
||||
GEG Nachweis Wohnen
|
||||
</div>
|
||||
{:else if ausweisart == Enums.Ausweisart.GEGNachweisGewerbe}
|
||||
<div class="text-lg font-semibold">
|
||||
GEG Nachweis Gewerbe
|
||||
</div>
|
||||
{:else if ausweisart == Enums.Ausweisart.GEGNachweisBedarfsausweis}
|
||||
<div class="text-lg font-semibold">
|
||||
Bedarfsausweis Gewerbe
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="badge badge-accent font-semibold text-black text-m">{objekt.adresse}</div>
|
||||
|
||||
<div class="flex flex-row justify-end gap-4 mt-4">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dialog bind:this={hilfeModal} class="modal">
|
||||
<div class="modal-box">
|
||||
<h3 class="font-bold text-xl mb-4">Hilfe Anfordern</h3>
|
||||
<p>
|
||||
Brauchen sie Hilfe bei der Erstellung oder Bearbeitung ihres
|
||||
Ausweises?
|
||||
</p>
|
||||
<p>
|
||||
In unserem <a href="/helpdesk">Helpdesk</a> finden sie antworten auf
|
||||
häufig gestellte Fragen.
|
||||
</p>
|
||||
<p>
|
||||
Falls sie dort nicht finden wonach sie suchen, rufen sie uns doch
|
||||
unter <a href="tel:040-209-339-850">040 209 339 850</a> an oder
|
||||
<a href="mailto:info@online-energieausweis.com">schreiben sie uns eine email</a
|
||||
>.
|
||||
</p>
|
||||
<p>
|
||||
Wenn wir telefonisch nicht erreichbar sind, können sie uns auch
|
||||
direkt hier eine Nachricht hinterlassen.
|
||||
</p>
|
||||
<form class="my-4">
|
||||
<textarea
|
||||
class="textarea textarea-bordered"
|
||||
placeholder="Ihre Nachricht..."
|
||||
cols="10"
|
||||
rows="5"
|
||||
></textarea>
|
||||
<button class="btn btn-primary">Nachricht Abschicken</button>
|
||||
</form>
|
||||
<div class="modal-action">
|
||||
<form method="dialog">
|
||||
<button class="btn">Schließen</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -6,10 +6,11 @@
|
||||
import DashboardNotification from "./DashboardNotification.svelte";
|
||||
import { notifications } from "#components/NotificationProvider/shared.js";
|
||||
import ThemeController from "#components/ThemeController.svelte";
|
||||
import { BenutzerClient } from "#components/Ausweis/types.js";
|
||||
import { BenutzerClient, ObjektClient } from "#components/Ausweis/types.js";
|
||||
|
||||
export let lightTheme: boolean;
|
||||
export let benutzer: BenutzerClient;
|
||||
export let objekte: ObjektClient[];
|
||||
|
||||
const rippleOptions: RippleOptions = {
|
||||
center: false,
|
||||
@@ -41,15 +42,10 @@
|
||||
<Reader width={22} height={22} />
|
||||
Gebäude
|
||||
</a>
|
||||
<div class="flex ml-12">Katendeich 5AAA<br>44145 Dortmund</div>
|
||||
<hr class="border-gray-600">
|
||||
<div class="flex ml-12">Birkenalee<br>33175 Bad Lippspringe</div>
|
||||
<hr class="border-gray-600">
|
||||
<div class="flex ml-12">Birkenalee<br>33175 Bad Lippspringe</div>
|
||||
<hr class="border-gray-600">
|
||||
<div class="flex ml-12">Katendeich 5AAA<br>44145 Dortmund</div>
|
||||
<hr class="border-gray-600">
|
||||
<div class="flex ml-12">Katendeich 5AAA<br>44145 Dortmund</div>
|
||||
{#each objekte as objekt}
|
||||
<a class="flex ml-12" href="/dashboard/aufnahme/{objekt.aufnahmen[0].uid}">{objekt.adresse}<br>{objekt.plz} {objekt.ort}</a>
|
||||
<hr class="border-gray-600">
|
||||
{/each}
|
||||
<!-- <button use:ripple={rippleOptions} class="button-tab">
|
||||
<EnvelopeClosed width={22} height={22} />
|
||||
Kontakt
|
||||
|
||||
@@ -4,7 +4,8 @@ import "../style/global.css";
|
||||
import "../../svelte-dialogs.config.js";
|
||||
import DashboardSidebar from "../components/Dashboard/DashboardSidebar.svelte";
|
||||
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
|
||||
import { BenutzerClient } from "#components/Ausweis/types";
|
||||
import { BenutzerClient, ObjektClient } from "#components/Ausweis/types";
|
||||
import { prisma } from "#lib/server/prisma";
|
||||
|
||||
const valid = validateAccessTokenServer(Astro)
|
||||
|
||||
@@ -19,6 +20,29 @@ export interface Props {
|
||||
|
||||
const { title, user } = Astro.props;
|
||||
|
||||
const objekte = await prisma.objekt.findMany({
|
||||
where: {
|
||||
benutzer: {
|
||||
uid: user.uid
|
||||
}
|
||||
},
|
||||
take: 10,
|
||||
orderBy: {
|
||||
erstellungsdatum: "desc"
|
||||
},
|
||||
include: {
|
||||
aufnahmen: {
|
||||
include: {
|
||||
bilder: true,
|
||||
unterlagen: true,
|
||||
bedarfsausweise_wohnen: true,
|
||||
verbrauchsausweise_gewerbe: true,
|
||||
verbrauchsausweise_wohnen: true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const schema = JSON.stringify({
|
||||
"@context": "http://schema.org",
|
||||
"@type": "Corporation",
|
||||
@@ -107,7 +131,7 @@ let lightTheme = Astro.cookies.get("theme")?.value === "light";
|
||||
2xl:grid-cols-[minmax(150px,300px)1fr] 2xl:gap-5 2xl:p-6"
|
||||
>
|
||||
|
||||
<DashboardSidebar lightTheme={lightTheme} benutzer={user} client:load>
|
||||
<DashboardSidebar lightTheme={lightTheme} benutzer={user} {objekte} client:load>
|
||||
</DashboardSidebar>
|
||||
|
||||
<article class="box rounded-tl-none
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { AufnahmeKomplettClient, BenutzerClient } from "#components/Ausweis/types.js";
|
||||
import Carousel from "#components/Carousel.svelte";
|
||||
import DashboardAusweis from "#components/Dashboard/DashboardAusweis.svelte";
|
||||
import DashboardNachweis from "#components/Dashboard/DashboardNachweis.svelte";
|
||||
import { Objekt } from "#lib/client/prisma.js";
|
||||
import { ChevronLeft, ChevronRight } from "radix-svelte-icons";
|
||||
|
||||
@@ -71,4 +72,7 @@
|
||||
{#each aufnahme.verbrauchsausweise_gewerbe as ausweis}
|
||||
<DashboardAusweis {ausweis} {aufnahme} {objekt}></DashboardAusweis>
|
||||
{/each}
|
||||
{#each aufnahme.geg_nachweise_wohnen as nachweis}
|
||||
<DashboardNachweis {nachweis} {aufnahme} {objekt}></DashboardNachweis>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -10,7 +10,7 @@
|
||||
GEGNachweisWohnenClient,
|
||||
} from "#components/Ausweis/types.js";
|
||||
import Bereich from "#components/labels/Bereich.svelte";
|
||||
import { Enums } from "#lib/client/prisma";
|
||||
import { Enums } from "#lib/client/prisma.js";
|
||||
import InputLabel from "#components/labels/InputLabel.svelte";
|
||||
import HelpLabel from "#components/labels/HelpLabel.svelte";
|
||||
import Progressbar from "#components/Ausweis/Progressbar.svelte";
|
||||
@@ -24,40 +24,39 @@
|
||||
export let aufnahme: AufnahmeClient;
|
||||
export let user: BenutzerClient = {} as BenutzerClient;
|
||||
export let bilder: UploadedGebaeudeBild[] = [];
|
||||
export let plaene: UnterlageClient[] =
|
||||
[];
|
||||
export let plaene: UnterlageClient[] = [];
|
||||
export let unterlagen: UnterlageClient[] = [];
|
||||
|
||||
if (Object.keys(nachweis).length === 0) {
|
||||
const localStorageAusweis = localStorage.getItem("ausweis");
|
||||
const localStorageAusweis = localStorage.getItem("geg-nachweis-wohnen.ausweis");
|
||||
if (localStorageAusweis) {
|
||||
nachweis = JSON.parse(localStorageAusweis)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(aufnahme).length === 0) {
|
||||
const localStorageAufnahme = localStorage.getItem("aufnahme");
|
||||
const localStorageAufnahme = localStorage.getItem("geg-nachweis-wohnen.aufnahme");
|
||||
if (localStorageAufnahme) {
|
||||
aufnahme = JSON.parse(localStorageAufnahme)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(objekt).length === 0) {
|
||||
const localStorageObjekt = localStorage.getItem("objekt");
|
||||
const localStorageObjekt = localStorage.getItem("geg-nachweis-wohnen.objekt");
|
||||
if (localStorageObjekt) {
|
||||
objekt = JSON.parse(localStorageObjekt)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(bilder).length === 0) {
|
||||
const localStorageBilder = localStorage.getItem("bilder");
|
||||
const localStorageBilder = localStorage.getItem("geg-nachweis-wohnen.bilder");
|
||||
if (localStorageBilder) {
|
||||
bilder = JSON.parse(localStorageBilder)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(unterlagen).length === 0) {
|
||||
const localStorageUnterlagen = localStorage.getItem("unterlagen");
|
||||
const localStorageUnterlagen = localStorage.getItem("geg-nachweis-wohnen.unterlagen");
|
||||
if (localStorageUnterlagen) {
|
||||
unterlagen = JSON.parse(localStorageUnterlagen)
|
||||
}
|
||||
@@ -65,18 +64,21 @@
|
||||
|
||||
|
||||
$: {
|
||||
localStorage.setItem("ausweis", JSON.stringify(nachweis))
|
||||
localStorage.setItem("aufnahme", JSON.stringify(aufnahme))
|
||||
localStorage.setItem("objekt", JSON.stringify(objekt))
|
||||
localStorage.setItem("bilder", JSON.stringify(bilder))
|
||||
localStorage.setItem("unterlagen", JSON.stringify(unterlagen))
|
||||
localStorage.setItem("geg-nachweis-wohnen.ausweis", JSON.stringify(nachweis))
|
||||
localStorage.setItem("geg-nachweis-wohnen.aufnahme", JSON.stringify(aufnahme))
|
||||
localStorage.setItem("geg-nachweis-wohnen.objekt", JSON.stringify(objekt))
|
||||
localStorage.setItem("geg-nachweis-wohnen.bilder", JSON.stringify(bilder))
|
||||
localStorage.setItem("geg-nachweis-wohnen.unterlagen", JSON.stringify(unterlagen))
|
||||
}
|
||||
|
||||
const ausweisart = Enums.Ausweisart.GEGNachweisWohnen;
|
||||
const anliegen = "Angebot anfragen";
|
||||
|
||||
let form: HTMLFormElement;
|
||||
let skala: HTMLDivElement;
|
||||
</script>
|
||||
|
||||
<div id="skala" class="bg-white grid grid-cols-1 p-4 lg:grid-cols-2 lg:gap-x-6 no-scroll">
|
||||
<div id="skala" bind:this={skala} class="bg-white grid grid-cols-1 p-4 lg:grid-cols-2 lg:gap-x-6 no-scroll">
|
||||
|
||||
<Progressbar active={0} {ausweisart} {anliegen} steps={["Gebäudedaten","Kundendaten","Anfragebestätigung"]} />
|
||||
|
||||
@@ -86,6 +88,7 @@
|
||||
id="formInput-1"
|
||||
name="ausweis"
|
||||
data-test="ausweis"
|
||||
bind:this={form}
|
||||
>
|
||||
<div id="formular-box" class="formular-boxen ring-0">
|
||||
<!-- A Prüfung der Ausweisart -->
|
||||
@@ -189,6 +192,8 @@
|
||||
bind:objekt
|
||||
bind:aufnahme
|
||||
ausweisart={Enums.Ausweisart.GEGNachweisWohnen}
|
||||
{form}
|
||||
{skala}
|
||||
>
|
||||
</ButtonWeiterHilfe>
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { authorizationMiddleware } from "#lib/middleware/authorization.js";
|
||||
import { prisma, UnterlageSchema } from "#lib/server/prisma";
|
||||
import { prisma } from "#lib/server/prisma.js";
|
||||
import { APIError, defineApiRoute } from "astro-typesafe-api/server";
|
||||
import { z } from "zod";
|
||||
import { fileURLToPath } from "url";
|
||||
import { writeFileSync } from "fs";
|
||||
import { PERSISTENT_DIR } from "#lib/server/constants.js";
|
||||
import { UnterlageSchema } from "src/generated/zod/unterlage.js";
|
||||
|
||||
export const PUT = defineApiRoute({
|
||||
input: UnterlageSchema.omit({
|
||||
|
||||
Reference in New Issue
Block a user