yyb
3 天以前 5f5343365460eceee65f3c20fe0f97fe426f6415
标准/实际成本对比分析更新导入支持月份参数
已修改2个文件
16 ■■■■ 文件已修改
src/api/costAccounting/productionSettlementBatches.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/costAccounting/stdVsActCostAnalysis/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/costAccounting/productionSettlementBatches.js
@@ -19,8 +19,16 @@
}
// 标准成本导入(el-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}`;
}
// 下载导入模板(GET,返回 blob)
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);