import request from '@/utils/request'

// 查询出库物料明细列表
export function listOrderdetail(query) {
  return request({
    url: '/system/orderdetail/list',
    method: 'get',
    params: query
  })
}

// 查询出库物料明细详细
export function getOrderdetail(id) {
  return request({
    url: '/system/orderdetail/' + id,
    method: 'get'
  })
}

// 新增出库物料明细
export function addOrderdetail(data) {
  return request({
    url: '/system/orderdetail',
    method: 'post',
    data: data
  })
}

// 修改出库物料明细
export function updateOrderdetail(data) {
  return request({
    url: '/system/orderdetail',
    method: 'put',
    data: data
  })
}

// 删除出库物料明细
export function delOrderdetail(id) {
  return request({
    url: '/system/orderdetail/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/orderdetail/enable/' + id,
    method: 'delete'
  })
}

// 禁用
export function disabled(id) {
  return request({
    url: '/system/orderdetail/disable/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/orderdetail/changeStatus',
    method: 'put',
    data: data
  })
}