import request from '@/utils/request'

// 查询盘点明细列表
export function listPan(query) {
  return request({
    url: '/system/pan/list',
    method: 'get',
    params: query
  })
}

// 查询盘点明细详细
export function getPan(id) {
  return request({
    url: '/system/pan/' + id,
    method: 'get'
  })
}

// 新增盘点明细
export function addPan(data) {
  return request({
    url: '/system/pan',
    method: 'post',
    data: data
  })
}

// 修改盘点明细
export function updatePan(data) {
  return request({
    url: '/system/pan',
    method: 'put',
    data: data
  })
}

// 删除盘点明细
export function delPan(id) {
  return request({
    url: '/system/pan/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/pan/enable/' + id,
    method: 'delete'
  })
}

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

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