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<SysCustomerHealthyExtended> 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 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.stdiet.custom.mapper.SysCustomerHealthyExtendedMapper"> + + <resultMap type="SysCustomerHealthyExtended" id="SysCustomerHealthyExtendedResult"> + <result property="id" column="id" /> + <result property="healthyId" column="healthy_id" /> + <result property="waist" column="waist" /> + <result property="hipline" column="hipline" /> + <result property="eatFruitsMessage" column="eat_fruits_message" /> + <result property="longEatDrugMessage" column="long_eat_drug_message" /> + <result property="bloodSugarMessage" column="blood_sugar_message" /> + <result property="depressedStateMessage" column="depressed_state_message" /> + <result property="bloodPressureMessage" column="blood_pressure_message" /> + <result property="anxietyStateMessage" column="anxiety_state_message" /> + <result property="delFlag" column="del_flag" /> + </resultMap> + + <sql id="selectSysCustomerHealthyExtendedVo"> + 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 + </sql> + + <select id="selectSysCustomerHealthyExtendedList" parameterType="SysCustomerHealthyExtended" resultMap="SysCustomerHealthyExtendedResult"> + <include refid="selectSysCustomerHealthyExtendedVo"/> where del_flag = 0 + </select> + + <select id="selectSysCustomerHealthyExtendedById" parameterType="Long" resultMap="SysCustomerHealthyExtendedResult"> + <include refid="selectSysCustomerHealthyExtendedVo"/> + where id = #{id} and del_flag = 0 + </select> + + <insert id="insertSysCustomerHealthyExtended" parameterType="SysCustomerHealthyExtended" useGeneratedKeys="true" keyProperty="id"> + insert into sys_customer_healthy_extended + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="healthyId != null">healthy_id,</if> + <if test="waist != null">waist,</if> + <if test="hipline != null">hipline,</if> + <if test="eatFruitsMessage != null">eat_fruits_message,</if> + <if test="longEatDrugMessage != null">long_eat_drug_message,</if> + <if test="bloodSugarMessage != null">blood_sugar_message,</if> + <if test="depressedStateMessage != null">depressed_state_message,</if> + <if test="bloodPressureMessage != null">blood_pressure_message,</if> + <if test="anxietyStateMessage != null">anxiety_state_message,</if> + <if test="delFlag != null">del_flag,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="healthyId != null">#{healthyId},</if> + <if test="waist != null">#{waist},</if> + <if test="hipline != null">#{hipline},</if> + <if test="eatFruitsMessage != null">#{eatFruitsMessage},</if> + <if test="longEatDrugMessage != null">#{longEatDrugMessage},</if> + <if test="bloodSugarMessage != null">#{bloodSugarMessage},</if> + <if test="depressedStateMessage != null">#{depressedStateMessage},</if> + <if test="bloodPressureMessage != null">#{bloodPressureMessage},</if> + <if test="anxietyStateMessage != null">#{anxietyStateMessage},</if> + <if test="delFlag != null">#{delFlag},</if> + </trim> + </insert> + + <update id="updateSysCustomerHealthyExtended" parameterType="SysCustomerHealthyExtended"> + update sys_customer_healthy_extended + <trim prefix="SET" suffixOverrides=","> + <if test="healthyId != null">healthy_id = #{healthyId},</if> + <if test="waist != null">waist = #{waist},</if> + <if test="hipline != null">hipline = #{hipline},</if> + <if test="eatFruitsMessage != null">eat_fruits_message = #{eatFruitsMessage},</if> + <if test="longEatDrugMessage != null">long_eat_drug_message = #{longEatDrugMessage},</if> + <if test="bloodSugarMessage != null">blood_sugar_message = #{bloodSugarMessage},</if> + <if test="depressedStateMessage != null">depressed_state_message = #{depressedStateMessage},</if> + <if test="bloodPressureMessage != null">blood_pressure_message = #{bloodPressureMessage},</if> + <if test="anxietyStateMessage != null">anxiety_state_message = #{anxietyStateMessage},</if> + <if test="delFlag != null">del_flag = #{delFlag},</if> + </trim> + where id = #{id} + </update> + + <update id="deleteSysCustomerHealthyExtendedById" parameterType="Long"> + update sys_customer_healthy_extended set del_flag = 1 where id = #{id} + </update> + + <update id="deleteSysCustomerHealthyExtendedByIds" parameterType="String"> + update sys_customer_healthy_extended set del_flag = 1 where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </update> + + +</mapper> \ 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 @@ <result property="avoidFood" column="avoid_food" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler" /> <!-- column是传的参数, select是调用的查询 --> <association property="signList" column="physical_signs_id" select="getSignByIds"/> - + <association property="healthyExtend" column="id" select="getHealthyExtendedByHealthyId"></association> </resultMap> <sql id="selectSysCustomerHealthyVo"> @@ -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 </select> - <insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy"> + <insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy" useGeneratedKeys="true" keyProperty="id"> insert into sys_customer_healthy <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> @@ -542,4 +542,22 @@ order by dict_sort asc </select> + <resultMap type="SysCustomerHealthyExtended" id="HealthyExtendedResult"> + <result property="id" column="id" /> + <result property="healthyId" column="healthy_id" /> + <result property="waist" column="waist" /> + <result property="hipline" column="hipline" /> + <result property="eatFruitsMessage" column="eat_fruits_message" /> + <result property="longEatDrugMessage" column="long_eat_drug_message" /> + <result property="bloodSugarMessage" column="blood_sugar_message" /> + <result property="depressedStateMessage" column="depressed_state_message" /> + <result property="bloodPressureMessage" column="blood_pressure_message" /> + <result property="anxietyStateMessage" column="anxiety_state_message" /> + <result property="delFlag" column="del_flag" /> + </resultMap> + + <select id="getHealthyExtendedByHealthyId" parameterType="Long" resultMap="HealthyExtendedResult"> + select waist, hipline, eat_fruits_message, long_eat_drug_message, blood_sugar_message, depressed_state_message, blood_pressure_message, anxiety_state_message from sys_customer_healthy_extended where del_flag = 0 and healthy_id = #{id} limit 1 + </select> + </mapper> \ 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 @@ <el-form-item label="体重(斤)" prop="weight" > <el-input v-model="form.weight" placeholder="请输入体重(可保留一位小数)" autocomplete="off" ></el-input> </el-form-item> + <el-form-item label="腰围(厘米)" prop="waist" > + <el-input v-model="form.healthyExtend.waist" placeholder="请输入腰围(可保留一位小数)" autocomplete="off" ></el-input> + </el-form-item> + <el-form-item label="臀围(厘米)" prop="hipline" > + <el-input v-model="form.healthyExtend.hipline" placeholder="请输入臀围(可保留一位小数)" autocomplete="off" ></el-input> + </el-form-item> <el-form-item label="调理项目" prop="conditioningProjectId"> <el-select v-model="form.conditioningProjectId" filterable clearable placeholder="请选择"> <el-option diff --git a/stdiet-ui/src/components/HealthyForm/Form4.vue b/stdiet-ui/src/components/HealthyForm/Form4.vue index c4f79a00f..ed5fb2c8c 100644 --- a/stdiet-ui/src/components/HealthyForm/Form4.vue +++ b/stdiet-ui/src/components/HealthyForm/Form4.vue @@ -65,6 +65,21 @@ <el-radio v-for="(item,index) in healthyData['fruitsRateArray']" :label="item.value" :key="index">{{item.name}}</el-radio> </el-radio-group> </el-form-item> + + <el-form-item label="(5) 常吃什么水果以及对应份量" prop="eatFruitsNameArray" class="margin-left"> + <el-select v-model="form.healthyExtend.eatFruitsNameArray" multiple filterable allow-create default-first-option placeholder="请选择水果种类(可手动输入再选择)" style="width:90%"> + <el-option + v-for="item in healthyData['eatFruitsArray']" + :key="item.value" + :label="item.name" + :value="item.value"> + </el-option> + </el-select> + <div style="margin-top:10px" v-for="item in form.healthyExtend.eatFruitsMessage" :key="item.name"> + <el-input v-model="item.name" :disabled="true" placeholder="水果名称" style="width:37%"></el-input><el-input style="width:50%;margin-left:3%;" v-model="item.num" placeholder="份量描述"></el-input> + </div> + </el-form-item> + <p class="p_title_2">5、饮食习惯</p> <el-form-item label="(1) 一餐吃几碗饭,几成饱" prop="riceNum" class="margin-left"> <div> @@ -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 @@ <el-radio :label="1" key="2">是</el-radio> </el-radio-group> </el-form-item> - <el-form-item label="(2) 长期服用药物有(可多选)" prop="longEatDrugClassify" class="margin-left"> + <el-form-item label="(2) 长期服用药物以及对应药物信息(可多选)" prop="longEatDrugClassify" class="margin-left"> <el-checkbox-group v-model="form.longEatDrugClassify"> <el-checkbox v-for="(item, index) in healthyData['longEatDrugClassifyArray']" :key="index" :label="item.value">{{item.name}}</el-checkbox> </el-checkbox-group> - <div><span>其他长期服用的药物</span> + <div style="margin-top:2px" v-for="item in form.healthyExtend.longEatDrugMessage" :key="item.type"> + <div><span>{{getDrugTypeName(item.type)}}</span><el-button type="text" size="normal" style="margin-left:5px" @click="addNewDrugInput(item.type)">新增</el-button></div> + <div v-for="(it,index) in item.drug" :key="index" :style="index == 0 ? '' : 'margin-top:10px'"> + <el-input placeholder="药物名称" v-model="it.name" style="width:33%"></el-input><el-input style="width:30%;margin-left:3%;" v-model="it.num" placeholder="用量"></el-input><el-input style="width:30%;margin-left:3%;" placeholder="服用时间" v-model="it.time"></el-input> + </div> + </div> + <div style="margin-top:10px"><span>其他长期服用的药物(药物名称、用量、服用时间)</span> <el-input type="textarea" - placeholder="请输入其他药物" + placeholder="请输入其他药物名称、用量、服用时间" v-model="form.otherLongEatDrugClassify" maxlength="200" show-word-limit @@ -191,6 +197,21 @@ export default { }); } }, + getDrugTypeName(type){ + if(healthyData['longEatDrugClassifyArray'] && healthyData['longEatDrugClassifyArray'].length > 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:{ + + } }; </script> 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 @@ +<template> + <div> + <p class="p_title_1">{{projectName[form.conditioningProjectId+'']}}信息调查</p> + <!--高血糖--> + <div v-show="form.conditioningProjectId == 6 || form.conditioningProjectId == 5"> + <div v-show="form.conditioningProjectId == 6"> + <p class="p_title_2">1、餐前餐后血糖</p> + <div style="margin-top:10px"> + <div class="margin-left"><span>餐前:</span><el-input placeholder="输入血糖数值" v-model="form.healthyExtend.bloodSugarMessage.beforeMealBloodSugar" maxlength="100" style="width:50%"></el-input><span class="margin-left">mmol/L</span></div> + <div class="margin-left" style="margin-top:8px;"><span>餐后两小时:</span><el-input style="width:50%;" v-model="form.healthyExtend.bloodSugarMessage.afterMealBloodSugar" maxlength="100" placeholder="输入血糖数值"></el-input><span class="margin-left">mmol/L</span></div> + </div> + <p class="p_title_2">2、血糖水平以及测量时间</p> + <el-form-item :label="'(1) 是否有规律测血糖'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodSugarMessage.measureBloodSugarFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>测量时间 </span><el-input v-model="form.healthyExtend.bloodSugarMessage.measureBloodSugarTime" placeholder="请描述血糖测量时间" /></div> + <div><span>近期血糖水平</span> + <el-input type="textarea" + v-model="form.healthyExtend.bloodSugarMessage.nearBloodSugar" + placeholder="请描述下近期血糖水平" + maxlength="200" + show-word-limit + rows="3" + ></el-input> + </div> + </el-form-item> + <el-form-item :label="'(2) 是否有低血糖反应'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodSugarMessage.lowBloodSugarFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>低血糖反应出现时间 </span><el-input v-model="form.healthyExtend.bloodSugarMessage.lowBloodSugarTime" maxlength="100" placeholder="请描述低血糖出现时间" /></div> + </el-form-item> + <el-form-item :label="'(3) 是否有出现并发症'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodSugarMessage.complicationFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>并发症情况 </span> + <el-input type="textarea" + v-model="form.healthyExtend.bloodSugarMessage.complication" + placeholder="请描述下并发症情况" + maxlength="200" + show-word-limit + rows="3" + ></el-input> + </div> + </el-form-item> + <el-form-item :label="'(4) 目前是否存在下方症状'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodSugarMessage.inferiorSymptomFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>若存在请选择对应症状</span> + <el-checkbox-group v-model="form.healthyExtend.bloodSugarMessage.inferiorSymptom"> + <el-checkbox v-for="(item,index) in healthyData['syndromeNameArray']" :label="item.value" :key="index">{{ item.name }}</el-checkbox> + </el-checkbox-group> + + </div> + </el-form-item> + <p class="p_title_2">2、体重变化情况</p> + <el-form-item :label="'(1) 近三个月体重是否有变化'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodSugarMessage.weightChangeFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + </div> + + <div v-show="form.conditioningProjectId == 5"> + <p class="p_title_2">1、餐前餐后血压</p> + <div style="margin-top:10px"> + <div class="margin-left"><span>餐前:</span><el-input placeholder="输入血压数值" maxlength="100" v-model="form.healthyExtend.bloodPressureMessage.beforeMealBloodPressure" style="width:50%"></el-input><span class="margin-left">mmHg</span></div> + <div class="margin-left" style="margin-top:8px;"><span>餐后两小时:</span><el-input style="width:50%;" maxlength="100" v-model="form.healthyExtend.bloodPressureMessage.afterMealBloodPressure" placeholder="输入血压数值"></el-input><span class="margin-left">mmHg</span></div> + </div> + <p class="p_title_2">2、血压水平以及测量时间</p> + <el-form-item :label="'(1) 是否有规律测血压'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodPressureMessage.measureBloodPressureFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>测量时间 </span><el-input maxlength="100" v-model="form.healthyExtend.bloodPressureMessage.measureBloodPressureTime" placeholder="请描述血压测量时间" /></div> + <div><span>近期血压水平</span> + <el-input type="textarea" + v-model="form.healthyExtend.bloodPressureMessage.nearBloodPressure" + placeholder="请描述下近期血压水平" + maxlength="200" + show-word-limit + rows="3" + ></el-input> + </div> + </el-form-item> + <el-form-item :label="'(2) 是否有低血压反应'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodPressureMessage.lowBloodPressureFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>低血压反应出现时间 </span><el-input maxlength="100" v-model="form.healthyExtend.bloodPressureMessage.lowBloodPressureTime" placeholder="请描述低血压出现时间" /></div> + </el-form-item> + <el-form-item :label="'(3) 是否有出现并发症'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodPressureMessage.complicationFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>并发症情况 </span> + <el-input type="textarea" + v-model="form.healthyExtend.bloodPressureMessage.complication" + placeholder="请描述下并发症情况" + maxlength="200" + show-word-limit + rows="3" + ></el-input> + </div> + </el-form-item> + <el-form-item :label="'(4) 目前是否存在下方症状'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodPressureMessage.inferiorSymptomFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + <div style="margin-top:8px;"><span>若存在请选择对应症状</span> + <el-checkbox-group v-model="form.healthyExtend.bloodPressureMessage.inferiorSymptom"> + <el-checkbox v-for="(item,index) in healthyData['syndromeNameArray']" :label="item.name" :key="index">{{ item.name }}</el-checkbox> + </el-checkbox-group> + + </div> + </el-form-item> + <p class="p_title_2">2、体重变化情况</p> + <el-form-item :label="'(1) 近三个月体重是否有变化'" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.bloodPressureMessage.weightChangeFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + </div> + + <div> + <p class="p_title_2">3、焦虑状态评估</p> + <el-form-item label="(1) 你认为你是一个容易焦虑或紧张的人吗?" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.anxietyStateMessage.easyAnxiousFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="(2) 最近一段时间,你是否比平时更感到焦虑或忐忑不安?" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.anxietyStateMessage.upsetRecently"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="(3) 是否有一些特殊场合或情景更容易使得你紧张、焦虑?" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.anxietyStateMessage.nervousOnSpecialOccasionsFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="(4) 你曾经有过惊恐发作吗.即突然发生的强烈不适感或心慌、眩晕、感到憋气或呼吸困难等症状?" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.anxietyStateMessage.terrifiedFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <p class="p_title_2">4、郁抑状态评估</p> + <el-form-item label="(1) 过去几周(或几个月)是否感觉到无精打采、伤感、或对生活的乐趣减少?" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.depressedStateMessage.listlessRecentlyFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="(2) 除了不开心之外,是否比平时更加悲观或想哭?" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.depressedStateMessage.cryRecentlyFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="(3) 经常有早醒吗?(事实上不需那么早醒来)" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.depressedStateMessage.wakeUpEarlyRecentlyFlag"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="(4) 近来是否经常想到活着没有意思" class="margin-left"> + <el-radio-group v-model="form.healthyExtend.depressedStateMessage.noFunLiving"> + <el-radio :label="1" >是</el-radio> + <el-radio :label="0" >否</el-radio> + </el-radio-group> + </el-form-item> + </div> + </div> + </div> +</template> +<script> +import * as healthyData from "@/utils/healthyData"; +export default { + name: "FormExtended", + components: { + }, + data() { + return { + healthyData:healthyData, + projectName:{'0':'减脂','5':'高血压','6':'高血糖'} + }; + }, + methods: { + + }, + props: { + form: { + type: Object, + default: null + } + }, + created() { + + }, + computed:{ + + } + +}; +</script> + +<style scoped> + + .el-form-item { + margin-bottom: 8px; + } + + .p_title_1{ + font-size: 18px; + font-weight: bold; + margin-top: 30px; + } + .p_title_2{ + font-size: 16px; + font-weight: bold; + margin-top: 30px; + } + .p_title_3{ + font-size: 14px; + font-weight: bold; + margin-top: 30px; + } + .margin-left{ + margin-left: 14px; + } + .el-input__inner{ + width: 30%; + } + .margin-top-10{ + margin-top: 10px; + } + .width-50-left-8-right-5{ + width:50%; + margin-left: 8px; + margin-right: 5px; + } + .width-70-left-8-right-5{ + width:70%; + margin-left: 8px; + margin-right: 5px; + } + + +</style> + 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 @@ </el-table> </div> </div> + <div + v-for="(item, index) in dataList.slice(10, 12)" + style="margin-bottom: 50px" + :key="index" + > + <div v-if="index==0"> + <p class="p_title_1" style="margin-top: 5px"> + {{ '高血糖问卷信息' }} + </p> + <table-detail-message + :data="item" + ></table-detail-message> + </div> + <div v-if="index==1"> + <p class="p_title_1" style="margin-top: 5px"> + {{ '高血压问卷信息' }} + </p> + <table-detail-message + :data="item" + ></table-detail-message> + </div> + </div> </div> </div> <!-- 客户体征 --> @@ -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 @@ <healthy-form5 v-show="stepArray[4]" :form.sync="form"></healthy-form5> <healthy-form6 v-show="stepArray[5]" :form.sync="form"></healthy-form6> <healthy-form7 v-show="stepArray[6]" :form.sync="form"></healthy-form7> - <healthy-form8 v-show="stepArray[7]" :form.sync="form"></healthy-form8> + <healthy-form8 v-show="stepArray[7]" :form.sync="form" @addNewDrugInput="addNewDrugInput"></healthy-form8> + <healthy-extended v-show="stepArray[8]" :form.sync="form"></healthy-extended> <healthy-form9 - v-show="stepArray[8]" + v-show="stepArray[9]" ref="fileForm" @addOrEditHealthy="addCustomerHealthy()" :form.sync="form" @@ -77,6 +78,7 @@ import Form6 from "@/components/HealthyForm/Form6"; import Form7 from "@/components/HealthyForm/Form7"; import Form8 from "@/components/HealthyForm/Form8"; import Form9 from "@/components/HealthyForm/Form9"; +import FormExtended from "@/components/HealthyForm/FormExtended"; export default { name: "index", data() { @@ -86,7 +88,7 @@ export default { healthyData: healthyData, logo, submitFlag: false, - stepArray: [true, false, false, false, false, false, false, false, false], + stepArray: [true, false, false, false, false, false, false, false, false, false], stepActive: 0, form: { customerEncId: null, @@ -195,6 +197,63 @@ export default { crux: 1, dishesIngredient: null, makeFoodType: 3, + + healthyExtend:{ + //腰围 + waist: null, + //臀围 + hipline: null, + //常吃水果名称,[''] + eatFruitsNameArray:[], + //常吃水果json数组.[{'name':'苹果', "num": '200克'}, {'name':'西瓜','num': '两个'}] + eatFruitsMessage:[], + //长期服用药物JSON数组, [{'type': 1, 'drug':[{'name':'降压药1','num':'每天三粒','time':'早中晚'}]}] + longEatDrugMessage:[], + //高血糖评估 + bloodSugarMessage: { + "beforeMealBloodSugar": null, + "afterMealBloodSugar": null, + "measureBloodSugarFlag": 0, + "measureBloodSugarTime": null, + "nearBloodSugar": null, + "lowBloodSugarFlag": 0, + "lowBloodSugarTime": null, + "complicationFlag": 0, + "complication": null, + "inferiorSymptomFlag": 0, + "inferiorSymptom": [], + "weightChangeFlag": 0 + }, + //高血压评估 + bloodPressureMessage:{ + "beforeMealBloodPressure": null, + "afterMealBloodPressure": null, + "measureBloodPressureFlag": 0, + "measureBloodPressureTime": null, + "nearBloodPressure": null, + "lowBloodPressureFlag": 0, + "lowBloodPressureTime": null, + "complicationFlag": 0, + "complication": null, + "inferiorSymptomFlag": 0, + "inferiorSymptom": [], + "weightChangeFlag": 0 + }, + //焦虑情绪评估 + anxietyStateMessage:{ + "easyAnxiousFlag": 0, + "upsetRecently": 0, + "nervousOnSpecialOccasionsFlag": 0, + "terrifiedFlag":0 + }, + //郁抑情绪评估 + depressedStateMessage:{ + "listlessRecentlyFlag": 0, + "cryRecentlyFlag":0, + "wakeUpEarlyRecentlyFlag":0, + "noFunLiving":0 + } + } }, timer: null, rules: { @@ -245,6 +304,7 @@ export default { "healthy-form7": Form7, "healthy-form8": Form8, "healthy-form9": Form9, + 'healthy-extended':FormExtended }, methods: { //根据用户ID获取用户基本信息(手机号、姓名) @@ -291,9 +351,14 @@ export default { //数据处理 let cusMessage = Object.assign({}, this.form); this.healthyData["arrayName"].forEach(function (item, index) { - cusMessage[item] = - cusMessage[item] != null ? cusMessage[item].join(",") : null; + cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null; }); + let cusMessageExtended = Object.assign({}, this.form.healthyExtend); + //处理healthyExtend扩展数据 + this.healthyData["needJSONFieldName"].forEach(function (item, index) { + cusMessageExtended[item] = cusMessageExtended[item] != null ? JSON.stringify(cusMessageExtended[item]) : null; + }); + cusMessage.healthyExtend = cusMessageExtended; addCustomerHealthy(cusMessage) .then((response) => { 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; + }); + } + } + } }; </script>