外食计算器功能优化修改

This commit is contained in:
xiezhijun
2021-02-20 19:38:17 +08:00
parent afdee0abdf
commit 3f3fcda862
15 changed files with 822 additions and 108 deletions

View File

@ -19,16 +19,16 @@
<span>{{ parseTime(scope.row.edibleDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="食材" align="center" prop="ingredient" />
<el-table-column label="通俗量" align="center" prop="unitName">
<!-- <el-table-column label="食材" align="center" prop="ingredient" />
<el-table-column label="通俗量" align="center" prop="unitName">
<template slot-scope="scope">
{{ scope.row.number + "" + scope.row.unitName }}
{{ scope.row.number ? (scope.row.number + "" + (scope.row.unitName != null ? scope.row.unitName : "")) : "" }}
</template>
</el-table-column>
<el-table-column label="质量(克)" align="center" prop="quantity" />
<el-table-column label="质量(克)" align="center" prop="quantity" />-->
<!--<el-table-column label="类型0早 1中 2晚" align="center" prop="edibleType" />-->
<el-table-column label="热量数值" align="center" prop="heatValue" />
<el-table-column label="最大摄入量" align="center" prop="maxHeatValue" />
<el-table-column label="食材热量" align="center" prop="heatValue" />
<el-table-column label="热量缺口" align="center" prop="heatGap" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -39,6 +39,12 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['custom:foodHeatStatistics:edit']"
>修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCalculate(scope.row)"
>计算</el-button>
<el-button
size="mini"
type="text"
@ -58,6 +64,8 @@
@pagination="fetchHeatList"
/>
<heatStatisticsCalculate ref="heatStatisticsCalculateRef"></heatStatisticsCalculate>
</div>
</el-drawer>
</div>
@ -65,9 +73,11 @@
<script>
import { listFoodHeatStatistics, getFoodHeatStatistics, delFoodHeatStatistics, addFoodHeatStatistics, updateFoodHeatStatistics, exportFoodHeatStatistics } from "@/api/custom/foodHeatStatistics";
import Clipboard from 'clipboard';
import HeatStatisticsCalculate from "@/components/HeatStatisticsCalculate";
export default {
name: "HeatStatisticsDrawer",
components: {
'heatStatisticsCalculate':HeatStatisticsCalculate
},
data() {
return {
@ -137,6 +147,11 @@ export default {
message: '拷贝成功',
type: 'success'
});
},
handleCalculate(data){
this.$refs.heatStatisticsCalculateRef.showDialog(data,() => {
this.fetchHeatList();
});
}
},
};