
import request from '@/utils/request'

/***************************************************** 食堂管理 ****************************************************/
// 食堂列表
export function getCustomerList(params : Record<string, any>) {
	return request.get(`erp/base/customer`, params)
}
// 食堂列表
export function getCustomerSelect(params : Record<string, any>) {
	return request.get(`erp/base/customer/select`, params)
}
// 食堂详情
export function getCustomerInfo(id : number) {
	return request.get(`erp/base/customer/${id}`)
}

// 添加食堂信息
export function addCustomer(data : AnyObject) {
	return request.post("erp/base/customer", data, { showErrorMessage: true });
}

// 删除食堂信息
export function deleteCustomer(id : number) {
	return request.delete(`erp/base/customer/${id}`, { showErrorMessage: true });
}

/***************************************************** 供应商管理 ****************************************************/
// 供应商列表
export function getSupplierList(params : Record<string, any>) {
	return request.get(`erp/base/supplier`, params)
}

// 供应商列表
export function getSupplierSelect(params : Record<string, any>) {
	return request.get(`erp/base/supplier/select`, params)
}


// 供应商详情
export function getSupplierInfo(id : number) {
	return request.get(`erp/base/supplier/${id}`)
}

// 添加供应商信息
export function addSupplier(data : AnyObject) {
	return request.post("erp/base/supplier", data, { showErrorMessage: true });
}

// 删除供应商信息
export function deleteSupplier(id : number) {
	return request.delete(`erp/base/supplier/${id}`, { showErrorMessage: true });
}

/***************************************************** 仓库管理 ****************************************************/
// 仓库列表
export function getWarehouseList(params : Record<string, any>) {
	return request.get(`erp/base/warehouse`, params)
}

export function getWarehouseSelect(params : Record<string, any>) {
	return request.get(`erp/base/warehouse/select`, params)
}


// 仓库详情
export function getWarehouseInfo(id : number) {
	return request.get(`erp/base/warehouse/${id}`)
}

// 添加仓库信息
export function addWarehouse(data : AnyObject) {
	return request.post("erp/base/warehouse", data, { showErrorMessage: true });
}

// 删除仓库信息
export function deleteWarehouse(id : number) {
	return request.delete(`erp/base/warehouse/${id}`, { showErrorMessage: true });
}