import request from "@/utils/request";
import { AxiosPromise } from "axios";

/**
 * 获取物料信息
 *
 * @param id
 * @param data
 */
export function getMaterialDetails(materialCode: String): AxiosPromise<any> {
  return request({
    url: "/api/v1/base/material/getDetails/" + materialCode,
    method: "get",
  });
}

export function getMaterialDetailsByseqNo(workOrderCode: String,seqNo: String): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/web/traceability/get/" + workOrderCode + "/" + seqNo,
    method: "get",
  });
}

export function getOperationCompent(opId: String): AxiosPromise<any> {
  return request({
    url: "/api/v1/op/compent/get/" + opId,
    method: "get",
  });
}


/**
 * 根据物料编码获取最大版本号
 *
 * @param id
 * @param data
 */
export function getBomVersion(materialCode: String): AxiosPromise<any> {
  return request({
    url: "/api/v1/base/bomVersion/max/" + materialCode,
    method: "get",
  });
}
