Browse Source

feat(forecast): 新增销售预测汇总分页查询接口及类型定义

yz 4 weeks ago
parent
commit
e34b8e9ba7
2 changed files with 41 additions and 0 deletions
  1. 27 0
      src/api/forecast/forecast-summary.js
  2. 14 0
      src/api/forecast/types.d.ts

+ 27 - 0
src/api/forecast/forecast-summary.js

@@ -13,6 +13,8 @@ import request from '@/router/axios'
  * @typedef {import('./types').ApprovalData} ApprovalData
  * @typedef {import('./types').SalesForecastSummaryBatchSaveRequest} SalesForecastSummaryBatchSaveRequest
  * @typedef {import('./types').SalesForecastSummaryBatchSaveResponse} SalesForecastSummaryBatchSaveResponse
+ * @typedef {import('./types').SalesForecastSummaryPageQueryParams} SalesForecastSummaryPageQueryParams
+ * @typedef {import('./types').SalesForecastSummaryPageResponse} SalesForecastSummaryPageResponse
  */
 
 /**
@@ -48,6 +50,31 @@ export const getForecastSummaryList = async (current = 1, size = 10, params = {}
 }
 
 /**
+ * 销售预测汇总分页查询
+ * 对应后端:GET /api/blade-factory/api/factory/salesForecastSummary/page
+ * @param {number} [current=1] - 当前页码
+ * @param {number} [size=10] - 每页数量
+ * @param {SalesForecastSummaryPageQueryParams} [params={}] - 查询参数(startMonth、endMonth、brandName、startDate、endDate)
+ * @returns {Promise<SalesForecastSummaryPageResponse>} 分页响应
+ * @example
+ * // 基础分页
+ * const res = await getSalesForecastSummaryPage(1, 10)
+ * // 条件筛选
+ * const res2 = await getSalesForecastSummaryPage(1, 20, { startMonth: '2025-08', endMonth: '2025-12', brandName: '朝阳', startDate: '2025-09-01', endDate: '2025-09-30' })
+ */
+export const getSalesForecastSummaryPage = async (current = 1, size = 10, params = {}) => {
+  return request({
+    url: '/api/blade-factory/api/factory/salesForecastSummary/page',
+    method: 'get',
+    params: {
+      current,
+      size,
+      ...params
+    }
+  })
+}
+
+/**
  * 获取预测汇总详情
  * @param {string|number} forecastSummaryId - 预测汇总ID
  * @returns {Promise<ForecastSummaryOperationResponse>} 预测汇总详情响应

+ 14 - 0
src/api/forecast/types.d.ts

@@ -74,6 +74,20 @@ export interface ForecastSummaryQueryParams {
   approvalStatus?: number
 }
 
+// 新增:销售预测汇总分页查询参数(对应 /salesForecastSummary/page)
+export interface SalesForecastSummaryPageQueryParams {
+  /** 开始月份,格式例如 2025-08 */
+  startMonth?: string
+  /** 结束月份,格式例如 2025-12 */
+  endMonth?: string
+  /** 品牌名称模糊匹配 */
+  brandName?: string
+  /** 开始日期,格式例如 2025-09-01 */
+  startDate?: string
+  /** 结束日期,格式例如 2025-09-30 */
+  endDate?: string
+}
+
 // 预测汇总表单数据
 export interface ForecastSummaryForm {
   id?: string