import request from "@/utils/request";

// 创建出货
export function createbox(data) {
  return request({
    url: "/shipment/box/createAir",
    method: "post",
    data: data,
  });
}

// 更新出货
export function updatebox(data) {
  return request({
    url: "/shipment/box/update",
    method: "put",
    data: data,
  });
}

/**
 * 订舱
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function booking(data) {
  if (data.id) {
    return request({
      url: "/shipment/box-book-air/update",
      method: "put",
      data,
    });
  }

  return request({
    url: "/shipment/box-book-air/create",
    method: "post",
    data,
  });
}

/**
 * 获得待预装分页
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function preloadPage(data) {
  return request({
    url: "/ecw/box-preload-goods/preloadPageAir",
    method: "post",
    data,
  });
}

/**
 * 预装
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function createGoods(data) {
  return request({
    url: "/ecw/box-preload-goods/createAir",
    method: "post",
    data,
  });
}