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

// 查询销售出库明细
export function getSaleOutOrderDetail(query) {
    return request({
        url: "/rtkwms/sale-out-order/detail",
        method: "get",
        params: query,
    });
}

// 获得生产订单分页
export function getProductionOrderPage(query) {
    return request({
        url: "/mes/production-work-order-detail/page",
        method: "get",
        params: query,
    });
}

// 创建出货单
export function createNewSaleOut(data) {
    return request({
        url: "/rtkwms/sale-out-order-master/createNew",
        method: "post",
        data,
    });
}

// 增箱
export function createSalePackageMaster(data) {
    return request({
        url: "/rtkwms/sale-package-master/create",
        method: "post",
        data,
    });
}

// 扫码装箱
export function createSalePackageDetails(data) {
    return request({
        url: "/rtkwms/sale-package-detail/create",
        method: "post",
        data,
    });
}

// 扫码装箱->修改销售订单
export function updateSalePackageMaster(data) {
    return request({
        url: "/rtkwms/sale-package-master/update",
        method: "put",
        data,
    });
}

// 待装箱列表
export function getPackingList(query) {
    return request({
        url: "/rtkwms/sale-package-detail/getNoPackage",
        method: "get",
        params: query,
    });
}

// 已装箱列表
export function getSalePackageMasterPage(query) {
    return request({
        url: "/rtkwms/sale-package-master/page2",
        method: "get",
        params: query,
    });
}

// 已装箱明细列表
export function getSalePackageDetailsPage(query) {
    return request({
        url: "/rtkwms/sale-package-detail/page2",
        method: "get",
        params: query,
    });
}

// 物料列表
export function getMaterialPageList(query) {
    return request({
        url: "/rtkerp/material/page",
        method: "get",
        params: query,
    });
}
// 获得出货标签打印数据
export function getBeforeSalePackageLabelPrintData(query) {
    return axios({
        url: baseURL + "/report/wms-print/beforeSalePackagePrint",
        method: "get",
        params: query,
    });
}

// 完成装箱打印数据
export function getSaleBoxLabelPrintData(query) {
    return axios({
        url: baseURL + "/report/wms-print/saleBoxPrint",
        method: "get",
        params: query,
    });
}

// 已装箱明细删除
export function deleteSalePackageDetail(id) {
    return request({
        url: "/rtkwms/sale-package-detail/delete?id=" + id,
        method: "delete",
    });
}