feat(@vben/web-antd): 新增 ERP API 接口并符合 Vben 项目标准
- 将所有 ERP API 文件从旧的 axios 配置迁移到新的 requestClient - 使用 namespace 组织接口类型定义,提高代码可维护性 - 将对象方法改为独立的导出函数,符合现代 JavaScript 最佳实践 - 为所有 API 函数添加完整的 TypeScript 类型定义 - 统一分页查询参数和状态更新参数的接口定义 - 涵盖财务、采购、销售、库存等所有 ERP 业务模块
This commit is contained in:
31
apps/web-antd/src/api/erp/statistics/purchase/index.ts
Normal file
31
apps/web-antd/src/api/erp/statistics/purchase/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace ErpPurchaseStatisticsApi {
|
||||
/** ERP 采购全局统计 */
|
||||
export interface PurchaseSummary {
|
||||
todayPrice: number; // 今日采购金额
|
||||
yesterdayPrice: number; // 昨日采购金额
|
||||
monthPrice: number; // 本月采购金额
|
||||
yearPrice: number; // 今年采购金额
|
||||
}
|
||||
|
||||
/** ERP 采购时间段统计 */
|
||||
export interface PurchaseTimeSummary {
|
||||
time: string; // 时间
|
||||
price: number; // 采购金额
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得采购统计 */
|
||||
export function getPurchaseSummary() {
|
||||
return requestClient.get<ErpPurchaseStatisticsApi.PurchaseSummary>(
|
||||
'/erp/purchase-statistics/summary',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得采购时间段统计 */
|
||||
export function getPurchaseTimeSummary() {
|
||||
return requestClient.get<ErpPurchaseStatisticsApi.PurchaseTimeSummary[]>(
|
||||
'/erp/purchase-statistics/time-summary',
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user