import axios from "../../utils/axios";


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: "get",
        params: query
    });
}


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


export function orderListError(query) {
    return axios({
        url: "/admin/warehouse/inout/order/listerror",
        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 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: "/warehouse/inout/order/unit",
        method: "post",
        data: query
    });
}

export function filterOrder(query) {
    return axios({
        url: "/warehouse/inout/order/filter",
        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: "/warehouse/inout/order/deleteOrder",
        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 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 updateSpms(query) {
    return axios(
        {
            url: "/warehouse/inout/order/updateSpms",
            method: "post",
            data: query
        }
    );
}

//查询补单数据
export function getSupplementOrder(query) {
    return axios({
        url: "warehouse/inout/order/filterSupplementOrder",
        method: "get",
        params: query
    });
}

//查询补录单据数据
export function additionalOrderList(query) {
    return axios({
        url: "/warehouse/inout/order/filterAdditionalOrder",
        method: "get",
        params: query
    });
}

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

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

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

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

