import axios from '@/utils/request'

export function getCountOrderList(params) {
  return axios({
    url: "/invCount/order/filter",
    method: "get",
    params: params
  });
}

export function deleteCountOrder(data) {
  return axios({
    url: "/invCount/order/delete",
    method: "post",
    data: data
  });
}

export function getCountOrderDetailList(params) {
  return axios({
    url: "/invCount/order/detail/filter",
    method: "get",
    params: params
  });
}

export function saveCountOrder(data) {
  return axios({
    url: "/invCount/order/saveCountOrder",
    method: "post",
    data: data
  });
}

export function submitAudit(params) {
  return axios({
    url: "/invCount/order/submitAudit",
    method: "post",
    data: params
  });
}

export function deleteCountOrderDetail(data) {
  return axios({
    url: "/invCount/order/detail/deleteOrderDetail",
    method: "post",
    data: data
  });
}

export function addCountOrderDetail(data) {
  return axios({
    url: "/invCount/order/detail/addCountOrderDetail",
    method: "post",
    data: data
  });
}

export function updateCountOrderStatus(data) {
  return axios({
    url: "/invCount/order/updateCountOrderStatus",
    method: "post",
    data: data
  });
}

export function updateCountOrderDetail(data) {
  return axios({
    url: "/invCount/order/detail/updateCountOrderDetail",
    method: "post",
    data: data
  });
}




export function verifyTemplateFile(data) {
  return axios({
    url: "/invCount/order/verifyTemplateFile",
    method: "post",
    data: data
  });
}

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

export function batchAddDetail(data) {
  return axios({
    url: "/inv/count/order/detail/batchAddDetail",
    method: "post",
    data: data
  });
}

