diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesServiceImpl.java index 46523212a..e18f40614 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesServiceImpl.java @@ -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); } diff --git a/stdiet-ui/src/components/BodySignView/index.vue b/stdiet-ui/src/components/BodySignView/index.vue index c8ce84013..b7f1cdffc 100644 --- a/stdiet-ui/src/components/BodySignView/index.vue +++ b/stdiet-ui/src/components/BodySignView/index.vue @@ -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, [ diff --git a/stdiet-ui/src/components/HealthyView/index.vue b/stdiet-ui/src/components/HealthyView/index.vue index 298c19881..3f33b25fe 100644 --- a/stdiet-ui/src/components/HealthyView/index.vue +++ b/stdiet-ui/src/components/HealthyView/index.vue @@ -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 { diff --git a/stdiet-ui/src/components/RecipesPlanDrawer/index.vue b/stdiet-ui/src/components/RecipesPlanDrawer/index.vue index 2953e26dd..664a1d27c 100644 --- a/stdiet-ui/src/components/RecipesPlanDrawer/index.vue +++ b/stdiet-ui/src/components/RecipesPlanDrawer/index.vue @@ -60,24 +60,9 @@ @@ -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 = ""; diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js index 8c8ab2448..dffa2921d 100644 --- a/stdiet-ui/src/store/modules/recipes.js +++ b/stdiet-ui/src/store/modules/recipes.js @@ -302,7 +302,7 @@ const actions = { const recipesId = result.data; if (!payload.planId) { // 非保存模板 - commit("updateStateData", { recipesId }); + commit("updateStateData", { recipesId, reviewStatus: 3 }); dispatch("getRecipesInfo", { recipesId }); } payload.callback && diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index f915a3242..b917fc781 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -482,6 +482,8 @@ 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} - ${lowRecProtein * 1.5}`; needAttrName.forEach(name => { if (customerHealthy.hasOwnProperty(name)) { diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue index b856ccf51..096fe8bea 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue @@ -37,37 +37,43 @@ /> - 返回 + + 返回 +
审核通过已审核 未审核通过未审核 + 制作中
- {{ reviewStatus === 1 ? "未审核" : "已审核" }} + {{ getReviewStatusName(reviewStatus) }}
忌口
{{ item.name }}
@@ -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; + } } } diff --git a/stdiet-ui/src/views/custom/recipesPlan/index.vue b/stdiet-ui/src/views/custom/recipesPlan/index.vue index d21a3722f..3f15d2125 100644 --- a/stdiet-ui/src/views/custom/recipesPlan/index.vue +++ b/stdiet-ui/src/views/custom/recipesPlan/index.vue @@ -108,24 +108,9 @@ @@ -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; diff --git a/stdiet-ui/src/views/custom/recipesTemplate/index.vue b/stdiet-ui/src/views/custom/recipesTemplate/index.vue index 995d31ab1..f67c11f0b 100644 --- a/stdiet-ui/src/views/custom/recipesTemplate/index.vue +++ b/stdiet-ui/src/views/custom/recipesTemplate/index.vue @@ -87,24 +87,9 @@