extend report by title
This commit is contained in:
parent
b56347c172
commit
b5a3ff4dc6
8 changed files with 38 additions and 5 deletions
|
@ -5,6 +5,7 @@
|
||||||
>
|
>
|
||||||
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
||||||
<p>
|
<p>
|
||||||
|
{{ damageReport.title }} -
|
||||||
{{ damageReport?.related?.name ?? "Ohne Zuordnung" }}
|
{{ damageReport?.related?.name ?? "Ohne Zuordnung" }}
|
||||||
<small v-if="damageReport?.related">({{ damageReport.related.code }})</small>
|
<small v-if="damageReport?.related">({{ damageReport.related.code }})</small>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
</p>
|
</p>
|
||||||
<p>Typ: {{ check.gear.type }}</p>
|
<p>Typ: {{ check.gear.type }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="title">Kurzbeschreibung (Titel)</label>
|
||||||
|
<input id="title" type="text" readonly :value="check.title" />
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="description">Beschreibung des Schadens</label>
|
<label for="description">Beschreibung des Schadens</label>
|
||||||
<textarea id="description" readonly :value="check.description"></textarea>
|
<textarea id="description" readonly :value="check.description"></textarea>
|
||||||
|
@ -59,6 +63,7 @@ export default defineComponent({
|
||||||
check: {
|
check: {
|
||||||
type: Object as PropType<{
|
type: Object as PropType<{
|
||||||
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
|
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
|
||||||
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
location: string;
|
location: string;
|
||||||
note: string;
|
note: string;
|
||||||
|
@ -98,6 +103,7 @@ export default defineComponent({
|
||||||
this.message = "";
|
this.message = "";
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
if (this.check.gear) formData.append("related", JSON.stringify(this.check.gear));
|
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("description", this.check.description);
|
||||||
formData.append("location", this.check.location);
|
formData.append("location", this.check.location);
|
||||||
formData.append("note", this.check.note);
|
formData.append("note", this.check.note);
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
<form class="flex flex-col gap-2" @submit.prevent="setup">
|
<form class="flex flex-col gap-2" @submit.prevent="setup">
|
||||||
<p class="text-primary cursor-pointer" @click="$emit('stepBack')">zurück</p>
|
<p class="text-primary cursor-pointer" @click="$emit('stepBack')">zurück</p>
|
||||||
<div class="flex flex-col gap-2">
|
<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>
|
<div>
|
||||||
<label for="description">Beschreibung des Schadens</label>
|
<label for="description">Beschreibung des Schadens</label>
|
||||||
<textarea id="description" required :value="data.description"></textarea>
|
<textarea id="description" required :value="data.description"></textarea>
|
||||||
|
@ -45,6 +49,7 @@ export default defineComponent({
|
||||||
data: {
|
data: {
|
||||||
type: Object as PropType<{
|
type: Object as PropType<{
|
||||||
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
|
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
|
||||||
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
location: string;
|
location: string;
|
||||||
note: string;
|
note: string;
|
||||||
|
@ -57,7 +62,14 @@ export default defineComponent({
|
||||||
emits: {
|
emits: {
|
||||||
nextStep: (s: string) => true,
|
nextStep: (s: string) => true,
|
||||||
stepBack: () => 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() {
|
mounted() {
|
||||||
if (this.data.image) {
|
if (this.data.image) {
|
||||||
|
@ -68,6 +80,7 @@ export default defineComponent({
|
||||||
setup(e: any) {
|
setup(e: any) {
|
||||||
let formData = e.target.elements;
|
let formData = e.target.elements;
|
||||||
this.$emit("data", {
|
this.$emit("data", {
|
||||||
|
title: formData.title.value,
|
||||||
description: formData.description.value,
|
description: formData.description.value,
|
||||||
location: formData.location.value,
|
location: formData.location.value,
|
||||||
note: formData.note.value,
|
note: formData.note.value,
|
||||||
|
|
|
@ -22,6 +22,7 @@ export type DamageReportAssigned = {
|
||||||
|
|
||||||
export type DamageReportViewModel = {
|
export type DamageReportViewModel = {
|
||||||
id: string;
|
id: string;
|
||||||
|
title: string;
|
||||||
reportedAt: Date;
|
reportedAt: Date;
|
||||||
status: string;
|
status: string;
|
||||||
done: boolean;
|
done: boolean;
|
||||||
|
@ -35,6 +36,7 @@ export type DamageReportViewModel = {
|
||||||
} & Optional<DamageReportAssigned>;
|
} & Optional<DamageReportAssigned>;
|
||||||
|
|
||||||
export interface CreateDamageReportViewModel {
|
export interface CreateDamageReportViewModel {
|
||||||
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
reportedBy: string;
|
reportedBy: string;
|
||||||
affectedId: string;
|
affectedId: string;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
>
|
>
|
||||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
<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" />
|
<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 class="flex flex-row gap-2">
|
||||||
<div v-if="row.images.length != 0" class="cursor-pointer">
|
<div v-if="row.images.length != 0" class="cursor-pointer">
|
||||||
<PhotoIcon class="w-5 h-5" />
|
<PhotoIcon class="w-5 h-5" />
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
>
|
>
|
||||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
<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" />
|
<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 class="flex flex-row gap-2">
|
||||||
<div v-if="row.images.length != 0" class="cursor-pointer">
|
<div v-if="row.images.length != 0" class="cursor-pointer">
|
||||||
<PhotoIcon class="w-5 h-5" />
|
<PhotoIcon class="w-5 h-5" />
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
>
|
>
|
||||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
<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" />
|
<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 class="flex flex-row gap-2">
|
||||||
<div v-if="row.images.length != 0" class="cursor-pointer">
|
<div v-if="row.images.length != 0" class="cursor-pointer">
|
||||||
<PhotoIcon class="w-5 h-5" />
|
<PhotoIcon class="w-5 h-5" />
|
||||||
|
|
|
@ -56,6 +56,7 @@ export default defineComponent({
|
||||||
usingBarcode: false,
|
usingBarcode: false,
|
||||||
content: {
|
content: {
|
||||||
gear: undefined,
|
gear: undefined,
|
||||||
|
title: "",
|
||||||
description: "",
|
description: "",
|
||||||
location: "",
|
location: "",
|
||||||
note: "",
|
note: "",
|
||||||
|
@ -63,6 +64,7 @@ export default defineComponent({
|
||||||
image: undefined,
|
image: undefined,
|
||||||
} as {
|
} as {
|
||||||
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
|
gear: undefined | MinifiedEquipmentViewModel | MinifiedVehicleViewModel | MinifiedWearableViewModel;
|
||||||
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
location: string;
|
location: string;
|
||||||
note: string;
|
note: string;
|
||||||
|
@ -83,7 +85,15 @@ export default defineComponent({
|
||||||
this.step = index;
|
this.step = index;
|
||||||
this.successfull = index - 1;
|
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.description = d.description;
|
||||||
this.content.location = d.location;
|
this.content.location = d.location;
|
||||||
this.content.note = d.note;
|
this.content.note = d.note;
|
||||||
|
@ -102,6 +112,7 @@ export default defineComponent({
|
||||||
this.usingBarcode = false;
|
this.usingBarcode = false;
|
||||||
this.content = {
|
this.content = {
|
||||||
gear: undefined,
|
gear: undefined,
|
||||||
|
title: "",
|
||||||
description: "",
|
description: "",
|
||||||
location: "",
|
location: "",
|
||||||
note: "",
|
note: "",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue