This commit is contained in:
xiezhijun
2021-06-30 18:53:22 +08:00
18 changed files with 629 additions and 129 deletions

View File

@ -20,6 +20,12 @@
:value.sync="data.avoidFood"
@onConfirm="handleOnConfirm"
/>
<RemarkCom
v-if="dev && showRemark"
title="营养师点评"
:value.sync="data.recipesPlanRemark"
@onConfirm="handleOnRemarkConfirm"
/>
</div>
</template>
<script>
@ -39,6 +45,10 @@ export default {
type: Boolean,
default: false,
},
showRemark: {
type: Boolean,
default: false,
},
},
components: {
"text-info": TextInfo,
@ -115,6 +125,21 @@ export default {
});
},
},
watch: {
data(val, oldVal) {
if (
val &&
val.dietitianName &&
!this.basicInfo[3].some((obj) => obj.value === "dietitianName")
) {
this.basicInfo.splice(3, 0, [
{ title: "主营养师", value: "dietitianName" },
{ title: "营养师助理", value: "assDietitianName" },
{ title: "售后营养师", value: "afterDietitianName" },
]);
}
},
},
};
</script>
<style lang="scss" scoped>

View File

@ -4,7 +4,7 @@
placement="right"
trigger="click"
width="400"
title="备注"
:title="title"
@hide="handleOnHide"
>
<el-input
@ -12,10 +12,10 @@
v-model="nData"
rows="6"
placeholder="请输入备注信息"
maxlength="300"
maxlength="600"
show-word-limit
/>
<span slot="reference" class="trigger">备注 </span>
<span slot="reference" class="trigger">{{ title }}</span>
</el-popover>
<div class="content">
<span v-if="newLine">
@ -35,6 +35,10 @@ export default {
type: String,
default: "",
},
title: {
type: String,
default: "备注",
},
},
components: {},
data() {

View File

@ -21,6 +21,12 @@
:value.sync="data.avoidFood"
@onConfirm="handleOnConfirm"
/>
<RemarkCom
v-if="dev && showRemark"
title="营养师点评"
:value.sync="data.recipesPlanRemark"
@onConfirm="handleOnRemarkConfirm"
/>
</div>
<el-collapse>
<el-collapse-item
@ -57,6 +63,7 @@ import TextInfo from "@/components/TextInfo";
import ACFCom from "./ACFCom";
import RemarkCom from "./RemarkCom";
import { updateHealthy } from "@/api/custom/healthy";
import { updateRecipesPlan } from "@/api/custom/recipesPlan";
export default {
name: "HealthyView",
@ -69,6 +76,10 @@ export default {
type: Boolean,
default: false,
},
showRemark: {
type: Boolean,
default: false,
},
},
components: {
"text-info": TextInfo,
@ -121,7 +132,7 @@ export default {
{ title: "过敏源", value: "allergen" },
],
},
{
{
title: "运动习惯评估",
content: [
{ title: "每周运动次数", value: "motionNum" },
@ -238,6 +249,33 @@ export default {
}
});
},
handleOnRemarkConfirm(data) {
const { pathname } = window.location;
const recipesId = pathname.substring(pathname.lastIndexOf("/") + 1);
updateRecipesPlan({
id: recipesId,
...data,
}).then((res) => {
if (res.code === 200) {
this.$message.success("修改成功");
}
});
},
},
watch: {
data(val, oldVal) {
if (
val &&
val.dietitianName &&
!this.basicInfo[3].some((obj) => obj.value === "dietitianName")
) {
this.basicInfo.splice(3, 0, [
{ title: "主营养师", value: "dietitianName" },
{ title: "营养师助理", value: "assDietitianName" },
{ title: "售后营养师", value: "afterDietitianName" },
]);
}
},
},
};
</script>