import request from "@/utils/request";

// 创建客户
export function createCustomer(data) {
    return request({
        url: "/rtkerp/customer/create",
        method: "post",
        data: data,
    });
}

// 更新客户
export function updateCustomer(data) {
    return request({
        url: "/rtkerp/customer/update",
        method: "put",
        data: data,
    });
}

// 删除客户
export function deleteCustomer(id) {
    return request({
        url: "/rtkerp/customer/delete?id=" + id,
        method: "delete",
    });
}

// 获得客户
export function getCustomer(id) {
    return request({
        url: "/rtkerp/customer/get?id=" + id,
        method: "get",
    });
}

// 获得客户分页
export function getCustomerPage(query) {
    return request({
        url: "/rtkerp/customer/page",
        method: "get",
        params: query,
    });
}

// 导出客户 Excel
export function exportCustomerExcel(query) {
    return request({
        url: "/rtkerp/customer/export-excel",
        method: "get",
        params: query,
        responseType: "blob",
    });
}