import axios from "@/utils/request";

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

export function getJoinBussinessType(query) {
    return axios({
        url: "/udiwms/bussinessType/joinFilter",
        method: "get",
        params: query
    });
}

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

export function updateBussinessType(query) {
    return axios({
        url: "/udiwms/bussinessType/update",
        method: "post",
        data: query
    });
}

export function insertBussinessType(query) {
    return axios({
        url: "/udiwms/bussinessType/insert",
        method: "post",
        data: query
    });
}

export function getCandidateBussinessType(query) {
    return axios({
        url: "/warehouse/bussinessType/candidateBussinessType",
        method: 'get',
        params: query
    });
}

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