2025-05-14 09:13:47 +02:00
|
|
|
<template>
|
|
|
|
<div class="flex flex-col gap-2 h-full w-full">
|
|
|
|
<Pagination
|
|
|
|
:items="inspections"
|
|
|
|
:totalCount="totalCount"
|
|
|
|
:indicateLoading="false"
|
|
|
|
@load-data="(offset, count, search) => {}"
|
|
|
|
@search="(search) => {}"
|
|
|
|
>
|
|
|
|
<template #pageRow="{ row }: { row: InspectionViewModel }">
|
2025-05-15 14:11:33 +02:00
|
|
|
<RouterLink
|
2025-05-16 10:27:08 +02:00
|
|
|
:to="{ name: 'admin-unit-inspection-execute', params: { inspectionId: row.id } }"
|
2025-05-15 14:11:33 +02:00
|
|
|
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
|
|
|
>
|
2025-05-14 09:13:47 +02:00
|
|
|
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
|
|
|
<PencilSquareIcon v-if="row.isOpen" class="w-5 h-5" />
|
2025-07-10 13:22:38 +02:00
|
|
|
<p>{{ row.inspectionPlan.title }} - {{ row.finished ?? "in Arbeit" }}</p>
|
2025-05-14 09:13:47 +02:00
|
|
|
</div>
|
2025-07-10 13:22:38 +02:00
|
|
|
<div v-if="row.context || row.nextInspection" class="p-2">
|
2025-05-14 09:13:47 +02:00
|
|
|
<p v-if="row.context">Kontext: {{ row.context }}</p>
|
|
|
|
<p v-if="row.nextInspection">nächste Inspektion: {{ row.nextInspection }}</p>
|
|
|
|
</div>
|
2025-05-15 14:11:33 +02:00
|
|
|
</RouterLink>
|
2025-05-14 09:13:47 +02:00
|
|
|
</template>
|
|
|
|
</Pagination>
|
|
|
|
<div class="flex flex-row gap-4">
|
2025-05-15 14:11:33 +02:00
|
|
|
<RouterLink
|
|
|
|
v-if="can('create', 'unit', 'vehicle')"
|
2025-07-09 12:58:12 +02:00
|
|
|
:to="{ name: 'admin-unit-inspection-start', params: { type: 'vehicle', relatedId: vehicleId } }"
|
2025-05-15 14:11:33 +02:00
|
|
|
button
|
|
|
|
primary
|
|
|
|
class="w-fit!"
|
|
|
|
>
|
2025-07-10 13:22:38 +02:00
|
|
|
Prüfung durchführen
|
|
|
|
</RouterLink>
|
2025-05-14 09:13:47 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { defineComponent } from "vue";
|
|
|
|
import { mapActions, mapState } from "pinia";
|
|
|
|
import { useAbilityStore } from "@/stores/ability";
|
|
|
|
import { useVehicleInspectionStore } from "@/stores/admin/unit/vehicle/inspection";
|
|
|
|
import { PencilSquareIcon } from "@heroicons/vue/24/outline";
|
|
|
|
import Pagination from "@/components/Pagination.vue";
|
2025-05-16 10:27:08 +02:00
|
|
|
import type { InspectionViewModel } from "@/viewmodels/admin/unit/inspection/inspection.models";
|
2025-05-14 09:13:47 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
vehicleId: String,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState(useAbilityStore, ["can"]),
|
|
|
|
...mapState(useVehicleInspectionStore, ["inspections", "loading", "totalCount"]),
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetchItem();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions(useVehicleInspectionStore, ["fetchInspectionForVehicle"]),
|
|
|
|
fetchItem() {
|
|
|
|
this.fetchInspectionForVehicle();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|