import request from "@/utils/request";

// 创建退料单前置
export function createReturnWorkOrderPre(data) {
    return request({
        url: "/rtkwms/return-work-order-pre/create",
        method: "post",
        data: data,
    });
}

// 更新退料单前置
export function updateReturnWorkOrderPre(data) {
    return request({
        url: "/rtkwms/return-work-order-pre/update",
        method: "put",
        data: data,
    });
}

// 删除退料单前置
export function deleteReturnWorkOrderPre(id) {
    return request({
        url: "/rtkwms/return-work-order-pre/delete?id=" + id,
        method: "delete",
    });
}

// 获得退料单前置
export function getReturnWorkOrderPre(id) {
    return request({
        url: "/rtkwms/return-work-order-pre/get?id=" + id,
        method: "get",
    });
}

// 获得退料单前置分页
export function getReturnWorkOrderPrePage(query) {
    return request({
        url: "/rtkwms/return-work-order-pre/page",
        method: "get",
        params: query,
    });
}

// 获得退料单前置明细分页
export function getReturnWorkOrderPreDetailPage(query) {
    return request({
        url: "/rtkwms/return-work-order-pre-detail/page",
        method: "get",
        params: query,
    });
}

export function createReturnWorkOrder(data) {
    return request({
        url: "/mes/return-work-order/create",
        method: "post",
        data: data,
    });
}
// 扫物料条码获取物料信息
export function getMaterialToReturn(query) {
    return request({
        url: "/rtkwms/label-master/getMaterialToReturn",
        method: "get",
        params: query,
    });
}
// 查看退料日志
export function getWorkLogPage(query) {
    return request({
        url: "/rtkwms/return-work-order-pre-log/page",
        method: "get",
        params: query,
    });
}
// 提交退料单前置
export function commitMaterialsReturnPre(query) {
    return request({
        url: "/rtkwms/return-work-order-pre/commit",
        method: "get",
        params: query,
    });
}

// 保存退料单前置
export function saveMaterialsReturnPre(data) {
    return request({
        url: "/rtkwms/return-work-order-pre/save",
        method: "post",
        data: data,
    });
}

// QC审核
export function qcAudit(data) {
    return request({
        url: "/rtkwms/return-work-order-pre/qcAudit",
        method: "put",
        data: data,
    });
}
// 过账审核
export function gzAudit(data) {
    return request({
        url: "/rtkwms/return-work-order-pre/gzAudit",
        method: "put",
        data: data,
    });
}