From 4a9124647e8dc7b19596da7faaf802ffecff984d Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Wed, 23 Jun 2021 20:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E4=BD=93=E5=BE=81=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=EF=BC=8C=E7=B3=96=E5=B0=BF=E7=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/domain/SysCustomerHealthy.java | 2 + .../domain/SysCustomerHealthyExtended.java | 62 ++++ .../SysCustomerHealthyExtendedMapper.java | 61 ++++ .../impl/SysCustomerHealthyServiceImpl.java | 10 + .../SysCustomerHealthyExtendedMapper.xml | 91 ++++++ .../custom/SysCustomerHealthyMapper.xml | 22 +- .../src/components/HealthyForm/Form1.vue | 6 + .../src/components/HealthyForm/Form4.vue | 17 +- .../src/components/HealthyForm/Form8.vue | 30 +- .../components/HealthyForm/FormExtended.vue | 267 ++++++++++++++++++ .../components/PhysicalSignsDialog/index.vue | 144 +++++++++- stdiet-ui/src/utils/healthyData.js | 46 ++- .../custom/subhealthy/investigation/index.vue | 129 ++++++++- 13 files changed, 860 insertions(+), 27 deletions(-) create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthyExtended.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyExtendedMapper.java create mode 100644 stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyExtendedMapper.xml create mode 100644 stdiet-ui/src/components/HealthyForm/FormExtended.vue diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java index 0b4c09318..209c66e5c 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java @@ -446,4 +446,6 @@ public class SysCustomerHealthy extends BaseEntity private Long delFlag; private JSONArray avoidFood; + + private SysCustomerHealthyExtended healthyExtend; } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthyExtended.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthyExtended.java new file mode 100644 index 000000000..aceb2abb6 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthyExtended.java @@ -0,0 +1,62 @@ +package com.stdiet.custom.domain; + +import java.math.BigDecimal; + +import com.alibaba.fastjson.JSON; +import com.stdiet.common.annotation.Excel; +import com.stdiet.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * 客户健康信息补充对象 sys_customer_healthy_extended + * + * @author wonder + * @date 2021-06-21 + */ +@Data +public class SysCustomerHealthyExtended extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** healthy表id */ + @Excel(name = "healthy表id") + private Long healthyId; + + /** 腰围,厘米 */ + @Excel(name = "腰围,厘米") + private BigDecimal waist; + + /** 臀围,厘米 */ + @Excel(name = "臀围,厘米") + private BigDecimal hipline; + + /** 常吃水果信息:水果名称、水果数量 */ + @Excel(name = "常吃水果信息:水果名称、水果数量") + private String eatFruitsMessage; + + /** 长时间服用药物信息:药物类型、药物名称、用药量、用药时间 */ + @Excel(name = "长时间服用药物信息:药物类型、药物名称、用药量、用药时间") + private String longEatDrugMessage; + + /** 血糖相关信息 */ + @Excel(name = "血糖相关信息") + private String bloodSugarMessage; + + /** 郁抑状态评估 */ + @Excel(name = "郁抑状态评估") + private String depressedStateMessage; + + /** 血压相关信息 */ + @Excel(name = "血压相关信息") + private String bloodPressureMessage; + + /** 焦虑状态评估 */ + @Excel(name = "焦虑状态评估") + private String anxietyStateMessage; + + /** 删除标识 0未删除 1已删除 */ + private Long delFlag; +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyExtendedMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyExtendedMapper.java new file mode 100644 index 000000000..c7e8b0402 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyExtendedMapper.java @@ -0,0 +1,61 @@ +package com.stdiet.custom.mapper; + +import java.util.List; +import com.stdiet.custom.domain.SysCustomerHealthyExtended; + +/** + * 客户健康信息补充Mapper接口 + * + * @author wonder + * @date 2021-06-21 + */ +public interface SysCustomerHealthyExtendedMapper +{ + /** + * 查询客户健康信息补充 + * + * @param id 客户健康信息补充ID + * @return 客户健康信息补充 + */ + public SysCustomerHealthyExtended selectSysCustomerHealthyExtendedById(Long id); + + /** + * 查询客户健康信息补充列表 + * + * @param sysCustomerHealthyExtended 客户健康信息补充 + * @return 客户健康信息补充集合 + */ + public List selectSysCustomerHealthyExtendedList(SysCustomerHealthyExtended sysCustomerHealthyExtended); + + /** + * 新增客户健康信息补充 + * + * @param sysCustomerHealthyExtended 客户健康信息补充 + * @return 结果 + */ + public int insertSysCustomerHealthyExtended(SysCustomerHealthyExtended sysCustomerHealthyExtended); + + /** + * 修改客户健康信息补充 + * + * @param sysCustomerHealthyExtended 客户健康信息补充 + * @return 结果 + */ + public int updateSysCustomerHealthyExtended(SysCustomerHealthyExtended sysCustomerHealthyExtended); + + /** + * 删除客户健康信息补充 + * + * @param id 客户健康信息补充ID + * @return 结果 + */ + public int deleteSysCustomerHealthyExtendedById(Long id); + + /** + * 批量删除客户健康信息补充 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysCustomerHealthyExtendedByIds(Long[] ids); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java index 123a546d7..94704a4e6 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java @@ -11,9 +11,11 @@ import com.stdiet.common.utils.bean.ObjectUtils; import com.stdiet.common.utils.reflect.ReflectUtils; import com.stdiet.common.utils.sign.AesUtils; import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.domain.SysCustomerHealthyExtended; import com.stdiet.custom.domain.SysCustomerPhysicalSigns; import com.stdiet.custom.dto.request.HealthyDetailRequest; import com.stdiet.custom.dto.response.NutritionalCalories; +import com.stdiet.custom.mapper.SysCustomerHealthyExtendedMapper; import com.stdiet.custom.mapper.SysCustomerMapper; import com.stdiet.custom.service.ISysCustomerService; import com.stdiet.custom.utils.NutritionalUtils; @@ -39,6 +41,9 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService @Autowired private SysCustomerMapper sysCustomerMapper; + @Autowired + private SysCustomerHealthyExtendedMapper sysCustomerHealthyExtendedMapper; + public static final String reportDownFileNameFormat = "%s超重%s斤%s"; /** @@ -91,6 +96,11 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService //设置客户ID sysCustomerHealthy.setCustomerId(Long.parseLong(customerId)); int rows = sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy); + if(rows > 0 && sysCustomerHealthy.getId() != null){ + //添加扩展信息 + sysCustomerHealthy.getHealthyExtend().setHealthyId(sysCustomerHealthy.getId()); + rows = sysCustomerHealthyExtendedMapper.insertSysCustomerHealthyExtended(sysCustomerHealthy.getHealthyExtend()); + } return rows > 0 ? AjaxResult.success() : AjaxResult.error(); } diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyExtendedMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyExtendedMapper.xml new file mode 100644 index 000000000..472c1099e --- /dev/null +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyExtendedMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + select id, healthy_id, waist, hipline, eat_fruits_message, long_eat_drug_message, blood_sugar_message, depressed_state_message, blood_pressure_message, anxiety_state_message, del_flag from sys_customer_healthy_extended + + + + + + + + insert into sys_customer_healthy_extended + + healthy_id, + waist, + hipline, + eat_fruits_message, + long_eat_drug_message, + blood_sugar_message, + depressed_state_message, + blood_pressure_message, + anxiety_state_message, + del_flag, + + + #{healthyId}, + #{waist}, + #{hipline}, + #{eatFruitsMessage}, + #{longEatDrugMessage}, + #{bloodSugarMessage}, + #{depressedStateMessage}, + #{bloodPressureMessage}, + #{anxietyStateMessage}, + #{delFlag}, + + + + + update sys_customer_healthy_extended + + healthy_id = #{healthyId}, + waist = #{waist}, + hipline = #{hipline}, + eat_fruits_message = #{eatFruitsMessage}, + long_eat_drug_message = #{longEatDrugMessage}, + blood_sugar_message = #{bloodSugarMessage}, + depressed_state_message = #{depressedStateMessage}, + blood_pressure_message = #{bloodPressureMessage}, + anxiety_state_message = #{anxietyStateMessage}, + del_flag = #{delFlag}, + + where id = #{id} + + + + update sys_customer_healthy_extended set del_flag = 1 where id = #{id} + + + + update sys_customer_healthy_extended set del_flag = 1 where id in + + #{id} + + + + + \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml index 1a92618b6..fe07a1836 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -121,7 +121,7 @@ - + @@ -160,7 +160,7 @@ where sch.del_flag = 0 and sc.del_flag = 0 and sch.customer_id = #{customerId} order by sch.id desc limit 1 - + insert into sys_customer_healthy id, @@ -542,4 +542,22 @@ order by dict_sort asc + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stdiet-ui/src/components/HealthyForm/Form1.vue b/stdiet-ui/src/components/HealthyForm/Form1.vue index 6801e0958..165015ee8 100644 --- a/stdiet-ui/src/components/HealthyForm/Form1.vue +++ b/stdiet-ui/src/components/HealthyForm/Form1.vue @@ -23,6 +23,12 @@ + + + + + + {{item.name}} + + + + + + +
+ +
+
+

5、饮食习惯

@@ -145,7 +160,7 @@ export default { } }, created() { - + }, }; diff --git a/stdiet-ui/src/components/HealthyForm/Form8.vue b/stdiet-ui/src/components/HealthyForm/Form8.vue index 6c5d1b18d..57a822e76 100644 --- a/stdiet-ui/src/components/HealthyForm/Form8.vue +++ b/stdiet-ui/src/components/HealthyForm/Form8.vue @@ -88,14 +88,20 @@ - + {{item.name}} -
其他长期服用的药物 +
+
{{getDrugTypeName(item.type)}}新增
+
+ +
+
+
其他长期服用的药物(药物名称、用量、服用时间) 0){ + for(let i = 0 ; i < healthyData['longEatDrugClassifyArray'].length; i++){ + if(healthyData['longEatDrugClassifyArray'][i].value == type){ + //console.log(healthyData['longEatDrugClassifyArray'][i].name); + return healthyData['longEatDrugClassifyArray'][i].name; + } + } + }else{ + return ""; + } + }, + addNewDrugInput(type){ + this.$emit('addNewDrugInput', type); + } }, props: { form: { @@ -208,6 +229,9 @@ export default { this.getMoistureDictData(); this.getBloodDictData(); }, + computed:{ + + } }; diff --git a/stdiet-ui/src/components/HealthyForm/FormExtended.vue b/stdiet-ui/src/components/HealthyForm/FormExtended.vue new file mode 100644 index 000000000..6cf2f8190 --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/FormExtended.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue index 4f6161eeb..39cb7f0c9 100644 --- a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue @@ -173,6 +173,28 @@
+
+
+

+ {{ '高血糖问卷信息' }} +

+ +
+
+

+ {{ '高血压问卷信息' }} +

+ +
+
@@ -303,8 +325,8 @@ export default { [ ["创建时间", "客户姓名", "手机号"], ["调理项目", "性别", "年龄"], - ["身高(厘米)", "体重(斤)", "地域"], - ["BMI", "", ""], + ["身高(厘米)", "体重(斤)", "腰围(厘米)"], + ["臀围(厘米)", "地域", "BMI"], ], [ ["减脂经历", "减脂遇到的困难", "减脂是否反弹"], @@ -320,10 +342,10 @@ export default { ["晚餐时间", "每周吃夜宵次数", "夜宵通常吃的食物"], ["食物的冷热偏好", "食物的口味偏好", "平均每周吃生蔬菜几次"], ["每周吃生蔬菜的频次类型", "平均每天吃水果次数", "吃水果的时间段"], - ["平时吃水果的频次", "一餐吃几碗饭", "吃几成饱"], - ["吃饭速度", "饮食特点", "常吃的零食"], - ["有无服用营养保健品", "营养保健品品牌名", "营养保健品产品名"], - ["服用营养保健品频次", "忌口过敏食物", ""], + ["平时吃水果的频次", "经常吃的水果以及份量","一餐吃几碗饭"], + ["吃几成饱","吃饭速度", "饮食特点"], + ["常吃的零食","有无服用营养保健品", "营养保健品品牌名"], + ["营养保健品产品名","服用营养保健品频次", "忌口过敏食物"], ], [ ["每天的饮水量", "喜欢喝什么水", "喝水习惯"], @@ -348,14 +370,30 @@ export default { ["是否出现过过敏症状", "过敏症状", "过敏源"], ], [["体检报告(1)", "体检报告(2)", "体检报告(3)"]], + [ + ["餐前餐后血糖", "是否有规律测血糖", "测量血糖时间"], + ["近期血糖水平", "是否有低血糖反应", "是否有出现并发症"], + ["并发症情况", "存在症状", "近三个月体重是否有变化"], + ["你认为你是一个容易焦虑或紧张的人吗","最近一段时间,你是否比平时更感到焦虑或忐忑不安","是否有一些特殊场合或情景更容易使得你紧张、焦虑"], + ["你曾经有过惊恐发作吗.即突然发生的强烈不适感或心慌、眩晕、感到憋气或呼吸困难等症状","过去几周(或几个月)是否感觉到无精打采、伤感、或对生活的乐趣减少","除了不开心之外,是否比平时更加悲观或想哭"], + ["经常有早醒吗?(事实上不需那么早醒来)","近来是否经常想到活着没有意思",""] + ] + [ + ["餐前餐后血压", "是否有规律测血压", "测量血压时间"], + ["近期血压水平", "是否有低血压反应", "是否有出现并发症"], + ["并发症情况", "存在症状", "近三个月体重是否有变化"], + ["你认为你是一个容易焦虑或紧张的人吗","最近一段时间,你是否比平时更感到焦虑或忐忑不安","是否有一些特殊场合或情景更容易使得你紧张、焦虑"], + ["你曾经有过惊恐发作吗.即突然发生的强烈不适感或心慌、眩晕、感到憋气或呼吸困难等症状","过去几周(或几个月)是否感觉到无精打采、伤感、或对生活的乐趣减少","除了不开心之外,是否比平时更加悲观或想哭"], + ["经常有早醒吗?(事实上不需那么早醒来)","近来是否经常想到活着没有意思",""] + ] ], // 健康评估属性 healthyValueData: [ [ ["createTime", "name", "phone"], ["conditioningProject", "sex", "age"], - ["tall", "weight", "position"], - ["bmi", "", ""], + ["tall", "weight", "healthyExtend,waist"], + ["healthyExtend,hipline", "position", "bmi"], ], [ ["experience", "difficulty", "rebound"], @@ -371,10 +409,10 @@ export default { ["dinnerTime", "supperNum", "supperFood"], ["dietHotAndCold", "dietFlavor", "vegetablesNum"], ["vegetablesRateType", "fruitsNum", "fruitsTime"], - ["fruitsRate", "riceNum", "riceFull"], - ["eatingSpeed", "makeFoodType", "snacks"], - ["healthProductsFlag", "healthProductsBrand", "healthProductsName"], - ["healthProductsWeekRate", "dishesIngredient", ""], + ["fruitsRate", "healthyExtend,eatFruitsMessage", "riceNum"], + [ "riceFull","eatingSpeed", "makeFoodType"], + ["snacks","healthProductsFlag", "healthProductsBrand"], + ["healthProductsName","healthProductsWeekRate", "dishesIngredient"], ], [ ["waterNum", "waterType", "waterHabit"], @@ -399,6 +437,22 @@ export default { ["allergyFlag", "allergySituation", "allergen"], ], [["medicalReport_one", "medicalReport_two", "medicalReport_three"]], + [ + ["mealBloodSugar", "measureBloodSugarFlag", "measureBloodSugarTime"], + ["nearBloodSugar", "lowBloodSugarFlag", "complicationFlag"], + ["complication", "inferiorSymptomFlag", "weightChangeFlag"], + ["easyAnxiousFlag","upsetRecently","nervousOnSpecialOccasionsFlag"], + ["terrifiedFlag","listlessRecentlyFlag","cryRecentlyFlag"], + ["wakeUpEarlyRecentlyFlag","noFunLiving",""] + ], + [ + ["mealBloodPressure", "measureBloodPressureFlag", "measureBloodPressureTime"], + ["nearBloodPressure", "lowBloodPressureFlag", "complicationFlag"], + ["complication", "inferiorSymptomFlag", "weightChangeFlag"], + ["easyAnxiousFlag","upsetRecently","nervousOnSpecialOccasionsFlag"], + ["terrifiedFlag","listlessRecentlyFlag","cryRecentlyFlag"], + ["wakeUpEarlyRecentlyFlag","noFunLiving",""] + ] ], copyValue: "", detailHealthy: null, @@ -441,6 +495,12 @@ export default { getCustomerPhysicalSignsByCusId(this.data.id).then((res) => { this.showFlag = false; if (res.data.customerHealthy) { + if(res.data.type == 0){ + //处理healthyExtend扩展数据 + healthyData["needJSONFieldName"].forEach(function (item, index) { + res.data.customerHealthy.healthyExtend[item] = res.data.customerHealthy.healthyExtend[item] != null ? JSON.parse(res.data.customerHealthy.healthyExtend[item]) : null; + }); + } //判断是体征还是健康评估 this.dataType = res.data.type; this.healthyData = JSON.parse( @@ -500,6 +560,7 @@ export default { //对健康评估信息进行处理 getDataListByHealthyMessage(healthy) { let detailHealthy = this.dealHealthy(healthy); + console.log(detailHealthy.longEatDrugClassify); //性别 detailHealthy.sex = detailHealthy.sex == 0 ? "男" : detailHealthy.sex == 1 ? "女" : "未知"; @@ -670,6 +731,19 @@ export default { ? detailHealthy.otherLongEatDrugClassify : "") ); + if (detailHealthy.healthyExtend.longEatDrugMessage != null) { + let m = ""; + detailHealthy.healthyExtend.longEatDrugMessage.forEach((item,i) => { + let mm = ""; + if(item.drug != null && item.drug.length > 0){ + item.drug.forEach((it, j) => { + mm += (mm == "" ? "" : ",") + it.name + "/" + it.num + "/" + it.time; + }) + } + m += (m == "" ? "" : ",") + mm; + }); + detailHealthy.longEatDrugClassify += " 药物详情:" + m; + } detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无"; detailHealthy.allergen = this.trimComma( detailHealthy.allergen + @@ -729,17 +803,57 @@ export default { (detailHealthy.tall / 100) / (detailHealthy.tall / 100) ).toFixed(1); + //常吃水果以及份量 + let eatFruitsMessage = ""; + if(detailHealthy.healthyExtend.eatFruitsMessage != null && detailHealthy.healthyExtend.eatFruitsMessage.length > 0){ + detailHealthy.healthyExtend.eatFruitsMessage.forEach((item,index) => { + eatFruitsMessage += (eatFruitsMessage == "" ? "" : ", ") + item.name + "/" + item.num; + }); + } + detailHealthy.healthyExtend.eatFruitsMessage = eatFruitsMessage; + + detailHealthy.mealBloodSugar = "餐前血糖:"+(detailHealthy.healthyExtend.bloodSugarMessage.beforeMealBloodSugar == null ? "" : detailHealthy.healthyExtend.bloodSugarMessage.beforeMealBloodSugar == null)+", " + +"餐后两小时血糖:"+(detailHealthy.healthyExtend.bloodSugarMessage.afterMealBloodSugar == null ? "" : detailHealthy.healthyExtend.bloodSugarMessage.afterMealBloodSugar); + detailHealthy.measureBloodSugarFlag = detailHealthy.healthyExtend.bloodSugarMessage.measureBloodSugarFlag == 1 ? "是" : "否"; + detailHealthy.measureBloodSugarTime = detailHealthy.healthyExtend.bloodSugarMessage.measureBloodSugarTime; + detailHealthy.nearBloodSugar = detailHealthy.healthyExtend.bloodSugarMessage.nearBloodSugar; + detailHealthy.lowBloodSugarFlag = (detailHealthy.healthyExtend.bloodSugarMessage.lowBloodSugarFlag == 1 ? "是" : "否") + ", 出现时间:"+detailHealthy.healthyExtend.bloodSugarMessage.lowBloodSugarTime; + detailHealthy.complicationFlag = detailHealthy.healthyExtend.bloodSugarMessage.complicationFlag == 1 ? "是" : "否"; + detailHealthy.complication = detailHealthy.healthyExtend.bloodSugarMessage.complication; + detailHealthy.inferiorSymptomFlag = (detailHealthy.healthyExtend.bloodSugarMessage.inferiorSymptomFlag == 1 ? "是" : "否") + ", 具体症状:"+detailHealthy.healthyExtend.bloodSugarMessage.inferiorSymptom.join(","); + detailHealthy.weightChangeFlag = detailHealthy.healthyExtend.bloodSugarMessage.weightChangeFlag == 1 ? "是" : "否"; + + detailHealthy.mealBloodPressure = "餐前血糖:"+(detailHealthy.healthyExtend.bloodPressureMessage.beforeMealBloodPressure == null ? "" : detailHealthy.healthyExtend.bloodPressureMessage.beforeMealBloodPressure == null)+", " + +"餐后两小时血糖:"+(detailHealthy.healthyExtend.bloodPressureMessage.afterMealBloodPressure == null ? "" : detailHealthy.healthyExtend.bloodPressureMessage.afterMealBloodPressure); + detailHealthy.measureBloodPressureFlag = detailHealthy.healthyExtend.bloodPressureMessage.measureBloodPressureFlag == 1 ? "是" : "否"; + detailHealthy.measureBloodPressureTime = detailHealthy.healthyExtend.bloodPressureMessage.measureBloodPressureTime; + detailHealthy.nearBloodPressure = detailHealthy.healthyExtend.bloodPressureMessage.nearBloodPressure; + detailHealthy.lowBloodPressureFlag = (detailHealthy.healthyExtend.bloodPressureMessage.lowBloodPressureFlag == 1 ? "是" : "否") + ", 出现时间:"+detailHealthy.healthyExtend.bloodPressureMessage.lowBloodPressureTime; + detailHealthy.complicationFlag = detailHealthy.healthyExtend.bloodPressureMessage.complicationFlag == 1 ? "是" : "否"; + detailHealthy.complication = detailHealthy.healthyExtend.bloodPressureMessage.complication; + detailHealthy.inferiorSymptomFlag = (detailHealthy.healthyExtend.bloodPressureMessage.inferiorSymptomFlag == 1 ? "是" : "否") + ", 具体症状:"+detailHealthy.healthyExtend.bloodPressureMessage.inferiorSymptom.join(","); + detailHealthy.weightChangeFlag = detailHealthy.healthyExtend.bloodPressureMessage.weightChangeFlag == 1 ? "是" : "否"; + + detailHealthy.easyAnxiousFlag = detailHealthy.healthyExtend.anxietyStateMessage.easyAnxiousFlag == 1 ? "是" : "否"; + detailHealthy.upsetRecently = detailHealthy.healthyExtend.anxietyStateMessage.upsetRecently == 1 ? "是" : "否"; + detailHealthy.unervousOnSpecialOccasionsFlag = detailHealthy.healthyExtend.anxietyStateMessage.nervousOnSpecialOccasionsFlag == 1 ? "是" : "否"; + detailHealthy.terrifiedFlag = detailHealthy.healthyExtend.anxietyStateMessage.terrifiedFlag == 1 ? "是" : "否"; + detailHealthy.listlessRecentlyFlag = detailHealthy.healthyExtend.depressedStateMessage.listlessRecentlyFlag == 1 ? "是" : "否"; + detailHealthy.cryRecentlyFlag = detailHealthy.healthyExtend.depressedStateMessage.cryRecentlyFlag == 1 ? "是" : "否"; + detailHealthy.wakeUpEarlyRecentlyFlag = detailHealthy.healthyExtend.depressedStateMessage.wakeUpEarlyRecentlyFlag == 1 ? "是" : "否"; + detailHealthy.noFunLiving = detailHealthy.healthyExtend.depressedStateMessage.noFunLiving == 1 ? "是" : "否"; + this.detailHealthy = detailHealthy; for (let i = 0; i < this.healthyTitleData.length; i++) { let stepArray = []; for (let j = 0; j < this.healthyTitleData[i].length; j++) { stepArray[j] = { attr_name_one: this.healthyTitleData[i][j][0], - value_one: detailHealthy[this.healthyValueData[i][j][0]], + value_one: this.healthyValueData[i][j][0].indexOf(",") == -1 ? detailHealthy[this.healthyValueData[i][j][0]] : detailHealthy[this.healthyValueData[i][j][0].split(",")[0]][this.healthyValueData[i][j][0].split(",")[1]], attr_name_two: this.healthyTitleData[i][j][1], - value_two: detailHealthy[this.healthyValueData[i][j][1]], + value_two: this.healthyValueData[i][j][1].indexOf(",") == -1 ? detailHealthy[this.healthyValueData[i][j][1]] : detailHealthy[this.healthyValueData[i][j][1].split(",")[0]][this.healthyValueData[i][j][1].split(",")[1]], attr_name_three: this.healthyTitleData[i][j][2], - value_three: detailHealthy[this.healthyValueData[i][j][2]], + value_three: this.healthyValueData[i][j][2].indexOf(",") == -1 ? detailHealthy[this.healthyValueData[i][j][2]] : detailHealthy[this.healthyValueData[i][j][2].split(",")[0]][this.healthyValueData[i][j][2].split(",")[1]], }; } this.dataList[i] = stepArray; diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index 53905d723..7d61f253a 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -19,7 +19,9 @@ export const condimentArray = [ { name: "浓汤宝", value: "6" }, { name: "鸡粉", value: "7" }, { name: "花椒", value: "8" }, - { name: "辣椒油", value: "9" } + { name: "辣椒油", value: "9" }, + { name: "黄酒", value: "10" }, + { name: "料酒", value: "11" } ]; export const cookingStyleArray = [ @@ -97,6 +99,25 @@ export const fruitsRateArray = [ { name: "从不吃", value: "4" } ]; +export const eatFruitsArray = [ + { name: "梨", value: "梨" }, + { name: "苹果", value: "苹果" }, + { name: "香蕉", value: "香蕉" }, + { name: "榴莲", value: "榴莲" }, + { name: "橙子", value: "橙子" }, + { name: "西瓜", value: "西瓜" }, + { name: "桃子", value: "桃子" }, + { name: "葡萄", value: "葡萄" }, + { name: "李子", value: "李子" }, + { name: "哈密瓜", value: "哈密瓜"}, + { name: "香瓜", value: "香瓜" }, + { name: "荔枝", value: "荔枝" }, + { name: "杨梅", value: "杨梅" }, + { name: "菠萝", value: "菠萝" }, + { name: "草莓", value: "草莓" }, + { name: "龙眼", value: "龙眼" }, +]; + export const eatingSpeedArray = [ { name: "很快", value: "1" }, { name: "偏快", value: "2" }, @@ -298,6 +319,19 @@ export const drinkWineAmountUnitArray = ["两", "瓶", "毫升"]; export const smokeRateArray = ["每天抽烟", "烟龄", "已戒烟"]; export const smokeRateUnitArray = ["次", "年", "年"]; + +//并发症 +export const syndromeNameArray = [ + { name: "腰痛", value: "1" }, + { name: "四肢酸痛", value: "2" }, + { name: "手足蚁感", value: "3" }, + { name: "麻木", value: "4" }, + { name: "皮肤瘙痒", value: "5" }, + { name: "性欲减退", value: "6" }, + { name: "海男性勃起功能障碍", value: "7" }, + { name: "视力下降", value: "8" } +]; + //需要将数组转成字符串的属性名称,包含对象数组、字符串数组 export const arrayName = [ "condiment", @@ -471,6 +505,16 @@ const moduleObj = { moistureDateArray }; +//healthyExtend扩展信息中需要将对象转为json字符串或字符串转json的字段 +export const needJSONFieldName = [ + "eatFruitsMessage", + "longEatDrugMessage", + "bloodSugarMessage", + "bloodPressureMessage", + "anxietyStateMessage", + "depressedStateMessage" +]; + //健康信息处理,将数组转为字符串 export function dealHealthy(customerHealthy) { customerHealthy.bmi = ( diff --git a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue index 4798dfc6f..1e456ad9d 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -27,9 +27,10 @@ - + + { if (response.code === 200) { @@ -313,12 +378,27 @@ export default { this.submitFlag = false; }, nextStep(step) { + var reg = new RegExp(/^(\d+)(\.\d{1})?$/) ; if (!this.customerExistFlag) { this.$message.error("客户不存在"); return; } this.$refs.form.validate((valid) => { if (valid || step < 0) { + if(this.stepActive == 0){ + if((this.form.healthyExtend.waist != null && this.form.healthyExtend.waist.trim() != "")){ + if(!reg.test(this.form.healthyExtend.waist)){ + this.$message.error("腰围格式错误,整数或一位小数"); + return; + } + } + if((this.form.healthyExtend.hipline != null && this.form.healthyExtend.hipline.trim() != "")){ + if(!reg.test(this.form.healthyExtend.hipline)){ + this.$message.error("臀围格式错误,整数或一位小数"); + return; + } + } + } this.stepArray[this.stepActive] = false; this.stepActive = this.stepActive + step; this.stepArray[this.stepActive] = true; @@ -334,6 +414,15 @@ export default { goTop() { window.scroll(0, 0); }, + addNewDrugInput(type){ + let index = null; + this.form.healthyExtend.longEatDrugMessage.forEach((v, i) => { + if(v.type == type){ + index = i; + } + }); + this.form.healthyExtend.longEatDrugMessage[index].drug.push({'name':'','num':'','time':''}); + } }, created() { this.form.customerEncId = this.$route.params.id; @@ -342,6 +431,36 @@ export default { beforeCreate() { document.title = this.$route.meta.title; }, + watch:{ + 'form.healthyExtend.eatFruitsNameArray'(newArray, oldArray){ + oldArray = (oldArray == undefined || oldArray == null) ? [] : oldArray; + newArray = (newArray == undefined || newArray == null) ? [] : newArray; + if(newArray.length > oldArray.length){ + this.form.healthyExtend.eatFruitsMessage.push({'name': newArray[newArray.length-1], "num": ''}); + }else{ + let array = newArray.concat(oldArray).filter(function(v, i, arr) { + return arr.indexOf(v) === arr.lastIndexOf(v); + }); + this.form.healthyExtend.eatFruitsMessage = this.form.healthyExtend.eatFruitsMessage.filter(function(v, i, arr) { + return array.indexOf(v.name) == -1; + }); + } + }, + 'form.longEatDrugClassify'(newArray, oldArray){ + oldArray = (oldArray == undefined || oldArray == null) ? [] : oldArray; + newArray = (newArray == undefined || newArray == null) ? [] : newArray; + if(newArray.length > oldArray.length){ + this.form.healthyExtend.longEatDrugMessage.push({'type': newArray[newArray.length-1], 'drug': [{'name':'','num':'','time':''}]}); + }else{ + let array = newArray.concat(oldArray).filter(function(v, i, arr) { + return arr.indexOf(v) === arr.lastIndexOf(v); + }); + this.form.healthyExtend.longEatDrugMessage = this.form.healthyExtend.longEatDrugMessage.filter(function(v, i, arr) { + return array.indexOf(v.name) == -1; + }); + } + } + } };