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

export function queryOutSourceDetails(
    id: object
): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/outsource/get/" + id,
    method: "get",
  });
}

export function updateOutSourceApply(
    params: object
): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/outsource/update",
    method: "post",
    data: params
  });
}

export function queryChildrenInfo(
    workOrderCode: object
): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/info/childrenInfo/" + workOrderCode,
    method: "get",
  });
}

export function traceabilityTabCount(
    params: object
): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/web/traceability/tabCount",
    method: "post",
    data: params
  });
}

export function sendTdm(
  params: object
): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/outsource/tdm",
    method: "post",
    data: params
  });
}

export function sendTdmTBom(
  params: object
): AxiosPromise<any> {
  return request({
    url: "/api/v1/process/outsource/bom",
    method: "post",
    data: params
  });
}
