2025-05-14 09:13:47 +02:00
|
|
|
<template>
|
|
|
|
<div class="flex flex-col gap-2 h-full w-full">
|
|
|
|
<Pagination
|
|
|
|
:items="damageReports"
|
|
|
|
:totalCount="totalCount"
|
|
|
|
:indicateLoading="false"
|
|
|
|
@load-data="(offset, count, search) => {}"
|
|
|
|
@search="(search) => {}"
|
|
|
|
>
|
|
|
|
<template #pageRow="{ row }: { row: DamageReportViewModel }">
|
|
|
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
|
|
|
<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" />
|
2025-06-04 14:30:41 +02:00
|
|
|
<PhotoIcon v-if="row.imageCount != 0" class="w-5 h-5" />
|
|
|
|
<p>{{ row.reportedAt }} - {{ row.status }}</p>
|
2025-05-14 09:13:47 +02:00
|
|
|
</div>
|
|
|
|
<div class="p-2">
|
2025-06-04 14:30:41 +02:00
|
|
|
<p v-if="row.reportedBy">gemeldet von: {{ row.reportedBy }}</p>
|
2025-05-14 09:13:47 +02:00
|
|
|
<p>Beschreibung: {{ row.description }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</Pagination>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { defineComponent } from "vue";
|
|
|
|
import { mapActions, mapState } from "pinia";
|
|
|
|
import { useAbilityStore } from "@/stores/ability";
|
|
|
|
import { useVehicleDamageReportStore } from "@/stores/admin/unit/vehicle/damageReport";
|
|
|
|
import Pagination from "@/components/Pagination.vue";
|
2025-06-04 12:49:42 +02:00
|
|
|
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
2025-05-14 09:13:47 +02:00
|
|
|
import { PhotoIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
vehicleId: String,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState(useAbilityStore, ["can"]),
|
|
|
|
...mapState(useVehicleDamageReportStore, ["damageReports", "loading", "totalCount"]),
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetchItem();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions(useVehicleDamageReportStore, ["fetchDamageReportForVehicle"]),
|
|
|
|
fetchItem() {
|
|
|
|
this.fetchDamageReportForVehicle();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|