import axios from '@/utils/request'
import request from "@/utils/request";

//--------------获取领用单据-------------------
export function getReceiveOrder(query) {
  return axios({
    url: "/udiwms/receive/order/filter",
    method: "get",
    params: query
  });
}


export function addDetail(query) {
  return axios({
    url: "/udiwms/receive/detail/add",
    method: "post",
    data: query
  });
}
export function addWarlockBag(query) {
  return axios({
    url: "/udiwms/receive/detail/addWarlockBag",
    method: "post",
    data: query
  });
}

export function repeatAdd(query) {
  return axios({
    url: "/udiwms/thrsys/order/repeatAdd",
    method: "post",
    data: query
  });
}


export function getOrderDetail(query) {
  return axios({
    url: "/udiwms/receive/order/detail",
    method: "get",
    params: query
  });
}

export function getAudit(query) {
  return axios({
    url: "/udiwms/receive/order/audit",
    method: "post",
    data: query
  });
}

// 根据领用单单添加详情表
export function addOrderDetailAndApply(data) {
  return request({
    url: "/receive/order/addOrderDetailAndApply",
    method: 'post',
    data: data
  })
}


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








