import request from "@/utils/request";

// 复制工艺路线
export function copyRoute(data: object) {
  return request({
    url: `/api/v1/op/route/copyAdd`,
    method: "post",
    data: data,
  });
}

// 获取工艺路线 工序关系表信息
export function processesByRouteId(id: string) {
  return request({
    url: `/api/v1/op/routeOperation/get/${id}`,
    method: "get",
  });
}

// 新增-更新工艺路线《---》工序关系表
export function saveProcessInRoute(data: object) {
  return request({
    url: `/api/v1/op/routeOperation/saveOrUpdate`,
    method: "post",
    data: data,
  });
}
// 后端蛇形排序
export function toJavaSnake(data: object) {
  return request({
    url: `/api/v1/op/routeOperation/serpentine/sort`,
    method: "post",
    data: data,
  });
}

// 保存xx关系表中的工序
export function updateProcess(data: object) {
  return request({
    url: `/api/v1/op/operation/update`,
    method: "post",
    data: data,
  });
}

// 编辑工艺 针对产品负责人的修改
export function editRouteWith(data: object) {
  return request({
    url: `/api/v1/op/route/updateManager`,
    method: "post",
    data: data,
  });
}

// 编辑工艺 针对产品负责人的修改
export function copyList(data: object) {
  return request({
    url: `/api/v1/op/route/copyList`,
    method: "post",
    data: data,
  });
}

// 复制工艺路线子项
export function copyProductRoute(data: object) {
  return request({
    url: `/api/v1/op/route/copyProductRoute`,
    method: "post",
    data: data,
  });
}
export function updateMain(data: object) {
  return request({
    url: `/api/v1/op/route/updateMain`,
    method: "post",
    data: data,
  });
}
export function getMaxRouteVersion(prodtCode: string) {
  return request({
    url: `/api/v1/op/route/getMaxRouteVersion/${prodtCode}`,
    method: "get",
  });
}
