This commit is contained in:
xiezhijun 2021-03-15 18:02:20 +08:00
commit 579a8b31ab
13 changed files with 262 additions and 85 deletions
stdiet-custom/src/main
java/com/stdiet/custom/service/impl
resources/mapper/custom
stdiet-ui/src
components
BodySignView
HealthyView
RecipesPlanDrawer
store/modules
utils
views/custom
recipesBuild
RecipesView
RecipesCom/EditableText
RecipesHeaderCom
RecommendView/TemplateView
VerifyView
recipesPlan
recipesTemplate

@ -54,8 +54,8 @@ public class SysRecipesServiceImpl implements ISysRecipesService {
// 更新食谱计划
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
sysRecipesPlan.setId(sysRecipes.getPlanId());
sysRecipesPlan.setReviewStatus(3);// 设置制作中
sysRecipesPlan.setRecipesId(sysRecipes.getId());
sysRecipesPlan.setReviewStatus(1);
sysRecipesPlanMapper.updateSysRecipesPlan(sysRecipesPlan);
}

@ -31,7 +31,7 @@
left join sys_user su_nutritionist on su_nutritionist.user_id = srt.nutritionist_id and su_nutritionist.del_flag = 0
left join sys_user su_nutritionist_assis on su_nutritionist_assis.user_id = srt.nutri_assis_id and su_nutritionist_assis.del_flag = 0
where srt.del_flag = 0
<if test="name != null and name != ''">and srt.name like concat('%', #{name}, '%')</if>
<if test="name != null and name != ''">and srt.name like concat('%', #{name}, '%') or srt.remark like concat('%', #{name}, '%')</if>
<if test="nutriAssisId != null ">and srt.nutri_assis_id = #{nutriAssisId}</if>
<if test="nutritionistId != null ">and srt.nutritionist_id = #{nutritionistId}</if>
<if test="reviewStatus != null ">and srp.review_status = #{reviewStatus}</if>

@ -104,8 +104,9 @@ export default {
[{ title: "方便沟通时间", value: "connectTime" }],
];
if (this.dev) {
basicInfo.splice(3, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
basicInfo.splice(4, 0, [
basicInfo.splice(3, 0, [{ title: "蛋白范围", value: "recProtein" }]);
basicInfo.splice(4, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
basicInfo.splice(5, 0, [
{ title: "不运动总热量", value: "notSportHeat" },
]);
basicInfo.splice(basicInfo.length, 0, [

@ -90,11 +90,12 @@ export default {
[{ title: "地域", value: "position" }],
];
if (this.dev) {
basicInfo.splice(3, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
basicInfo.splice(4, 0, [
basicInfo.splice(3, 0, [{ title: "推荐蛋白范围", value: "recProtein" }]);
basicInfo.splice(4, 0, [{ title: "基础代谢BMR", value: "basicBMR" }]);
basicInfo.splice(5, 0, [
{ title: "不运动总热量", value: "notSportHeat" },
]);
basicInfo.splice(6, 0, [{ title: "备注", value: "remark" }]);
basicInfo.splice(basicInfo.length, 0, [{ title: "备注", value: "remark" }]);
}
return {

@ -60,24 +60,9 @@
<el-table :data="planList" v-loading="planLoading" height="80%">
<el-table-column label="审核状态" align="center" width="80">
<template slot-scope="scope">
<el-tag
:type="
scope.row.reviewStatus === 0
? 'info'
: scope.row.reviewStatus === 2
? 'success'
: 'danger'
"
>{{
`${
scope.row.reviewStatus === 0
? "未制作"
: scope.row.reviewStatus === 2
? "已审核"
: "未审核"
}`
}}</el-tag
>
<el-tag :type="getReviewType(scope.row.reviewStatus)">
{{ getReviewStatusName(scope.row.reviewStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="计划" align="center">
@ -226,6 +211,32 @@ export default {
};
this.resetForm("form");
},
getReviewStatusName(status) {
switch (status) {
case 1:
return "未审核";
case 2:
return "已审核";
case 3:
return "制作中";
case 0:
default:
return "未制作";
}
},
getReviewType(status) {
switch (status) {
case 1:
return "danger";
case 2:
return "success";
case 3:
return "";
case 0:
default:
return "info";
}
},
handleOnClosed() {
this.data = undefined;
this.cusOutId = "";

@ -132,6 +132,7 @@ const actions = {
recipesId,
reviewStatus,
temId: payload.temId,
name: payload.name,
planId: payload.planId,
startNum: startNumDay,
endNum: endNumDay
@ -302,7 +303,7 @@ const actions = {
const recipesId = result.data;
if (!payload.planId) {
// 非保存模板
commit("updateStateData", { recipesId });
commit("updateStateData", { recipesId, reviewStatus: 3 });
dispatch("getRecipesInfo", { recipesId });
}
payload.callback &&

@ -200,7 +200,7 @@ export const familyIllnessHistoryArray = [
{ name: "冠心病", value: "3" },
{ name: "外周血管病", value: "4" },
{ name: "心力衰竭", value: "5" },
{ name: "冠心病", value: "6" },
{ name: "糖尿病", value: "6" },
{ name: "肥胖症", value: "7" },
{ name: "慢性肾脏疾病", value: "8" },
{ name: "骨质疏松", value: "9" },
@ -482,6 +482,10 @@ export function dealHealthy(customerHealthy) {
customerHealthy.notSportHeat = (customerHealthy.basicBMR * 1.3).toFixed(1);
customerHealthy.basicBMR += "千卡";
customerHealthy.notSportHeat += "千卡";
const lowRecProtein = customerHealthy.tall - 105;
customerHealthy.recProtein = `${(lowRecProtein * 0.8).toFixed(1)} - ${(
lowRecProtein * 1.5
).toFixed(1)}`;
needAttrName.forEach(name => {
if (customerHealthy.hasOwnProperty(name)) {
@ -538,6 +542,68 @@ export function dealHealthy(customerHealthy) {
}
});
if (customerHealthy.hasOwnProperty("physicalSignsId")) {
const signs = customerHealthy.otherPhysicalSigns
? [customerHealthy.otherPhysicalSigns]
: [];
customerHealthy.signList.forEach(obj => {
signs.push(obj.name);
});
customerHealthy.physicalSigns = signs.join(",");
}
if (customerHealthy.hasOwnProperty("otherLongEatDrugClassify")) {
customerHealthy.longEatDrugClassify += customerHealthy.otherLongEatDrugClassify
? `${customerHealthy.otherLongEatDrugClassify}`
: "";
}
if (customerHealthy.hasOwnProperty("washVegetablesStyle")) {
customerHealthy.washVegetablesStyle += customerHealthy.otherWashVegetablesStyle
? `${customerHealthy.otherWashVegetablesStyle}`
: "";
}
if (customerHealthy.hasOwnProperty("snacks")) {
customerHealthy.snacks += customerHealthy.otherSnacks
? `${customerHealthy.otherSnacks}`
: "";
}
if (customerHealthy.hasOwnProperty("healthProductsWeekRate")) {
customerHealthy.healthProductsWeekRate =
customerHealthy.healthProductsDayRate +
"次/天," +
customerHealthy.healthProductsWeekRate +
"次/周";
}
if (customerHealthy.hasOwnProperty("drinkWineClassify")) {
customerHealthy.drinkWineClassify += customerHealthy.otherWineClassify
? `${customerHealthy.otherWineClassify}`
: "";
}
if (customerHealthy.hasOwnProperty("otherMotionClassify")) {
let motionStr = customerHealthy.aerobicMotionClassify
? `${customerHealthy.aerobicMotionClassify}`
: "";
motionStr += customerHealthy.anaerobicMotionClassify
? `${customerHealthy.anaerobicMotionClassify}`
: "";
motionStr += customerHealthy.anaerobicAerobicMotionClassify
? `${customerHealthy.anaerobicAerobicMotionClassify}`
: "";
motionStr += customerHealthy.otherMotionClassify
? `${customerHealthy.otherMotionClassify}`
: "";
customerHealthy.motion = motionStr;
}
if (customerHealthy.hasOwnProperty("motionField")) {
customerHealthy.motionField += customerHealthy.otherMotionField
? `${customerHealthy.otherMotionField}`
: "";
}
if (customerHealthy.hasOwnProperty("defecationNum")) {
customerHealthy.defecationNum += "次/天";
}
if (customerHealthy.hasOwnProperty("motionDuration")) {
customerHealthy.motionDuration += "分钟";
}
if (customerHealthy.hasOwnProperty("tall")) {
customerHealthy.tall += "cm";
}

@ -9,7 +9,7 @@
:step="5"
:value="value"
@blur="handleOnBlur"
@keydown.enter="handleEnterClick"
@keydown.enter.native="handleEnterClick"
/>
</div>
</template>

@ -37,37 +37,43 @@
/>
</el-select>
</span>
<el-button size="mini" v-if="!recipesId" @click="handleOnBack"
>返回</el-button
>
<el-button size="mini" v-if="!recipesId" @click="handleOnBack">
返回
</el-button>
<el-popover
placement="bottom"
trigger="click"
title="修改审核状态"
title="修改食谱状态"
style="margin-right: 12px"
v-hasPermi="['recipes:plan:review']"
>
<div>
<el-button
size="mini"
type="success"
v-hasPermi="['recipes:plan:review']"
@click="hanldeOnReveiwChange(2)"
>审核通过</el-button
>审核</el-button
>
<el-button
size="mini"
type="danger"
@click="hanldeOnReveiwChange(1)"
>未审核通过</el-button
>未审核</el-button
>
<el-button
size="mini"
type="primary"
@click="hanldeOnReveiwChange(3)"
>制作中</el-button
>
</div>
<el-button
slot="reference"
size="mini"
v-if="reviewStatus"
:type="reviewStatus === 1 ? 'danger' : 'success'"
v-if="!!recipesId"
:type="getReviewType(reviewStatus)"
>
{{ reviewStatus === 1 ? "未审核" : "已审核" }}
{{ getReviewStatusName(reviewStatus) }}
</el-button>
</el-popover>
<el-button
@ -122,8 +128,12 @@ export default {
this.saveRecipes({
callback: (query) => {
// console.log(query);
let path = "/recipes/build/" + query.name + "/" + query.planId;
if (this.$route.query.temId) {
path += "?temId=" + this.$route.query.temId;
}
this.$router.replace({
path: "/recipes/build/" + query.name + "/" + query.planId,
path,
});
},
});
@ -157,6 +167,32 @@ export default {
}
});
},
getReviewStatusName(status) {
switch (status) {
case 1:
return "未审核";
case 2:
return "已审核";
case 3:
return "制作中";
case 0:
default:
return "未制作";
}
},
getReviewType(status) {
switch (status) {
case 1:
return "danger";
case 2:
return "success";
case 3:
return "primary";
case 0:
default:
return "info";
}
},
...mapActions(["saveRecipes", "updateReviewStatus"]),
...mapMutations(["updateStateData", "updateFontSize", "toggleLeftShow"]),
},

@ -7,11 +7,11 @@
<div class="content">
<!-- 筛选 -->
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="模板名称" prop="name">
<el-form-item label="搜索内容" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入模板名称"
@keydown.enter="handleQuery"
placeholder="请输入模板名称或备注"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="营养师" prop="nutritionistId">

@ -3,10 +3,12 @@
<div>忌口</div>
<div class="content">
<span
class="item"
:class="`item ${
selectedNotRec.includes(item.name) ? 'selected_item' : ''
} `"
v-for="item in verifyNotRecData"
:key="item.name"
@click="handleOnClick(item.data)"
@click="handleOnClick(item)"
>{{ item.name }}</span
>
</div>
@ -18,14 +20,38 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers("recipes");
export default {
name: "VerifyView",
data() {
return {};
return {
selectedNotRec: [],
};
},
computed: {
...mapGetters(["verifyNotRecData"]),
},
methods: {
handleOnClick(data) {
console.log({ data, verifyNotRecData: this.verifyNotRecData });
if (this.selectedNotRec.some((str) => data.name === str)) {
this.selectedNotRec = this.selectedNotRec.filter(
(str) => str !== data.name
);
} else {
this.selectedNotRec.push(data.name);
this.selectedNotRec = JSON.parse(JSON.stringify(this.selectedNotRec));
}
const notRecIgds = this.selectedNotRec.reduce((arr, cur) => {
this.verifyNotRecData[cur].data.forEach((obj) => {
if (!arr.includes(obj.igdId)) {
arr.push(obj.igdId);
}
});
return arr;
}, []);
console.log({
data,
notRecIgds,
verifyNotRecData: this.verifyNotRecData,
});
},
},
};
@ -44,12 +70,21 @@ export default {
border: 1px solid #8c8c8c;
padding: 3px 8px;
word-break: normal;
transition: all 0.3s;
&:hover {
color: #d96969;
color: white;
background: #d96969;
border-color: #d96969;
}
}
.selected_item {
color: white;
background: #d96969;
border-color: #d96969;
font-weight: bold;
}
}
}
</style>

@ -108,24 +108,9 @@
<el-table v-loading="loading" :data="recipesPlanList">
<el-table-column label="审核状态" align="center" width="100">
<template slot-scope="scope">
<el-tag
:type="
!scope.row.reviewStatus
? 'info'
: scope.row.reviewStatus === 1
? 'danger'
: 'success'
"
>{{
`${
!scope.row.reviewStatus
? "未制作"
: scope.row.reviewStatus == 1
? "未审核"
: "已审核"
}`
}}</el-tag
>
<el-tag :type="getReviewType(scope.row.reviewStatus)">
{{ getReviewStatusName(scope.row.reviewStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="customer" />
@ -338,6 +323,32 @@ export default {
};
this.resetForm("form");
},
getReviewStatusName(status) {
switch (status) {
case 1:
return "未审核";
case 2:
return "已审核";
case 3:
return "制作中";
case 0:
default:
return "未制作";
}
},
getReviewType(status) {
switch (status) {
case 1:
return "danger";
case 2:
return "success";
case 3:
return "";
case 0:
default:
return "info";
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;

@ -6,8 +6,12 @@
:inline="true"
v-show="showSearch"
>
<el-form-item label="模板名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入模板名称" />
<el-form-item label="搜索内容" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入模板名称或备注"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="营养师" prop="nutritionistId">
<el-select
@ -87,24 +91,9 @@
<el-table v-loading="loading" :data="recipesTemplateList">
<el-table-column label="审核状态" align="center" width="120">
<template slot-scope="scope">
<el-tag
:type="
!scope.row.reviewStatus
? 'info'
: scope.row.reviewStatus === 1
? 'danger'
: 'success'
"
>{{
`${
!scope.row.reviewStatus
? "未制作"
: scope.row.reviewStatus == 1
? "未审核"
: "已审核"
}`
}}</el-tag
>
<el-tag :type="getReviewType(scope.row.reviewStatus)">
{{ getReviewStatusName(scope.row.reviewStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column
@ -299,6 +288,32 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
getReviewStatusName(status) {
switch (status) {
case 1:
return "未审核";
case 2:
return "已审核";
case 3:
return "制作中";
case 0:
default:
return "未制作";
}
},
getReviewType(status) {
switch (status) {
case 1:
return "danger";
case 2:
return "success";
case 3:
return "";
case 0:
default:
return "info";
}
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;