添加营养师评论功能

This commit is contained in:
huangdeliang
2021-06-29 18:40:39 +08:00
parent 36b479dd25
commit 9e837165d8
10 changed files with 108 additions and 30 deletions

View File

@ -4,7 +4,7 @@
placement="right"
trigger="click"
width="400"
title="备注"
:title="title"
@hide="handleOnHide"
>
<el-input
@ -15,7 +15,7 @@
maxlength="300"
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"
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",
@ -121,7 +128,7 @@ export default {
{ title: "过敏源", value: "allergen" },
],
},
{
{
title: "运动习惯评估",
content: [
{ title: "每周运动次数", value: "motionNum" },
@ -238,6 +245,18 @@ 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("修改成功");
}
});
},
},
};
</script>

View File

@ -49,7 +49,8 @@ const oriState = {
igdTypeOptions: [],
physicalSignsOptions: [],
//
curShortCutObj: {}
curShortCutObj: {},
recipesPlanRemark: ""
};
const mutations = {
@ -147,7 +148,8 @@ const actions = {
endNumDay,
recipesId,
cusId,
reviewStatus
reviewStatus,
remark
} = planResponse.data;
commit("updateStateData", {
cusId,
@ -157,7 +159,8 @@ const actions = {
name: payload.name,
planId: payload.planId,
startNum: startNumDay,
endNum: endNumDay
endNum: endNumDay,
recipesPlanRemark: remark
});
getDicts("cus_cus_unit").then(response => {
commit("updateStateData", { cusUnitOptions: response.data });
@ -237,7 +240,8 @@ const actions = {
commit("updateStateData", payload);
}
},
async getHealthyData({ commit }, payload) {
async getHealthyData({ commit, state }, payload) {
const { recipesPlanRemark } = state;
commit("updateStateData", { healthDataLoading: true });
const healthyDataResult = await getCustomerPhysicalSignsByCusId(
payload.cusId
@ -256,7 +260,10 @@ const actions = {
commit("updateStateData", {
healthDataLoading: false,
healthyDataType,
healthyData,
healthyData: {
...healthyData,
recipesPlanRemark
},
avoidFoodIds: (healthyData.avoidFood || []).map(obj => obj.id)
});
},
@ -555,7 +562,7 @@ const actions = {
id: new Date().getTime(),
name: tarDishes.name,
type: response.data.type.split(",").sort(),
className: response.data.className, //大类小类名称
className: response.data.className, //大类小类名称
data: tarDishes
}).then(() => {
window.postMessage(