import request from '@/config/axios'
// 查询列表
export const getWarehousePage = async (params) => {
  return await request.get({ url: '/admin-api/crm/erp-warehouse/page', params })
}

// 新增
export const createWarehouse = async (data) => {
  return await request.post({ url: '/admin-api/crm/erp-warehouse/create', data: data })
}

// 修改
export const updateWarehouse = async (params) => {
  return await request.put({ url: '/admin-api/crm/erp-warehouse/update', data: params })
}

// 删除
export const deleteWarehouse = async (id) => {
  return await request.delete({ url: '/admin-api/crm/erp-warehouse/delete?id=' + id })
}

// 获取仓库
export const getWarehouse = async (id) => {
  return await request.get({ url: '/admin-api/crm/erp-warehouse/get?id=' + id })
}

// 获取仓库列表
export const getSimpleWarehouseList = async () => {
  return await request.get({ url: '/admin-api/crm/erp-warehouse/simple-list' })
}

// 获取库存
export const getInventoryList = async (params) => {
  return await request.get({ url: '/admin-api/crm/erp-inventory/page', params })
}

// 获取库存变动记录
export const getInventoryRecord = async (params) => {
  return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
}
