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)}%` : '', ])