import axios from '@/utils/request'


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

export function orderGetUdi(query) {
  return axios({
    url: "/udiwms/inout/order/getUdi",
    method: "get",
    params: query
  });
}

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

export function submitOrderWeb(query) {
  return axios({
    url: "/warehouse/inout/submitOrderWeb",
    method: "post",
    data: query
  });
}

export function submitCodes(query) {
  return axios({
    url: "/warehouse/inout/submitCodes",
    method: "post",
    data: query
  });
}

export function submitBiz(query) {
  return axios({
    url: "/warehouse/inout/submitBiz",
    method: "post",
    data: query
  });
}

export function delmitBiz(query) {
  return axios({
    url: "/warehouse/inout/delmitBiz",
    method: "post",
    data: query
  });
}

export function submitAllocateBiz(query) {
  return axios({
    url: "/warehouse/inout/waitAllocate/submitOrderWeb",
    method: "post",
    data: query
  });
}


export function saveOrderWeb(query) {
  return axios({
    url: "/warehouse/inout/saveOrderWeb",
    method: "post",
    data: query
  });
}

export function filterInvoice(params) {
  return axios({
    url: "/udiwms/inout/order/filterInvoice",
    method: "get",
    params: params
  });
}


export function orderListError(query) {
  return axios({
    url: "/udiwms/inout/order/error",
    method: "get",
    params: query
  });
}

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

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

export function addOrderWeb(query) {
  return axios({
    url: "/warehouse/inout/addOrderWeb",
    method: "post",
    data: query
  });
}


export function addDrugOrderWeb(query) {
  return axios({
    url: "/warehouse/inout/drug/addOrderWeb",
    method: "post",
    data: query
  });
}

export function enterCodeWeb(query) {
  return axios({
    url: "/warehouse/inout/enterCode",
    method: "post",
    data: query
  });
}

export function enterCodeBillNo(query) {
  return axios({
    url: "/warehouse/inout/enterCodeBillNo",
    method: "post",
    data: query
  });
}


export function postOrdersWeb(query) {
  return axios({
    url: "/warehouse/inout/postOrdersWeb",
    method: "post",
    data: query
  });
}

export function mergeOrder(query) {
  return axios({
    url: "/warehouse/inout/order/mergeOrder",
    method: "post",
    data: query
  });
}

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

export function filterOrder(query) {
  return axios({
    url: "/udiwms/inout/order/filter",
    method: "get",
    params: query
  });
}

export function filterOrderList(query) {
  return axios({
    url: "/udiwms/inout/order/filterList",
    method: "get",
    params: query
  });
}

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


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

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

export function selectWait(query) {
  return axios({
    url: "/sale/inout/order/selectWait",
    method: "get",
    params: query
  });
}

export function selectStatus(query) {
  return axios({
    url: "/sale/inout/order/selectStatus",
    method: "get",
    params: query
  });
}

export function selectDownload(query) {
  return axios({
    url: "/sale/inout/order/selectDownload",
    method: "get",
    params: query
  });
}

export function selectFinish(query) {
  return axios({
    url: "/sale/inout/order/selectFinish",
    method: "get",
    params: query
  });
}

export function selectSubOrders(query) {
  return axios({
    url: "/sale/inout/order/selectSubOrders",
    method: "get",
    params: query
  });
}


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

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


export function deleteCodes(query) {
  return axios({
    url: "/warehouse/inout/code/deleteCodes",
    method: "post",
    data: query
  });
}

export function commitOrder(query) {
  return axios({
    url: "/warehouse/inout/commit",
    method: "post",
    data: query
  });
}

export function addCommitOrder(query) {
  return axios({
    url: "/warehouse/inout/addCommit",
    method: "post",
    data: query
  });
}


export function updateExportStatus(query) {
  return axios(
    {
      url: "/warehouse/inout/order/updateExportStatus",
      method: "post",
      data: query
    }
  )
}

export function orderDetail(query) {
  return axios(
    {
      url: "/warehouse/inout/order/detail",
      method: "get",
      params: query
    }
  )
}

export function updateBind(query) {
  return axios(
    {
      url: "/udiwms/erpOrder/updateBind",
      method: "post",
      data: query
    }
  )
}

export function updateBindSup(query) {
  return axios(
    {
      url: "/udiwms/erpOrder/updateBindSup",
      method: "post",
      data: query
    }
  )
}

export function updateCodeBindSup(query) {
  return axios(
    {
      url: "/udiwms/addCode/updateBindSup",
      method: "post",
      data: query
    }
  )
}


export function updateBizBind(query) {
  return axios(
    {
      url: "/udiwms/inout/biz/updateBind",
      method: "post",
      data: query
    }
  )
}


export function backStock(query) {
  return axios(
    {
      url: "/sale/inout/order/backStock",
      method: "get",
      params: query
    }
  )
}

