import request from "@/utils/request";

// 通过生产过程id物料生产信息 :包含上方基本信息和报故数量需要选择的序列号
export function breakReportInfoById(processId: string) {
  return request({
    url: `/api/v1/process/escalationFault/getWorkDetail/${processId}`,
    method: "get",
  });
}

// 根据缺陷分类，获取原因列表（缺陷大类获取二类）
export function basebugsByType(type: string) {
  return request({
    url: `/api/v1/op/baseBug/list`,
    method: "post",
    data: { bugType: type },
  });
}

// 不合格品分布情况及工序(通过序列号获取关联工序)
export function operationListByIds(ids: string[]) {
  return request({
    url: `/api/v1/process/escalationFault/operation/list`,
    method: "post",
    data: { seqNoList: ids },
  });
}

// 新增一体机报故
export function addBreakReport(data: object) {
  return request({
    url: `/api/v1/process/escalationFault/add`,
    method: "post",
    data: data,
  });
}

// 报工
export function reportWork(data: object) {
  return request({
    url: `/api/v1/process/info/reporting`,
    method: "post",
    data: data,
  });
}

// 多人报工工时分配列表查询
export function reportWorkList(id: string) {
  return request({
    url: `/api/v1/process/processUserReport/list`,
    method: "post",
    data: { processId: id },
  });
}

//图纸管理列表查询
export function drawingList(data: object) {
  return request({
    url: `/api/v1/base/drawing/list`,
    method: "post",
    data: data,
  });
}

// 报工的签章人列表查询
export function signList(data: object) {
  return request({
    url: `/api/v1/base/signature/list`,
    method: "post",
    data: data,
  });
}
