|
|
@@ -156,40 +156,6 @@ export default {
|
|
|
}).catch(res => {
|
|
|
this.$message.error(res.data.message)
|
|
|
})
|
|
|
- // try {
|
|
|
- // const nutrientRes = await getNutrientList(row.foodId)
|
|
|
- // const nutrients = nutrientRes.data
|
|
|
- // const foodUnitRes = await convertFoodUnit(row.foodId, { fromUnit: row.inInitUnit })
|
|
|
- // const foodUnitRatio = foodUnitRes.data.ratio
|
|
|
- // if (!foodUnitRatio) {
|
|
|
- // this.dialogHtml = ''
|
|
|
- // return
|
|
|
- // }
|
|
|
- // let unitPairs = []
|
|
|
- // nutrients.forEach(item => unitPairs.push({ fromUnit: }))
|
|
|
- // const convertedUnits = await convertUnits()
|
|
|
- //
|
|
|
- //
|
|
|
- // } catch {
|
|
|
- // this.$message.error('获取数据失败')
|
|
|
- // }
|
|
|
- //
|
|
|
- // this.dialogHtml = `转换关系:1${row.inInitUnit}${this.food.name}=${res.data.ratio}${this.food.normalizedUnit}${this.food.name}<br>`
|
|
|
- // this.dialogHtml += `${row.inInit}${row.inInitUnit}${this.food.name}含有如下营养素:<br>`
|
|
|
- // this.dialogHtml += `******************************<br>`
|
|
|
- // for (let i=0; i < nutrients.length; i++) {
|
|
|
- // const nutrient = nutrients[i]
|
|
|
- // const quantity = nutrient.normalizedQuantity * res.data.ratio * row.inInit
|
|
|
- // this.dialogHtml += `${nutrient.nutrientName}:${quantity}${nutrient.unit}。<br>`
|
|
|
- // this.dialogHtml += `营养素计量为:${nutrient.quantity}${nutrient.unit}。Nv_Spec为:${nutrient.nvSpec}${nutrient.nvSpecUnit}。<br>`
|
|
|
- // this.dialogHtml += `******************************<br>`
|
|
|
- // }
|
|
|
- // this.dialogFormVisible = true
|
|
|
- // this.di
|
|
|
- // })
|
|
|
- // }).catch(res => {
|
|
|
- // this.$message.error('获取数据失败')
|
|
|
- // })
|
|
|
}
|
|
|
}
|
|
|
}
|