import request from '@/config/axios'

export interface PlanMaintenanceVO {
  id?: number | string
  planName: string
  planType: number | string
  description?: string
  subjectIdS?: string
  creator?: string
  creatorName?: string
  createTime?: string | number | Date
  updateTime?: string | number | Date
}

export interface PlanMaintenanceSubjectVO {
  id?: number | string
  subjectCode?: string
  subjectName?: string
  inspectionMethod?: string
  judgmentCriteria?: string
}

export const PlanMaintenanceApi = {
  getPlanMaintenancePage: async (params: any) => {
    return await request.get({ url: `/mes/mold-plan-maintenance/page`, params })
  },

  getSubjectList: async (id: number | string) => {
    return await request.get({ url: `/mes/mold-plan-maintenance/getSubjectList`, params: { id } })
  },

  createPlanMaintenance: async (data: any) => {
    return await request.post({ url: `/mes/mold-plan-maintenance/create`, data })
  },

  updatePlanMaintenance: async (data: any) => {
    return await request.put({ url: `/mes/mold-plan-maintenance/update`, data })
  },

  deletePlanMaintenance: async (ids: string) => {
    return await request.delete({ url: `/mes/mold-plan-maintenance/delete?ids=` + ids })
  },

  exportPlanMaintenance: async (params: any) => {
    return await request.download({ url: `/mes/mold-plan-maintenance/export-excel`, params })
  }
}
