|
|
@@ -22,6 +22,7 @@ import request from '@/router/axios'
|
|
|
* @typedef {import('./types').SalesForecastMainUpdateRequest} SalesForecastMainUpdateRequest
|
|
|
* @typedef {import('./types').SalesForecastMainUpdateResponse} SalesForecastMainUpdateResponse
|
|
|
* @typedef {import('./types').SalesForecastByMonthResponse} SalesForecastByMonthResponse
|
|
|
+ * @typedef {import('./types').SalesForecastExportByYearMonthParams} SalesForecastExportByYearMonthParams
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
@@ -393,6 +394,25 @@ export const exportSalesForecastByMonth = async (year, month) => {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 销售预测数据导出(按年月:query参数)
|
|
|
+ * 对应后端:GET /api/blade-factory/api/factory/salesForecastSummary/exportByYearMonth?year=2025&month=10
|
|
|
+ * @param {SalesForecastExportByYearMonthParams['year']} year - 年份,如 2025
|
|
|
+ * @param {SalesForecastExportByYearMonthParams['month']} month - 月份,1-12 或 '01'-'12'
|
|
|
+ * @returns {Promise<SalesForecastTemplateResponse>} 导出响应(Blob 数据 + 响应头)
|
|
|
+ * @example
|
|
|
+ * const res = await exportSalesForecastByYearMonthQuery(2025, 10)
|
|
|
+ * // 文件名可从 res.headers['content-disposition'] 中解析
|
|
|
+ */
|
|
|
+export const exportSalesForecastByYearMonthQuery = async (year, month) => {
|
|
|
+ return request({
|
|
|
+ url: '/api/blade-factory/api/factory/salesForecastSummary/exportByYearMonth',
|
|
|
+ method: 'get',
|
|
|
+ responseType: 'blob',
|
|
|
+ params: { year, month }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
* 销售预测数据导出(用户维度,按年月)
|
|
|
* 对应后端:GET /api/blade-factory/api/factory/salesForecastSummary/user/export/{year}/{month}
|
|
|
* @param {number|string} year - 年份,如 2025
|