// @ts-ignore

/* eslint-disable */
import { request } from 'umi';

/** 获取入库列表  post /kitchen/api/rule */
export async function getStockItemList(data) {
  return request(`/kitchen/api​/stock-item-application​/stock-item-page`, {
    method: 'Post',
    data: data,
  });
}

/** 新建入库 POST /kitchen/api/rule */

export async function addStockItem(data) {
  // http://localhost:7002
  return request('/kitchen/api/stock-item-application/stock-item', {
    method: 'POST',
    // type:'json',
    data: data,
    // ...(options || {}),
  });
}
/** 修改入库 PUT /kitchen/api/rule */

export async function updateStockItem(data) {
  return request('/kitchen/api/stock-item-application/stock-item', {
    method: 'PUT',
    data: data,
  });
}

/** 批量删除入库 DELETE /kitchen/api/rule */

export async function removeStockItem(data) {
  console.log(data);
  return request(`/kitchen/api/stock-item-application/stock-item`, {
    method: 'DELETE',
    data: data,
    // ...(options || {}),
  });
}

/**获取物料基础信息 */
export async function getProductPage(data) {
  return request('/kitchen/api/product/product-list', {
    method: 'Post',
    data: data,
  });
}

/**获取机构基础信息 */
export async function getOrgPage(data) {
  return request('/kitchen/api​/sysOrg​/page', {
    method: 'GET',
    data: data,
  });
}

/**获取物料单位 */
export async function getUintList(params, options) {
  return request('/kitchen/api/unit/uint-list', {
    method: 'GET',
    params: {
      ...params,
    },
  });
}

/**获取单条库存 */
export async function getStockItem(id) {
  return request(`/kitchen/api/stock-item-application/stock-item/${id}`, {
    method: 'GET',
  });

}
