import request from '@/utils/request'

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

// 配件新购到货-新增
export function addPartInfo(data) {
  return request({
      url: '/material/part_arrived',
      method: 'post',
      data: data,
  })
}

 //配件新购到货-列表
 export function getListNewBuy(query) {
   return request({
       url: '/material/part_arrived/list',
       method: 'get',
       params: query,
   })
 }

//配件新购到货-列表详情
export function getPartTypeCheckInfo(query) {
  return request({
      url: '/material/part_arrived/getInfo',
      method: 'get',
      params: query,
  })
}

// 配件新购到货-编辑
export function updatePartInfo(data) {
  return request({
      url: '/material/part_arrived',
      method: 'put',
      data: data,
  })
}

// 配件新购到货--删除
export function deletePartInfo(data) {
  return request({
      url: '/material/part_arrived/delete' ,
      method: 'post',
      data: data,
  })
}

//根据任务id查询报告附件
export function getPartTypeFileList(query) {
  return request({
    url: '/material/part_arrived/getPartFilelist',
    method: 'get',
    params: query
  })
}

//根据任务id查询入库单
export function getInBoundForm(query) {
  return request({
    url: '/material/part_arrived/getInBoundForm',
    method: 'get',
    params: query
  })
}

// 根据id查3级树
export function getSelectPartListApi(query) {
  return request({
    url: '/material/part_lease/selectPartList',
    method: 'get',
    params: query
  })
}

// 配件库存
export function getPartPersonNumApi(data){
  return request({
    url: '/material/complex_query/getPartPersonNum',
    method: 'get',
    params: data,
  })
}
