import request from "@/utils/request";

// 创建仓库
export function createStock(data) {
    return request({
        url: "/rtkerp/stock/create",
        method: "post",
        data: data,
    });
}

// 更新仓库
export function updateStock(data) {
    return request({
        url: "/rtkerp/stock/update",
        method: "put",
        data: data,
    });
}

// 删除仓库
export function deleteStock(id) {
    return request({
        url: "/rtkerp/stock/delete?id=" + id,
        method: "delete",
    });
}

// 获得仓库
export function getStock(id) {
    return request({
        url: "/rtkerp/stock/get?id=" + id,
        method: "get",
    });
}

// 获得仓库分页
export function getStockPage(query) {
    return request({
        url: "/rtkerp/stock/page",
        method: "get",
        params: query,
    });
}

// 获得仓库下拉列表
export function getStockPageList(query) {
    return request({
        url: "/rtkerp/stock/dropDownList",
        method: "get",
        params: query,
    });
}

// 获得倒冲仓下拉列表
export function getReverseStockListPage(query) {
    return request({
        url: "/rtkerp/stock/reverseStockList",
        method: "get",
        params: query,
    });
}

// 导出仓库 Excel
export function exportStockExcel(query) {
    return request({
        url: "/rtkerp/stock/export-excel",
        method: "get",
        params: query,
        responseType: "blob",
    });
}
// 获得工厂管理分页
export function getFactoryPage(query) {
    return request({
        url: "/rtkwms/factory/page",
        method: "get",
        params: query,
    });
}
// 获得用户列表
export function getUserList(query) {
    return request({
        url: "/rtkerp/stock/userList",
        method: "get",
        params: query,
    });
}