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

// 获得wms销售出库单主分页--待出库
export function getSaleOutOrderPage(query) {
    return request({
        url: "/rtkwms/sale-out-order/toOutPage",
        method: "get",
        params: query,
    });
}
// 获得wms销售出库单主分页--出库中
export function getSaleOutingPage(query) {
    return request({
        url: "/rtkwms/sale-out-order/outingPage",
        method: "get",
        params: query,
    });
}
// 获得wms销售出库单主分页--已完成
export function getSaleOutedPage(query) {
    return request({
        url: "/rtkwms/sale-out-order/outedPage",
        method: "get",
        params: query,
    });
}
// 获得销售明细(或出库中页面的)查看分页
export function getToOutDetailPage(query) {
    return request({
        url: "/rtkwms/sale-out-order-detail/toOutDetailPage",
        method: "get",
        params: query,
    });
}
// 获得出库部分或出库全部
export function getToOutPartAllPage(query) {
    return request({
        url: "/rtkwms/sale-out-order-detail/toOutPartAllPage",
        method: "get",
        params: query,
    });
}
// 获得出库明细-主列表查询
export function getMasterPage(query) {
    return request({
        url: "/rtkwms/sale-out-order/masterPage",
        method: "get",
        params: query,
    });
}
// 获得出库明细页面-出库明细查看分页
export function getToOutedDetailPage(query) {
    return request({
        url: "/rtkwms/sale-out-order-detail/toOutedDetailPage",
        method: "get",
        params: query,
    });
}
// 发出或查看
export function getDetailPage(query) {
    return request({
        url: "/rtkwms/sale-out-order-detail/detailPage",
        method: "get",
        params: query,
    });
}

// 根据箱号获取产品信息
export function getProductInfo(query) {
    return request({
        url: "/rtkwms/sale-out-order-detail/getProductInfo",
        method: "get",
        params: query,
    });
}
// 完成
export function getSalesCreateBatch(data) {
    return request({
        url: "/rtkwms/sale-out-order-detail/createBatch",
        method: "post",
        data: data,
    });
}
// 完成发料部分
export function updateCompetePart(data) {
    return request({
        url: "/rtkwms/sale-out-order/competePart",
        method: "put",
        data: data,
    });
}
// 完成发料全部
export function updateCompeteAll(data) {
    return request({
        url: "/rtkwms/sale-out-order/competeAll",
        method: "put",
        data: data,
    });
}
// 确认出库
export function updateOutOrder(data) {
    return request({
        url: "/rtkwms/sale-out-order/update",
        method: "put",
        data: data,
    });
}

// 补打查询箱内产品信息
export function queryBoxDetails(id) {
    return request({
        url: "/mes/finish-goods-box/query",
        method: "get",
        params: { id },
    });
}

// 销售出库明细标签补打
export function queryLabelDetail(id) {
    return axios({
        method: "get",
        url: baseURL + "/report/wms-print/saleOutLabelPrint",
        params: { id },
    });
}

// 结束生产
export function completeProduct(data) {
    return request({
        url: "/rtkwms/sale-out-order-master/compete",
        method: "put",
        data: data,
    });
}

// 删除销售出库明细
export function deleteOrderDetail(id) {
    return request({
        url: "/rtkwms/sale-out-order-detail/delete?id=" + id,
        method: "delete",
    });
}