correct type inspectionPlans request
This commit is contained in:
parent
adfe64d1f2
commit
d96c73d5b1
11 changed files with 64 additions and 52 deletions
|
@ -1,20 +1,24 @@
|
||||||
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
|
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
|
||||||
|
import { useEquipmentDamageReportStore } from "../../stores/admin/unit/equipment/damageReport";
|
||||||
|
import { useEquipmentInspectionStore } from "../../stores/admin/unit/equipment/inspection";
|
||||||
|
|
||||||
export async function setEquipmentId(to: any, from: any, next: any) {
|
export async function setEquipmentId(to: any, from: any, next: any) {
|
||||||
const EquipmentStore = useEquipmentStore();
|
const equipmentStore = useEquipmentStore();
|
||||||
EquipmentStore.activeEquipment = to.params?.equipmentId ?? null;
|
equipmentStore.activeEquipment = to.params?.equipmentId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
useEquipmentDamageReportStore().$reset();
|
||||||
|
useEquipmentInspectionStore().$reset();
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetEquipmentStores(to: any, from: any, next: any) {
|
export async function resetEquipmentStores(to: any, from: any, next: any) {
|
||||||
const EquipmentStore = useEquipmentStore();
|
const equipmentStore = useEquipmentStore();
|
||||||
EquipmentStore.activeEquipment = null;
|
equipmentStore.activeEquipment = null;
|
||||||
EquipmentStore.activeEquipmentObj = null;
|
equipmentStore.activeEquipmentObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
useEquipmentDamageReportStore().$reset();
|
||||||
|
useEquipmentInspectionStore().$reset();
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { useInspectionStore } from "@/stores/admin/unit/inspection/inspection";
|
import { useInspectionStore } from "@/stores/admin/unit/inspection/inspection";
|
||||||
|
|
||||||
export async function setInspectionId(to: any, from: any, next: any) {
|
export async function setInspectionId(to: any, from: any, next: any) {
|
||||||
const InspectionStore = useInspectionStore();
|
const inspectionStore = useInspectionStore();
|
||||||
InspectionStore.activeInspection = to.params?.inspectionId ?? null;
|
inspectionStore.activeInspection = to.params?.inspectionId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ export async function setInspectionId(to: any, from: any, next: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetInspectionStores(to: any, from: any, next: any) {
|
export async function resetInspectionStores(to: any, from: any, next: any) {
|
||||||
const InspectionStore = useInspectionStore();
|
const inspectionStore = useInspectionStore();
|
||||||
InspectionStore.activeInspection = null;
|
inspectionStore.activeInspection = null;
|
||||||
InspectionStore.activeInspectionObj = null;
|
inspectionStore.activeInspectionObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { useInspectionPlanStore } from "@/stores/admin/unit/inspectionPlan/inspe
|
||||||
import { useInspectionPointStore } from "../../stores/admin/unit/inspectionPlan/inspectionPoint";
|
import { useInspectionPointStore } from "../../stores/admin/unit/inspectionPlan/inspectionPoint";
|
||||||
|
|
||||||
export async function setInspectionPlanId(to: any, from: any, next: any) {
|
export async function setInspectionPlanId(to: any, from: any, next: any) {
|
||||||
const InspectionPlanStore = useInspectionPlanStore();
|
const inspectionPlanStore = useInspectionPlanStore();
|
||||||
InspectionPlanStore.activeInspectionPlan = to.params?.inspectionPlanId ?? null;
|
inspectionPlanStore.activeInspectionPlan = to.params?.inspectionPlanId ?? null;
|
||||||
|
|
||||||
useInspectionPointStore().$reset();
|
useInspectionPointStore().$reset();
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ export async function setInspectionPlanId(to: any, from: any, next: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetInspectionPlanStores(to: any, from: any, next: any) {
|
export async function resetInspectionPlanStores(to: any, from: any, next: any) {
|
||||||
const InspectionPlanStore = useInspectionPlanStore();
|
const inspectionPlanStore = useInspectionPlanStore();
|
||||||
InspectionPlanStore.activeInspectionPlan = null;
|
inspectionPlanStore.activeInspectionPlan = null;
|
||||||
InspectionPlanStore.activeInspectionPlanObj = null;
|
inspectionPlanStore.activeInspectionPlanObj = null;
|
||||||
|
|
||||||
useInspectionPointStore().$reset();
|
useInspectionPointStore().$reset();
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear";
|
import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear";
|
||||||
|
|
||||||
export async function setRespiratoryGearId(to: any, from: any, next: any) {
|
export async function setRespiratoryGearId(to: any, from: any, next: any) {
|
||||||
const RespiratoryGearStore = useRespiratoryGearStore();
|
const respiratoryGearStore = useRespiratoryGearStore();
|
||||||
RespiratoryGearStore.activeRespiratoryGear = to.params?.respiratoryGearId ?? null;
|
respiratoryGearStore.activeRespiratoryGear = to.params?.respiratoryGearId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ export async function setRespiratoryGearId(to: any, from: any, next: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetRespiratoryGearStores(to: any, from: any, next: any) {
|
export async function resetRespiratoryGearStores(to: any, from: any, next: any) {
|
||||||
const RespiratoryGearStore = useRespiratoryGearStore();
|
const respiratoryGearStore = useRespiratoryGearStore();
|
||||||
RespiratoryGearStore.activeRespiratoryGear = null;
|
respiratoryGearStore.activeRespiratoryGear = null;
|
||||||
RespiratoryGearStore.activeRespiratoryGearObj = null;
|
respiratoryGearStore.activeRespiratoryGearObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission";
|
import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission";
|
||||||
|
|
||||||
export async function setRespiratoryMissionId(to: any, from: any, next: any) {
|
export async function setRespiratoryMissionId(to: any, from: any, next: any) {
|
||||||
const RespiratoryMissionStore = useRespiratoryMissionStore();
|
const respiratoryMissionStore = useRespiratoryMissionStore();
|
||||||
RespiratoryMissionStore.activeRespiratoryMission = to.params?.respiratoryMissionId ?? null;
|
respiratoryMissionStore.activeRespiratoryMission = to.params?.respiratoryMissionId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ export async function setRespiratoryMissionId(to: any, from: any, next: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetRespiratoryMissionStores(to: any, from: any, next: any) {
|
export async function resetRespiratoryMissionStores(to: any, from: any, next: any) {
|
||||||
const RespiratoryMissionStore = useRespiratoryMissionStore();
|
const respiratoryMissionStore = useRespiratoryMissionStore();
|
||||||
RespiratoryMissionStore.activeRespiratoryMission = null;
|
respiratoryMissionStore.activeRespiratoryMission = null;
|
||||||
RespiratoryMissionStore.activeRespiratoryMissionObj = null;
|
respiratoryMissionStore.activeRespiratoryMissionObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer";
|
import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer";
|
||||||
|
|
||||||
export async function setRespiratoryWearerId(to: any, from: any, next: any) {
|
export async function setRespiratoryWearerId(to: any, from: any, next: any) {
|
||||||
const RespiratoryWearerStore = useRespiratoryWearerStore();
|
const respiratoryWearerStore = useRespiratoryWearerStore();
|
||||||
RespiratoryWearerStore.activeRespiratoryWearer = to.params?.respiratoryWearerId ?? null;
|
respiratoryWearerStore.activeRespiratoryWearer = to.params?.respiratoryWearerId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ export async function setRespiratoryWearerId(to: any, from: any, next: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetRespiratoryWearerStores(to: any, from: any, next: any) {
|
export async function resetRespiratoryWearerStores(to: any, from: any, next: any) {
|
||||||
const RespiratoryWearerStore = useRespiratoryWearerStore();
|
const respiratoryWearerStore = useRespiratoryWearerStore();
|
||||||
RespiratoryWearerStore.activeRespiratoryWearer = null;
|
respiratoryWearerStore.activeRespiratoryWearer = null;
|
||||||
RespiratoryWearerStore.activeRespiratoryWearerObj = null;
|
respiratoryWearerStore.activeRespiratoryWearerObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
|
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
|
||||||
|
import { useVehicleDamageReportStore } from "../../stores/admin/unit/vehicle/damageReport";
|
||||||
|
import { useVehicleInspectionStore } from "../../stores/admin/unit/vehicle/inspection";
|
||||||
|
|
||||||
export async function setVehicleId(to: any, from: any, next: any) {
|
export async function setVehicleId(to: any, from: any, next: any) {
|
||||||
const VehicleStore = useVehicleStore();
|
const vehicleStore = useVehicleStore();
|
||||||
VehicleStore.activeVehicle = to.params?.vehicleId ?? null;
|
vehicleStore.activeVehicle = to.params?.vehicleId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
useVehicleDamageReportStore().$reset();
|
||||||
|
useVehicleInspectionStore().$reset();
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetVehicleStores(to: any, from: any, next: any) {
|
export async function resetVehicleStores(to: any, from: any, next: any) {
|
||||||
const VehicleStore = useVehicleStore();
|
const vehicleStore = useVehicleStore();
|
||||||
VehicleStore.activeVehicle = null;
|
vehicleStore.activeVehicle = null;
|
||||||
VehicleStore.activeVehicleObj = null;
|
vehicleStore.activeVehicleObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
useVehicleDamageReportStore().$reset();
|
||||||
|
useVehicleInspectionStore().$reset();
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
import { useWearableStore } from "@/stores/admin/unit/wearable/wearable";
|
import { useWearableStore } from "@/stores/admin/unit/wearable/wearable";
|
||||||
|
import { useWearableDamageReportStore } from "../../stores/admin/unit/wearable/damageReport";
|
||||||
|
import { useWearableTypeInspectionPlanStore } from "../../stores/admin/unit/wearableType/inspectionPlan";
|
||||||
|
|
||||||
export async function setWearableId(to: any, from: any, next: any) {
|
export async function setWearableId(to: any, from: any, next: any) {
|
||||||
const WearableStore = useWearableStore();
|
const wearableStore = useWearableStore();
|
||||||
WearableStore.activeWearable = to.params?.wearableId ?? null;
|
wearableStore.activeWearable = to.params?.wearableId ?? null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
useWearableDamageReportStore().$reset();
|
||||||
|
useWearableTypeInspectionPlanStore().$reset();
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function resetWearableStores(to: any, from: any, next: any) {
|
export async function resetWearableStores(to: any, from: any, next: any) {
|
||||||
const WearableStore = useWearableStore();
|
const wearableStore = useWearableStore();
|
||||||
WearableStore.activeWearable = null;
|
wearableStore.activeWearable = null;
|
||||||
WearableStore.activeWearableObj = null;
|
wearableStore.activeWearableObj = null;
|
||||||
|
|
||||||
//useXYStore().$reset();
|
useWearableDamageReportStore().$reset();
|
||||||
|
useWearableTypeInspectionPlanStore().$reset();
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,9 @@ export const useEquipmentTypeInspectionPlanStore = defineStore("equipmentTypeIns
|
||||||
const equipmentTypeId = useEquipmentTypeStore().activeEquipmentType;
|
const equipmentTypeId = useEquipmentTypeStore().activeEquipmentType;
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/inspectionPlan/equipmentType/${equipmentTypeId}`)
|
.get(`/admin/inspectionPlan/equipmentType/${equipmentTypeId}?noLimit=true`)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.inspectionPlans = result.data;
|
this.inspectionPlans = result.data.inspectionPlans;
|
||||||
this.loading = "fetched";
|
this.loading = "fetched";
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
|
@ -16,9 +16,9 @@ export const useVehicleTypeInspectionPlanStore = defineStore("vehicleTypeInspect
|
||||||
const vehicleTypeId = useVehicleTypeStore().activeVehicleType;
|
const vehicleTypeId = useVehicleTypeStore().activeVehicleType;
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/inspectionPlan/vehicleType/${vehicleTypeId}`)
|
.get(`/admin/inspectionPlan/vehicleType/${vehicleTypeId}?noLimit=true`)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.inspectionPlans = result.data;
|
this.inspectionPlans = result.data.inspectionPlans;
|
||||||
this.loading = "fetched";
|
this.loading = "fetched";
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
|
@ -16,9 +16,9 @@ export const useWearableTypeInspectionPlanStore = defineStore("wearableTypeInspe
|
||||||
const wearableTypeId = useWearableTypeStore().activeWearableType;
|
const wearableTypeId = useWearableTypeStore().activeWearableType;
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/inspectionPlan/wearableType/${wearableTypeId}`)
|
.get(`/admin/inspectionPlan/wearableType/${wearableTypeId}?noLimit=true`)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.inspectionPlans = result.data;
|
this.inspectionPlans = result.data.inspectionPlans;
|
||||||
this.loading = "fetched";
|
this.loading = "fetched";
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue