From b2f5c965f5278a7f40d84ef88aa92fc8f8a76ca4 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期六, 07 十一月 2026 14:27:00 +0800
Subject: [PATCH] feat: 补齐退单管理/成本分析/执行分析/远程诊断/停机报表/风险监测前端
---
src/api/srm/statistics/index.ts | 62 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 1 deletions(-)
diff --git a/src/api/srm/statistics/index.ts b/src/api/srm/statistics/index.ts
index 36525c0..7a08b70 100644
--- a/src/api/srm/statistics/index.ts
+++ b/src/api/srm/statistics/index.ts
@@ -1,3 +1,5 @@
+import type { PageParam, PageResult } from '@vben/request';
+
import { requestClient } from '#/api/request';
export namespace SrmStatisticsApi {
@@ -10,9 +12,67 @@
supplierCount?: number;
period?: string;
}
+
+ /** 鎶ヤ环鏄庣粏椤� */
+ export interface CostQuoteItem {
+ supplierId?: number;
+ supplierName?: string;
+ quotePrice?: number;
+ taxRate?: number;
+ deliveryCycle?: number;
+ quoteTime?: string;
+ }
+
+ /** 鐗╂枡鎴愭湰鍒嗘瀽琛� */
+ export interface CostAnalysis {
+ productId?: number;
+ productCode?: string;
+ productName?: string;
+ productSpec?: string;
+ unit?: string;
+ totalQuantity?: number;
+ quoteCount?: number;
+ supplierCount?: number;
+ weightedAvgPrice?: number;
+ minPrice?: number;
+ maxPrice?: number;
+ estimatedPrice?: number;
+ deviationRate?: number;
+ lastQuoteTime?: string;
+ priceChange?: number;
+ quotes?: CostQuoteItem[];
+ }
+
+ /** 浠锋牸瓒嬪娍鐐� */
+ export interface CostTrendPoint {
+ month?: string;
+ avgPrice?: number;
+ count?: number;
+ }
}
/** 鑾峰彇鎷涙爣缁熻 */
export function getTenderStatistics(year: string) {
- return requestClient.get<SrmStatisticsApi.TenderStatisticsVO>(`/srm/statistics/tender?year=${year}`);
+ return requestClient.get<SrmStatisticsApi.TenderStatisticsVO>(
+ '/srm/statistics/tender',
+ { params: { year } },
+ );
+}
+
+/** 閲囪喘鎴愭湰鍒嗘瀽锛堝熀浜庢嫑鏍囬渶姹傞噺涓庝緵搴斿晢鎶ヤ环锛屼笉渚濊禆 ERP锛� */
+export function getCostAnalysis(
+ params: PageParam & { productName?: string },
+) {
+ return requestClient.get<PageResult<SrmStatisticsApi.CostAnalysis>>(
+ '/srm/statistics/cost-analysis',
+ { params },
+ );
+}
+
+/** 鐗╂枡浠锋牸瓒嬪娍 */
+export function getCostTrend(productId: number) {
+ return requestClient.get<SrmStatisticsApi.CostTrendPoint[]>(
+ '/srm/statistics/cost-trend',
+ { params: { productId } },
+ );
}
--
Gitblit v1.9.3