import request from '@/utils/request'

// 查询出库单列表
export function listWarehouse(query) {
  return request({
    url: '/inventory/warehouse/list',
    method: 'get',
    params: query
  })
}

// 查询出库单详细
export function getWarehouse(id) {
  return request({
    url: '/inventory/warehouse/' + id,
    method: 'get'
  })
}

// 新增出库单
export function addWarehouse(data) {
  return request({
    url: '/inventory/warehouse',
    method: 'post',
    data: data
  })
}

// 修改出库单
export function updateWarehouse(data) {
  return request({
    url: '/inventory/warehouse',
    method: 'put',
    data: data
  })
}

// 删除出库单
export function delWarehouse(id) {
  return request({
    url: '/inventory/warehouse/' + id,
    method: 'delete'
  })
}

// 导出出库单
export function exportWarehouse(query) {
  return request({
    url: '/inventory/warehouse/export',
    method: 'get',
    params: query
  })
}

//记账
export function updataKeeping(id) {
  return request({
    url: '/inventory/warehouse/keeping/' + id,
    method: 'put',
  })
}

//冲销
export function undataWriteOff(id) {
  return request({
    url: '/inventory/warehouse/writeOff/' + id,
    method: 'put'
  })
}

//出库
export function listCk(query) {
  return request({
    url: '/pharmacy/storage/listCk',
    method: 'get',
    params: query
  })
}
