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

export function getCompanyList(query) {
    return axios({
        url: "/udiwms/info/suppliers/enterprise/basic/getCompanyList",
        method: "get",
        params: query
    });
}

export function getCompanyInfo(query) {
    return axios({
        url: "/udiwms/info/suppliers/enterprise/basic/getCompanyInfo",
        method: "get",
        params: query
    });
}

export function addOrModifyCompany(query, formName) {
    let url = formName === "add" ?
            "/udiwms/info/suppliers/enterprise/basic/addCompany" : "/udiwms/info/suppliers/enterprise/basic/modifyCompany";
    return axios(
        {
            url: url,
            method: "post",
            data: query
        }
    );
}

export function deleteCompany(query) {
    return axios({
        url: "/udiwms/info/suppliers/enterprise/basic/delete",
        method: "get",
        params: query
    });
}

