From 51be6ba97ae81daa9ddc093afc2146c3928da910 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Sat, 13 Mar 2021 18:21:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A3=9F=E8=B0=B1=E5=88=B6=E4=BD=9C?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysRecipesServiceImpl.java | 2 +- .../src/components/BodySignView/index.vue | 5 +- .../src/components/HealthyView/index.vue | 7 +-- .../components/RecipesPlanDrawer/index.vue | 47 ++++++++++------- stdiet-ui/src/store/modules/recipes.js | 2 +- stdiet-ui/src/utils/healthyData.js | 2 + .../RecipesView/RecipesHeaderCom/index.vue | 52 +++++++++++++++---- .../custom/recipesBuild/VerifyView/index.vue | 45 ++++++++++++++-- .../src/views/custom/recipesPlan/index.vue | 47 ++++++++++------- .../views/custom/recipesTemplate/index.vue | 47 ++++++++++------- 10 files changed, 180 insertions(+), 76 deletions(-) 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 @@ Date: Sat, 13 Mar 2021 18:30:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=90=8Eurl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdiet-ui/src/store/modules/recipes.js | 1 + .../recipesBuild/RecipesView/RecipesHeaderCom/index.vue | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js index dffa2921d..e03bd6c20 100644 --- a/stdiet-ui/src/store/modules/recipes.js +++ b/stdiet-ui/src/store/modules/recipes.js @@ -132,6 +132,7 @@ const actions = { recipesId, reviewStatus, temId: payload.temId, + name: payload.name, planId: payload.planId, startNum: startNumDay, endNum: endNumDay 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 096fe8bea..c18ce21fd 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue @@ -128,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, }); }, }); @@ -141,7 +145,8 @@ export default { this.updateStateData({ recipesData: [] }); }, handleOnTemplateClick() { - this.$refs.templateRef.showDialog(); + // this.$refs.templateRef.showDialog(); + console.log(this.$route.query); }, handleOnCopy(form) { this.loading = true; From 3056bc2b8496d32d0d34010ac558e2a8dafa7842 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Sat, 13 Mar 2021 19:25:44 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=97=85=E5=8F=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/custom/SysRecipesTemplateMapper.xml | 2 +- stdiet-ui/src/utils/healthyData.js | 15 +++++++++++++-- .../RecipesView/RecipesCom/EditableText/index.vue | 2 +- .../RecommendView/TemplateView/index.vue | 6 +++--- .../src/views/custom/recipesTemplate/index.vue | 8 ++++++-- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysRecipesTemplateMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysRecipesTemplateMapper.xml index 6a212f21b..dac9aa98a 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysRecipesTemplateMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysRecipesTemplateMapper.xml @@ -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 - and srt.name like concat('%', #{name}, '%') + and srt.name like concat('%', #{name}, '%') or srt.remark like concat('%', #{name}, '%') and srt.nutri_assis_id = #{nutriAssisId} and srt.nutritionist_id = #{nutritionistId} and srp.review_status = #{reviewStatus} diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index b917fc781..c171bb8e4 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -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" }, @@ -483,7 +483,9 @@ export function dealHealthy(customerHealthy) { customerHealthy.basicBMR += "千卡"; customerHealthy.notSportHeat += "千卡"; const lowRecProtein = customerHealthy.tall - 105; - customerHealthy.recProtein = `${lowRecProtein * 0.8} - ${lowRecProtein * 1.5}`; + customerHealthy.recProtein = `${(lowRecProtein * 0.8).toFixed(1)} - ${( + lowRecProtein * 1.5 + ).toFixed(1)}`; needAttrName.forEach(name => { if (customerHealthy.hasOwnProperty(name)) { @@ -540,6 +542,15 @@ 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("tall")) { customerHealthy.tall += "cm"; } diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/EditableText/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/EditableText/index.vue index 43501e00d..a1f8f1414 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/EditableText/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/EditableText/index.vue @@ -9,7 +9,7 @@ :step="5" :value="value" @blur="handleOnBlur" - @keydown.enter="handleEnterClick" + @keydown.enter.native="handleEnterClick" /> diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecommendView/TemplateView/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecommendView/TemplateView/index.vue index 4f2af9a4b..84d8d5c88 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecommendView/TemplateView/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecommendView/TemplateView/index.vue @@ -7,11 +7,11 @@
- + diff --git a/stdiet-ui/src/views/custom/recipesTemplate/index.vue b/stdiet-ui/src/views/custom/recipesTemplate/index.vue index f67c11f0b..e387c57c3 100644 --- a/stdiet-ui/src/views/custom/recipesTemplate/index.vue +++ b/stdiet-ui/src/views/custom/recipesTemplate/index.vue @@ -6,8 +6,12 @@ :inline="true" v-show="showSearch" > - - + + Date: Sat, 13 Mar 2021 20:00:18 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdiet-ui/src/utils/healthyData.js | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index c171bb8e4..ebe4e85e1 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -551,6 +551,59 @@ export function dealHealthy(customerHealthy) { }); 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.replaceAll(",", ","); + } + 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"; }