import request from '@/utils/request'

// 查询设备点检计划头列表
export function listCheckplan(query) {
  return request({
    url: '/pms/CheckPlan/list',
    method: 'get',
    params: query
  })
}

// 查询设备点检计划头详细
export function getCheckplan(planId) {
  return request({
    url: '/pms/CheckPlan/' + planId,
    method: 'get'
  })
}

// 新增设备点检计划头
export function addCheckplan(data) {
  return request({
    url: '/pms/CheckPlan',
    method: 'post',
    data: data
  })
}

// 修改设备点检计划头
export function updateCheckplan(data) {
  return request({
    url: '/pms/CheckPlan',
    method: 'put',
    data: data
  })
}

// 删除设备点检计划头
export function delCheckplan(planId) {
  return request({
    url: '/pms/CheckPlan/' + planId,
    method: 'delete'
  })
}

//设备点检保养状态修改
export function changeCheckplanStatus(id, status) {
  return request({
    url: '/pms/CheckPlan/updateStatus',
    method: 'put',
    data: {
      id,
      status
    }
  })

}



// 查询设备点检保养记录列表
export function listCheckRecord(query) {
  return request({
    url: '/pms/checkRecord/list',
    method: 'get',
    params: query
  })
}

// 查询保养记录详细
export function getCheckRecord(id) {
  return request({
    url: '/pms/checkRecord/' + id,
    method: 'get'
  })
}

// 修改保养记录
export function updateCheckRecord(data) {
  return request({
    url: '/pms/checkRecord',
    method: 'put',
    data: data
  })
}


// 删除保养记录
export function delCheckRecord(id) {
  return request({
    url: '/pms/checkRecord/' + id,
    method: 'delete'
  })
}
