import request from "@/utils/request";
import axios from "axios";
const baseURL = process.env.VUE_APP_REPORT_API;

// 获取分拆单列表
export function getSplitOrderMasterPage2(query) {
    return request({
        url: "/rtkwms/split-order-master/page2",
        method: "get",
        params: query,
    });
}

// 扫入条形码获取母卷信息
export function getMaterialDemolitionBatch(query) {
    return request({
        url: "/rtkwms/material-demolition-batch/toPage",
        method: "get",
        params: query,
    });
}

// 根据分拆单号获取分拆信息
export function getSplitOrderInfo(query) {
    return request({
        url: "/rtkwms/split-order-master/getSplitInfo",
        method: "get",
        params: query,
    });
}

// 拆分
export function createSplitOrderMaster(data) {
    return request({
        url: "/rtkwms/split-order-master/create",
        method: "post",
        data,
    });
}

// 设为损耗
export function createSplitDetailToloss(data) {
    return request({
        url: "/rtkwms/split-order-detail/toLoss",
        method: "post",
        data,
    });
}

// 放回原仓库/放到中间仓
export function toStock(data) {
    return request({
        url: "/rtkwms/split-order-detail/toStock",
        method: "post",
        data,
    });
}

// 二次拆分保存
export function createDemergeOrderBySecond(data) {
    return request({
        url: "/rtkwms/split-order-master/createBySecond",
        method: "post",
        data,
    });
}

// 获取分拆打印数据
export function getSplitPrintData(query) {
    return axios({
        method: "get",
        url: baseURL + "/report/wms-print/labelPrintData",
        params: query,
    });
}

// 删除子卷项
export function deleteSplitOrderDetail(query) {
    return request({
        url: "/rtkwms/split-order-detail/delete",
        method: "delete",
        params: query,
    });
}

// 查看日志
export function getBusinessOperateLogPage(query) {
    return request({
        url: "/rtkwms/business-operate-log/page2",
        method: "get",
        params: query,
    });
}