Sfoglia il codice sorgente

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

yz 3 settimane fa
parent
commit
0c714cd44b
2 ha cambiato i file con 94 aggiunte e 0 eliminazioni
  1. 27 0
      src/api/forecast/forecast-summary.js
  2. 67 0
      src/api/forecast/types.d.ts

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

@@ -15,6 +15,8 @@ import request from '@/router/axios'
  * @typedef {import('./types').SalesForecastSummaryBatchSaveResponse} SalesForecastSummaryBatchSaveResponse
  * @typedef {import('./types').SalesForecastSummaryPageQueryParams} SalesForecastSummaryPageQueryParams
  * @typedef {import('./types').SalesForecastSummaryPageResponse} SalesForecastSummaryPageResponse
+ * @typedef {import('./types').SalesForecastMainListQueryParams} SalesForecastMainListQueryParams
+ * @typedef {import('./types').SalesForecastMainListResponse} SalesForecastMainListResponse
  */
 
 /**
@@ -75,6 +77,31 @@ export const getSalesForecastSummaryPage = async (current = 1, size = 10, params
 }
 
 /**
+ * 销售预测主表分页列表
+ * 对应后端:GET /api/blade-factory/api/factory/salesForecastSummary/main-list
+ * @param {number} [current=1] - 当前页码
+ * @param {number} [size=10] - 每页数量
+ * @param {SalesForecastMainListQueryParams} [params={}] - 查询参数(year、month、customerName)
+ * @returns {Promise<SalesForecastMainListResponse>} 分页响应
+ * @example
+ * // 基础分页
+ * const res = await getSalesForecastMainList(1, 10)
+ * // 条件筛选
+ * const res2 = await getSalesForecastMainList(1, 10, { year: 2025, month: 9, customerName: '库比森' })
+ */
+export const getSalesForecastMainList = async (current = 1, size = 10, params = {}) => {
+  return request({
+    url: '/api/blade-factory/api/factory/salesForecastSummary/main-list',
+    method: 'get',
+    params: {
+      current,
+      size,
+      ...params
+    }
+  })
+}
+
+/**
  * 获取预测汇总详情
  * @param {string|number} forecastSummaryId - 预测汇总ID
  * @returns {Promise<ForecastSummaryOperationResponse>} 预测汇总详情响应

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

@@ -230,3 +230,70 @@ export type SalesForecastSummaryBatchSaveRequest = SalesForecastSummaryBatchSave
 
 // 销售预测汇总批量保存 - 响应类型(data 返回为 null,msg 提示文本,success 表示成功与否)
 export type SalesForecastSummaryBatchSaveResponse = Promise<AxiosResponse<ApiResponse<null>>>
+
+// 新增:销售预测主表分页(main-list)查询参数
+export interface SalesForecastMainListQueryParams {
+  /** 年份,例如 2025 */
+  year?: number
+  /** 月份,1-12 */
+  month?: number
+  /** 客户名称(模糊查询) */
+  customerName?: string
+}
+
+// 新增:销售预测主表分页(main-list)- 子项记录(列表中的 pcBladeSalesForecastSummaryList 元素)
+export interface SalesForecastMainListItemRecord {
+  id: string
+  createUser: string
+  createDept: string
+  createTime: string
+  updateUser: string | null
+  updateTime: string | null
+  status: number
+  isDeleted: number
+  forecastMainId: string | null
+  year: number
+  month: number
+  customerId: number | string
+  customerCode: string
+  customerName: string
+  brandId: number | string
+  brandCode: string
+  brandName: string
+  itemId: number | string
+  itemCode: string
+  itemName: string
+  specs: string
+  pattern: string
+  /** 后端示例为字符串,兼容 number */
+  forecastQuantity: string | number
+  approvalStatus: number
+  approvedBy: number | string | null
+  approvedName: string | null
+  approvedTime: string | null
+}
+
+// 新增:销售预测主表分页(main-list)- 顶层记录
+export interface SalesForecastMainRecord {
+  id: string
+  createUser: string
+  createDept: string
+  createTime: string
+  updateUser: string | null
+  updateTime: string | null
+  status: number
+  isDeleted: number
+  year: number
+  month: number
+  customerId: string
+  customerCode: string
+  customerName: string
+  approvalStatus: number
+  approvedBy: string | null
+  approvedName: string | null
+  approvedTime: string | null
+  pcBladeSalesForecastSummaryList: SalesForecastMainListItemRecord[]
+}
+
+// 新增:销售预测主表分页(main-list)响应类型
+export type SalesForecastMainListResponse = Promise<AxiosResponse<ApiResponse<PageResult<SalesForecastMainRecord>>>>