import request from "@/utils/request";

// 创建材料汇总
export function createMaterialSummary(data) {
    return request({
        url: "/rtkwms/material-summary/create",
        method: "post",
        data: data,
    });
}

// 更新材料汇总
export function updateMaterialSummary(data) {
    return request({
        url: "/rtkwms/material-summary/update",
        method: "put",
        data: data,
    });
}

// 删除材料汇总
export function deleteMaterialSummary(id) {
    return request({
        url: "/rtkwms/material-summary/delete?id=" + id,
        method: "delete",
    });
}

// 获得材料汇总
export function getMaterialSummary(id) {
    return request({
        url: "/rtkwms/material-summary/get?id=" + id,
        method: "get",
    });
}

// 获得材料汇总分页
export function getMaterialSummaryPage(query) {
    return request({
        url: "/rtkwms/material-summary/page",
        method: "get",
        params: query,
    });
}

// 导出材料汇总 Excel
export function exportMaterialSummaryExcel(query) {
    return request({
        url: "/rtkwms/material-summary/export-excel",
        method: "get",
        params: query,
        responseType: "blob",
    });
}

// 查询材料汇总选择列表
export function getWorkOrderPageList(query) {
    return request({
        url: "/rtkwms/material-summary/workOrderPage",
        method: "get",
        params: query,
    });
}

// 创建材料汇总单
export function createByWorkOrder(data) {
    return request({
        url: "/rtkwms/material-summary/createByWorkOrder",
        method: "post",
        data,
    });
}

// 创建材料汇总单
export function getDetailAndMainPage(query) {
    return request({
        url: "/rtkwms/work-order-bom-detail/detailAndMainPage",
        method: "get",
        params: query,
    });
}