
import { request } from 'umi';
import { getDataBaseUrl } from '@/global_data';
export async function GetGoodsBom(data) {
  return request(getDataBaseUrl()+`/api/goods/getgoodsbompage`, {
    method: 'Post',
    data: data,
  });
}
export async function getbompage (data) {
  return request(getDataBaseUrl()+`/api/bom/getpage`, {
    method: 'Post',
    data: data,
  });
}

export async function GetCosRequestURL(data) {
  return request(getDataBaseUrl()+`/api/systemconfig/GetCosRequestSignURL`, {
   method: 'POST',
   data: data,
 });
}

export async function AddBomApi (data) {
  return request(getDataBaseUrl()+`/api/GoodsBom/AddBom`, {
    method: 'Post',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
export async function GetbomTypelist (data) {
  return request(getDataBaseUrl()+`/api/bom/getbomtypelist`, {
    method: 'Get',
    // params: { ...params },
    // ...(options || {}),
  });
}
export async function AddBomType (data) {
  return request(getDataBaseUrl()+`/api/bom/addbomtype`, {
    method: 'Post',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
export async function DelGoodsBom (data) {
  return request(getDataBaseUrl()+`/api/goods/delgoodsbom?Ids=${data}`, {
    method: 'GET',
    //data: data,
  });
}
export async function gettree(params) {
  return request(getDataBaseUrl()+'​/api​/goodstype/tree', {
    method: 'GET',
    data: {
      ...params,
    },
  });
}

export async function unitList() {
  return request(getDataBaseUrl()+`/api/goods/getgoodsuintlist`, {
    method: 'Get',
  });
}
export async function addunit(data) {
  return request(getDataBaseUrl()+`/api/goods/addgoodsuint`, {
    method: 'Post',
    data: data,
  });
}
export async function getbygoodsidattribute (data) {
  return request(getDataBaseUrl()+`/api/goodsattribute/getbygoodsidattribute?id=`+data, {
    method: 'Get',
    // params: { ...params },
    // ...(options || {}),
  });
}export async function getbomlist() {
  return request(getDataBaseUrl()+'/api/bom/getbomlist', {
    method: 'Get',
  });
}
export async function getproductpage(params) {
  return request(getDataBaseUrl()+'/api/batching/getbatchingselectlist', {
    method: 'Get',
  });
}
export async function getbomtypepage(data) {
  return request(getDataBaseUrl()+`/api/bom/getbomtypepage`, {
    method: 'Post',
    data: data,
  });
}
export async function addgoodsbomattribute(data) {
  return request(getDataBaseUrl()+`/api/goods/addgoodsbomattribute`, {
    method: 'Post',
    data: data,
  });
}
export async function addgoodsbom(data) {
  return request(getDataBaseUrl()+`/api/goods/addgoodsbom`, {
    method: 'Post',
    data: data,
  });
}
export async function getbyidgoods (data) {
  return request(getDataBaseUrl()+`/api/goods/getbyidgoods?id=`+data, {
    method: 'Get'
    // params: { ...params },
    // ...(options || {}),
  });
}
export async function GetGoodsTechnology(data) {
  return request(getDataBaseUrl()+`/api/technology/gettechnologylist?deviceId=`+data, {
    method: 'Get',
  });
}
export async function GetTechnologyactionList(data) {
  return request(getDataBaseUrl()+`/api/productfunction/getproductfunctionaction?productFunctionId=`+data, {
    method: 'Get',
  });
}
export async function GetTechnologyActionListAll() {
  return request(getDataBaseUrl()+`/api/productfunction/getproductfunctionactionlist`, {
    method: 'Get',
  });
}
export async function AddGoodsTechnologyAction(data) {
  return request(getDataBaseUrl()+`/api/goodstechnology/addgoodstechnologyaction`, {
    method: 'Post',
    data: data,
  });
}
export async function UpdateGoodsTechnologyAction(data) {
  return request(getDataBaseUrl()+`/api/goodstechnology/updategoodstechnologyaction`, {
    method: 'Post',
    data: data,
  });
}
export async function GetGoodsTechnologyAction(data) {
  return request(getDataBaseUrl()+`/api/goodstechnology/getGoodstechnologyaction?goodsId=`+data, {
    method: 'Get',
  });
}
export async function DeleteGoodsTechnologyAction(data) {
  return request(getDataBaseUrl()+`/api/goodstechnology/deletegoodstechnologyaction?id=`+data, {
    method: 'Get',
  });
}
export async function deletebydevidegoodstechnologyaction(data) {
  return request(getDataBaseUrl()+`/api/goodstechnology/deletebydevidegoodstechnologyaction`, {
    method: 'Post',
    data: data,
  });
}
export async function GetDeviceTechnology() {
  return request(getDataBaseUrl()+`/api/goodstechnology/getdevicetechnology`, {
    method: 'Get',
  });
}
export async function GetByTypebatching() {
  return request(getDataBaseUrl()+`/api/batching/getbytypebatching`, {
    method: 'Get',
  });
}
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,
  });
}