import request from '@/utils/request'

// 查询托盘列表
export function listPallet(query) {
  return request({
    url: '/system/pallet/list',
    method: 'get',
    params: query
  })
}

// 查询托盘详细
export function getPallet(id) {
  return request({
    url: '/system/pallet/' + id,
    method: 'get'
  })
}

// 新增托盘
export function addPallet(data) {
  return request({
    url: '/system/pallet',
    method: 'post',
    data: data
  })
}

// 修改托盘
export function updatePallet(data) {
  return request({
    url: '/system/pallet',
    method: 'put',
    data: data
  })
}

// 删除托盘
export function delPallet(id) {
  return request({
    url: '/system/pallet/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/pallet/enable/' + id,
    method: 'delete'
  })
}

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

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