69 lines
2.3 KiB
Vue
69 lines
2.3 KiB
Vue
<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 }">
|
|
<RouterLink
|
|
:to="{ name: 'admin-unit-inspection-execute', params: { inspectionId: row.id } }"
|
|
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.isOpen" class="w-5 h-5" />
|
|
<p>{{ row.inspectionPlan.title }} - {{ row.finished }}</p>
|
|
</div>
|
|
<div class="p-2">
|
|
<p v-if="row.context">Kontext: {{ row.context }}</p>
|
|
<p v-if="row.nextInspection">nächste Inspektion: {{ row.nextInspection }}</p>
|
|
</div>
|
|
</RouterLink>
|
|
</template>
|
|
</Pagination>
|
|
<div class="flex flex-row gap-4">
|
|
<RouterLink
|
|
v-if="can('create', 'unit', 'equipment')"
|
|
:to="{ name: 'admin-unit-inspection-plan', params: { type: 'equipment', relatedId: equipmentId } }"
|
|
button
|
|
primary
|
|
class="w-fit!"
|
|
@click=""
|
|
>Prüfung durchführen</RouterLink
|
|
>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { defineComponent } from "vue";
|
|
import { mapActions, mapState } from "pinia";
|
|
import { useAbilityStore } from "@/stores/ability";
|
|
import { useEquipmentInspectionStore } from "@/stores/admin/unit/equipment/inspection";
|
|
import { PencilSquareIcon } from "@heroicons/vue/24/outline";
|
|
import Pagination from "@/components/Pagination.vue";
|
|
import type { InspectionViewModel } from "@/viewmodels/admin/unit/inspection/inspection.models";
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
export default defineComponent({
|
|
props: {
|
|
equipmentId: String,
|
|
},
|
|
computed: {
|
|
...mapState(useAbilityStore, ["can"]),
|
|
...mapState(useEquipmentInspectionStore, ["inspections", "loading", "totalCount"]),
|
|
},
|
|
mounted() {
|
|
this.fetchItem();
|
|
},
|
|
methods: {
|
|
...mapActions(useEquipmentInspectionStore, ["fetchInspectionForEquipment"]),
|
|
fetchItem() {
|
|
this.fetchInspectionForEquipment();
|
|
},
|
|
},
|
|
});
|
|
</script>
|