import { request } from 'umi';
import { getDataBaseUrl } from '@/global_data';

export async function bomPage(data) {
    return request(getDataBaseUrl()+'/api/bom/BomPage', {
      method: 'POST',
      data:data,
    });
  }
  export async function AddBom(data) {
    return request(getDataBaseUrl()+'/api/bom/AddBom', {
      method: 'POST',
      data:data,
    });
  }



  export async function AddBomType (data) {
    return request(getDataBaseUrl()+`/api/bom/addbomtype`, {
      method: 'Post',
      data: data,
      // params: { ...params },
      // ...(options || {}),
    });
  }

  export async function getproductpage(params) {
    return request(getDataBaseUrl()+'/api/batching/getbatchingselectlist', {
      method: 'Get',
    });
  }

  export async function GetbomTypelist (data) {
    return request(getDataBaseUrl()+`/api/bom/getbomtypelist`, {
      method: 'Get',
      // params: { ...params },
      // ...(options || {}),
    });
  }


  export async function GetByidBomList(data) {
    return request(getDataBaseUrl()+`/api/bom/getbyidbomlist?bomId=`+data, {
      method: 'Get',
    });
  }

  export async function UpdateBomInfo(data) {
    return request(getDataBaseUrl()+`/api/bom/update`, {
      method: 'Post',
      data: data,
    });
  }

  export async function UpdateBomBatcing(data) {
    return request(getDataBaseUrl()+`/api/bom/updatebombatcing`, {
      method: 'Post',
      data: data,
    });
  }

  export async function DelBom (data) {
    return request(getDataBaseUrl()+`/api/bom/DelBom?id=${data}`, {
      method: 'post',
      //data: data,
    });
  }
  

