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

/** 设备菜谱列表  */
export async function GetFoodMenuInfoPage(data) {
  return request(`/kitchen/api/FoodMenu/GetFoodMenuInfoPage`, {
    method: 'POST',
    data: data,
  });
}

/** 添加菜谱类型  */
export async function UpdateFoodMenu(data) {
  return request(`/kitchen/api/FoodMenu/AddUpdateFoodMenu`, {
    method: 'POST',
    data: data,
  });
}

export async function AddFoodMenu(data) {
  return request(`/kitchen/api/FoodMenu/AddUpdateFoodMenu`, {
    method: 'POST',
    data: data,
  });
}

/** 删除菜谱类型  */
export async function DelFoodMenu(data) {
  return request(`​/kitchen/api/FoodMenu/DelFoodMenu`, {
    method: 'POST',
    data: data,
  });
}

/**
 * 获取所有菜品
 * @param {*} params 
 * @returns 
 */
export async function GetAllGoodsMenuPage(params) {
  return request('/kitchen/api/FoodMenu/GetGoodsByMenuIdPage', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 根据菜谱ID，查询菜品列表
 * @param {*} params 
 * @param {*} options 
 * @returns 
 */
export async function getpage_v2(params) {
  return request('/kitchen/api/FoodMenu/GetFoodMenuGoodsPage_V2', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 添加/删除 菜谱商品
 * @param {*} params 
 * @param {*} options 
 * @returns 
 */
export async function EditFoodMenuGoods(params) {
  return request('/kitchen/api/FoodMenu/EditFoodMenuGoods', {
    method: 'POST',
    data: params,
  });
}

