import request from '@/utils/request'
import { parseStrEmpty } from '@/utils/bonus'
// 查询新购验收任务列表
export function getPurchaseList(query) {
    return request({
      url: '/material/purchase_check_info/list',
      method: 'get',
      params: query
    })
  }

// 查询新购验收任务详细列表
export function getPurchaseDetailsList(query) {
    return request({
    url: '/material/purchase_check_info/getInfo',
    method: 'get',
    params: query
    })
}

// 外层批量验收合格API
export function acceptOuterVerify(data) {
  return request({
    url: '/material/purchase_check_info/outerVerify',
    method: 'put',
    data: data
  })
}

// 内层批量验收合格API
export function acceptInnerVerifyer(data) {
  return request({
    url: '/material/purchase_check_info/innerVerify',
    method: 'put',
    data: data
  })
}
// //根据任务id查询报告附件
// export function getPurchaseFileList(query) {
//   return request({
//     url: '/material/purchase_check_details/fileList',
//     method: 'get',
//     params: query
//   })
// }
// 上传报告附件 - 异步
export function uploadPurchaseFile(data) {
  return request({
    url: '/material/bm_file_info',
    method: 'post',
    data: data
  })
}
//根据任务id查询报告附件
export function getPurchaseFileList(query) {
  return request({
    url: '/material/bm_file_info/list',
    method: 'get',
    params: query
  })
}

// 查询新购验收任务详细列表
export function getPurchaseCheckFormByTaskId(taskId) {
  return request({
    url: '/material/purchase_check_info/getPurchaseCheckFormByTaskId/'+taskId,
    method: 'get'
  })
}

// 验收人查询
export function getCheckUserList(query) {
  return request({
    url: '/material/purchase_check_info/getCheckUserList',
    method: 'get',
    params: query
  })
}

// 流程图
export function getSignListApi(query) {
  return request({
    url: '/material/purchase_check_info/getSignList',
    method: 'get',
    params: query
  })
}

// 查看新增报告
export function bmFileInfoAddApi(data) {
  return request({
    url: '/material/bm_file_info',
    method: 'post',
    data
  })
}

// 查看删除报告
export function bmFileInfoRemoveApi(id) {
  return request({
    url: '/material/bm_file_info/' + id,
    method: 'delete',
  })
}
