import request from '@/utils/request'

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

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

// 新增入库单
export function addWarehousing(data) {
  return request({
    url: '/inventory/warehousing',
    method: 'post',
    data: data
  })
}

// 修改入库单
export function updateWarehousing(data) {
  return request({
    url: '/inventory/warehousing',
    method: 'put',
    data: data
  })
}

// 删除入库单
export function delWarehousing(id) {
  return request({
    url: '/inventory/warehousing/' + id,
    method: 'delete'
  })
}

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

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

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

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

//上个生产批号
export function getProductionCode(data) {
  return request({
    url: '/inventory/warehousing/getProductionCode',
    method: 'post',
    data: data
  })
}
