import axios from "@/utils/request";

export function getSupComapnys(query) {
    return axios(
        {
            url: "/api/pur/getSupComapnys",
            method: "get",
            params: query
        }
    );
}

export function delSupComapnys(query) {
    return axios(
        {
            url: "/api/pur/supCompany/delete",
            method: "post",
            data: query
        }
    );
}


export function modifyCompany(query) {
    return axios(
        {
            url: "/api/pur/modifyCompany",
            method: "post",
            data: query
        }
    );
}

export function auditCompany(query) {
    return axios(
        {
            url: "/api/pur/auditCompany",
            method: "post",
            data: query
        }
    );
}


export function addCompany(query) {
    return axios(
        {
            url: "/api/pur/addCompany",
            method: "post",
            data: query
        }
    );
}


export function getRefid(query) {
    return axios(
        {
            url: "/sale/info/refid",
            method: "get",
            params: query
        }
    );
}

export function checkCompany(query) {
    return axios(
        {
            url: "/salewarehouse/register/checkCompany",
            method: "get",
            params: query
        }
    );
}

export function getRegisterConfig(query) {
    return axios(
        {
            url: "/salewarehouse/register/getRegisterConfig",
            method: "get",
            params: query
        }
    );
}


export function getSubCompany(query) {
    return axios(
        {
            url: "/sale/info/getSubCompany",
            method: "get",
            params: query
        }
    );
}

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

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

export function bindCorp(query) {
    return axios(
        {
            url: "/sup/company/selectBind",
            method: "post",
            data: query
        }
    );
}

export function filterCompanyCertIdList(query) {
    return axios(
        {
            url: "/sup/info/filterCompanyCertIdList",
            method: "post",
            data: query
        }
    );
}

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

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









