import request from "@/utils/request";

export function getFirstLevel() {
  return request({
    url: "/api/v1/quality/inspect/opts/get/firstLevel",
    method: "get",
  });
}

export function getSecondLevel(firstLevelId) {
  return request({
    url: `/api/v1/quality/inspect/opts/get/secondLevel/${firstLevelId}`,
    method: "get",
  });
}

export function getById(id) {
  return request({
    url: `/api/v1/quality/inspect/opts/get/${id}`,
    method: "get",
  });
}

export function getAllOpts() {
  return request({
    url: "/api/v1/quality/inspect/opts/list/all",
    method: "get",
  });
}

export function addBatch(data) {
  return request({
    url: "/api/v1/quality/batch/items/add",
    method: "post",
    data: data,
  });
}

export function getBatchPage(data) {
  return request({
    url: `/api/v1/quality/batch/items/page`,
    method: "post",
    data: data,
  });
}

export function delSingleBatch(id) {
  return request({
    url: `/api/v1/quality/batch/items/delete/${id}`,
    method: "post",
  });
}

export function getBatchOptionPage(data) {
  return request({
    url: `/api/v1/quality/batch/items/options/page`,
    method: "post",
    data: data,
  });
}

export function updateStatus(data) {
  return request({
    url: `/api/v1/quality/batch/items/update`,
    method: "post",
    data: data,
  });
}

export function deleteBatchRow(data) {
  return request({
    url: `/api/v1/quality/batch/items/del`,
    method: "post",
    data: data,
  });
}
