

import request from '@/utils/request'

// 查询维修任务一级列表
export function getRepairTaskList(query) {
  return request({
    url: '/material/repair/getRepairTaskList',
    method: 'get',
    params: query
  })
}

// // 查询维修任务一级列表
// export function getRepaiDocumentInfo(query) {
//   return request({
//     url: '/material/repair/getRepaiDocumentInfo',
//     method: 'get',
//     params: query
//   })
// }

// 查询维修任务机具列表二级列表
export function getAppRepairMaTypeList(query) {
  return request({
    url: '/material/repair/getAppRepairMaTypeList',
    method: 'get',
    params: query
  })
}

//获取配件类型树
export function partTypeTreeList(query) {
  return request({
    url: '/material/ma_part_type/list',
    method: 'get',
    params: query,
  })
}

export function partTypeTreeListNew(query) {
  return request({
    url: '/material/ma_part_type/partList',
    method: 'get',
    params: query,
  })
}


// //维修驳回至退料
// export function rejectRepair(data) {
//   return request({
//       url: '/material/repair/rejectRepair',
//       method: 'post',
//       data: data,
//   })
// }
// 维修驳回至退料
export function rejectRepair(taskIds) {
  return request({
    url: '/material/repair/' + taskIds,
    method: 'delete'
  })
}

// 维修保存
export function saveCodeList(data) {
  return request({
    url: '/material/repair/batchRepairApply',
    method: 'post',
    data: data,
  })
}

//维修提交
export function sendList(data) {
  return request({
    url: '/material/repair/endRepairTask',
    method: 'post',
    data: data,
  })
}

//内层维修合格
export function auditPass(data) {
  return request({
    url: '/material/repair/batchQualified',
    method: 'post',
    data: data,

  })
}



//获取维修任务单信息
export function getRepairDocumentInfo(taskId) {
  return request({
    url: '/material/repair/getRepairDocumentInfo/?taskId=' + taskId,
    method: 'get',
  })
}

//获取维修记录
export function getRepairCodeList(query) {
  return request({
    url: '/material/repair/getRepairCodeList',
    method: 'get',
    params: query
  })
}

export function getRepairRecord(query) {
  return request({
    url: '/material/repair/getTestRecordData',
    method: 'get',
    params: query
  })
}

// 在修工程查询
export function getRepairProjectListApi(query) {
  return request({
    url: '/material/repair/getRepairProjectList',
    method: 'get',
    params: query
  })
}


//维修查询
export function getRepairQueryList(query) {
  return request({
    url: '/material/repair/getRepairQueryList',
    method: 'get',
    params: query,
  })
}

//维修审核查询
export function getRepairAuditQueryList(query) {
  return request({
    url: '/material/repair/getRepairAuditQueryList',
    method: 'get',
    params: query,
  })
}
