You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0 KiB
TypeScript

import request from '@/config/axios'
// 维保计划 VO
export interface DvCheckVO {
id: number // ID
planCode: string // 计划编码
planName: string // 计划名称
planType: string // 计划类型
startDate: Date // 开始日期
endDate: Date // 结束日期
status: string // 状态
remark: string // 备注
isEnable: boolean // 是否启用
cycleUnit: string // 频率单位
cycleCount: number // 频率
planLevel: string // 维保等级
lastTime: Date // 上次执行时间
formulaCode: string // 计算公式
}
// 维保计划 API
export const DvCheckApi = {
// 查询维保计划分页
getDvCheckPage: async (params: any) => {
return await request.get({ url: `/mes/dv-check/page`, params })
},
// 查询维保计划详情
getDvCheck: async (id: number) => {
return await request.get({ url: `/mes/dv-check/get?id=` + id })
},
// 新增维保计划
createDvCheck: async (data: DvCheckVO) => {
return await request.post({ url: `/mes/dv-check/create`, data })
},
// 修改维保计划
updateDvCheck: async (data: DvCheckVO) => {
return await request.put({ url: `/mes/dv-check/update`, data })
},
// 删除维保计划
deleteDvCheck: async (id: number) => {
return await request.delete({ url: `/mes/dv-check/delete?id=` + id })
},
// 导出维保计划 Excel
exportDvCheck: async (params) => {
return await request.download({ url: `/mes/dv-check/export-excel`, params })
},
// ==================== 子表(维保计划设备) ====================
// 获得维保计划设备列表
getDvCheckDeviceListByPlanId: async (planId) => {
return await request.get({ url: `/mes/dv-check/dv-check-device/list-by-plan-id?planId=` + planId })
},
// ==================== 子表(维保计划项目) ====================
// 获得维保计划项目列表
getDvCheckSubjectListByPlanId: async (planId) => {
return await request.get({ url: `/mes/dv-check/dv-check-subject/list-by-plan-id?planId=` + planId })
}
}