feat: 套装方案对比导出时配方名后附容量
形如「某配方(100ml)」。full/simple/横向对比三个 sheet 都带上。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -267,8 +267,9 @@ async function exportExcel(mode) {
|
|||||||
const unit = oils.unitLabel(i.oil)
|
const unit = oils.unitLabel(i.oil)
|
||||||
return `${i.oil} ${i.drops}${unit}`
|
return `${i.oil} ${i.drops}${unit}`
|
||||||
}).join('、')
|
}).join('、')
|
||||||
|
const vol = volumeLabel(r)
|
||||||
ws.addRow([
|
ws.addRow([
|
||||||
r.name,
|
vol ? `${r.name}(${vol})` : r.name,
|
||||||
(r.tags || []).join('/'),
|
(r.tags || []).join('/'),
|
||||||
ingredientStr,
|
ingredientStr,
|
||||||
calcMaxTimes(r),
|
calcMaxTimes(r),
|
||||||
@@ -287,8 +288,9 @@ async function exportExcel(mode) {
|
|||||||
for (const r of ka.recipes) {
|
for (const r of ka.recipes) {
|
||||||
const price = getSellingPrice(r._id)
|
const price = getSellingPrice(r._id)
|
||||||
const margin = calcMargin(r.kitCost, price)
|
const margin = calcMargin(r.kitCost, price)
|
||||||
|
const vol = volumeLabel(r)
|
||||||
ws.addRow([
|
ws.addRow([
|
||||||
r.name,
|
vol ? `${r.name}(${vol})` : r.name,
|
||||||
calcMaxTimes(r),
|
calcMaxTimes(r),
|
||||||
Number(r.kitCost.toFixed(2)),
|
Number(r.kitCost.toFixed(2)),
|
||||||
Number(r.originalCost.toFixed(2)),
|
Number(r.originalCost.toFixed(2)),
|
||||||
@@ -326,7 +328,8 @@ async function exportExcel(mode) {
|
|||||||
|
|
||||||
for (const row of crossComparison.value) {
|
for (const row of crossComparison.value) {
|
||||||
const price = getSellingPrice(row.id)
|
const price = getSellingPrice(row.id)
|
||||||
const vals = [row.name]
|
const vol = volumeLabel(row)
|
||||||
|
const vals = [vol ? `${row.name}(${vol})` : row.name]
|
||||||
if (mode === 'full') vals.push((row.tags || []).join('/'))
|
if (mode === 'full') vals.push((row.tags || []).join('/'))
|
||||||
for (const ka of kitAnalysis.value) {
|
for (const ka of kitAnalysis.value) {
|
||||||
const cost = row.costs[ka.id]
|
const cost = row.costs[ka.id]
|
||||||
|
|||||||
Reference in New Issue
Block a user