import request from "@/utils/request";

// 创建用料清单（投料单）
export function createWorkOrderBom(data) {
  return request({
    url: "/rtkwms/work-order-bom/create",
    method: "post",
    data: data,
  });
}
// 修改备料-支援明细
export function updateAllSynthetical(data) {
  return request({
    url: "/rtkwms/synthetical-send-master/updateAll",
    method: "post",
    data: data,
  });
}

// 生产备料-签收
export function syntheticalSign(data) {
  return request({
    url: "/rtkwms/synthetical-send-master/sign",
    method: "post",
    data: data,
  });
}

// 生产备料-撤销签收
export function revokeMasterSign(data) {
  return request({
    url: "/rtkwms/synthetical-send-master/revokeSign",
    method: "post",
    data,
  });
}

// 更新用料清单（投料单）
export function updateWorkOrderBom(data) {
  return request({
    url: "/rtkwms/work-order-bom/update",
    method: "put",
    data: data,
  });
}

// 删除用料清单（投料单）
export function deleteWorkOrderBom(id) {
  return request({
    url: "/rtkwms/work-order-bom/delete?id=" + id,
    method: "delete",
  });
}

// 获得用料清单（投料单）
export function getWorkOrderBom(id) {
  return request({
    url: "/rtkwms/work-order-bom/get?id=" + id,
    method: "get",
  });
}

// 查看多单备料支援表
export function getWorkOrderBomPage(query) {
  return request({
    url: "rtkwms/work-order-bom-detail/synDetailListPage",
    method: "get",
    params: query,
  });
}

// 获得用料清单列表
export function getDetailListPage(query) {
  return request({
    url: "/rtkwms/work-order-bom-detail/workBomDetailPage",
    method: "get",
    params: query,
  });
}
// 通过表体id查看资源档
export function getResourcePage(query) {
  return request({
    url: "/rtkwms/synthetical-send-resource/page",
    method: "get",
    params: query,
  });
}
// 获得从生产备料跳转到得用料清单（投料单）分页
export function getWorkOrderBomFromPreparePage(query) {
  return request({
    url: "/rtkwms/work-order-bom/fromPreparePage",
    method: "get",
    params: query,
  });
}

// 导出用料清单（投料单） Excel
export function exportWorkOrderBomExcel(query) {
  return request({
    url: "/rtkwms/work-order-bom/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}
// 获得用料清单明细分页
export function getWorkOrderBomDetailPage(query) {
  return request({
    url: "/rtkwms/work-order-bom-detail/page",
    method: "get",
    params: query,
  });
}

// 获取库存可应答量
export function getMaterialTotalList(data) {
  return request({
    url: "/rtkwms/material-total/canUseQtyList",
    method: "post",
    data: data,
  });
}

// 导出用料清单明细 Excel
export function exportWorkOrderBomDetailExcel(query) {
  return request({
    url: "/rtkwms/work-order-bom-detail/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}
