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