import request from "@/utils/request";

// 创建入库申请主
export function createInRequest(data) {
    return request({
        url: "/rtkwms/inout-request/createOutRequestOrder",
        method: "post",
        data: data,
    });
}
// 创建入库申请主
export function createRequest(data) {
    return request({
        url: "/rtkwms/in-request/createOutRequestOrder",
        method: "post",
        data: data,
    });
}
// 创建入库申请主
export function getSourceOrder(data) {
    return request({
        url: "/rtkwms/inout-request/getSourceOrder",
        method: "post",
        data: data,
    });
}

// 更新入库申请主
export function updateInRequest(data) {
    return request({
        url: "/rtkwms/inout-request/updateOutRequestOrder",
        method: "put",
        data: data,
    });
}
// 更新入库申请主
export function updateRequest(data) {
    return request({
        url: "/rtkwms/in-request/updateOutRequestOrder",
        method: "put",
        data: data,
    });
}

// 删除入库申请主
export function deleteInRequest(id) {
    return request({
        url: "/rtkwms/inout-request/delete?id=" + id,
        method: "delete",
    });
}

// 获得入库申请主
export function getInRequest(id) {
    return request({
        url: "/rtkwms/inout-request/get?id=" + id,
        method: "get",
    });
}
// 获得入库申请主
export function getStockPage(params) {
    return request({
        url: "/rtkerp/stock/page",
        method: "get",
        params,
    });
}
// 获得入库申请主分页
export function getInRequestPage(params) {
    return request({
        url: "/rtkwms/inout-request/page",
        method: "get",
        params,
    });
}
// 导出入库申请主 Excel
export function exportInRequestExcel(params) {
    return request({
        url: "/rtkwms/inout-request/export-excel",
        method: "get",
        params,
        responseType: "blob",
    });
}

export function getDictByOrderType(params) {
    return request({
        url: "/rtkwms/inout-request/getDictByOrderType",
        method: "get",
        params,
    });
}