change of models
This commit is contained in:
parent
a49babe48d
commit
ee700d9e02
28 changed files with 257 additions and 39 deletions
|
@ -61,7 +61,7 @@ export default defineComponent({
|
|||
return {
|
||||
tabs: [
|
||||
{ route: "admin-unit-equipment-overview", title: "Übersicht" },
|
||||
{ route: "admin-unit-equipment-maintenance", title: "Wartungen" },
|
||||
{ route: "admin-unit-equipment-maintenance", title: "Wartungen/Reparaturen" },
|
||||
{ route: "admin-unit-equipment-inspection", title: "Prüfungen" },
|
||||
{ route: "admin-unit-equipment-damage_report", title: "Schadensmeldungen" },
|
||||
],
|
||||
|
|
|
@ -7,7 +7,15 @@
|
|||
<p v-else-if="loading == 'failed'" @click="fetchItem" class="cursor-pointer">↺ laden fehlgeschlagen</p>
|
||||
</div>
|
||||
<div class="flex flex-row gap-4">
|
||||
<button v-if="can('create', 'unit', 'equipment_type')" primary class="w-fit!" @click="">Prüfplan erstellen</button>
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'equipment_type')"
|
||||
:to="{ name: 'admin-unit-inspection_plan-create', query: { type: 'equipment', id: equipmentTypeId } }"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
>
|
||||
Prüfplan erstellen
|
||||
</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<EquipmentTypeSearchSelect v-if="active == 'gear'" title="Typ" v-model="selectedType" />
|
||||
<EquipmentTypeSearchSelect v-if="active == 'equipment'" title="Typ" v-model="selectedType" />
|
||||
<VehicleTypeSearchSelect v-else title="Typ" v-model="selectedType" />
|
||||
|
||||
<div>
|
||||
|
@ -114,22 +114,32 @@ export default defineComponent({
|
|||
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||
timeout: null as any,
|
||||
selectedType: "" as string,
|
||||
active: "gear" as string,
|
||||
active: "equipment" as "equipment" | "vehicle",
|
||||
tabs: [
|
||||
{
|
||||
key: "gear",
|
||||
key: "equipment",
|
||||
title: "Gerät",
|
||||
},
|
||||
{
|
||||
key: "vehicle",
|
||||
title: "Fahrzeug",
|
||||
},
|
||||
],
|
||||
] as Array<{ key: "equipment" | "vehicle"; title: string }>,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useInspectionPlanStore, ["inspectionPlans"]),
|
||||
},
|
||||
mounted() {
|
||||
let query = this.$route.query;
|
||||
const queryType = Array.isArray(query.type) ? query.type[0] : query.type;
|
||||
const queryId = Array.isArray(query.id) ? query.id[0] : query.id;
|
||||
if (["vehicle", "equipment"].includes(queryType ?? "")) {
|
||||
this.active = queryType as "equipment" | "vehicle";
|
||||
this.selectedType = queryId as string;
|
||||
}
|
||||
console.log(query);
|
||||
},
|
||||
beforeUnmount() {
|
||||
try {
|
||||
clearTimeout(this.timeout);
|
||||
|
@ -143,9 +153,10 @@ export default defineComponent({
|
|||
let formData = e.target.elements;
|
||||
let createInspectionPlan: CreateInspectionPlanViewModel = {
|
||||
title: formData.name.value,
|
||||
equipmentTypeId: "",
|
||||
inspectionInterval: formData.name.value,
|
||||
remindTime: formData.name.value,
|
||||
relatedId: this.selectedType,
|
||||
assigned: this.active,
|
||||
};
|
||||
this.status = "loading";
|
||||
this.createInspectionPlan(createInspectionPlan)
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
<template>
|
||||
<div class="flex flex-col gap-2 h-full w-full overflow-y-auto">
|
||||
<div class="flex flex-col gap-2 h-full w-full overflow-hidden">
|
||||
<div v-if="activeInspectionPlanObj != null" class="flex flex-col gap-2 w-full">
|
||||
<div>
|
||||
<label for="type">Typ</label>
|
||||
<input type="text" id="type" :value="activeInspectionPlanObj.equipmentType.type" readonly />
|
||||
<input type="text" id="type" :value="activeInspectionPlanObj.related.type" readonly />
|
||||
</div>
|
||||
<div>
|
||||
<label for="interval">Intervall</label>
|
||||
<input type="text" id="interval" :value="activeInspectionPlanObj.inspectionInterval" reaonly />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="activeInspectionPlanObj?.inspectionPoints" class="flex flex-col gap-2">
|
||||
<p>Prüfungspunkte</p>
|
||||
<div v-if="activeInspectionPlanObj?.inspectionPoints" class="flex flex-col gap-2 grow overflow-y-scroll">
|
||||
<div
|
||||
v-for="point in activeInspectionPlanObj?.inspectionPoints"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
|
|
|
@ -61,7 +61,7 @@ export default defineComponent({
|
|||
return {
|
||||
tabs: [
|
||||
{ route: "admin-unit-vehicle-overview", title: "Übersicht" },
|
||||
{ route: "admin-unit-vehicle-maintenance", title: "Wartungen" },
|
||||
{ route: "admin-unit-vehicle-maintenance", title: "Wartungen/Reparaturen" },
|
||||
{ route: "admin-unit-vehicle-inspection", title: "Prüfungen" },
|
||||
{ route: "admin-unit-vehicle-damage_report", title: "Schadensmeldungen" },
|
||||
],
|
||||
|
|
|
@ -8,7 +8,15 @@
|
|||
</div>
|
||||
|
||||
<div class="flex flex-row gap-4">
|
||||
<button v-if="can('create', 'unit', 'vehicle_type')" primary class="w-fit!" @click="">Prüfplan erstellen</button>
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'vehicle_type')"
|
||||
:to="{ name: 'admin-unit-inspection_plan-create', query: { type: 'vehicle', id: vehicleTypeId } }"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
>
|
||||
Prüfplan erstellen
|
||||
</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
55
src/views/admin/unit/wearable/DamageReport.vue
Normal file
55
src/views/admin/unit/wearable/DamageReport.vue
Normal file
|
@ -0,0 +1,55 @@
|
|||
<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" />
|
||||
<PhotoIcon v-if="row.providedImage" />
|
||||
<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 { useWearableDamageReportStore } from "@/stores/admin/unit/wearable/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: {
|
||||
wearableId: String,
|
||||
},
|
||||
computed: {
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
...mapState(useWearableDamageReportStore, ["damageReports", "loading", "totalCount"]),
|
||||
},
|
||||
mounted() {
|
||||
this.fetchItem();
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useWearableDamageReportStore, ["fetchDamageReportForWearable"]),
|
||||
fetchItem() {
|
||||
this.fetchDamageReportForWearable();
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
|
@ -61,6 +61,7 @@ export default defineComponent({
|
|||
return {
|
||||
tabs: [
|
||||
{ route: "admin-unit-wearable-overview", title: "Übersicht" },
|
||||
{ route: "admin-unit-wearable-maintenance", title: "Reparaturen" },
|
||||
{ route: "admin-unit-wearable-damage_report", title: "Schadensmeldungen" },
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue