Merge branch 'master' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
commit
636a808d3a
@ -30,7 +30,6 @@ public class SysFoodHeatStatisticsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询外食热量统计列表
|
* 查询外食热量统计列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('custom:foodHeatStatistics:list')")
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
public TableDataInfo list(SysCustomerHeatStatistics sysCustomerHeatStatistics)
|
||||||
{
|
{
|
||||||
|
@ -104,9 +104,10 @@ export default {
|
|||||||
[{ title: "方便沟通时间", value: "connectTime" }],
|
[{ title: "方便沟通时间", value: "connectTime" }],
|
||||||
];
|
];
|
||||||
if (this.dev) {
|
if (this.dev) {
|
||||||
basicInfo.splice(3, 0, [{ title: "蛋白范围", value: "recProtein" }]);
|
basicInfo.splice(3, 0, [{ title: "BMI", value: "bmi" }]);
|
||||||
basicInfo.splice(4, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
basicInfo.splice(4, 0, [{ title: "蛋白范围", value: "recProtein" }]);
|
||||||
basicInfo.splice(5, 0, [
|
basicInfo.splice(5, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
||||||
|
basicInfo.splice(6, 0, [
|
||||||
{ title: "不运动总热量", value: "notSportHeat" },
|
{ title: "不运动总热量", value: "notSportHeat" },
|
||||||
]);
|
]);
|
||||||
basicInfo.splice(basicInfo.length, 0, [
|
basicInfo.splice(basicInfo.length, 0, [
|
||||||
|
@ -90,12 +90,15 @@ export default {
|
|||||||
[{ title: "地域", value: "position" }],
|
[{ title: "地域", value: "position" }],
|
||||||
];
|
];
|
||||||
if (this.dev) {
|
if (this.dev) {
|
||||||
basicInfo.splice(3, 0, [{ title: "推荐蛋白范围", value: "recProtein" }]);
|
basicInfo.splice(3, 0, [{ title: "BMI", value: "bmi" }]);
|
||||||
basicInfo.splice(4, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
basicInfo.splice(4, 0, [{ title: "推荐蛋白范围", value: "recProtein" }]);
|
||||||
basicInfo.splice(5, 0, [
|
basicInfo.splice(5, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
|
||||||
|
basicInfo.splice(6, 0, [
|
||||||
{ title: "不运动总热量", value: "notSportHeat" },
|
{ title: "不运动总热量", value: "notSportHeat" },
|
||||||
]);
|
]);
|
||||||
basicInfo.splice(basicInfo.length, 0, [{ title: "备注", value: "remark" }]);
|
basicInfo.splice(basicInfo.length, 0, [
|
||||||
|
{ title: "备注", value: "remark" },
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -312,6 +312,7 @@ export default {
|
|||||||
["创建时间", "客户姓名", "手机号"],
|
["创建时间", "客户姓名", "手机号"],
|
||||||
["调理项目", "性别", "年龄"],
|
["调理项目", "性别", "年龄"],
|
||||||
["身高(厘米)", "体重(斤)", "地域"],
|
["身高(厘米)", "体重(斤)", "地域"],
|
||||||
|
["BMI", "", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["减脂经历", "减脂遇到的困难", "减脂是否反弹"],
|
["减脂经历", "减脂遇到的困难", "减脂是否反弹"],
|
||||||
@ -362,6 +363,7 @@ export default {
|
|||||||
["createTime", "name", "phone"],
|
["createTime", "name", "phone"],
|
||||||
["conditioningProject", "sex", "age"],
|
["conditioningProject", "sex", "age"],
|
||||||
["tall", "weight", "position"],
|
["tall", "weight", "position"],
|
||||||
|
["bmi", "", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["experience", "difficulty", "rebound"],
|
["experience", "difficulty", "rebound"],
|
||||||
@ -722,6 +724,12 @@ export default {
|
|||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
}, []);
|
}, []);
|
||||||
|
detailHealthy.bmi = (
|
||||||
|
detailHealthy.weight /
|
||||||
|
2 /
|
||||||
|
(detailHealthy.tall / 100) /
|
||||||
|
(detailHealthy.tall / 100)
|
||||||
|
).toFixed(1);
|
||||||
this.detailHealthy = detailHealthy;
|
this.detailHealthy = detailHealthy;
|
||||||
for (let i = 0; i < this.healthyTitleData.length; i++) {
|
for (let i = 0; i < this.healthyTitleData.length; i++) {
|
||||||
let stepArray = [];
|
let stepArray = [];
|
||||||
|
@ -517,6 +517,7 @@ const getters = {
|
|||||||
obj.fHeat = obj.fWeight * 9;
|
obj.fHeat = obj.fWeight * 9;
|
||||||
obj.cWeight += (igd.weight / 100) * igd.carbonRatio;
|
obj.cWeight += (igd.weight / 100) * igd.carbonRatio;
|
||||||
obj.cHeat = obj.cWeight * 4;
|
obj.cHeat = obj.cWeight * 4;
|
||||||
|
obj.totalHeat = obj.pHeat + obj.fHeat + obj.cHeat;
|
||||||
obj[`heat${cur.type}`] +=
|
obj[`heat${cur.type}`] +=
|
||||||
(igd.weight / 100) * igd.proteinRatio * 4 +
|
(igd.weight / 100) * igd.proteinRatio * 4 +
|
||||||
(igd.weight / 100) * igd.fatRatio * 9 +
|
(igd.weight / 100) * igd.fatRatio * 9 +
|
||||||
@ -532,16 +533,17 @@ const getters = {
|
|||||||
pHeat: 0,
|
pHeat: 0,
|
||||||
fHeat: 0,
|
fHeat: 0,
|
||||||
cHeat: 0,
|
cHeat: 0,
|
||||||
|
totalHeat: 0,
|
||||||
heat1: 0,
|
heat1: 0,
|
||||||
heat2: 0,
|
heat2: 0,
|
||||||
heat3: 0,
|
heat3: 0,
|
||||||
heat4: 0,
|
heat4: 0,
|
||||||
heat5: 0,
|
heat5: 0,
|
||||||
heat6: 0,
|
heat6: 0
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
// console.log(nutriData);
|
console.log(nutriData);
|
||||||
return nutriData;
|
return nutriData;
|
||||||
},
|
},
|
||||||
verifyNotRecData: state =>
|
verifyNotRecData: state =>
|
||||||
|
@ -473,6 +473,12 @@ const moduleObj = {
|
|||||||
|
|
||||||
//健康信息处理,将数组转为字符串
|
//健康信息处理,将数组转为字符串
|
||||||
export function dealHealthy(customerHealthy) {
|
export function dealHealthy(customerHealthy) {
|
||||||
|
customerHealthy.bmi = (
|
||||||
|
customerHealthy.weight /
|
||||||
|
2 /
|
||||||
|
(customerHealthy.tall / 100) /
|
||||||
|
(customerHealthy.tall / 100)
|
||||||
|
).toFixed(1);
|
||||||
customerHealthy.basicBMR = (
|
customerHealthy.basicBMR = (
|
||||||
(10 * customerHealthy.weight) / 2 +
|
(10 * customerHealthy.weight) / 2 +
|
||||||
6.25 * customerHealthy.tall -
|
6.25 * customerHealthy.tall -
|
||||||
|
@ -352,6 +352,7 @@
|
|||||||
:on-success="handleOnUploadSuccess"
|
:on-success="handleOnUploadSuccess"
|
||||||
:on-exceed="handleOnUploadExceed"
|
:on-exceed="handleOnUploadExceed"
|
||||||
:on-remove="handleOnUploadRemove"
|
:on-remove="handleOnUploadRemove"
|
||||||
|
:on-preview="handleOnUploadPreview"
|
||||||
list-type="picture"
|
list-type="picture"
|
||||||
>
|
>
|
||||||
<em class="el-icon-upload" />
|
<em class="el-icon-upload" />
|
||||||
@ -408,6 +409,17 @@
|
|||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 预览弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="previewVisible"
|
||||||
|
:title="previewTitle"
|
||||||
|
class="preview_dialog_wrapper"
|
||||||
|
>
|
||||||
|
<div class="preview_content">
|
||||||
|
<img :src="previewUrl" alt="" class="preview_img" />
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -437,6 +449,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|
||||||
//
|
//
|
||||||
actionUrl: process.env.VUE_APP_BASE_API + "/custom/fileUpload/ingredient",
|
actionUrl: process.env.VUE_APP_BASE_API + "/custom/fileUpload/ingredient",
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -480,6 +493,10 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {},
|
||||||
|
//
|
||||||
|
previewVisible: false,
|
||||||
|
previewUrl: "",
|
||||||
|
previewTitle: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -704,6 +721,23 @@ export default {
|
|||||||
type: "warning",
|
type: "warning",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleOnUploadPreview(file) {
|
||||||
|
console.log(file);
|
||||||
|
this.previewTitle = file.name;
|
||||||
|
this.previewVisible = true;
|
||||||
|
this.previewUrl = file.url;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.preview_dialog_wrapper {
|
||||||
|
.preview_content {
|
||||||
|
text-align: center;
|
||||||
|
.preview_img {
|
||||||
|
max-height: 600px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<div class="summary">
|
<div class="summary">
|
||||||
<div style="font-size: 12px; color: #606266">总热量约等于</div>
|
<div style="font-size: 12px; color: #606266">总热量约等于</div>
|
||||||
<div style="color: #515a6e; font-weight: bold">
|
<div style="color: #515a6e; font-weight: bold">
|
||||||
{{ totalHeat.toFixed(1) }}千卡
|
{{ data[0] ? data[0].totalHeat.toFixed(1) : 0 }}千卡
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -82,7 +82,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null,
|
||||||
totalHeat: 0,
|
|
||||||
nameDict: {
|
nameDict: {
|
||||||
p: "蛋白质",
|
p: "蛋白质",
|
||||||
f: "脂肪",
|
f: "脂肪",
|
||||||
@ -107,15 +106,15 @@ export default {
|
|||||||
mData() {
|
mData() {
|
||||||
const [data] = this.data;
|
const [data] = this.data;
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.totalHeat = 0;
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
this.totalHeat = data.cHeat + data.fHeat + data.pHeat;
|
|
||||||
const mData = ["Weight", "Rate"].map((t, idx) => ({
|
const mData = ["Weight", "Rate"].map((t, idx) => ({
|
||||||
type: this.typeDict[t],
|
type: this.typeDict[t],
|
||||||
...["p", "f", "c"].reduce((obj, cur) => {
|
...["p", "f", "c"].reduce((obj, cur) => {
|
||||||
obj[cur] = idx
|
obj[cur] = idx
|
||||||
? `${((data[`${cur}Heat`] / this.totalHeat) * 100).toFixed(2)}%`
|
? data.totalHeat === 0
|
||||||
|
? 0
|
||||||
|
: `${((data[`${cur}Heat`] / data.totalHeat) * 100).toFixed(2)}%`
|
||||||
: `${data[`${cur}Weight`].toFixed(1)}克`;
|
: `${data[`${cur}Weight`].toFixed(1)}克`;
|
||||||
return obj;
|
return obj;
|
||||||
}, {}),
|
}, {}),
|
||||||
@ -199,7 +198,9 @@ export default {
|
|||||||
top: 18,
|
top: 18,
|
||||||
left: 8,
|
left: 8,
|
||||||
style: {
|
style: {
|
||||||
text: `${this.totalHeat.toFixed(1)}千卡`,
|
text: `${
|
||||||
|
data.totalHeat ? data.totalHeat.toFixed(1) : 0
|
||||||
|
}千卡`,
|
||||||
font: '14px "Microsoft YaHei", sans-serif',
|
font: '14px "Microsoft YaHei", sans-serif',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user