import request from "@/utils/request";

// 创建盘赢盘亏
export function createStockCheckDetail(data) {
    return request({
        url: "/rtkwms/stock-check-detail/create",
        method: "post",
        data: data,
    });
}

// 更新盘赢盘亏
export function updateStockCheckDetail(data) {
    return request({
        url: "/rtkwms/stock-check-detail/update",
        method: "put",
        data: data,
    });
}

// 删除盘赢盘亏
export function deleteStockCheckDetail(id) {
    return request({
        url: "/rtkwms/stock-check-detail/delete?id=" + id,
        method: "delete",
    });
}

// 获得盘赢盘亏
export function getStockCheckDetail(id) {
    return request({
        url: "/rtkwms/stock-check-detail/get?id=" + id,
        method: "get",
    });
}

// 获得盘赢盘亏分页
export function getStockCheckDetailPage(query) {
    return request({
        url: "/rtkwms/stock-check-detail/page",
        method: "get",
        params: query,
    });
}

// 导出盘赢盘亏 Excel
export function exportStockCheckDetailExcel(query) {
    return request({
        url: "/rtkwms/stock-check-detail/export-excel",
        method: "get",
        params: query,
        responseType: "blob",
    });
}

// 盘点保存
export function createCheckMaster(data) {
    return request({
        url: "/rtkwms/stock-check-master/create",
        method: "post",
        data,
    });
}

// 同步盘点
export function writeBackStockOut(data) {
    return request({
        url: "/rtkwms/stock-count/writeBack",
        method: "put",
        data,
    });
}

// 查询盘点作业
export function getAllStockOutList(query) {
    return request({
        url: "/rtkwms/stock-count/getAll",
        method: "get",
        params: query,
    });
}