From 5f5343365460eceee65f3c20fe0f97fe426f6415 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 02 四月 2026 10:35:10 +0800
Subject: [PATCH] 标准/实际成本对比分析更新导入支持月份参数

---
 src/views/costAccounting/stdVsActCostAnalysis/index.vue |    4 +++-
 src/api/costAccounting/productionSettlementBatches.js   |   12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/api/costAccounting/productionSettlementBatches.js b/src/api/costAccounting/productionSettlementBatches.js
index 95a5fba..0ffbc01 100644
--- a/src/api/costAccounting/productionSettlementBatches.js
+++ b/src/api/costAccounting/productionSettlementBatches.js
@@ -19,8 +19,16 @@
 }
 
 // 鏍囧噯鎴愭湰瀵煎叆锛坋l-upload 闇�瑕佸畬鏁� URL锛�
-export function getImportActionUrl() {
-  return `${import.meta.env.VITE_APP_BASE_API}/productionSettlementBatches/import`;
+// @param {Object} [params]
+// @param {string} [params.periodTime] 鏍哥畻鏈堜唤锛屼笌鏌ヨ鏉′欢涓�鑷达紝濡� 2025-04
+export function getImportActionUrl(params = {}) {
+  const base = `${import.meta.env.VITE_APP_BASE_API}/productionSettlementBatches/import`;
+  const periodTime = params.periodTime;
+  if (periodTime == null || periodTime === "") {
+    return base;
+  }
+  const qs = new URLSearchParams({ periodTime: String(periodTime) }).toString();
+  return `${base}?${qs}`;
 }
 
 // 涓嬭浇瀵煎叆妯℃澘锛圙ET锛岃繑鍥� blob锛�
diff --git a/src/views/costAccounting/stdVsActCostAnalysis/index.vue b/src/views/costAccounting/stdVsActCostAnalysis/index.vue
index 55830cd..2630be7 100644
--- a/src/views/costAccounting/stdVsActCostAnalysis/index.vue
+++ b/src/views/costAccounting/stdVsActCostAnalysis/index.vue
@@ -276,7 +276,9 @@
   Authorization: `Bearer ${getToken()}`,
 }));
 
-const importAction = computed(() => getImportActionUrl());
+const importAction = computed(() =>
+  getImportActionUrl({ periodTime: searchForm.month || undefined })
+);
 
 const chartRef = ref(null);
 const largeChartRef = ref(null);

--
Gitblit v1.9.3