|
|
@@ -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').SalesForecastSummaryImportResponse} SalesForecastSummaryImportResponse
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
@@ -412,6 +413,28 @@ export const exportSalesForecastSummaryByYearMonth = async (year, month) => {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 销售预测数据导入(按主表ID)
|
|
|
+ * 对应后端:POST /api/blade-factory/api/factory/salesForecastSummary/importForecastData/{id}
|
|
|
+ * @param {string|number} id - 主表ID
|
|
|
+ * @param {File|Blob} file - Excel 文件
|
|
|
+ * @returns {Promise<SalesForecastSummaryImportResponse>} 导入响应(data: 明细数组)
|
|
|
+ * @example
|
|
|
+ * const res = await importSalesForecastSummaryById('1988177030718513154', file)
|
|
|
+ */
|
|
|
+export const importSalesForecastSummaryById = async (id, file) => {
|
|
|
+ const formData = new FormData()
|
|
|
+ formData.append('file', file)
|
|
|
+ return request({
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
+ },
|
|
|
+ url: `/api/blade-factory/api/factory/salesForecastSummary/importForecastData/${id}`,
|
|
|
+ method: 'post',
|
|
|
+ data: formData
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
* 销售预测数据导出(用户维度,按年月)
|
|
|
* 对应后端:GET /api/blade-factory/api/factory/salesForecastSummary/user/export/{year}/{month}
|
|
|
* @param {number|string} year - 年份,如 2025
|