export function uploadOrder(query) {
  return axios(
    {
      url: "/warehouse/inout/order/uploadOrder",
      method: "post",
      data: query
    }
  )
}

export function moveStock(query) {
  return axios(
    {
      url: "/sale/inout/order/moveStock",
      method: "post",
      data: query
    }
  )
}


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

export function revokeOredr(query) {
  return axios({
    url: "/spms/inout/order/revoke",
    method: "get",
    params: query
  });
}

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


export function expireTimeCheck(query) {
  return axios(
    {
      url: "/warehouse/inout/expireTimeCheck",
      method: "post",
      data: query
    }
  )
}

export function filterOrderForDelete(params) {
  return axios({
    url: "/udiwms/inout/order/filterOrderForDelete",
    method: "get",
    params: params
  });
}

export function updateOrderInfo(data) {
  return axios({
    url: "/udiwms/inout/order/updateOrderInfo",
    method: "post",
    data: data
  })
}


export function getOrderById(params) {
  return axios({
    url: "/udiwms/inout/order/getOrderById",
    method: "get",
    params: params
  })
}


export function updateOrder(data) {
  return axios({
    url: "/udiwms/inout/order/updateOrder",
    method: "post",
    data: data
  })
}


export function uploadSpms(query) {
  return axios(
    {
      url: "/warehouse/inout/order/uploadSpms",
      method: "post",
      data: query
    }
  );
}

export function updateOrderPrintRemark(data) {
  return axios({
    url: "/udiwms/inout/order/updateOrderPrintRemark",
    method: "post",
    data: data
  });
}

export function getOrderList(params) {
  return axios({
    url: "/udiwms/inout/order/filter",
    method: "get",
    params: params
  });
}

export function getOrderFilter(params) {
  return axios({
    url: "udiwms/inout/preInorder/filter",
    method: "get",
    params: params
  });
}

export function updateStatus(query) {
  return axios({
    url: "/spms/inout/order/web/updateStatus",
    method: "post",
    data: query
  });
}

export function thirdUpdateStatus(query) {
  return axios({
    url: "/spms/inout/order/third/updateStatus",
    method: "post",
    data: query
  });
}


export function filterOrderTrace(params) {
  return axios({
    url: "/udiwms/inout/order/filterOrderTrace",
    method: "get",
    params: params
  });
}

export function deleteInvByBillNo(query) {
  return axios({
    url: "/udiwms/inout/order/finish/delete",
    method: "post",
    data: query
  });
}


export function deleteInvByCode(query) {
  return axios({
    url: "/udiwms/inout/code/finish/delete",
    method: "post",
    data: query
  });
}

export function deleteAllInvByCode(query) {
  return axios({
    url: "/udiwms/inout/code/finish/deleteAll",
    method: "post",
    data: query
  });
}


export function rollbackOrder(params) {
  return axios({
    url: "/udiwms/inout/order/received/rollback",
    method: "get",
    params: params
  });
}

export function rollUnReceivebackOrder(params) {
  return axios({
    url: "/udiwms/inout/order/unReceive/rollback",
    method: "get",
    params: params
  });
}

export function getUploadOrderList(params) {
  return axios({
    url: "/udiwms/inout/order/upload/filter",
    method: "get",
    params: params
  });
}

export function submitOrderToThrSys(params) {
  return axios({
    url: "/udiwms/inout/order/submitToThrSys",
    method: "get",
    params: params
  });
}

export function updateOrderDetailBiz(params) {
  return axios({
    url: "/udiwms/inout/order/updateOrderDetailBiz",
    method: "post",
    data: params
  });
}


export function orderDetailAdd(params) {
  return axios({
    url: "/inv/inner/order/orderDetailAdd",
    method: "post",
    data: params
  });
}

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


export function rollbackWaitcheck(params) {
  return axios({
    url: "/udiwms/inout/order/waitCheck/rollback",
    method: "get",
    params: params
  });
}


export function submitCodeResult(query) {
  return axios({
    url: "/warehouse/inout/codeResult/submitOrderWeb",
    method: "post",
    data: query
  });
}

export function submitCheckResult(query) {
  return axios({
    url: "/warehouse/inout/codeCheck/submitOrderWeb",
    method: "post",
    data: query
  });
}

export function batchVailCode(query) {
  return axios({
    url: "warehouse/inout/batchVailCode",
    method: "post",
    data: query
  });
}


export function batchAddCode(query) {
  return axios({
    url: "warehouse/inout/batchAddCode",
    method: "post",
    data: query
  });
}


export function batchAddCodeByOrderFinish(query) {
  return axios({
    url: "warehouse/inout/batchAddCodeByOrderFinish",
    method: "post",
    data: query
  });
}

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

export function getProcessingOrder(params) {
  return axios({
    url: "/udiwms/inout/order/getProcessingOrder",
    method: "get",
    params: params
  });
}
