import request from "@/utils/request";

// 创建销售订单
export function createSaleOrder(data) {
  return request({
    url: "/rtkwms/sale-order/create",
    method: "post",
    data: data,
  });
}
// 创建出货通知单
export function createSaleOutOrderMaster(data) {
  return request({
    url: "rtkwms/sale-out-order-master/create",
    method: "post",
    data: data,
  });
}

// 更新销售订单
export function updateSaleOrder(data) {
  return request({
    url: "/rtkwms/sale-order/update",
    method: "put",
    data: data,
  });
}

// 删除销售订单
export function deleteSaleOrder(id) {
  return request({
    url: "/rtkerp/sale-order-detail/delete?id=" + id,
    method: "delete",
  });
}

// 获得销售订单
export function getSaleOrder(id) {
  return request({
    url: "/rtkwms/sale-order/get?id=" + id,
    method: "get",
  });
}

// 获得销售订单分页 /rtkwms/sale-order/page
export function getSaleOrderPage(query) {
  return request({
    url: "/rtkerp/sale-order/mainDetailPage",
    method: "get",
    params: query,
  });
}

// 导出销售订单 Excel
export function exportSaleOrderExcel(query) {
  return request({
    url: "/rtkwms/sale-order/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}
// 获得销售订单明细分页
export function getSaleOrderDetailPage(query) {
  return request({
    url: "/rtkwms/sale-order-detail/page",
    method: "get",
    params: query,
  });
}

// 导出销售订单明细 Excel
export function exportSaleOrderDetailExcel(query) {
  return request({
    url: "/rtkwms/sale-order-detail/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}
