ff-admin/src/views/admin/unit/vehicle/DamageReport.vue

56 lines
1.8 KiB
Vue
Raw Normal View History

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-02 13:14:24 +02:00
<PhotoIcon v-if="row.providedImage" class="w-5 h-5" />
2025-05-14 09:13:47 +02:00
<p>{{ row.reported }} - {{ row.status }}</p>
</div>
<div class="p-2">
<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";
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
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>