import request from "@/utils/request";

// 创建销售退货
export function createSaleReturnMaster(data) {
    return request({
        url: "/rtkwms/sale-return-master/create",
        method: "post",
        data: data,
    });
}

// 更新销售退货
export function updateSaleReturnMaster(data) {
    return request({
        url: "/rtkwms/sale-return-master/update",
        method: "put",
        data: data,
    });
}

// 删除销售退货
export function deleteSaleReturnMaster(id) {
    return request({
        url: "/rtkwms/sale-return-master/delete?id=" + id,
        method: "delete",
    });
}

// 获得销售退货
export function getSaleReturnMaster(id) {
    return request({
        url: "/rtkwms/sale-return-master/get?id=" + id,
        method: "get",
    });
}

// 获得销售退货分页
export function getSaleReturnMasterPage(query) {
    return request({
        url: "/rtkwms/sale-return-master/page",
        method: "get",
        params: query,
    });
}

// 导出销售退货 Excel
export function exportSaleReturnMasterExcel(query) {
    return request({
        url: "/rtkwms/sale-return-master/export-excel",
        method: "get",
        params: query,
        responseType: "blob",
    });
}

// 销售退货-扫描物料信息
export function getProductToReturn(query) {
    return request({
        url: "/rtkwms/sale-return-master/getProductToReturn",
        method: "get",
        params: query,
    });
}

// 销售退货明细
export function salesReturnDetailPage(query) {
    return request({
        url: "/rtkwms/sale-return-detail/page",
        method: "get",
        params: query,
    });
}

// 销售退货签收
export function signSaleReturn(data) {
    return request({
        url: "/rtkwms/sale-return-master/sign",
        method: "post",
        data,
    });
}

// 销售退货撤销签收
export function cancelSignSaleReturn(data) {
    return request({
        url: "/rtkwms/sale-return-master/cancelSign",
        method: "post",
        data,
    });
}