import request from '../request.js';

const Api = {
  page: '/api/wms/outBill/page',
  list: '/api/wms/outBill/list',
  remove: '/api/wms/outBill/remove',
  removeBatch: '/api/wms/outBill/removeBatch',
  save: '/api/wms/outBill/save',
  edit: '/api/wms/outBill/edit',
  createOutBill: '/api/wms/outBill/CreateOutBill',
  billsAllot: '/api/wms/outBill/billsAllot',
  billsConform: '/api/wms/outBill/billsConform',
  billsExecute: '/api/wms/outBill/billsExecute',
  billsCancelAllot: '/api/wms/outBill/billsCancelAllot',
}

/** 出库单管理 */
export const page = data => {
  return request.request({
    url: Api.page,
    params: data,
    method: 'GET'
  })
}

/** 出库单列表 */
export const list = data => {
  return request.request({
    url: Api.list,
    params: data,
    method: 'GET'
  })
}

/** 新增出库单 */
export const save = data => {
  return request.request({
    url: Api.save,
    data: data,
    method: 'POST'
  })
}

/** 修改出库单 */
export const edit = data => {
  return request.request({
    url: Api.edit,
    data: data,
    method: 'PUT'
  })
}

/** 删除出库单 */
export const remove = data => {
  return request.request({
    url: Api.remove,
    params: data,
    method: 'DELETE'
  })
}

/** 批量删除 */
export const removeBatch = data => {
  return request.request({
    url: Api.removeBatch,
    params: data,
    method: 'DELETE'
  })
}

/** 新增入库单 */
export const createOutBill = data => {
  return request.request({
    url: Api.createOutBill,
    data: data,
    method: 'POST'
  })
}

/** 出库单据分配 */
export const billsAllot = data => {
  return request.request({
    url: Api.billsAllot,
    data: data,
    method: 'POST'
  })
}
/** 出库单据确认 */
export const billsConform = data => {
  return request.request({
    url: Api.billsConform,
    data: data,
    method: 'POST'
  })
}
/** 出库单据执行 */
export const billsExecute = data => {
  return request.request({
    url: Api.billsExecute,
    data: data,
    method: 'POST'
  })
}
/** 出库单取消分配 */
export const billsCancelAllot = data => {
  return request.request({
    url: Api.billsCancelAllot,
    data: data,
    method: 'POST'
  })
}
