// 设备借用相关接口api
import request from '../index'
// 设备管理点检查列表
export function getcheckInfoList(data: { limit: number; offset: number }) {
  return request({
    url: `/check/checkInfoList?limit=${data.limit}&offset=${data.offset}`,
    method: 'post',
    data,
  })
}

// 数据删除
export function getDeleteCheckInfo(data: object) {
  return request({
    url: '/check/deleteCheckInfo',
    method: 'post',
    data,
  })
}

// 数据导出
export function getExportCheckInfoList(data: object) {
  return request({
    url: '/check/exportCheckInfoList',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 保养验收单导出
export function exportCheckList(data: object) {
  return request({
    url: '/acceptanceCheck/exportList',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 获取详情数据
export function getselectCheckInfo(data: object) {
  return request({
    url: '/check/selectCheckInfo',
    method: 'post',
    data,
  })
}
// 获取详情数据
export function getAddCheckInfo(data: object) {
  return request({
    url: '/check/addCheckInfo',
    method: 'post',
    data,
  })
}

// 设备检修保养验收单列表
export function getacceptanceCheckList(data: { limit: number; offset: number }) {
  return request({
    url: `/acceptanceCheck/acceptanceCheckList?limit=${data.limit}&offset=${data.offset}`,
    method: 'post',
    data,
  })
}

// 设备检修申请新建
export function addEquipmentApply(data: object) {
  return request({
    url: '/equipmentApply/addEquipmentApply',
    method: 'post',
    data,
  })
}

// 设备检修申请详情信息
export function equipmentApplyInfo(data: object) {
  return request({
    url: '/equipmentApply/equipmentApplyInfo',
    method: 'post',
    data,
  })
}

// 设备维护列表
export function getEquipmentApplyList(data: { limit: number; offset: number }) {
  return request({
    url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`,
    method: 'post',
    data,
  })
}

// 设备检修申请提交
export function submitEquipmentApply(data: object) {
  return request({
    url: '/equipmentApply/submitEquipmentApply',
    method: 'post',
    data,
  })
}

// 设备检修申请删除
export function deleteEquipmentApply(data: object) {
  return request({
    url: '/equipmentApply/deleteEquipmentApply',
    method: 'post',
    data,
  })
}

// 设备检修申请编辑
export function updateEquipmentApply(data: object) {
  return request({
    url: '/equipmentApply/updateEquipmentApply',
    method: 'post',
    data,
  })
}
// 设备检修列表编辑-未通过-驳回编辑
export function failUpdateEquipmentApply(data: object) {
  return request({
    url: '/equipmentApply/failUpdate',
    method: 'post',
    data,
  })
}

// 设备检修保养验收单保存
export function addAcceptanceCheck(data: object) {
  return request({
    url: '/acceptanceCheck/addAcceptanceCheck',
    method: 'post',
    data,
  })
}

// 设备检修保养验收单提交
export function submitAcceptanceCheck(data: object) {
  return request({
    url: '/acceptanceCheck/submitEquipmentApply',
    method: 'post',
    data,
  })
}

// 设备检修保养验收单编辑--草稿箱、已取消
export function updateAcceptanceCheckInfo(data: object) {
  return request({
    url: '/acceptanceCheck/updateAcceptanceCheckInfo',
    method: 'post',
    data,
  })
}
// 设备检修保养验收单编辑--未通过-驳回
export function failUpdateAcceptanceCheckInfo(data: object) {
  return request({
    url: '/acceptanceCheck/failUpdate',
    method: 'post',
    data,
  })
}

// 设备检修保养验收单详情信息
export function acceptanceCheckInfo(data: object) {
  return request({
    url: '/acceptanceCheck/acceptanceCheckInfo',
    method: 'post',
    data,
  })
}

// 设备检修保养验收单审批删除
export function deleteAcceptanceCheck(data: object) {
  return request({
    url: '/acceptanceCheck/deleteEquipmentApply',
    method: 'post',
    data,
  })
}

