import { requestClient } from '#/api/request';

const prefix = 'supplier/';
/**
 * 分页查询用户列表
 * @param data
 */
export async function getSupplierList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}
/**
 * 分页查询用户列表
 * @param data
 */
export async function getSupplierOption(data: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

/**
 * 获取供应商详情
 * @param id
 */
export async function getSupplierInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增供应商
 * @param data
 */
export async function createSupplier(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑供应商
 * @param data
 */
export async function updateSupplier(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除供应商
 * @param data
 */
export async function deleteSupplier(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
