extend report by title

This commit is contained in:
Julian Krauser 2025-07-21 11:03:49 +02:00
parent b56347c172
commit b5a3ff4dc6
8 changed files with 38 additions and 5 deletions

View file

@ -5,6 +5,7 @@
>
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
<p>
{{ damageReport.title }} -
{{ damageReport?.related?.name ?? "Ohne Zuordnung" }}
<small v-if="damageReport?.related">({{ damageReport.related.code }})</small>
</p>

View file

@ -9,6 +9,10 @@
</p>
<p>Typ: {{ check.gear.type }}</p>
</div>
<div>
<label for="title">Kurzbeschreibung (Titel)</label>
<input id="title" type="text" readonly :value="check.title" />
</div>
<div>
<label for="description">Beschreibung des Schadens</label>
<textarea id="description" readonly :value="check.description"></textarea>
@ -59,6 +63,7 @@ export default defineComponent({
check: {
type: Object as PropType<{
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
title: string;
description: string;
location: string;
note: string;
@ -98,6 +103,7 @@ export default defineComponent({
this.message = "";
const formData = new FormData();
if (this.check.gear) formData.append("related", JSON.stringify(this.check.gear));
formData.append("title", this.check.title);
formData.append("description", this.check.description);
formData.append("location", this.check.location);
formData.append("note", this.check.note);

View file

@ -2,6 +2,10 @@
<form class="flex flex-col gap-2" @submit.prevent="setup">
<p class="text-primary cursor-pointer" @click="$emit('stepBack')">zurück</p>
<div class="flex flex-col gap-2">
<div>
<label for="title">Kurzbeschreibung (Titel)</label>
<input id="title" type="text" required :value="data.title" />
</div>
<div>
<label for="description">Beschreibung des Schadens</label>
<textarea id="description" required :value="data.description"></textarea>
@ -45,6 +49,7 @@ export default defineComponent({
data: {
type: Object as PropType<{
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
title: string;
description: string;
location: string;
note: string;
@ -57,7 +62,14 @@ export default defineComponent({
emits: {
nextStep: (s: string) => true,
stepBack: () => true,
data: (d: { description: string; location: string; note: string; reportedBy: string; image?: File }) => true,
data: (d: {
title: string;
description: string;
location: string;
note: string;
reportedBy: string;
image?: File;
}) => true,
},
mounted() {
if (this.data.image) {
@ -68,6 +80,7 @@ export default defineComponent({
setup(e: any) {
let formData = e.target.elements;
this.$emit("data", {
title: formData.title.value,
description: formData.description.value,
location: formData.location.value,
note: formData.note.value,

View file

@ -22,6 +22,7 @@ export type DamageReportAssigned = {
export type DamageReportViewModel = {
id: string;
title: string;
reportedAt: Date;
status: string;
done: boolean;
@ -35,6 +36,7 @@ export type DamageReportViewModel = {
} & Optional<DamageReportAssigned>;
export interface CreateDamageReportViewModel {
title: string;
description: string;
reportedBy: string;
affectedId: string;

View file

@ -14,7 +14,7 @@
>
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
<PencilSquareIcon v-if="!row.done" class="w-5 h-5" />
<p class="grow">{{ new Date(row.reportedAt).toLocaleString("de") }} - {{ row.status }}</p>
<p class="grow">{{ row.title }} - {{ new Date(row.reportedAt).toLocaleString("de") }} - {{ row.status }}</p>
<div class="flex flex-row gap-2">
<div v-if="row.images.length != 0" class="cursor-pointer">
<PhotoIcon class="w-5 h-5" />

View file

@ -14,7 +14,7 @@
>
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
<PencilSquareIcon v-if="!row.done" class="w-5 h-5" />
<p class="grow">{{ new Date(row.reportedAt).toLocaleString("de") }} - {{ row.status }}</p>
<p class="grow">{{ row.title }} - {{ new Date(row.reportedAt).toLocaleString("de") }} - {{ row.status }}</p>
<div class="flex flex-row gap-2">
<div v-if="row.images.length != 0" class="cursor-pointer">
<PhotoIcon class="w-5 h-5" />

View file

@ -14,7 +14,7 @@
>
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
<PencilSquareIcon v-if="!row.done" class="w-5 h-5" />
<p class="grow">{{ new Date(row.reportedAt).toLocaleString("de") }} - {{ row.status }}</p>
<p class="grow">{{ row.title }} - {{ new Date(row.reportedAt).toLocaleString("de") }} - {{ row.status }}</p>
<div class="flex flex-row gap-2">
<div v-if="row.images.length != 0" class="cursor-pointer">
<PhotoIcon class="w-5 h-5" />

View file

@ -56,6 +56,7 @@ export default defineComponent({
usingBarcode: false,
content: {
gear: undefined,
title: "",
description: "",
location: "",
note: "",
@ -63,6 +64,7 @@ export default defineComponent({
image: undefined,
} as {
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
title: string;
description: string;
location: string;
note: string;
@ -83,7 +85,15 @@ export default defineComponent({
this.step = index;
this.successfull = index - 1;
},
updateContent(d: { description: string; location: string; note: string; reportedBy: string; image?: File }) {
updateContent(d: {
title: string;
description: string;
location: string;
note: string;
reportedBy: string;
image?: File;
}) {
this.content.title = d.title;
this.content.description = d.description;
this.content.location = d.location;
this.content.note = d.note;
@ -102,6 +112,7 @@ export default defineComponent({
this.usingBarcode = false;
this.content = {
gear: undefined,
title: "",
description: "",
location: "",
note: "",