import request from '@/utils/request';


export const allocateOrderlList = (query) => {
  return request({
    url: '/wms/allocateOrder/list',
    method: 'get',
    params: query
  });
};

export const allocateOrderDetailList = (query) => {
  return request({
    url: '/wms/allocateOrderDetail/list',
    method: 'get',
    params: query
  });
};

export const allocateOrderUpdate = (query) => {
  return request({
    url: '/wms/allocateOrder',
    method: 'put',
    data: query
  });
};

export const allocateOrder = (aoId) => {
  return request({
    url: '/wms/allocateOrder/' + aoId,
    method: 'delete'
  });
};

export const viewAllocateOrder = (aoId) => {
  return request({
    url: '/wms/allocateOrder/' + aoId,
    method: 'get'
  });
};

export const addAllocateOrder = (data) => {
  return request({
    url: '/wms/allocateOrder',
    method: 'post',
    data,
  });
};

export const getMaterialList = (query) => {
  return request({
    url: '/wms/inventory/getMaterialInfoList',
    method: 'get',
    params: query
  });
};
export const getInstockMaterialList = (query) => {
  return request({
    url: '/wms/baseMaterialInfo/materialList',
    method: 'get',
    params: query
  });
};

export const addAllocateOrderDetail = (data) => {
  return request({
    url: '/wms/allocateOrderDetail',
    method: 'post',
    data,
  });
};

export const viewAllocateOrderDetail = (aoId) => {
  return request({
    url: '/wms/allocateOrderDetail/' + aoId,
    method: 'get'
  });
};

export const delAllocateOrderDetail = (aoDId) => {
  return request({
    url: '/wms/allocateOrderDetail/removeDetail/' + aoDId,
    method: 'delete'
  });
};
