import { axios } from "@/utils/request";
import { upcloud_base_wh_outbound, upcloud_base_common } from "@/config/serviceSettings";
const headersJSON = { "Content-Type": "application/json" };

export function cancelDoBillH(params) {
  // 取消订单
  return axios({
    url: upcloud_base_wh_outbound + "/outboundOrder/cancelBill",
    method: "get",
    params,
    headersJSON,
  });
}
export function saveDoBillH(params) {
  // 保存订单
  return axios({
    url: upcloud_base_wh_outbound + "/outboundOrder/saveDoBillH",
    method: "post",
    data: params,
    headersJSON,
  });
}

export function queryDoBillDList(params) {
  // 订单明细
  return axios({
    url: upcloud_base_wh_outbound + "/outboundOrderLine/queryDoBillDList",
    method: "post",
    data: params,
    headersJSON,
  });
}

export function outDetailedPrint(params) {
  // 空模板打印
  return axios({
    url: upcloud_base_wh_outbound + "/do/print/out-detailed-print-null",
    method: "get",
    params,
  });
}

export function getInvoices(params) {
  // 发票下载
  return axios({
    url: upcloud_base_wh_outbound + "/outboundOrder/bill/getInvoices",
    method: "get",
    params,
  });
}

export function outReceiptPrint(params) {
  // 发票打印
  return axios({
    url: upcloud_base_wh_outbound + "/do/print/out-receipt-print",
    method: "get",
    params,
  });
}

export function getDicttype(params) {
  // 字典列表
  return axios({
    url: upcloud_base_common + "/dicttype/page",
    method: "get",
    params,
  });
}

//：出库清单打印
export function detailedPrint(params) {
  return axios({
    url: upcloud_base_wh_outbound + "/do/print/out-detailed-print",
    method: "get",
    params,
  });
}

export function detailedDownload(params) {
  return axios({
    url: upcloud_base_wh_outbound + "/do/print/out-detailed-download",
    method: "get",
    responseType: "blob",
    params,
  });
}
// 打印
export function printAll(url, data) {
  return axios({
    url: url,
    method: "post",
    data,
  });
}
