import axios from "@/utils/request";

export function codeList(query) {
  return axios({
    url: "/admin/warehouse/inout/findByOrderId",
    method: "get",
    params: query
  });
}

export function downloadInoutOrderSuccessPDF(query) {
  return axios({
    url: "/udiwms/pdf/download/inout/order/success",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}

export function orderDetailPDFFromTemplateCode(query) {
  return axios({
    url: "/udiwms/pdf/template/order/detail/code",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}

export function orderDetailPDFFromTemplateFile(query) {
  return axios({
    url: "/udiwms/pdf/template/order/detail/file",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}

export function inspectionOrderDetailPDFFromTemplateCode(query) {
  return axios({
    url: "/udiwms/pdf/template/inspection/order/detail/code",
    method: "post",
    data: query,
  });
}

export function inspectionOrderDetailPDFFromTemplateFile(query) {
  return axios({
    url: "/udiwms/pdf/template/inspection/order/detail/file",
    method: "post",
    data: query,
  });
}

//---------打印码
export function inspectionStockQRCodeTextPDFFromTemplateFile(query) {
  return axios({
    url: "/udiwms/pdf/template/inspection/stock/qrcode/text/file",
    method: "post",
    data: query,
  });
}
export function stockQRCodeTextPDFFromTemplateFile(query) {
  return axios({
    url: "/udiwms/pdf/template/stock/qrcode/text/file",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}

//---------打印码
export function inspectionStockQRCodeTextPDFFromTemplateStatementFile(query) {
  return axios({
    url: "/udiwms/pdf/template/inspection/stock/qrcode/text/statement/file",
    method: "post",
    data: query,
  });
}
export function stockQRCodeTextPDFFromTemplateStatementFile(query) {
  return axios({
    url: "/udiwms/pdf/template/stock/qrcode/text/statement/file",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}
export function stockQRCodeTextPDFFromTemplateFileMax(query) {
  return axios({
    url: "/udiwms/pdf/template/stock/qrcode/text/maxfile",
    method: "post",
    data: query,
  });
}
export function filterTemp(query) {
  return axios({
    url: "/spms/stock/qrcode/filterTemp",
    method: "get",
    params: query
  });
}



//---------打印订单
export function inspectionStockOrderPDFFromTemplateFile(query) {
  return axios({
    url: "/udiwms/pdf/template/inspection/stock/order/file",
    method: "post",
    data: query,
  });
}

export function stockOrderPDFFromTemplateFile(query) {
  return axios({
    url: "/udiwms/pdf/template/stock/order/file",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}


export function demoPrint(query) {
  return axios({
    url: "/system/pdf/template/demoPrint",
    method: "post",
    data: query,
    headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
    responseType: 'arraybuffer',   //一定要设置响应类型，否则页面会是空白pdf
  });
}




