import request from "@/util/oaRequest"

// 查询出库单管理列表
export function listOaWarehouseMaster (query) {
  return request({
    url: '/oa/oaWarehouseMaster/list',
    method: 'get',
    params: query
  })
}


// 查询出库单管理详细
export function getOaWarehouseMaster (masterId) {
  return request({
    url: '/oa/oaWarehouseMaster/' + masterId,
    method: 'get'
  })
}

// 新增出库单管理
export function addOaWarehouseMaster (data) {
  return request({
    url: '/oa/oaWarehouseMaster',
    method: 'post',
    data: data
  })
}

// 新增入库单管理
export function addOaWarehouseMasterToIn (data) {
  return request({
    url: '/oa/oaWarehouseMaster/in',
    method: 'post',
    data: data
  })
}

// 修改出库单管理
export function updateOaWarehouseMaster (data) {
  return request({
    url: '/oa/oaWarehouseMaster',
    method: 'put',
    data: data
  })
}

export function updateOaWarehouseMasterStatus (masterId, isLike) {
  return request({
    url: '/oa/oaWarehouseMaster/like',
    method: 'put',
    params: { masterId, isLike }
  })
}

// 删除出库单管理
export function delOaWarehouseMaster (masterId) {
  return request({
    url: '/oa/oaWarehouseMaster/' + masterId,
    method: 'delete'
  })
}

// 撤销出库单管理
export function redoMaster (masterId) {
  return request({
    url: '/oa/oaWarehouseMaster/redo/' + masterId,
    method: 'get'
  })
}

// 查询退库列表（会关联操作日志数量）
export function exitWareList (params) {
  return request({
    url: '/oa/oaWarehouseMaster/list/return',
    method: 'get',
    params
  })
}

export function updateWithdrawlock (params) {
  return request({
    url: '/oa/oaWarehouseMaster/withdrawlock',
    method: 'put',
    params
  })
}