Compare commits
2 commits
b280654f92
...
ddeac1aa26
Author | SHA1 | Date | |
---|---|---|---|
ddeac1aa26 | |||
6c8d57a7e5 |
78 changed files with 267 additions and 666 deletions
|
@ -16,7 +16,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -40,7 +40,7 @@ import Spinner from "@/components/Spinner.vue";
|
|||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipmentType";
|
||||
import type { CreateEquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import type { CreateEquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -39,7 +39,7 @@ import Spinner from "@/components/Spinner.vue";
|
|||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipmentType";
|
||||
import type { CreateEquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import type { CreateEquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
{{ equipmentType.type }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-col p-2">
|
||||
<div class="flex flex-row gap-2">
|
||||
<p class="min-w-16">Beschreibung:</p>
|
||||
<p class="grow overflow-hidden">{{ equipmentType.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</RouterLink>
|
||||
</template>
|
||||
|
||||
|
@ -15,7 +21,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<script setup lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
import { RadioGroup, RadioGroupOption } from "@headlessui/vue";
|
||||
import type { InspectionPointViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { InspectionPointViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
import type { InspectionPointViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { InspectionPointViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { RespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||
import type { RespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryGear.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { RespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||
import type { RespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryMission.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { RespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||
import type { RespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryWearer.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -40,7 +40,7 @@ import Spinner from "@/components/Spinner.vue";
|
|||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
import { useVehicleTypeStore } from "@/stores/admin/unit/vehicleType/vehicleType";
|
||||
import type { CreateVehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
import type { CreateVehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicle/vehicleType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
{{ vehicleType.type }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-col p-2">
|
||||
<div class="flex flex-row gap-2">
|
||||
<p class="min-w-16">Beschreibung:</p>
|
||||
<p class="grow overflow-hidden">{{ vehicleType.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</RouterLink>
|
||||
</template>
|
||||
|
||||
|
@ -15,7 +21,7 @@
|
|||
import { defineComponent, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicle/vehicleType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -40,7 +40,7 @@ import Spinner from "@/components/Spinner.vue";
|
|||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
import { useWearableTypeStore } from "@/stores/admin/unit/wearableType/wearableType";
|
||||
import type { CreateWearableTypeViewModel } from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
import type { CreateWearableTypeViewModel } from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -39,7 +39,7 @@ import Spinner from "@/components/Spinner.vue";
|
|||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
import { useWearableTypeStore } from "@/stores/admin/unit/wearableType/wearableType";
|
||||
import type { CreateWearableTypeViewModel } from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
import type { CreateWearableTypeViewModel } from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -4,15 +4,34 @@
|
|||
<p>
|
||||
{{ wearableType.type }}
|
||||
</p>
|
||||
<div class="flex flex-row">
|
||||
<RouterLink
|
||||
v-if="can('update', 'unit', 'wearable_type')"
|
||||
:to="{ name: 'admin-unit-wearable_type-edit', params: { wearableTypeId: wearableType.id } }"
|
||||
>
|
||||
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||
</RouterLink>
|
||||
<div v-if="can('delete', 'unit', 'wearable_type')" @click="openDeleteModal">
|
||||
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col p-2">
|
||||
<div class="flex flex-row gap-2">
|
||||
<p class="min-w-16">Beschreibung:</p>
|
||||
<p class="grow overflow-hidden">{{ wearableType.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
import { defineAsyncComponent, defineComponent, markRaw, type PropType } from "vue";
|
||||
import { mapState, mapActions } from "pinia";
|
||||
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
import { useModalStore } from "@/stores/modal";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -23,5 +42,14 @@ export default defineComponent({
|
|||
computed: {
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openDeleteModal() {
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/wearableType/DeleteWearableTypeModal.vue"))),
|
||||
this.wearableType.id
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
}"
|
||||
>
|
||||
<span class="block truncate" :class="{ 'font-medium': selected, 'font-normal': !selected }">
|
||||
{{ equipment.name }}
|
||||
{{ equipment.name }}<span v-if="equipment.code"> - Code: {{ equipment.code }}</span>
|
||||
</span>
|
||||
<span
|
||||
v-if="selected"
|
||||
|
|
|
@ -86,7 +86,7 @@ import {
|
|||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||
import Spinner from "../Spinner.vue";
|
||||
import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipmentType";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -86,7 +86,7 @@ import {
|
|||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||
import Spinner from "../Spinner.vue";
|
||||
import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspectionPlan";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -105,7 +105,7 @@ export default defineComponent({
|
|||
emits: ["update:model-value"],
|
||||
watch: {
|
||||
modelValue() {
|
||||
if (this.initialLoaded) return;
|
||||
//if (this.initialLoaded) return;
|
||||
this.initialLoaded = true;
|
||||
this.loadMemberInitial();
|
||||
},
|
||||
|
@ -162,7 +162,7 @@ export default defineComponent({
|
|||
return this.filtered.find((f) => f.id == id);
|
||||
},
|
||||
loadMemberInitial() {
|
||||
if (this.modelValue == "") return;
|
||||
if (this.modelValue == "" || this.modelValue == null) return;
|
||||
this.fetchMemberById(this.modelValue)
|
||||
.then((res) => {
|
||||
this.chosen = res.data;
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
}"
|
||||
>
|
||||
<span class="block truncate" :class="{ 'font-medium': selected, 'font-normal': !selected }">
|
||||
{{ vehicle.name }}
|
||||
{{ vehicle.name }}<span v-if="vehicle.code"> - Code: {{ vehicle.code }}</span>
|
||||
</span>
|
||||
<span
|
||||
v-if="selected"
|
||||
|
|
|
@ -86,7 +86,7 @@ import {
|
|||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||
import Spinner from "../Spinner.vue";
|
||||
import { useVehicleTypeStore } from "@/stores/admin/unit/vehicleType/vehicleType";
|
||||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicle/vehicleType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -86,7 +86,7 @@ import {
|
|||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||
import Spinner from "../Spinner.vue";
|
||||
import { useWearableTypeStore } from "@/stores/admin/unit/wearableType/wearableType";
|
||||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import { equipmentDemoData } from "./equipment";
|
||||
|
||||
export const damageReportDemoData: Array<DamageReportViewModel> = [
|
||||
{
|
||||
id: "sdfgh",
|
||||
reported: new Date(),
|
||||
status: "in Arbeit",
|
||||
done: false,
|
||||
description: "knjgljna g",
|
||||
providedImage: [],
|
||||
relatedId: "abc",
|
||||
related: {
|
||||
id: "abc",
|
||||
code: "0456984224498",
|
||||
name: "B-Schlauch",
|
||||
location: "HLF",
|
||||
commissioned: new Date(),
|
||||
equipmentTypeId: "xyz",
|
||||
equipmentType: {
|
||||
id: "xyz",
|
||||
type: "B-Schlauch",
|
||||
description: "Shläuche vom Typ B",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
inspections: [],
|
||||
},
|
||||
assigned: "equipment",
|
||||
},
|
||||
];
|
|
@ -1,17 +0,0 @@
|
|||
import type { EquipmentViewModel } from "@/viewmodels/admin/unit/equipment/equipment.models";
|
||||
import { equipmentTypeDemoData } from "./equipmentType";
|
||||
import { inspectionDemoData } from "./inspectionPlan";
|
||||
|
||||
export const equipmentDemoData: Array<EquipmentViewModel> = [
|
||||
{
|
||||
id: "abc",
|
||||
code: "0456984224498",
|
||||
name: "B-Schlauch",
|
||||
location: "HLF",
|
||||
commissioned: new Date(),
|
||||
decommissioned: undefined,
|
||||
equipmentTypeId: equipmentTypeDemoData[0].id,
|
||||
equipmentType: equipmentTypeDemoData[0],
|
||||
inspections: [inspectionDemoData[0]],
|
||||
},
|
||||
];
|
|
@ -1,11 +0,0 @@
|
|||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import { inspectionPlanDemoData } from "./inspectionPlan";
|
||||
|
||||
export const equipmentTypeDemoData: Array<EquipmentTypeViewModel> = [
|
||||
{
|
||||
id: "xyz",
|
||||
type: "B-Schlauch",
|
||||
description: "Shläuche vom Typ B",
|
||||
inspectionPlans: [inspectionPlanDemoData[0], inspectionPlanDemoData[1]],
|
||||
},
|
||||
];
|
|
@ -1,156 +0,0 @@
|
|||
import type {
|
||||
InspectionPlanViewModel,
|
||||
InspectionPointViewModel,
|
||||
} from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type {
|
||||
InspectionPointResultViewModel,
|
||||
InspectionViewModel,
|
||||
} from "@/viewmodels/admin/unit/inspection/inspection.models";
|
||||
|
||||
export const inspectionPointDemoData: Array<InspectionPointViewModel> = [
|
||||
{
|
||||
id: "edf",
|
||||
title: "vorhandene Spritzstellen ausgebessert",
|
||||
description: "",
|
||||
type: "number",
|
||||
},
|
||||
{
|
||||
id: "ghi",
|
||||
title: "Einband der Kupplung sitzt fest",
|
||||
description: "",
|
||||
type: "iO-niO",
|
||||
},
|
||||
{
|
||||
id: "lmn",
|
||||
title: "Das überstehende Drahtende des Knaggenteiles sitzt versenkt",
|
||||
description: "",
|
||||
type: "iO-niO",
|
||||
},
|
||||
{
|
||||
id: "jgj",
|
||||
title: "Gebrauchsprüfdruck 12bar",
|
||||
description: "",
|
||||
type: "iO-niO",
|
||||
},
|
||||
];
|
||||
|
||||
export const inspectionPlanDemoData: Array<InspectionPlanViewModel> = [
|
||||
{
|
||||
id: "abc",
|
||||
title: "Sichtprüfung",
|
||||
version: 1,
|
||||
inspectionInterval: "1-m",
|
||||
remindTime: "1-m",
|
||||
created: new Date(),
|
||||
inspectionPoints: [inspectionPointDemoData[0], inspectionPointDemoData[1], inspectionPointDemoData[2]],
|
||||
relatedId: "xyz",
|
||||
related: {
|
||||
id: "xyz",
|
||||
type: "B-Schlauch",
|
||||
description: "Shläuche vom Typ B",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
assigned: "equipment",
|
||||
},
|
||||
{
|
||||
id: "cba",
|
||||
title: "Druckprüfung",
|
||||
version: 1,
|
||||
inspectionInterval: "1-m",
|
||||
remindTime: "22/10",
|
||||
created: new Date(),
|
||||
inspectionPoints: [inspectionPointDemoData[3]],
|
||||
relatedId: "xyz",
|
||||
related: {
|
||||
id: "xyz",
|
||||
type: "B-Schlauch",
|
||||
description: "Shläuche vom Typ B",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
assigned: "equipment",
|
||||
},
|
||||
];
|
||||
|
||||
export const inspectionPointResultDemoData: Array<InspectionPointResultViewModel> = [
|
||||
{
|
||||
inspectionId: "jkvshdfg",
|
||||
inspectionVersionedPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionPointId: inspectionPointDemoData[0].id,
|
||||
value: "5",
|
||||
},
|
||||
{
|
||||
inspectionId: "jkvshdfg",
|
||||
inspectionVersionedPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionPointId: inspectionPointDemoData[1].id,
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
inspectionId: "jkvshdfg",
|
||||
inspectionVersionedPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionPointId: inspectionPointDemoData[1].id,
|
||||
value: "",
|
||||
},
|
||||
];
|
||||
|
||||
export const inspectionDemoData: Array<InspectionViewModel> = [
|
||||
{
|
||||
id: "jkvshdfg",
|
||||
inspectionPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionPlan: inspectionPlanDemoData[0],
|
||||
inspectionVersionedPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionVersionedPlan: inspectionPlanDemoData[0],
|
||||
context: "",
|
||||
created: new Date(),
|
||||
finished: undefined,
|
||||
nextInspection: undefined,
|
||||
isOpen: true,
|
||||
checks: [inspectionPointResultDemoData[0], inspectionPointResultDemoData[1], inspectionPointResultDemoData[2]],
|
||||
relatedId: "abc",
|
||||
related: {
|
||||
id: "abc",
|
||||
code: "0456984224498",
|
||||
name: "B-Schlauch",
|
||||
location: "HLF",
|
||||
commissioned: new Date(),
|
||||
equipmentTypeId: "xyz",
|
||||
equipmentType: {
|
||||
id: "xyz",
|
||||
type: "B-Schlauch",
|
||||
description: "Shläuche vom Typ B",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
inspections: [],
|
||||
},
|
||||
assigned: "equipment",
|
||||
},
|
||||
{
|
||||
id: "jkvshdfg",
|
||||
inspectionPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionPlan: inspectionPlanDemoData[0],
|
||||
inspectionVersionedPlanId: inspectionPlanDemoData[0].id,
|
||||
inspectionVersionedPlan: inspectionPlanDemoData[0],
|
||||
context: "sohgfpb",
|
||||
created: new Date(),
|
||||
finished: new Date(),
|
||||
nextInspection: new Date(),
|
||||
isOpen: false,
|
||||
checks: [inspectionPointResultDemoData[0], inspectionPointResultDemoData[1], inspectionPointResultDemoData[2]],
|
||||
relatedId: "abc",
|
||||
related: {
|
||||
id: "abc",
|
||||
code: "0456984224498",
|
||||
name: "B-Schlauch",
|
||||
location: "HLF",
|
||||
commissioned: new Date(),
|
||||
equipmentTypeId: "xyz",
|
||||
equipmentType: {
|
||||
id: "xyz",
|
||||
type: "B-Schlauch",
|
||||
description: "Shläuche vom Typ B",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
inspections: [],
|
||||
},
|
||||
assigned: "equipment",
|
||||
},
|
||||
];
|
|
@ -1,10 +0,0 @@
|
|||
import type { RespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||
import { equipmentDemoData } from "./equipment";
|
||||
|
||||
export const respiratoryGearDemoData: Array<RespiratoryGearViewModel> = [
|
||||
{
|
||||
id: "adfsg",
|
||||
equipmentId: equipmentDemoData[0].id,
|
||||
equipment: equipmentDemoData[0],
|
||||
},
|
||||
];
|
|
@ -1,11 +0,0 @@
|
|||
import type { RespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||
import { equipmentDemoData } from "./equipment";
|
||||
|
||||
export const respiratoryMissionDemoData: Array<RespiratoryMissionViewModel> = [
|
||||
{
|
||||
id: "adfsg",
|
||||
date: new Date(),
|
||||
title: "B5",
|
||||
description: "B5 Einsatz",
|
||||
},
|
||||
];
|
|
@ -1,17 +0,0 @@
|
|||
import type { RespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||
|
||||
export const respiratoryWearerDemoData: Array<RespiratoryWearerViewModel> = [
|
||||
{
|
||||
id: "dfghj",
|
||||
memberId: "9469991d-fa22-4899-82ce-b1ba5de990dc",
|
||||
member: {
|
||||
id: "9469991d-fa22-4899-82ce-b1ba5de990dc",
|
||||
salutation: { id: 3, salutation: "Herr" },
|
||||
firstname: "Julian",
|
||||
lastname: "Krauser",
|
||||
nameaffix: "",
|
||||
birthdate: new Date("2003-09-20"),
|
||||
internalId: "1312",
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,27 +0,0 @@
|
|||
import type { VehicleViewModel } from "@/viewmodels/admin/unit/vehicle/vehicle.models";
|
||||
import { vehicleTypeDemoData } from "./vehicleType";
|
||||
|
||||
export const vehicleDemoData: Array<VehicleViewModel> = [
|
||||
{
|
||||
id: "kjhb",
|
||||
code: "",
|
||||
name: "HLF",
|
||||
location: "Tor 1",
|
||||
commissioned: new Date(),
|
||||
decommissioned: undefined,
|
||||
vehicleTypeId: vehicleTypeDemoData[0].id,
|
||||
vehicleType: vehicleTypeDemoData[0],
|
||||
inspections: [],
|
||||
},
|
||||
{
|
||||
id: "kjhdfgb",
|
||||
code: "",
|
||||
name: "LF",
|
||||
location: "Tor 2",
|
||||
commissioned: new Date(),
|
||||
decommissioned: undefined,
|
||||
vehicleTypeId: vehicleTypeDemoData[1].id,
|
||||
vehicleType: vehicleTypeDemoData[1],
|
||||
inspections: [],
|
||||
},
|
||||
];
|
|
@ -1,16 +0,0 @@
|
|||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
|
||||
export const vehicleTypeDemoData: Array<VehicleTypeViewModel> = [
|
||||
{
|
||||
id: "xyfgdghfz",
|
||||
type: "HLF 20/10",
|
||||
description: "HLF",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
{
|
||||
id: "abc",
|
||||
type: "LF 8/6",
|
||||
description: "LF",
|
||||
inspectionPlans: [],
|
||||
},
|
||||
];
|
|
@ -1,25 +0,0 @@
|
|||
import type { WearableViewModel } from "@/viewmodels/admin/unit/wearable/wearable.models";
|
||||
import { wearableTypeDemoData } from "./wearableType";
|
||||
|
||||
export const wearableDemoData: Array<WearableViewModel> = [
|
||||
{
|
||||
id: "absdfgc",
|
||||
code: "0456984224498",
|
||||
name: "Jacke",
|
||||
location: "Spint",
|
||||
commissioned: new Date(),
|
||||
decommissioned: undefined,
|
||||
wearerId: "9469991d-fa22-4899-82ce-b1ba5de990dc",
|
||||
wearer: {
|
||||
id: "9469991d-fa22-4899-82ce-b1ba5de990dc",
|
||||
salutation: { id: 3, salutation: "Herr" },
|
||||
firstname: "Julian",
|
||||
lastname: "Krauser",
|
||||
nameaffix: "",
|
||||
birthdate: new Date("2003-09-20"),
|
||||
internalId: "1312",
|
||||
},
|
||||
wearableTypeId: wearableTypeDemoData[0].id,
|
||||
wearableType: wearableTypeDemoData[0],
|
||||
},
|
||||
];
|
|
@ -1,9 +0,0 @@
|
|||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
|
||||
export const wearableTypeDemoData: Array<WearableTypeViewModel> = [
|
||||
{
|
||||
id: "xyz",
|
||||
type: "Jacke",
|
||||
description: "Bayern 2000",
|
||||
},
|
||||
];
|
|
@ -3,11 +3,9 @@ import type {
|
|||
DamageReportViewModel,
|
||||
CreateDamageReportViewModel,
|
||||
UpdateDamageReportViewModel,
|
||||
} from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
} from "@/viewmodels/admin/unit/damageReport.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import type { VehicleViewModel } from "@/viewmodels/admin/unit/vehicle/vehicle.models";
|
||||
import { damageReportDemoData } from "@/demodata/damageReport";
|
||||
|
||||
export const useDamageReportStore = defineStore("damageReport", {
|
||||
state: () => {
|
||||
|
@ -19,12 +17,9 @@ export const useDamageReportStore = defineStore("damageReport", {
|
|||
},
|
||||
actions: {
|
||||
fetchDamageReports(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.damageReports = damageReportDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.damageReports.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.damageReports = [];
|
||||
this.loading = "loading";
|
||||
//TODO enable fetch of done reports
|
||||
http
|
||||
.get(`/admin/damageReport?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`)
|
||||
.then((result) => {
|
||||
|
@ -68,13 +63,6 @@ export const useDamageReportStore = defineStore("damageReport", {
|
|||
fetchDamageReportById(id: string) {
|
||||
return http.get(`/admin/damageReport/${id}`);
|
||||
},
|
||||
async createDamageReport(damageReport: CreateDamageReportViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/damageReport`, {
|
||||
// TODO: data
|
||||
});
|
||||
this.fetchDamageReports();
|
||||
return result;
|
||||
},
|
||||
async updateDamageReport(damageReport: UpdateDamageReportViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/damageReport/${damageReport.id}`, {
|
||||
// TODO: data
|
||||
|
@ -82,10 +70,5 @@ export const useDamageReportStore = defineStore("damageReport", {
|
|||
this.fetchDamageReports();
|
||||
return result;
|
||||
},
|
||||
async deleteDamageReport(damageReport: number): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.delete(`/admin/damageReport/${damageReport}`);
|
||||
this.fetchDamageReports();
|
||||
return result;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { http } from "@/serverCom";
|
||||
import { useEquipmentStore } from "./equipment";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import { damageReportDemoData } from "@/demodata/damageReport";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
|
||||
export const useEquipmentDamageReportStore = defineStore("equipmentDamageReport", {
|
||||
state: () => {
|
||||
|
@ -15,17 +14,11 @@ export const useEquipmentDamageReportStore = defineStore("equipmentDamageReport"
|
|||
actions: {
|
||||
fetchDamageReportForEquipment(offset = 0, count = 25, search = "", clear = false) {
|
||||
const equipmentId = useEquipmentStore().activeEquipment;
|
||||
this.damageReports = damageReportDemoData
|
||||
.filter((drdd) => drdd.relatedId == equipmentId)
|
||||
.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.damageReports.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.damageReports = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(
|
||||
`/admin/equipment/${equipmentId}/damageReport?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
`/admin/damagereport/equipment/${equipmentId}?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
|
|
|
@ -6,7 +6,6 @@ import type {
|
|||
} from "@/viewmodels/admin/unit/equipment/equipment.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { equipmentDemoData } from "@/demodata/equipment";
|
||||
|
||||
export const useEquipmentStore = defineStore("equipment", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useEquipmentStore = defineStore("equipment", {
|
|||
},
|
||||
actions: {
|
||||
fetchEquipments(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.equipments = equipmentDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.equipments.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.equipments = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -68,9 +63,6 @@ export const useEquipmentStore = defineStore("equipment", {
|
|||
});
|
||||
},
|
||||
fetchEquipmentByActiveId() {
|
||||
this.activeEquipmentObj = equipmentDemoData.find((e) => e.id == this.activeEquipment) as EquipmentViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/equipment/${this.activeEquipment}`)
|
||||
|
@ -87,14 +79,22 @@ export const useEquipmentStore = defineStore("equipment", {
|
|||
},
|
||||
async createEquipment(equipment: CreateEquipmentViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/equipment`, {
|
||||
// TODO: data
|
||||
equipmentTypeId: equipment.equipmentTypeId,
|
||||
name: equipment.name,
|
||||
code: equipment.code,
|
||||
location: equipment.location,
|
||||
commissioned: equipment.commissioned,
|
||||
});
|
||||
this.fetchEquipments();
|
||||
return result;
|
||||
},
|
||||
async updateActiveEquipment(equipment: UpdateEquipmentViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/equipment/${equipment.id}`, {
|
||||
// TODO: data
|
||||
name: equipment.name,
|
||||
code: equipment.code,
|
||||
location: equipment.location,
|
||||
commissioned: equipment.commissioned,
|
||||
decommissioned: equipment.decommissioned,
|
||||
});
|
||||
this.fetchEquipments();
|
||||
return result;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { http } from "@/serverCom";
|
||||
import type { InspectionViewModel } from "@/viewmodels/admin/unit/inspection/inspection.models";
|
||||
import { inspectionDemoData } from "@/demodata/inspectionPlan";
|
||||
import { useEquipmentStore } from "./equipment";
|
||||
|
||||
export const useEquipmentInspectionStore = defineStore("equipmentInspection", {
|
||||
|
@ -13,20 +12,12 @@ export const useEquipmentInspectionStore = defineStore("equipmentInspection", {
|
|||
};
|
||||
},
|
||||
actions: {
|
||||
fetchInspectionForEquipment(offset = 0, count = 25, search = "", clear = false) {
|
||||
fetchInspectionForEquipment(offset = 0, count = 25, clear = false) {
|
||||
const equipmentId = useEquipmentStore().activeEquipment;
|
||||
this.inspections = inspectionDemoData
|
||||
.filter((idd) => idd.relatedId == equipmentId)
|
||||
.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.inspections.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.inspections = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(
|
||||
`/admin/equipment/${equipmentId}/inspection?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
)
|
||||
.get(`/admin/inspection/equipment/${equipmentId}?offset=${offset}&count=${count}`)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
result.data.inspections
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
EquipmentTypeViewModel,
|
||||
CreateEquipmentTypeViewModel,
|
||||
UpdateEquipmentTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
} from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { equipmentTypeDemoData } from "@/demodata/equipmentType";
|
||||
|
||||
export const useEquipmentTypeStore = defineStore("equipmentType", {
|
||||
state: () => {
|
||||
|
@ -21,17 +20,13 @@ export const useEquipmentTypeStore = defineStore("equipmentType", {
|
|||
},
|
||||
actions: {
|
||||
fetchEquipmentTypes(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.equipmentTypes = equipmentTypeDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.equipmentTypes.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.equipmentTypes = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(`/admin/equipmentType?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
result.data.equipments
|
||||
result.data.equipmentTypes
|
||||
.filter((elem: EquipmentTypeViewModel) => this.equipmentTypes.findIndex((m) => m.id == elem.id) == -1)
|
||||
.map((elem: EquipmentTypeViewModel, index: number): EquipmentTypeViewModel & { tab_pos: number } => {
|
||||
return {
|
||||
|
@ -50,20 +45,15 @@ export const useEquipmentTypeStore = defineStore("equipmentType", {
|
|||
},
|
||||
async getAllEquipmentTypes(): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/equipmentType?noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.equipments };
|
||||
return { ...res, data: res.data.equipmentTypes };
|
||||
});
|
||||
},
|
||||
async searchEquipmentTypes(search: string): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/equipmentType?search=${search}&noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.equipments };
|
||||
return { ...res, data: res.data.equipmentTypes };
|
||||
});
|
||||
},
|
||||
fetchEquipmentTypeByActiveId() {
|
||||
this.activeEquipmentTypeObj = equipmentTypeDemoData.find(
|
||||
(e) => e.id == this.activeEquipmentType
|
||||
) as EquipmentTypeViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/equipmentType/${this.activeEquipmentType}`)
|
||||
|
@ -80,14 +70,16 @@ export const useEquipmentTypeStore = defineStore("equipmentType", {
|
|||
},
|
||||
async createEquipmentType(equipmentType: CreateEquipmentTypeViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/equipmentType`, {
|
||||
// TODO: data
|
||||
type: equipmentType.type,
|
||||
description: equipmentType.description,
|
||||
});
|
||||
this.fetchEquipmentTypes();
|
||||
return result;
|
||||
},
|
||||
async updateActiveEquipmentType(equipmentType: UpdateEquipmentTypeViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/equipmentType/${equipmentType.id}`, {
|
||||
// TODO: data
|
||||
type: equipmentType.type,
|
||||
description: equipmentType.description,
|
||||
});
|
||||
this.fetchEquipmentTypes();
|
||||
return result;
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import type {
|
||||
EquipmentTypeViewModel,
|
||||
CreateEquipmentTypeViewModel,
|
||||
UpdateEquipmentTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { equipmentTypeDemoData } from "@/demodata/equipmentType";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import { inspectionPlanDemoData } from "@/demodata/inspectionPlan";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import { useEquipmentTypeStore } from "./equipmentType";
|
||||
|
||||
export const useEquipmentTypeInspectionPlanStore = defineStore("equipmentTypeInspectionPlan", {
|
||||
|
@ -21,12 +13,9 @@ export const useEquipmentTypeInspectionPlanStore = defineStore("equipmentTypeIns
|
|||
actions: {
|
||||
fetchInspectionPlanForEquipmentType() {
|
||||
const equipmentTypeId = useEquipmentTypeStore().activeEquipmentType;
|
||||
this.inspectionPlans = inspectionPlanDemoData.filter((ipdd) => ipdd.relatedId == equipmentTypeId);
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(`/admin/equipmentType/${equipmentTypeId}/inspectionPlan`)
|
||||
.get(`/admin/inspectionPlan/equipmentType/${equipmentTypeId}`)
|
||||
.then((result) => {
|
||||
this.inspectionPlans = result.data;
|
||||
this.loading = "fetched";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { inspectionDemoData } from "@/demodata/inspectionPlan";
|
||||
import type { InspectionViewModel } from "@/viewmodels/admin/unit/inspection/inspection.models";
|
||||
|
||||
export const useInspectionStore = defineStore("inspection", {
|
||||
|
@ -14,10 +13,6 @@ export const useInspectionStore = defineStore("inspection", {
|
|||
},
|
||||
actions: {
|
||||
fetchInspectionByActiveId() {
|
||||
this.loadingActive = "loading";
|
||||
this.activeInspectionObj = inspectionDemoData.find((e) => e.id == this.activeInspection) as InspectionViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/inspection/${this.activeInspection}`)
|
||||
|
@ -34,14 +29,17 @@ export const useInspectionStore = defineStore("inspection", {
|
|||
},
|
||||
async createInspection(inspection: any): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/inspection`, {
|
||||
// TODO: data
|
||||
context: "",
|
||||
inspectionPlanId: "",
|
||||
relatedId: "",
|
||||
assigned: "equipment|vehicle",
|
||||
});
|
||||
this.fetchInspectionByActiveId();
|
||||
return result;
|
||||
},
|
||||
async updateActiveInspection(inspection: any): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/inspection/${inspection.id}`, {
|
||||
// TODO: data
|
||||
context: "",
|
||||
});
|
||||
this.fetchInspectionByActiveId();
|
||||
return result;
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
InspectionPlanViewModel,
|
||||
CreateInspectionPlanViewModel,
|
||||
UpdateInspectionPlanViewModel,
|
||||
} from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
} from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { inspectionPlanDemoData } from "@/demodata/inspectionPlan";
|
||||
|
||||
export const useInspectionPlanStore = defineStore("inspectionPlan", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useInspectionPlanStore = defineStore("inspectionPlan", {
|
|||
},
|
||||
actions: {
|
||||
fetchInspectionPlans(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.inspectionPlans = inspectionPlanDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.inspectionPlans.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.inspectionPlans = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -53,26 +48,12 @@ export const useInspectionPlanStore = defineStore("inspectionPlan", {
|
|||
return { ...res, data: res.data.inspectionPlans };
|
||||
});
|
||||
},
|
||||
async getInspectionPlansByIds(ids: Array<string>): Promise<AxiosResponse<any, any>> {
|
||||
return await http
|
||||
.post(`/admin/inspectionPlan/ids`, {
|
||||
ids,
|
||||
})
|
||||
.then((res) => {
|
||||
return { ...res, data: res.data.inspectionPlans };
|
||||
});
|
||||
},
|
||||
async searchInspectionPlans(search: string): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/inspectionPlan?search=${search}&noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.inspectionPlans };
|
||||
});
|
||||
},
|
||||
fetchInspectionPlanByActiveId() {
|
||||
this.activeInspectionPlanObj = inspectionPlanDemoData.find(
|
||||
(e) => e.id == this.activeInspectionPlan
|
||||
) as InspectionPlanViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/inspectionPlan/${this.activeInspectionPlan}`)
|
||||
|
@ -89,14 +70,20 @@ export const useInspectionPlanStore = defineStore("inspectionPlan", {
|
|||
},
|
||||
async createInspectionPlan(inspectionPlan: CreateInspectionPlanViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/inspectionPlan`, {
|
||||
// TODO: data
|
||||
title: inspectionPlan.title,
|
||||
inspectionInterval: inspectionPlan.inspectionInterval,
|
||||
remindTime: inspectionPlan.remindTime,
|
||||
relatedId: inspectionPlan.relatedId,
|
||||
assigned: inspectionPlan.assigned,
|
||||
});
|
||||
this.fetchInspectionPlans();
|
||||
return result;
|
||||
},
|
||||
async updateActiveInspectionPlan(inspectionPlan: UpdateInspectionPlanViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/inspectionPlan/${inspectionPlan.id}`, {
|
||||
// TODO: data
|
||||
title: inspectionPlan.title,
|
||||
inspectionInterval: inspectionPlan.inspectionInterval,
|
||||
remindTime: inspectionPlan.remindTime,
|
||||
});
|
||||
this.fetchInspectionPlans();
|
||||
return result;
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
RespiratoryGearViewModel,
|
||||
CreateRespiratoryGearViewModel,
|
||||
UpdateRespiratoryGearViewModel,
|
||||
} from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||
} from "@/viewmodels/admin/unit/respiratory/respiratoryGear.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { respiratoryGearDemoData } from "@/demodata/respiratoryGear";
|
||||
|
||||
export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
|||
},
|
||||
actions: {
|
||||
fetchRespiratoryGears(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.respiratoryGears = respiratoryGearDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.respiratoryGears.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.respiratoryGears = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -59,11 +54,6 @@ export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
|||
});
|
||||
},
|
||||
fetchRespiratoryGearByActiveId() {
|
||||
this.activeRespiratoryGearObj = respiratoryGearDemoData.find(
|
||||
(e) => e.id == this.activeRespiratoryGear
|
||||
) as RespiratoryGearViewModel;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/respiratoryGear/${this.activeRespiratoryGear}`)
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
RespiratoryMissionViewModel,
|
||||
CreateRespiratoryMissionViewModel,
|
||||
UpdateRespiratoryMissionViewModel,
|
||||
} from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||
} from "@/viewmodels/admin/unit/respiratory/respiratoryMission.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { respiratoryMissionDemoData } from "@/demodata/respiratoryMission";
|
||||
|
||||
export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
|||
},
|
||||
actions: {
|
||||
fetchRespiratoryMissions(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.respiratoryMissions = respiratoryMissionDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.respiratoryMissions.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.respiratoryMissions = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -63,11 +58,6 @@ export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
|||
});
|
||||
},
|
||||
fetchRespiratoryMissionByActiveId() {
|
||||
this.activeRespiratoryMissionObj = this.respiratoryMissions.find(
|
||||
(e) => e.id == this.activeRespiratoryMission
|
||||
) as RespiratoryMissionViewModel;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/respiratoryMission/${this.activeRespiratoryMission}`)
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
RespiratoryWearerViewModel,
|
||||
CreateRespiratoryWearerViewModel,
|
||||
UpdateRespiratoryWearerViewModel,
|
||||
} from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||
} from "@/viewmodels/admin/unit/respiratory/respiratoryWearer.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { respiratoryWearerDemoData } from "@/demodata/respiratoryWearer";
|
||||
|
||||
export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
|||
},
|
||||
actions: {
|
||||
fetchRespiratoryWearers(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.respiratoryWearers = respiratoryWearerDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.respiratoryWearers.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.respiratoryWearers = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -63,11 +58,6 @@ export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
|||
});
|
||||
},
|
||||
fetchRespiratoryWearerByActiveId() {
|
||||
this.activeRespiratoryWearerObj = respiratoryWearerDemoData.find(
|
||||
(e) => e.id == this.activeRespiratoryWearer
|
||||
) as RespiratoryWearerViewModel;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/respiratoryWearer/${this.activeRespiratoryWearer}`)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { http } from "@/serverCom";
|
||||
import { useVehicleStore } from "./vehicle";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import { damageReportDemoData } from "@/demodata/damageReport";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
|
||||
export const useVehicleDamageReportStore = defineStore("vehicleDamageReport", {
|
||||
state: () => {
|
||||
|
@ -15,17 +14,11 @@ export const useVehicleDamageReportStore = defineStore("vehicleDamageReport", {
|
|||
actions: {
|
||||
fetchDamageReportForVehicle(offset = 0, count = 25, search = "", clear = false) {
|
||||
const vehicleId = useVehicleStore().activeVehicle;
|
||||
this.damageReports = damageReportDemoData
|
||||
.filter((drdd) => drdd.relatedId == vehicleId)
|
||||
.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.damageReports.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.damageReports = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(
|
||||
`/admin/vehicle/${vehicleId}/damageReport?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
`/admin/damagereport/vehicle/${vehicleId}?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { http } from "@/serverCom";
|
||||
import type { InspectionViewModel } from "@/viewmodels/admin/unit/inspection/inspection.models";
|
||||
import { inspectionDemoData } from "@/demodata/inspectionPlan";
|
||||
import { useVehicleStore } from "./vehicle";
|
||||
|
||||
export const useVehicleInspectionStore = defineStore("vehicleInspection", {
|
||||
|
@ -15,17 +14,11 @@ export const useVehicleInspectionStore = defineStore("vehicleInspection", {
|
|||
actions: {
|
||||
fetchInspectionForVehicle(offset = 0, count = 25, search = "", clear = false) {
|
||||
const vehicleId = useVehicleStore().activeVehicle;
|
||||
this.inspections = inspectionDemoData
|
||||
.filter((idd) => idd.relatedId == vehicleId)
|
||||
.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.inspections.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.inspections = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(
|
||||
`/admin/vehicle/${vehicleId}/inspection?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
`/admin/inspection/vehicle/${vehicleId}?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
|
|
|
@ -6,7 +6,6 @@ import type {
|
|||
} from "@/viewmodels/admin/unit/vehicle/vehicle.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { vehicleDemoData } from "@/demodata/vehicle";
|
||||
|
||||
export const useVehicleStore = defineStore("vehicle", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useVehicleStore = defineStore("vehicle", {
|
|||
},
|
||||
actions: {
|
||||
fetchVehicles(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.vehicles = vehicleDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.vehicles.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.vehicles = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -68,9 +63,6 @@ export const useVehicleStore = defineStore("vehicle", {
|
|||
});
|
||||
},
|
||||
fetchVehicleByActiveId() {
|
||||
this.activeVehicleObj = vehicleDemoData.find((e) => e.id == this.activeVehicle) as VehicleViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/vehicle/${this.activeVehicle}`)
|
||||
|
@ -87,14 +79,22 @@ export const useVehicleStore = defineStore("vehicle", {
|
|||
},
|
||||
async createVehicle(vehicle: CreateVehicleViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/vehicle`, {
|
||||
// TODO: data
|
||||
vehicleTypeId: vehicle.vehicleTypeId,
|
||||
name: vehicle.name,
|
||||
code: vehicle.code,
|
||||
location: vehicle.location,
|
||||
commissioned: vehicle.commissioned,
|
||||
});
|
||||
this.fetchVehicles();
|
||||
return result;
|
||||
},
|
||||
async updateActiveVehicle(vehicle: UpdateVehicleViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/vehicle/${vehicle.id}`, {
|
||||
// TODO: data
|
||||
name: vehicle.name,
|
||||
code: vehicle.code,
|
||||
location: vehicle.location,
|
||||
commissioned: vehicle.commissioned,
|
||||
decommissioned: vehicle.decommissioned,
|
||||
});
|
||||
this.fetchVehicles();
|
||||
return result;
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import type {
|
||||
VehicleTypeViewModel,
|
||||
CreateVehicleTypeViewModel,
|
||||
UpdateVehicleTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { vehicleTypeDemoData } from "@/demodata/vehicleType";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import { inspectionPlanDemoData } from "@/demodata/inspectionPlan";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import { useVehicleTypeStore } from "./vehicleType";
|
||||
|
||||
export const useVehicleTypeInspectionPlanStore = defineStore("vehicleTypeInspectionPlan", {
|
||||
|
@ -22,12 +14,9 @@ export const useVehicleTypeInspectionPlanStore = defineStore("vehicleTypeInspect
|
|||
actions: {
|
||||
fetchInspectionPlanForVehicleType() {
|
||||
const vehicleTypeId = useVehicleTypeStore().activeVehicleType;
|
||||
this.inspectionPlans = inspectionPlanDemoData.filter((ipdd) => ipdd.relatedId == vehicleTypeId);
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(`/admin/vehicleType/${vehicleTypeId}/inspectionPlan`)
|
||||
.get(`/admin/inspectionPlan/vehicleType/${vehicleTypeId}`)
|
||||
.then((result) => {
|
||||
this.inspectionPlans = result.data;
|
||||
this.loading = "fetched";
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
VehicleTypeViewModel,
|
||||
CreateVehicleTypeViewModel,
|
||||
UpdateVehicleTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
} from "@/viewmodels/admin/unit/vehicle/vehicleType.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { vehicleTypeDemoData } from "@/demodata/vehicleType";
|
||||
|
||||
export const useVehicleTypeStore = defineStore("vehicleType", {
|
||||
state: () => {
|
||||
|
@ -21,17 +20,13 @@ export const useVehicleTypeStore = defineStore("vehicleType", {
|
|||
},
|
||||
actions: {
|
||||
fetchVehicleTypes(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.vehicleTypes = vehicleTypeDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.vehicleTypes.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.vehicleTypes = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(`/admin/vehicleType?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
result.data.vehicles
|
||||
result.data.vehicleTypes
|
||||
.filter((elem: VehicleTypeViewModel) => this.vehicleTypes.findIndex((m) => m.id == elem.id) == -1)
|
||||
.map((elem: VehicleTypeViewModel, index: number): VehicleTypeViewModel & { tab_pos: number } => {
|
||||
return {
|
||||
|
@ -50,20 +45,15 @@ export const useVehicleTypeStore = defineStore("vehicleType", {
|
|||
},
|
||||
async getAllVehicleTypes(): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/vehicleType?noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.vehicles };
|
||||
return { ...res, data: res.data.vehicleTypes };
|
||||
});
|
||||
},
|
||||
async searchVehicleTypes(search: string): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/vehicleType?search=${search}&noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.vehicles };
|
||||
return { ...res, data: res.data.vehicleTypes };
|
||||
});
|
||||
},
|
||||
fetchVehicleTypeByActiveId() {
|
||||
this.activeVehicleTypeObj = vehicleTypeDemoData.find(
|
||||
(e) => e.id == this.activeVehicleType
|
||||
) as VehicleTypeViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/vehicleType/${this.activeVehicleType}`)
|
||||
|
@ -80,14 +70,16 @@ export const useVehicleTypeStore = defineStore("vehicleType", {
|
|||
},
|
||||
async createVehicleType(vehicleType: CreateVehicleTypeViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/vehicleType`, {
|
||||
// TODO: data
|
||||
type: vehicleType.type,
|
||||
description: vehicleType.description,
|
||||
});
|
||||
this.fetchVehicleTypes();
|
||||
return result;
|
||||
},
|
||||
async updateActiveVehicleType(vehicleType: UpdateVehicleTypeViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/vehicleType/${vehicleType.id}`, {
|
||||
// TODO: data
|
||||
type: vehicleType.type,
|
||||
description: vehicleType.description,
|
||||
});
|
||||
this.fetchVehicleTypes();
|
||||
return result;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { http } from "@/serverCom";
|
||||
import { useWearableStore } from "./wearable";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import { damageReportDemoData } from "@/demodata/damageReport";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
|
||||
export const useWearableDamageReportStore = defineStore("wearableDamageReport", {
|
||||
state: () => {
|
||||
|
@ -15,17 +14,11 @@ export const useWearableDamageReportStore = defineStore("wearableDamageReport",
|
|||
actions: {
|
||||
fetchDamageReportForWearable(offset = 0, count = 25, search = "", clear = false) {
|
||||
const wearableId = useWearableStore().activeWearable;
|
||||
this.damageReports = damageReportDemoData
|
||||
.filter((drdd) => drdd.relatedId == wearableId)
|
||||
.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.damageReports.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.damageReports = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(
|
||||
`/admin/wearable/${wearableId}/damageReport?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
`/admin/damagereport/wearable/${wearableId}?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
|
||||
)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
|
|
|
@ -6,7 +6,6 @@ import type {
|
|||
} from "@/viewmodels/admin/unit/wearable/wearable.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { wearableDemoData } from "@/demodata/wearable";
|
||||
|
||||
export const useWearableStore = defineStore("wearable", {
|
||||
state: () => {
|
||||
|
@ -21,10 +20,6 @@ export const useWearableStore = defineStore("wearable", {
|
|||
},
|
||||
actions: {
|
||||
fetchWearables(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.wearables = wearableDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.wearables.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.wearables = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
|
@ -68,9 +63,6 @@ export const useWearableStore = defineStore("wearable", {
|
|||
});
|
||||
},
|
||||
fetchWearableByActiveId() {
|
||||
this.activeWearableObj = wearableDemoData.find((e) => e.id == this.activeWearable) as WearableViewModel;
|
||||
this.loadingActive = "fetched";
|
||||
return;
|
||||
this.loadingActive = "loading";
|
||||
http
|
||||
.get(`/admin/wearable/${this.activeWearable}`)
|
||||
|
@ -87,14 +79,24 @@ export const useWearableStore = defineStore("wearable", {
|
|||
},
|
||||
async createWearable(wearable: CreateWearableViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/wearable`, {
|
||||
// TODO: data
|
||||
wearableTypeId: wearable.wearableTypeId,
|
||||
name: wearable.name,
|
||||
code: wearable.code,
|
||||
location: wearable.location,
|
||||
commissioned: wearable.commissioned,
|
||||
wearerId: wearable.wearerId,
|
||||
});
|
||||
this.fetchWearables();
|
||||
return result;
|
||||
},
|
||||
async updateActiveWearable(wearable: UpdateWearableViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/wearable/${wearable.id}`, {
|
||||
// TODO: data
|
||||
name: wearable.name,
|
||||
code: wearable.code,
|
||||
location: wearable.location,
|
||||
commissioned: wearable.commissioned,
|
||||
decommissioned: wearable.decommissioned,
|
||||
wearerId: wearable.wearerId,
|
||||
});
|
||||
this.fetchWearables();
|
||||
return result;
|
||||
|
|
|
@ -3,10 +3,9 @@ import type {
|
|||
WearableTypeViewModel,
|
||||
CreateWearableTypeViewModel,
|
||||
UpdateWearableTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
} from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { wearableTypeDemoData } from "@/demodata/wearableType";
|
||||
|
||||
export const useWearableTypeStore = defineStore("wearableType", {
|
||||
state: () => {
|
||||
|
@ -18,17 +17,13 @@ export const useWearableTypeStore = defineStore("wearableType", {
|
|||
},
|
||||
actions: {
|
||||
fetchWearableTypes(offset = 0, count = 25, search = "", clear = false) {
|
||||
this.wearableTypes = wearableTypeDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||
this.totalCount = this.wearableTypes.length;
|
||||
this.loading = "fetched";
|
||||
return;
|
||||
if (clear) this.wearableTypes = [];
|
||||
this.loading = "loading";
|
||||
http
|
||||
.get(`/admin/wearableType?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`)
|
||||
.then((result) => {
|
||||
this.totalCount = result.data.total;
|
||||
result.data.wearables
|
||||
result.data.wearableTypes
|
||||
.filter((elem: WearableTypeViewModel) => this.wearableTypes.findIndex((m) => m.id == elem.id) == -1)
|
||||
.map((elem: WearableTypeViewModel, index: number): WearableTypeViewModel & { tab_pos: number } => {
|
||||
return {
|
||||
|
@ -47,12 +42,12 @@ export const useWearableTypeStore = defineStore("wearableType", {
|
|||
},
|
||||
async getAllWearableTypes(): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/wearableType?noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.wearables };
|
||||
return { ...res, data: res.data.wearableTypes };
|
||||
});
|
||||
},
|
||||
async searchWearableTypes(search: string): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/wearableType?search=${search}&noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.wearables };
|
||||
return { ...res, data: res.data.wearableTypes };
|
||||
});
|
||||
},
|
||||
fetchWearableTypeById(id: string) {
|
||||
|
@ -60,14 +55,16 @@ export const useWearableTypeStore = defineStore("wearableType", {
|
|||
},
|
||||
async createWearableType(wearableType: CreateWearableTypeViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.post(`/admin/wearableType`, {
|
||||
// TODO: data
|
||||
type: wearableType.type,
|
||||
description: wearableType.description,
|
||||
});
|
||||
this.fetchWearableTypes();
|
||||
return result;
|
||||
},
|
||||
async updateWearableType(wearableType: UpdateWearableTypeViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/wearableType/${wearableType.id}`, {
|
||||
// TODO: data
|
||||
type: wearableType.type,
|
||||
description: wearableType.description,
|
||||
});
|
||||
this.fetchWearableTypes();
|
||||
return result;
|
||||
|
|
|
@ -34,6 +34,6 @@ export interface InspectionPointResultViewModel {
|
|||
inspectionId: string;
|
||||
inspectionVersionedPlanId: string;
|
||||
inspectionPointId: string;
|
||||
inspectionPoint: InspectionPointViewModel;
|
||||
inspectionPoint?: InspectionPointViewModel;
|
||||
value: string;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import type { InspectionPointEnum } from "@/enums/inspectionEnum";
|
||||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
import type { EquipmentTypeViewModel } from "../equipment/equipmentType.models";
|
||||
import type { VehicleTypeViewModel } from "../vehicle/vehicleType.models";
|
||||
|
||||
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
||||
|
||||
|
@ -16,11 +18,11 @@ export type InspectionPlanViewModel = {
|
|||
} & (
|
||||
| {
|
||||
assigned: "equipment";
|
||||
related: EquipmentViewModel;
|
||||
related: EquipmentTypeViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "vehicle";
|
||||
related: VehicleViewModel;
|
||||
related: VehicleTypeViewModel;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import { mapActions, mapState } from "pinia";
|
|||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import { useDamageReportStore } from "@/stores/admin/unit/damageReport/damageReport";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import DamageReportListItem from "@/components/admin/unit/damageReport/DamageReportListItem.vue";
|
||||
</script>
|
||||
|
|
|
@ -51,14 +51,7 @@ export default defineComponent({
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useEquipmentStore, ["activeEquipmentObj"]),
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
},
|
||||
mounted() {
|
||||
this.fetchEquipmentByActiveId();
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useEquipmentStore, ["fetchEquipmentByActiveId"]),
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
<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" class="w-5 h-5" />
|
||||
<p>{{ row.reported }} - {{ row.status }}</p>
|
||||
<PhotoIcon v-if="row.imageCount != 0" class="w-5 h-5" />
|
||||
<p>{{ row.reportedAt }} - {{ row.status }}</p>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<p v-if="row.reportedBy">gemeldet von: {{ row.reportedBy }}</p>
|
||||
<p>Beschreibung: {{ row.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,7 +30,7 @@ import { mapActions, mapState } from "pinia";
|
|||
import { useAbilityStore } from "@/stores/ability";
|
||||
import { useEquipmentDamageReportStore } from "@/stores/admin/unit/equipment/damageReport";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
import { PhotoIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipme
|
|||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
import EquipmentTypeListItem from "@/components/admin/unit/equipmentType/EquipmentTypeListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
>
|
||||
<p class="mx-auto">Geräte-Typ bearbeiten</p>
|
||||
<div>
|
||||
<label for="name">Typ</label>
|
||||
<input type="text" id="name" required v-model="equipmentType.type" />
|
||||
<label for="type">Typ</label>
|
||||
<input type="text" id="type" required v-model="equipmentType.type" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="location">Beschreibung</label>
|
||||
<input type="text" id="location" v-model="equipmentType.description" />
|
||||
<label for="description">Beschreibung</label>
|
||||
<input type="text" id="description" v-model="equipmentType.description" />
|
||||
</div>
|
||||
<div class="flex flex-row justify-end gap-2">
|
||||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
|
@ -37,7 +37,7 @@ import type {
|
|||
CreateEquipmentTypeViewModel,
|
||||
EquipmentTypeViewModel,
|
||||
UpdateEquipmentTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
} from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
>
|
||||
<div v-for="point in points" :key="point.title">
|
||||
<OkNotOk
|
||||
v-if="point.type == 'iO-niO'"
|
||||
v-if="point.type == InspectionPointEnum.oknok"
|
||||
:inspectionPoint="point"
|
||||
:modelValue="boolPointResult(point.id)"
|
||||
@update:model-value="(val) => updateCheckResult(point.id, val)"
|
||||
|
@ -56,6 +56,7 @@ import ResultInput from "@/components/admin/unit/inspection/ResultInput.vue";
|
|||
import type { InspectionPointResultViewModel } from "@/viewmodels/admin/unit/inspection/inspection.models";
|
||||
import cloneDeep from "lodash.clonedeep";
|
||||
import isEqual from "lodash.isequal";
|
||||
import { InspectionPointEnum } from "@/enums/inspectionEnum";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
|
|
@ -94,9 +94,9 @@ import {
|
|||
} from "@headlessui/vue";
|
||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||
import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspectionPlan";
|
||||
import type { CreateInspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { CreateInspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import ScanInput from "@/components/ScanInput.vue";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||
import type { EquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipment/equipmentType.models";
|
||||
import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipmentType";
|
||||
import EquipmentTypeSearchSelect from "@/components/search/EquipmentTypeSearchSelect.vue";
|
||||
import VehicleTypeSearchSelect from "@/components/search/VehicleTypeSearchSelect.vue";
|
||||
|
@ -147,8 +147,8 @@ export default defineComponent({
|
|||
let formData = e.target.elements;
|
||||
let createInspectionPlan: CreateInspectionPlanViewModel = {
|
||||
title: formData.name.value,
|
||||
inspectionInterval: formData.name.value,
|
||||
remindTime: formData.name.value,
|
||||
inspectionInterval: formData.interval.value,
|
||||
remindTime: formData.remind.value,
|
||||
relatedId: this.selectedType,
|
||||
assigned: this.active,
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ import MainTemplate from "@/templates/Main.vue";
|
|||
import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspectionPlan";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import type { InspectionPlanViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import InspectionPlanListItem from "@/components/admin/unit/inspectionPlan/InspectionPlanListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
<input type="text" id="interval" :value="activeInspectionPlanObj.inspectionInterval" reaonly />
|
||||
</div>
|
||||
</div>
|
||||
<p>Prüfungspunkte</p>
|
||||
<p>Prüfungspunkte:</p>
|
||||
<div v-if="activeInspectionPlanObj?.inspectionPoints" class="flex flex-col gap-2 grow overflow-y-scroll">
|
||||
<small v-if="activeInspectionPlanObj?.inspectionPoints.length == 0">keine Prüfpunkte enthalten</small>
|
||||
<div
|
||||
v-for="point in activeInspectionPlanObj?.inspectionPoints"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
|
|
|
@ -13,8 +13,26 @@
|
|||
<input type="text" id="name" required v-model="inspectionPlan.title" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="interval">Intervall (optional)</label>
|
||||
<input type="text" id="interval" placeholder="<number>-(d|m|y) oder DD/MM" />
|
||||
<label for="interval">Intervall</label>
|
||||
<input
|
||||
type="text"
|
||||
id="interval"
|
||||
placeholder="<zahl>-(d|m|y) oder DD/MM oder DD/*"
|
||||
required
|
||||
pattern="^\d+-(d|m|y)$|^\d{2}/\d{2}$|^\d{2}/\*$"
|
||||
title="Eingabe muss im Format <zahl>-(d|m|y), DD/MM oder DD/* sein"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="remind">Erinnerung vor Fälligkeit</label>
|
||||
<input
|
||||
type="text"
|
||||
id="remind"
|
||||
placeholder="<zahl>-(d|m|y) oder DD/MM oder DD/*"
|
||||
required
|
||||
pattern="^\d+-(d|m|y)$|^\d{2}/\d{2}$|^\d{2}/\*$"
|
||||
title="Eingabe muss im Format <zahl>-(d|m|y), DD/MM oder DD/* sein"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-row justify-end gap-2">
|
||||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
|
@ -37,7 +55,7 @@ import type {
|
|||
CreateInspectionPlanViewModel,
|
||||
InspectionPlanViewModel,
|
||||
UpdateInspectionPlanViewModel,
|
||||
} from "@/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
} from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
@ -95,7 +113,8 @@ export default defineComponent({
|
|||
let updateInspectionPlan: UpdateInspectionPlanViewModel = {
|
||||
id: this.inspectionPlan.id,
|
||||
title: formData.name.value,
|
||||
inspectionInterval: formData.location.value || null,
|
||||
inspectionInterval: formData.interval.value,
|
||||
remindTime: formData.remind.value,
|
||||
};
|
||||
this.status = "loading";
|
||||
this.updateActiveInspectionPlan(updateInspectionPlan)
|
||||
|
|
|
@ -30,7 +30,7 @@ import { defineComponent } from "vue";
|
|||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear";
|
||||
import type { CreateRespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||
import type { CreateRespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryGear.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
|
|
@ -39,7 +39,7 @@ import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/res
|
|||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { RespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||
import type { RespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryGear.models";
|
||||
import RespiratoryGearListItem from "@/components/admin/unit/respiratoryGear/RespiratoryGearListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import { defineComponent } from "vue";
|
|||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission";
|
||||
import type { CreateRespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||
import type { CreateRespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryMission.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
|
|
@ -39,7 +39,7 @@ import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMissi
|
|||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { RespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||
import type { RespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryMission.models";
|
||||
import RespiratoryMissionListItem from "@/components/admin/unit/respiratoryMission/RespiratoryMissionListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import { defineComponent } from "vue";
|
|||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer";
|
||||
import type { CreateRespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||
import type { CreateRespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryWearer.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
|
|
@ -39,7 +39,7 @@ import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer
|
|||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { RespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||
import type { RespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratory/respiratoryWearer.models";
|
||||
import RespiratoryWearerListItem from "@/components/admin/unit/respiratoryWearer/RespiratoryWearerListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
<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" class="w-5 h-5" />
|
||||
<p>{{ row.reported }} - {{ row.status }}</p>
|
||||
<PhotoIcon v-if="row.imageCount != 0" class="w-5 h-5" />
|
||||
<p>{{ row.reportedAt }} - {{ row.status }}</p>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<p v-if="row.reportedBy">gemeldet von: {{ row.reportedBy }}</p>
|
||||
<p>Beschreibung: {{ row.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,7 +30,7 @@ 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 type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
import { PhotoIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
>
|
||||
<p class="mx-auto">Fahrzeug-Typ bearbeiten</p>
|
||||
<div>
|
||||
<label for="name">Typ</label>
|
||||
<input type="text" id="name" required v-model="vehicleType.type" />
|
||||
<label for="type">Typ</label>
|
||||
<input type="text" id="type" required v-model="vehicleType.type" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="location">Beschreibung</label>
|
||||
<input type="text" id="location" v-model="vehicleType.description" />
|
||||
<label for="description">Beschreibung</label>
|
||||
<input type="text" id="description" v-model="vehicleType.description" />
|
||||
</div>
|
||||
<div class="flex flex-row justify-end gap-2">
|
||||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
|
@ -37,7 +37,7 @@ import type {
|
|||
CreateVehicleTypeViewModel,
|
||||
VehicleTypeViewModel,
|
||||
UpdateVehicleTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
} from "@/viewmodels/admin/unit/vehicle/vehicleType.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="flex flex-row gap-4">
|
||||
<button v-if="can('create', 'unit', 'vehicle_type')" primary class="w-fit!" @click="openCreateModal">
|
||||
Geräte-Typ erstellen
|
||||
Fahrzeug-Typ erstellen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@ import { useVehicleTypeStore } from "@/stores/admin/unit/vehicleType/vehicleType
|
|||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicleType/vehicleType.models";
|
||||
import type { VehicleTypeViewModel } from "@/viewmodels/admin/unit/vehicle/vehicleType.models";
|
||||
import VehicleTypeListItem from "@/components/admin/unit/vehicleType/VehicleTypeListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
<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" class="w-5 h-5" />
|
||||
<p>{{ row.reported }} - {{ row.status }}</p>
|
||||
<PhotoIcon v-if="row.imageCount != 0" class="w-5 h-5" />
|
||||
<p>{{ row.reportedAt }} - {{ row.status }}</p>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<p v-if="row.reportedBy">gemeldet von: {{ row.reportedBy }}</p>
|
||||
<p>Beschreibung: {{ row.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,7 +30,7 @@ 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 type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
|
||||
import { PhotoIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<label for="location">Verortung (optional)</label>
|
||||
<input type="text" id="location" v-model="wearable.location" />
|
||||
</div>
|
||||
<MemberSearchSelectMultiple title="Träger (optional)" />
|
||||
<MemberSearchSelectSingle title="Träger (optional)" v-model="wearable.wearerId" />
|
||||
<div>
|
||||
<label for="commissioned">In-Betrieb-Nahme</label>
|
||||
<input type="date" id="commissioned" required v-model="wearable.commissioned" />
|
||||
|
@ -30,7 +30,9 @@
|
|||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
abbrechen
|
||||
</button>
|
||||
<button primary type="submit" class="w-fit!" :disabled="status == 'loading'">speichern</button>
|
||||
<button primary type="submit" class="w-fit!" :disabled="status == 'loading' || canSaveOrReset">
|
||||
speichern
|
||||
</button>
|
||||
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||
|
@ -54,7 +56,7 @@ import FailureXMark from "@/components/FailureXMark.vue";
|
|||
import ScanInput from "@/components/ScanInput.vue";
|
||||
import isEqual from "lodash.isequal";
|
||||
import cloneDeep from "lodash.clonedeep";
|
||||
import MemberSearchSelectMultiple from "@/components/search/MemberSearchSelectMultiple.vue";
|
||||
import MemberSearchSelectSingle from "@/components/search/MemberSearchSelectSingle.vue";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -109,7 +111,8 @@ export default defineComponent({
|
|||
name: formData.name.value,
|
||||
location: formData.location.value,
|
||||
commissioned: formData.commissioned.value,
|
||||
decommissioned: formData.decommissioned.value ?? null,
|
||||
decommissioned: formData.decommissioned.value || null,
|
||||
wearerId: this.wearable.wearerId,
|
||||
};
|
||||
this.status = "loading";
|
||||
this.updateActiveWearable(updateWearable)
|
||||
|
|
|
@ -1,43 +1,49 @@
|
|||
<template>
|
||||
<div class="flex flex-col gap-2 h-full w-full overflow-y-auto">
|
||||
<Spinner v-if="loading == 'loading'" class="mx-auto" />
|
||||
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
|
||||
<form
|
||||
v-else-if="wearableType != null"
|
||||
class="flex flex-col gap-4 py-2 w-full max-w-xl mx-auto"
|
||||
@submit.prevent="triggerUpdate"
|
||||
>
|
||||
<p class="mx-auto">Kleidungstyp bearbeiten</p>
|
||||
<div>
|
||||
<label for="name">Bezeichnung</label>
|
||||
<input type="text" id="name" required v-model="wearableType.type" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="description">Beschreibung (optional)</label>
|
||||
<input type="text" id="description" v-model="wearableType.description" />
|
||||
</div>
|
||||
<div class="flex flex-row justify-end gap-2">
|
||||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
abbrechen
|
||||
</button>
|
||||
<button primary type="submit" class="w-fit!" :disabled="status == 'loading'">speichern</button>
|
||||
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<MainTemplate :title="`Kleidungs-Typ ${origin?.type} - Daten bearbeiten`">
|
||||
<template #headerInsert>
|
||||
<RouterLink to="../" class="text-primary">zurück zur Liste (abbrechen)</RouterLink>
|
||||
</template>
|
||||
<template #main>
|
||||
<Spinner v-if="loading == 'loading'" class="mx-auto" />
|
||||
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
|
||||
<form
|
||||
v-else-if="wearableType != null"
|
||||
class="flex flex-col gap-4 py-2 w-full max-w-xl mx-auto"
|
||||
@submit.prevent="triggerUpdate"
|
||||
>
|
||||
<p class="mx-auto">Kleidungstyp bearbeiten</p>
|
||||
<div>
|
||||
<label for="type">Bezeichnung</label>
|
||||
<input type="text" id="type" required v-model="wearableType.type" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="description">Beschreibung (optional)</label>
|
||||
<input type="text" id="description" v-model="wearableType.description" />
|
||||
</div>
|
||||
<div class="flex flex-row justify-end gap-2">
|
||||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
abbrechen
|
||||
</button>
|
||||
<button primary type="submit" class="w-fit!" :disabled="status == 'loading'">speichern</button>
|
||||
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
</MainTemplate>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useWearableTypeStore } from "@/stores/admin/unit/wearableType/wearableType";
|
||||
import type {
|
||||
CreateWearableTypeViewModel,
|
||||
WearableTypeViewModel,
|
||||
UpdateWearableTypeViewModel,
|
||||
} from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
} from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
import Spinner from "@/components/Spinner.vue";
|
||||
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||
import FailureXMark from "@/components/FailureXMark.vue";
|
||||
|
@ -93,7 +99,7 @@ export default defineComponent({
|
|||
let formData = e.target.elements;
|
||||
let updateWearableType: UpdateWearableTypeViewModel = {
|
||||
id: this.wearableType.id,
|
||||
type: formData.name.value,
|
||||
type: formData.type.value,
|
||||
description: formData.description.value,
|
||||
};
|
||||
this.status = "loading";
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="flex flex-row gap-4">
|
||||
<button v-if="can('create', 'unit', 'wearable_type')" primary class="w-fit!" @click="openCreateModal">
|
||||
Geräte-Typ erstellen
|
||||
Kleidungs-Typ erstellen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@ import { useWearableTypeStore } from "@/stores/admin/unit/wearableType/wearableT
|
|||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearableType/wearableType.models";
|
||||
import type { WearableTypeViewModel } from "@/viewmodels/admin/unit/wearable/wearableType.models";
|
||||
import WearableTypeListItem from "@/components/admin/unit/wearableType/WearableTypeListItem.vue";
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue