Browse Source

feat(forecast): 新增品牌库存汇总列表接口及类型定义

yz 4 weeks ago
parent
commit
aa92d25d95
2 changed files with 86 additions and 0 deletions
  1. 31 0
      src/api/forecast/brand-stock.js
  2. 55 0
      src/api/forecast/types.d.ts

+ 31 - 0
src/api/forecast/brand-stock.js

@@ -0,0 +1,31 @@
+// @ts-check
+import request from '@/router/axios'
+
+/**
+ * @typedef {import('./types').BrandStockRecord} BrandStockRecord
+ * @typedef {import('./types').BrandStockListResponse} BrandStockListResponse
+ * @typedef {import('./types').BrandStockQueryParams} BrandStockQueryParams
+ */
+
+/**
+ * 获取品牌库存汇总列表
+ * @param {number} [current=1] - 当前页码
+ * @param {number} [size=10] - 每页数量
+ * @param {BrandStockQueryParams} [params={}] - 附加查询条件(按名称等字段模糊查询)
+ * @returns {Promise<BrandStockListResponse>} 分页查询结果响应
+ * @description 获取销售预测汇总-品牌库存数据(品牌库存汇总列表)。
+ * 对应后端接口:GET /api/blade-factory/api/factory/salesForecastSummary/brand-stock
+ * 支持分页参数 current、size 以及按名称/编码等的查询条件。
+ * @example
+ * // 获取第一页,每页10条,仅分页
+ * const res1 = await getBrandStockList(1, 10)
+ * // 按品牌名称、仓库名称筛选
+ * const res2 = await getBrandStockList(1, 10, { brandName: '米其林', storageName: '上海仓' })
+ */
+export const getBrandStockList = async (current = 1, size = 10, params = {}) => {
+  return request({
+    url: '/api/blade-factory/api/factory/salesForecastSummary/brand-stock',
+    method: 'get',
+    params: { current, size, ...params }
+  })
+}

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

@@ -136,3 +136,58 @@ export type ForecastSummaryListResponse = Promise<AxiosResponse<ApiResponse<Page
 export type ForecastSummaryOperationResponse = Promise<AxiosResponse<ApiResponse<ForecastSummaryRecord>>>
 export type ForecastSummaryBatchOperationResponse = Promise<AxiosResponse<ApiResponse<boolean>>>
 export type ForecastSummaryPageResponse = Promise<AxiosResponse<ApiResponse<PageResult<ForecastSummaryRecord>>>>
+
+// 品牌库存汇总查询参数
+export interface BrandStockQueryParams {
+  storageName?: string
+  brandName?: string
+  goodsTypeName?: string
+  salesCompanyName?: string
+  cname?: string
+  productDescription?: string
+  typeNo?: string
+  brandItem?: string
+}
+
+// 品牌库存汇总记录
+export interface BrandStockRecord {
+  id: string
+  createUser: string
+  createDept: string
+  createTime: string
+  updateUser: string | null
+  updateTime: string | null
+  status: number | null
+  isDeleted: number
+  tenantId: string
+  storageId: string
+  storageName: string
+  goodsId: string
+  code: string
+  cname: string
+  brandId: string
+  brandName: string
+  typeNo: string
+  brandItem: string
+  productDescription: string | null
+  goodsTypeId: string
+  balanceQuantity: string
+  balanceQuantityFinancing: string
+  balanceQuantityHave: string
+  salesCompanyId: string
+  salesCompanyName: string
+  dot: string | null
+  storeInventory: string
+  inventoryAmount: string
+  inventoryCostPrice: string
+  inventoryAlert: string | null
+  goodsTypeName: string
+  version: number
+  poNo: string | null
+  cnameInt: string | null
+  rebatePrice: string
+  rebateInventoryAmount: string
+}
+
+// 品牌库存汇总分页响应类型
+export type BrandStockListResponse = Promise<AxiosResponse<ApiResponse<PageResult<BrandStockRecord>>>>