diff --git a/inventory-web/src/api/inbound/inbound_summary.ts b/inventory-web/src/api/inbound/inbound_summary.ts index 6c14610..5c77336 100644 --- a/inventory-web/src/api/inbound/inbound_summary.ts +++ b/inventory-web/src/api/inbound/inbound_summary.ts @@ -17,11 +17,43 @@ export function getInboundSummaryList(params: InboundSummaryQuery) { }) } -export function exportInboundSummary(params: any) { +// ============================================================ +// 旧版:前端直接处理 Excel blob(已废弃,保留用于参考) +// ============================================================ +// export function exportInboundSummary(params: any) { +// return request({ +// url: '/v1/inbound/summary/export', +// method: 'get', +// params, +// responseType: 'blob' +// }) +// } + +// ============================================================ +// 新版:异步导出 API(后端生成 + 轮询任务状态) +// ============================================================ + +/** + * 提交异步导出任务 + * POST /api/v1/export/inventory + * 返回 { task_id: string } + */ +export function submitExportTask(filters: Record) { return request({ - url: '/v1/inbound/summary/export', - method: 'get', - params, - responseType: 'blob' + url: '/v1/export/inventory', + method: 'post', + data: filters + }) +} + +/** + * 轮询导出任务状态 + * GET /api/v1/export/status/ + * 返回 { status: 'processing'|'completed'|'failed', progress: number, url: string, error: string } + */ +export function checkExportStatus(taskId: string) { + return request({ + url: `/v1/export/status/${taskId}`, + method: 'get' }) } \ No newline at end of file diff --git a/inventory-web/src/views/stock/inbound/inbound_summary.vue b/inventory-web/src/views/stock/inbound/inbound_summary.vue index 3cd79e3..1ddf346 100644 --- a/inventory-web/src/views/stock/inbound/inbound_summary.vue +++ b/inventory-web/src/views/stock/inbound/inbound_summary.vue @@ -104,9 +104,9 @@