import { request } from 'umi';

/** 获取  */
export async function GetStoreInfoPage(data) {
  return request(`/kitchen/api/Store/GetStoreList`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
export async function GetCokingWorkList(data) {
  return request(`/kitchen/api/select/GetCokingWorkList`);
}
/** 获取店铺上架商品  */
export async function GetStoreGoods(data) {
  return request(`​​/kitchen/api/Store/GetStoreGoods`, {
    method: 'POST',
    data: data,
    // params: { ...params },

    // ...(options || {}),
  });
}

/** 启用停用  */
export async function UpdateStoreGoodsStatusAsync(data) {
  return request(`/kitchen/api/Store/UpdateStoreGood`, {
    method: 'put',
    data: data,
  });
}
/**商品估清 */
export async function stopgoods(data) {
  return request(`/kitchen/api/goods/stopgoods`, {
    method: 'POST',
    data: data,
  });
}
/** 修改  */
export async function UpdateStoreGoods(data) {
  return request(`/kitchen/api/Store/UpdateStoreGood`, {
    method: 'put',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}
/** 新增  */
export async function AddStoreGood(data) {
  return request(`/kitchen/api/store-info/store-good`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}



/** 删除上架商品  */
export async function DelStoreGoods(data) {
  return request(`/kitchen/api/store-info/del-store-good`, {
    method: 'POST',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}

/** 获取商品  sdsa GET /kitchen/api/rule */
export async function getGoods() {
  var data = { current: 1, pageSize: 1000, goods_Enable: 0 };
  return request(`/kitchen/api/goods/goodss`, {
    method: 'Post',
    data: data,
    // params: { ...params },
    // ...(options || {}),
  });
}

export function StoreGoodsAllUpdate(data) {
  return request(`/kitchen//api/Store/StoreGoodsAllUpdate`, {
    method: 'post',
    data: data,
  });
}


export function GetRequestLogPageAsync(data) {
  return request(`/kitchen/api/log/request-log-page`, {
    method: 'post',
    data: data,
  });
}

/** 根据门店ID获取菜谱列表  */
export async function GetShopFoodMenuPage(data) {
  return request(`/kitchen/api/FoodMenu/GetShopFoodMenuPage`, {
    method: 'POST',
    data: data,
  });
}

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

/** 获取设备列表  */
export async function GetDeviceInfoPage(data) {
  return request(`/kitchen/api/Device/GetDeviceInfoPage`, {
    method: 'POST',
    data: data,
  });
}

/** 商品绑定设备  */
export async function AddGoodDevice(data) {
  return request(`/kitchen/api/goodes/AddGoodDevice`, {
    method: 'POST',
    data: data,
  });
}

/** 查询商品绑定的所有设备  */
export async function GetGoodDevice(goodsId, storeId) {
  return request(`/kitchen/api/goodes/GetGoodDevice?foodId=${goodsId}&storeId=${storeId}`, {
    method: 'GET',
  });
}

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

/** 店铺添加菜谱  */
export async function StoreAddFoodMenuNew(data) {
  return request(`/kitchen/api/FoodMenu/StoreAddFoodMenuNew`, {
    method: 'POST',
    data: data,
  });
}