diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java index 31d881c9d..447cb6d86 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerServiceImpl.java @@ -154,6 +154,10 @@ public class SysCustomerServiceImpl implements ISysCustomerService { @Override public Map<String, Object> getPhysicalSignsById(Long id) { Map<String, Object> result = new HashMap<>(); + + SysCustomer customer = sysCustomerMapper.selectSysCustomerById(id); + result.put("customerInfo", customer); + String key = "customerHealthy"; result.put("type", 0); //查询健康评估信息 diff --git a/stdiet-ui/src/components/BodySignView/index.vue b/stdiet-ui/src/components/BodySignView/index.vue index baa172dea..1f379cf07 100644 --- a/stdiet-ui/src/components/BodySignView/index.vue +++ b/stdiet-ui/src/components/BodySignView/index.vue @@ -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> diff --git a/stdiet-ui/src/components/HealthyView/index.vue b/stdiet-ui/src/components/HealthyView/index.vue index 08195e6d8..b1db4cc37 100644 --- a/stdiet-ui/src/components/HealthyView/index.vue +++ b/stdiet-ui/src/components/HealthyView/index.vue @@ -22,7 +22,7 @@ @onConfirm="handleOnConfirm" /> <RemarkCom - v-if="dev" + v-if="dev && showRemark" title="营养师点评" :value.sync="data.recipesPlanRemark" @onConfirm="handleOnRemarkConfirm" @@ -76,6 +76,10 @@ export default { type: Boolean, default: false, }, + showRemark: { + type: Boolean, + default: false, + }, }, components: { "text-info": TextInfo, @@ -258,6 +262,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> diff --git a/stdiet-ui/src/store/modules/message.js b/stdiet-ui/src/store/modules/message.js index 5f61f0544..a15ff2c4e 100644 --- a/stdiet-ui/src/store/modules/message.js +++ b/stdiet-ui/src/store/modules/message.js @@ -1,6 +1,6 @@ import { - getCustomerPhysicalSignsByCusId, - getCustomer + getCustomerPhysicalSignsByCusId + // getCustomer } from "@/api/custom/customer"; import { dealHealthy } from "@/utils/healthyData"; import { @@ -34,8 +34,6 @@ const oriState = { healthyDataType: 0, avoidFoodIds: [], // - customerData: {}, - // planList: [], planListLoading: false }; @@ -130,7 +128,8 @@ const actions = { dispatch("fetchTopicDetailActions", { topicId: defTopic.topicId, id: defTopic.id, - uid: defTopic.uid + uid: defTopic.uid, + callback: payload.callback }); }, 100); mTopicList = result.rows; @@ -145,7 +144,6 @@ const actions = { const { healthyData, planList, - customerData, topicList, customerList } = state; @@ -158,11 +156,6 @@ const actions = { if (!planList.length || planList[0].cusId !== parseInt(uid)) { dispatch("getRecipesPlanActions", { cusId: uid }); } - // 客户档案 - if (customerData.id !== parseInt(uid)) { - dispatch("getCustomerFileActions", { cusId: uid }); - } - // const result = await fetchTopicDetail({ topicId, id }); if (result.code === 200) { // 设置已读 @@ -184,12 +177,6 @@ const actions = { }); } }, - async getCustomerFileActions({ commit }, payload) { - const result = await getCustomer(payload.cusId); - if (result.code === 200) { - commit("save", { customerData: result.data }); - } - }, async postTopicReplyActions( { commit, rootGetters, dispatch, state }, payload @@ -223,7 +210,7 @@ const actions = { const healthyDataResult = await getCustomerPhysicalSignsByCusId( payload.cusId ); - const newState = {}; + const newState = { healthyData: {}, avoidFoodIds: [] }; if (healthyDataResult.code === 200) { if (!healthyDataResult.data.customerHealthy) { // throw new Error("客户还没填写健康评估表"); @@ -236,6 +223,12 @@ const actions = { newState.avoidFoodIds = (newState.healthyData.avoidFood || []).map( obj => obj.id ); + newState.healthyData.dietitianName = + healthyDataResult.data.customerInfo.dietitianName; + newState.healthyData.assDietitianName = + healthyDataResult.data.customerInfo.assDietitianName; + newState.healthyData.afterDietitianName = + healthyDataResult.data.customerInfo.afterDietitianName; } } commit("save", { diff --git a/stdiet-ui/src/views/custom/message/messageBrowser/index.vue b/stdiet-ui/src/views/custom/message/messageBrowser/index.vue index 306e58c52..b4fa504ec 100644 --- a/stdiet-ui/src/views/custom/message/messageBrowser/index.vue +++ b/stdiet-ui/src/views/custom/message/messageBrowser/index.vue @@ -237,7 +237,12 @@ export default { this.replyTarget = ""; this.replyContent = ""; this.replyObj = {}; - this.fetchTopicListApi({ fromUid: data.uid }); + this.fetchTopicListApi({ + fromUid: data.uid, + callback: (msg) => { + this.$message.error(msg); + }, + }); } }, handleOnTopicClick(data) { diff --git a/stdiet-ui/src/views/custom/message/userInfo/index.vue b/stdiet-ui/src/views/custom/message/userInfo/index.vue index e7d69b176..f53cbf9cd 100644 --- a/stdiet-ui/src/views/custom/message/userInfo/index.vue +++ b/stdiet-ui/src/views/custom/message/userInfo/index.vue @@ -15,22 +15,6 @@ :data="healthyDataType === 1 ? healthyData : {}" v-show="healthyDataType === 1" /> - <div v-if="customerData.id" class="customer_service_info"> - <div class="info_item"> - <span>主任营养师:</span> - <span> - {{ customerData.dietitianName || "无" }} - </span> - </div> - <div class="info_item"> - <span>营养师助理:</span> - <span>{{ customerData.assDietitianName || "无" }}</span> - </div> - <div class="info_item"> - <span>售后营养师:</span> - <span>{{ customerData.afterDietitianName || "无" }}</span> - </div> - </div> </div> </el-tab-pane> <el-tab-pane label="食谱计划" name="plan"> @@ -69,12 +53,7 @@ export default { }, }, computed: { - ...mapState([ - "healthyData", - "healthyDataType", - "healthDataLoading", - "customerData", - ]), + ...mapState(["healthyData", "healthyDataType", "healthDataLoading"]), }, }; </script> diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue index 27bbb1bd3..a61fab174 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue @@ -10,11 +10,13 @@ <div class="content"> <HealthyView dev + showRemark :data="healthyDataType === 0 ? healthyData : {}" v-show="healthyDataType === 0" /> <BodySignView dev + showRemark :data="healthyDataType === 1 ? healthyData : {}" v-show="healthyDataType === 1" />