import request from "@/utils/request";

// 返回一工段为
export function processTreeList() {
  return request({
    url: "/api/v1/op/baseOperation/treeList",
    method: "post",
  });
}

// 新增自定义工艺工序组件路径
export function saveCompoents(data: object) {
  return request({
    url: "/api/v1/op/compent/saveOrUpdate",
    method: "post",
    data: data,
  });
}
//批量新增物料采集
export function addBatch(data: object) {
  return request({
    url: "/api/v1/op/operationItem/addBatch",
    method: "post",
    data: data,
  });
}

//批量新增esop
export function addEsopBatch(data: object) {
  return request({
    url: "/api/v1/op/esop/addBatch",
    method: "post",
    data: data,
  });
}

//批量新增检验项
export function addCheckBatch(data: object) {
  return request({
    url: "/api/v1/op/operationCheck/addBatch",
    method: "post",
    data: data,
  });
}
// 获取工艺工序组件路径信息
export function getCompoentsList(opId: string) {
  return request({
    url: `/api/v1/op/compent/get/${opId}`,
    method: "get",
  });
}

// 批量更新工序记录项信息
export function sortGXJLList(data: object) {
  return request({
    url: `/api/v1/op/operationRecord/batch-update`,
    method: "post",
    data: data,
  });
}

export function getBomVersion(data: object) {
  return request({
    url: `/api/v1/base/bomVersion/list`,
    method: "post",
    data: data,
  });
}

export function getRouteMaxVersion(routeId: string) {
  return request({
    url: `/api/v1/op/route/getRouteMaxVersion/${routeId}`,
    method: "get",
  });
}
