From 9206272a685b87c8c6c097e22da3a6f1868834f9 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Tue, 14 Apr 2026 10:55:59 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=9F=E4=BB=B7=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E2=86=92=E5=8D=95=E4=B9=B0=E6=88=90=E6=9C=AC=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=AE=80=E7=89=88=E5=8A=A0=E5=8F=AF=E5=81=9A=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E5=92=8C=E5=8D=95=E4=B9=B0=E6=88=90=E6=9C=AC=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 页面: 原价成本改为单买成本 导出简版: 配方名+可做次数+套装成本+单买成本+售价+利润率 导出完整版: 增加可做次数列,原价成本→单买成本 Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/views/KitExport.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/KitExport.vue b/frontend/src/views/KitExport.vue index f29a7ad..ff1a8e9 100644 --- a/frontend/src/views/KitExport.vue +++ b/frontend/src/views/KitExport.vue @@ -41,7 +41,7 @@ 配方名 可做次数 套装成本 - 原价成本 + 单买成本 售价 利润率 @@ -238,15 +238,15 @@ async function exportExcel(mode) { const ws = wb.addWorksheet(ka.name) // Kit info header - ws.mergeCells('A1:F1') + ws.mergeCells(mode === 'full' ? 'A1:H1' : 'A1:F1') const titleCell = ws.getCell('A1') titleCell.value = `${ka.name} — ¥${ka.price} — ${ka.oils.length}种精油 — 可做${ka.recipeCount}个配方` titleCell.font = { bold: true, size: 13 } titleCell.alignment = { horizontal: 'center' } if (mode === 'full') { - // Full version: recipe name, tags, ingredients detail, kit cost, original cost, selling price, margin - const headers = ['配方名', '标签', '精油成分', '套装成本', '原价成本', '售价', '利润率'] + // Full version: recipe name, tags, ingredients, times, kit cost, original cost, selling price, margin + const headers = ['配方名', '标签', '精油成分', '可做次数', '套装成本', '单买成本', '售价', '利润率'] const headerRow = ws.addRow(headers) applyHeaderStyle(headerRow) @@ -261,6 +261,7 @@ async function exportExcel(mode) { r.name, (r.tags || []).join('/'), ingredientStr, + calcMaxTimes(r), Number(r.kitCost.toFixed(2)), Number(r.originalCost.toFixed(2)), price || '', @@ -268,8 +269,8 @@ async function exportExcel(mode) { ]) } } else { - // Simple version: recipe name, kit cost, selling price, margin - const headers = ['配方名', '套装成本', '售价', '利润率'] + // Simple version: recipe name, times, kit cost, original cost, selling price, margin + const headers = ['配方名', '可做次数', '套装成本', '单买成本', '售价', '利润率'] const headerRow = ws.addRow(headers) applyHeaderStyle(headerRow) @@ -278,7 +279,9 @@ async function exportExcel(mode) { const margin = calcMargin(r.kitCost, price) ws.addRow([ r.name, + calcMaxTimes(r), Number(r.kitCost.toFixed(2)), + Number(r.originalCost.toFixed(2)), price || '', price ? `${margin.toFixed(1)}%` : '', ])