import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/spareparts',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/spareparts/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/spareparts',
    method: 'put',
    data
  })
}

// 零件耗用
export function hySpareParts(data) {
  return request({
    url: 'api/spareparts/hySpareParts',
    method: 'post',
    data
  })
}
//批量新增
export function autoAddHy(data) {
  return request({
    url: 'api/spareparts/autoAddHy',
    method: 'post',
    data
  })
}

export default { add, edit, del,hySpareParts,autoAddHy }
