feat: 非精油产品显示份、新增护肤品价目 #30
@@ -777,15 +777,15 @@ function editRecipe(recipe) {
|
||||
const coco = ings.find(i => i.oil === '椰子油')
|
||||
if (coco) {
|
||||
formCocoRow.value = { ...coco, _search: '椰子油', _open: false }
|
||||
const eoDrops = ings.filter(i => i.oil && i.oil !== '椰子油').reduce((s, i) => s + (i.drops || 0), 0)
|
||||
// Use stored volume if available, otherwise guess from drops
|
||||
if (recipe.volume) {
|
||||
formVolume.value = recipe.volume
|
||||
if (recipe.volume === 'custom') {
|
||||
const totalDrops = ings.reduce((s, i) => s + (i.drops || 0), 0)
|
||||
const totalDrops = eoDrops + coco.drops
|
||||
formCustomVolume.value = Math.round(totalDrops / DROPS_PER_ML)
|
||||
}
|
||||
} else {
|
||||
const eoDrops = ings.filter(i => i.oil && i.oil !== '椰子油').reduce((s, i) => s + (i.drops || 0), 0)
|
||||
const totalDrops = eoDrops + coco.drops
|
||||
const ml = totalDrops / DROPS_PER_ML
|
||||
if (ml <= 2) formVolume.value = 'single'
|
||||
|
||||
Reference in New Issue
Block a user