import request from '@/utils/request'

// 查询检查记录列表
export function checkCorrection(query) {
  return request({
    url: '/check/checkCorrection/list',
    method: 'get',
    params: query
  })
}

// 查询检查记录详细
export function getCheckCorrection(id) {
  return request({
    url: `/check/checkCorrection/${id}`,
    method: 'get'
  })
}

// 新增检查记录
export function addCheckRecord(data) {
  return request({
    url: '/check/checkCorrection',
    method: 'post',
    data: data
  })
}

// 修改检查记录
export function updateCheckRecord(data) {
  return request({
    url: '/check/checkCorrection',
    method: 'put',
    data: data
  })
}

// 删除检查记录
export function delCheckRecord(ids) {
  return request({
    url: `/check/checkCorrection/${ids}`,
    method: 'delete'
  })
}

export function historyInstance (id) {
  return request({
    url: `/system/check/approval/history/instance/${id}`,
    method: 'get'
  })
}

// 同意检查记录
export function approveTask (data) {
  return request({
    url: `/check/checkCorrection/approveTask`,
    method: 'post',
    data
  })
}
// 驳回检查记录
export function rejectTask(data) {
  return request({
    url: `/check/checkCorrection/rejectTask`,
    method: 'post',
    data
  })
}

