fix: 原价成本→单买成本,导出简版加可做次数和单买成本列
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 16s
Test / e2e-test (push) Failing after 7m5s
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 16s
Test / e2e-test (push) Failing after 7m5s
页面: 原价成本改为单买成本 导出简版: 配方名+可做次数+套装成本+单买成本+售价+利润率 导出完整版: 增加可做次数列,原价成本→单买成本 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
<th class="th-name">配方名</th>
|
<th class="th-name">配方名</th>
|
||||||
<th class="th-times">可做次数</th>
|
<th class="th-times">可做次数</th>
|
||||||
<th class="th-cost">套装成本</th>
|
<th class="th-cost">套装成本</th>
|
||||||
<th class="th-cost">原价成本</th>
|
<th class="th-cost">单买成本</th>
|
||||||
<th class="th-price">售价</th>
|
<th class="th-price">售价</th>
|
||||||
<th class="th-profit">利润率</th>
|
<th class="th-profit">利润率</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -238,15 +238,15 @@ async function exportExcel(mode) {
|
|||||||
const ws = wb.addWorksheet(ka.name)
|
const ws = wb.addWorksheet(ka.name)
|
||||||
|
|
||||||
// Kit info header
|
// Kit info header
|
||||||
ws.mergeCells('A1:F1')
|
ws.mergeCells(mode === 'full' ? 'A1:H1' : 'A1:F1')
|
||||||
const titleCell = ws.getCell('A1')
|
const titleCell = ws.getCell('A1')
|
||||||
titleCell.value = `${ka.name} — ¥${ka.price} — ${ka.oils.length}种精油 — 可做${ka.recipeCount}个配方`
|
titleCell.value = `${ka.name} — ¥${ka.price} — ${ka.oils.length}种精油 — 可做${ka.recipeCount}个配方`
|
||||||
titleCell.font = { bold: true, size: 13 }
|
titleCell.font = { bold: true, size: 13 }
|
||||||
titleCell.alignment = { horizontal: 'center' }
|
titleCell.alignment = { horizontal: 'center' }
|
||||||
|
|
||||||
if (mode === 'full') {
|
if (mode === 'full') {
|
||||||
// Full version: recipe name, tags, ingredients detail, kit cost, original cost, selling price, margin
|
// Full version: recipe name, tags, ingredients, times, kit cost, original cost, selling price, margin
|
||||||
const headers = ['配方名', '标签', '精油成分', '套装成本', '原价成本', '售价', '利润率']
|
const headers = ['配方名', '标签', '精油成分', '可做次数', '套装成本', '单买成本', '售价', '利润率']
|
||||||
const headerRow = ws.addRow(headers)
|
const headerRow = ws.addRow(headers)
|
||||||
applyHeaderStyle(headerRow)
|
applyHeaderStyle(headerRow)
|
||||||
|
|
||||||
@@ -261,6 +261,7 @@ async function exportExcel(mode) {
|
|||||||
r.name,
|
r.name,
|
||||||
(r.tags || []).join('/'),
|
(r.tags || []).join('/'),
|
||||||
ingredientStr,
|
ingredientStr,
|
||||||
|
calcMaxTimes(r),
|
||||||
Number(r.kitCost.toFixed(2)),
|
Number(r.kitCost.toFixed(2)),
|
||||||
Number(r.originalCost.toFixed(2)),
|
Number(r.originalCost.toFixed(2)),
|
||||||
price || '',
|
price || '',
|
||||||
@@ -268,8 +269,8 @@ async function exportExcel(mode) {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Simple version: recipe name, kit cost, selling price, margin
|
// Simple version: recipe name, times, kit cost, original cost, selling price, margin
|
||||||
const headers = ['配方名', '套装成本', '售价', '利润率']
|
const headers = ['配方名', '可做次数', '套装成本', '单买成本', '售价', '利润率']
|
||||||
const headerRow = ws.addRow(headers)
|
const headerRow = ws.addRow(headers)
|
||||||
applyHeaderStyle(headerRow)
|
applyHeaderStyle(headerRow)
|
||||||
|
|
||||||
@@ -278,7 +279,9 @@ async function exportExcel(mode) {
|
|||||||
const margin = calcMargin(r.kitCost, price)
|
const margin = calcMargin(r.kitCost, price)
|
||||||
ws.addRow([
|
ws.addRow([
|
||||||
r.name,
|
r.name,
|
||||||
|
calcMaxTimes(r),
|
||||||
Number(r.kitCost.toFixed(2)),
|
Number(r.kitCost.toFixed(2)),
|
||||||
|
Number(r.originalCost.toFixed(2)),
|
||||||
price || '',
|
price || '',
|
||||||
price ? `${margin.toFixed(1)}%` : '',
|
price ? `${margin.toFixed(1)}%` : '',
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user