From c4fe017d4de6944d66f6c66ffe27089079919211 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Sat, 23 Jan 2021 22:11:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E3=80=81=E8=A1=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/SysCustomerHealthyController.java | 103 ++ .../custom/domain/SysCustomerHealthy.java | 1244 +++++++++++++++++ .../mapper/SysCustomerHealthyMapper.java | 61 + .../service/ISysCustomerHealthyService.java | 61 + .../impl/SysCustomerHealthyServiceImpl.java | 96 ++ .../custom/SysCustomerHealthyMapper.xml | 415 ++++++ .../custom/subhealthy/investigation/index.vue | 545 +++++--- 7 files changed, 2325 insertions(+), 200 deletions(-) create mode 100644 stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java create mode 100644 stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java new file mode 100644 index 000000000..b61f9e02f --- /dev/null +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java @@ -0,0 +1,103 @@ +package com.stdiet.custom.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.stdiet.common.annotation.Log; +import com.stdiet.common.core.controller.BaseController; +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.common.enums.BusinessType; +import com.stdiet.custom.domain.SysCustomerHealthy; +import com.stdiet.custom.service.ISysCustomerHealthyService; +import com.stdiet.common.utils.poi.ExcelUtil; +import com.stdiet.common.core.page.TableDataInfo; + +/** + * 客户健康Controller + * + * @author xzj + * @date 2021-01-23 + */ +@RestController +@RequestMapping("/customer/healthy") +public class SysCustomerHealthyController extends BaseController +{ + @Autowired + private ISysCustomerHealthyService sysCustomerHealthyService; + + /** + * 查询客户健康列表 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:list')") + @GetMapping("/list") + public TableDataInfo list(SysCustomerHealthy sysCustomerHealthy) + { + startPage(); + List<SysCustomerHealthy> list = sysCustomerHealthyService.selectSysCustomerHealthyList(sysCustomerHealthy); + return getDataTable(list); + } + + /** + * 导出客户健康列表 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:export')") + @Log(title = "客户健康", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysCustomerHealthy sysCustomerHealthy) + { + List<SysCustomerHealthy> list = sysCustomerHealthyService.selectSysCustomerHealthyList(sysCustomerHealthy); + ExcelUtil<SysCustomerHealthy> util = new ExcelUtil<SysCustomerHealthy>(SysCustomerHealthy.class); + return util.exportExcel(list, "healthy"); + } + + /** + * 获取客户健康详细信息 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(sysCustomerHealthyService.selectSysCustomerHealthyById(id)); + } + + /** + * 新增客户健康 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:add')") + @Log(title = "客户健康", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy) + { + return toAjax(sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy)); + } + + /** + * 修改客户健康 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:edit')") + @Log(title = "客户健康", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy) + { + return toAjax(sysCustomerHealthyService.updateSysCustomerHealthy(sysCustomerHealthy)); + } + + /** + * 删除客户健康 + */ + @PreAuthorize("@ss.hasPermi('customer:healthy:remove')") + @Log(title = "客户健康", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysCustomerHealthyService.deleteSysCustomerHealthyByIds(ids)); + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..b8e32cfcd --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerHealthy.java @@ -0,0 +1,1244 @@ +package com.stdiet.custom.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.stdiet.common.annotation.Excel; +import com.stdiet.common.core.domain.BaseEntity; + +/** + * 客户健康对象 sys_customer_healthy + * + * @author xzj + * @date 2021-01-23 + */ +public class SysCustomerHealthy extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 客户ID */ + @Excel(name = "客户ID") + private Long customerId; + + /** 调理项目id */ + @Excel(name = "调理项目id") + private Long conditioningProjectId; + + /** 0男 1女 2未知,默认2 */ + @Excel(name = "0男 1女 2未知,默认2") + private Long sex; + + /** 年龄 */ + @Excel(name = "年龄") + private Long age; + + /** 调味品种类,使用 , 隔开 */ + @Excel(name = "调味品种类,使用 , 隔开") + private String condiment; + + /** 其他调味品种类 */ + @Excel(name = "其他调味品种类") + private String otherCondiment; + + /** 喜好的烹调方式,使用 , 隔开 */ + @Excel(name = "喜好的烹调方式,使用 , 隔开") + private String cookingStyle; + + /** 烹调方式对应频次,每周几次,使用 , 隔开 */ + @Excel(name = "烹调方式对应频次,每周几次,使用 , 隔开") + private String cookingStyleRate; + + /** 洗菜方式,使用 , 隔开 */ + @Excel(name = "洗菜方式,使用 , 隔开") + private String washVegetablesStyle; + + /** 其他洗菜方式 */ + @Excel(name = "其他洗菜方式") + private String otherWashVegetablesStyle; + + /** 早餐习惯 */ + @Excel(name = "早餐习惯") + private String breakfastType; + + /** 早餐吃的食物 */ + @Excel(name = "早餐吃的食物") + private String breakfastFood; + + /** 午餐习惯,使用 , 隔开 */ + @Excel(name = "午餐习惯,使用 , 隔开") + private String lunchType; + + /** 晚餐习惯,使用 , 隔开 */ + @Excel(name = "晚餐习惯,使用 , 隔开") + private String dinner; + + /** 早餐当中素菜占比 */ + @Excel(name = "早餐当中素菜占比") + private Long vegetableRate; + + /** 最常吃的肉类 */ + @Excel(name = "最常吃的肉类") + private String commonMeat; + + /** 晚餐时间(24小时制) */ + @Excel(name = "晚餐时间", readConverterExp = "2=4小时制") + private String dinnerTime; + + /** 每周吃夜宵次数,默认0 */ + @Excel(name = "每周吃夜宵次数,默认0") + private Long supperNum; + + /** 夜宵通常吃的食物 */ + @Excel(name = "夜宵通常吃的食物") + private String supperFood; + + /** 食物的冷热偏好 */ + @Excel(name = "食物的冷热偏好") + private String dietHotAndCold; + + /** 食物的口味偏好,使用 , 隔开 */ + @Excel(name = "食物的口味偏好,使用 , 隔开") + private String dietFlavor; + + /** 平均每周吃生菜几次 */ + @Excel(name = "平均每周吃生菜几次") + private Long vegetablesNum; + + /** 每周吃生菜的频次类型 */ + @Excel(name = "每周吃生菜的频次类型") + private String vegetablesRateType; + + /** 平均每天吃水果次数,默认0 */ + @Excel(name = "平均每天吃水果次数,默认0") + private Long fruitsNum; + + /** 吃水果的时间段 */ + @Excel(name = "吃水果的时间段") + private String fruitsTime; + + /** 平时吃水果的频次 */ + @Excel(name = "平时吃水果的频次") + private String fruitsRate; + + /** 一餐吃几碗饭 */ + @Excel(name = "一餐吃几碗饭") + private Long riceNum; + + /** 吃几成饱 */ + @Excel(name = "吃几成饱") + private Long riceFull; + + /** 吃饭速度 */ + @Excel(name = "吃饭速度") + private String eatingSpeed; + + /** 常吃的零食,使用 , 隔开 */ + @Excel(name = "常吃的零食,使用 , 隔开") + private String snacks; + + /** 其他零食 */ + @Excel(name = "其他零食") + private String otherSnacks; + + /** 有无服用营养保健品,0无 1有 */ + @Excel(name = "有无服用营养保健品,0无 1有") + private Long healthProductsFlag; + + /** 营养保健品品牌名 */ + @Excel(name = "营养保健品品牌名") + private String healthProductsBrand; + + /** 营养保健品产品名 */ + @Excel(name = "营养保健品产品名") + private String healthProductsName; + + /** 服用营养保健品频次,每周几次 */ + @Excel(name = "服用营养保健品频次,每周几次") + private Long healthProductsWeekRate; + + /** 服用营养保健品频次,每天几次 */ + @Excel(name = "服用营养保健品频次,每天几次") + private Long healthProductsDayRate; + + /** 每天的饮水量,单位:毫升 */ + @Excel(name = "每天的饮水量,单位:毫升") + private Long waterNum; + + /** 喜欢喝什么水,使用 , 隔开 */ + @Excel(name = "喜欢喝什么水,使用 , 隔开") + private String waterType; + + /** 喝水习惯,使用 , 隔开 */ + @Excel(name = "喝水习惯,使用 , 隔开") + private String waterHabit; + + /** 常喝的饮品的每周频次,使用,隔开 */ + @Excel(name = "常喝的饮品的每周频次,使用,隔开") + private String drinksNum; + + /** 是否喝酒 */ + @Excel(name = "是否喝酒") + private String drinkWineFlag; + + /** 喝酒种类,使用,隔开 */ + @Excel(name = "喝酒种类,使用,隔开") + private String drinkWineClassify; + + /** 其他酒种类 */ + @Excel(name = "其他酒种类") + private String otherWineClassify; + + /** 对应酒的量 */ + @Excel(name = "对应酒的量") + private String drinkWineAmount; + + /** 是否抽烟,0否 1是,默认0 */ + @Excel(name = "是否抽烟,0否 1是,默认0") + private Long smokeFlag; + + /** 抽烟频次和烟龄,戒烟几年,使用,隔开 */ + @Excel(name = "抽烟频次和烟龄,戒烟几年,使用,隔开") + private String smokeRate; + + /** 是否经常抽二手烟 0否 1是,默认0 */ + @Excel(name = "是否经常抽二手烟 0否 1是,默认0") + private Long secondSmoke; + + /** 工作行业 */ + @Excel(name = "工作行业") + private String workIndustry; + + /** 工作性质,使用,隔开 */ + @Excel(name = "工作性质,使用,隔开") + private String workType; + + /** 排便次数 */ + @Excel(name = "排便次数") + private String defecationNum; + + /** 其他手动输入的排便次数 */ + @Excel(name = "其他手动输入的排便次数") + private Long otherDefecationNum; + + /** 排便时间段,使用,隔开 */ + @Excel(name = "排便时间段,使用,隔开") + private String defecationTime; + + /** 排便的形状 */ + @Excel(name = "排便的形状") + private String defecationShape; + + /** 排便的气味 */ + @Excel(name = "排便的气味") + private String defecationSmell; + + /** 排便的速度 */ + @Excel(name = "排便的速度") + private String defecationSpeed; + + /** 排便的颜色 */ + @Excel(name = "排便的颜色") + private String defecationColor; + + /** 每周运动次数 */ + @Excel(name = "每周运动次数") + private Long motionNum; + + /** 每次运动的时长,分钟 */ + @Excel(name = "每次运动的时长,分钟") + private Long motionDuration; + + /** 每天运动的时间,24小时制 */ + @Excel(name = "每天运动的时间,24小时制") + private String motionTime; + + /** 有氧运动项目,使用,隔开 */ + @Excel(name = "有氧运动项目,使用,隔开") + private String aerobicMotionClassify; + + /** 无氧运动项目,使用,隔开 */ + @Excel(name = "无氧运动项目,使用,隔开") + private String anaerobicMotionClassify; + + /** 无氧有氧项目,使用,隔开 */ + @Excel(name = "无氧有氧项目,使用,隔开") + private String anaerobicAerobicMotionClassify; + + /** 其他运动项目,使用,隔开 */ + @Excel(name = "其他运动项目,使用,隔开") + private String otherMotionClassify; + + /** 运动场地,使用,隔开 */ + @Excel(name = "运动场地,使用,隔开") + private String motionField; + + /** 其他运动场地 */ + @Excel(name = "其他运动场地") + private String otherMotionField; + + /** 睡觉时间,24小时制 */ + @Excel(name = "睡觉时间,24小时制") + private String sleepTime; + + /** 睡眠质量 */ + @Excel(name = "睡眠质量") + private String sleepQuality; + + /** 是否有辅助入睡药物,0否 1是,默认0 */ + @Excel(name = "是否有辅助入睡药物,0否 1是,默认0") + private Long sleepDrugFlag; + + /** 辅助睡眠类药物名称 */ + @Excel(name = "辅助睡眠类药物名称") + private String sleepDrug; + + /** 是否经常熬夜(超过11点)0否 1是,默认0 */ + @Excel(name = "是否经常熬夜", readConverterExp = "超=过11点") + private Long stayupLateFlag; + + /** 熬夜频次,每周几次 */ + @Excel(name = "熬夜频次,每周几次") + private Long stayupLateWeekNum; + + /** 家族疾病史,使用,隔开 */ + @Excel(name = "家族疾病史,使用,隔开") + private String familyIllnessHistory; + + /** 其他家族病史 */ + @Excel(name = "其他家族病史") + private String otherFamilyIllnessHistory; + + /** 手术史,使用,隔开 */ + @Excel(name = "手术史,使用,隔开") + private String operationHistory; + + /** 其他手术史 */ + @Excel(name = "其他手术史") + private String otherOperationHistory; + + /** 近期是否做过手术,0否 1是,默认0 */ + @Excel(name = "近期是否做过手术,0否 1是,默认0") + private Long nearOperationFlag; + + /** 手术恢复情况 */ + @Excel(name = "手术恢复情况") + private String recoveryeSituation; + + /** 是否长期服用药物,0否 1是,默认0 */ + @Excel(name = "是否长期服用药物,0否 1是,默认0") + private Long longEatDrugFlag; + + /** 长期服用的药物,使用,隔开 */ + @Excel(name = "长期服用的药物,使用,隔开") + private String longEatDrugClassify; + + /** 其他长期服用的药物 */ + @Excel(name = "其他长期服用的药物") + private String otherLongEatDrugClassify; + + /** 是否出现过过敏症状,0否 1是,默认0 */ + @Excel(name = "是否出现过过敏症状,0否 1是,默认0") + private Long allergyFlag; + + /** 过敏症状 */ + @Excel(name = "过敏症状") + private String allergySituation; + + /** 过敏源,使用,隔开 */ + @Excel(name = "过敏源,使用,隔开") + private String allergen; + + /** 其他过敏源 */ + @Excel(name = "其他过敏源") + private String otherAllergen; + + /** 体检报告 */ + @Excel(name = "体检报告") + private String medicalReport; + + /** 删除标识 0未删除 1已删除。默认0 */ + private Long delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCustomerId(Long customerId) + { + this.customerId = customerId; + } + + public Long getCustomerId() + { + return customerId; + } + public void setConditioningProjectId(Long conditioningProjectId) + { + this.conditioningProjectId = conditioningProjectId; + } + + public Long getConditioningProjectId() + { + return conditioningProjectId; + } + public void setSex(Long sex) + { + this.sex = sex; + } + + public Long getSex() + { + return sex; + } + public void setAge(Long age) + { + this.age = age; + } + + public Long getAge() + { + return age; + } + public void setCondiment(String condiment) + { + this.condiment = condiment; + } + + public String getCondiment() + { + return condiment; + } + public void setOtherCondiment(String otherCondiment) + { + this.otherCondiment = otherCondiment; + } + + public String getOtherCondiment() + { + return otherCondiment; + } + public void setCookingStyle(String cookingStyle) + { + this.cookingStyle = cookingStyle; + } + + public String getCookingStyle() + { + return cookingStyle; + } + public void setCookingStyleRate(String cookingStyleRate) + { + this.cookingStyleRate = cookingStyleRate; + } + + public String getCookingStyleRate() + { + return cookingStyleRate; + } + public void setWashVegetablesStyle(String washVegetablesStyle) + { + this.washVegetablesStyle = washVegetablesStyle; + } + + public String getWashVegetablesStyle() + { + return washVegetablesStyle; + } + public void setOtherWashVegetablesStyle(String otherWashVegetablesStyle) + { + this.otherWashVegetablesStyle = otherWashVegetablesStyle; + } + + public String getOtherWashVegetablesStyle() + { + return otherWashVegetablesStyle; + } + public void setBreakfastType(String breakfastType) + { + this.breakfastType = breakfastType; + } + + public String getBreakfastType() + { + return breakfastType; + } + public void setBreakfastFood(String breakfastFood) + { + this.breakfastFood = breakfastFood; + } + + public String getBreakfastFood() + { + return breakfastFood; + } + public void setLunchType(String lunchType) + { + this.lunchType = lunchType; + } + + public String getLunchType() + { + return lunchType; + } + public void setDinner(String dinner) + { + this.dinner = dinner; + } + + public String getDinner() + { + return dinner; + } + public void setVegetableRate(Long vegetableRate) + { + this.vegetableRate = vegetableRate; + } + + public Long getVegetableRate() + { + return vegetableRate; + } + public void setCommonMeat(String commonMeat) + { + this.commonMeat = commonMeat; + } + + public String getCommonMeat() + { + return commonMeat; + } + public void setDinnerTime(String dinnerTime) + { + this.dinnerTime = dinnerTime; + } + + public String getDinnerTime() + { + return dinnerTime; + } + public void setSupperNum(Long supperNum) + { + this.supperNum = supperNum; + } + + public Long getSupperNum() + { + return supperNum; + } + public void setSupperFood(String supperFood) + { + this.supperFood = supperFood; + } + + public String getSupperFood() + { + return supperFood; + } + public void setDietHotAndCold(String dietHotAndCold) + { + this.dietHotAndCold = dietHotAndCold; + } + + public String getDietHotAndCold() + { + return dietHotAndCold; + } + public void setDietFlavor(String dietFlavor) + { + this.dietFlavor = dietFlavor; + } + + public String getDietFlavor() + { + return dietFlavor; + } + public void setVegetablesNum(Long vegetablesNum) + { + this.vegetablesNum = vegetablesNum; + } + + public Long getVegetablesNum() + { + return vegetablesNum; + } + public void setVegetablesRateType(String vegetablesRateType) + { + this.vegetablesRateType = vegetablesRateType; + } + + public String getVegetablesRateType() + { + return vegetablesRateType; + } + public void setFruitsNum(Long fruitsNum) + { + this.fruitsNum = fruitsNum; + } + + public Long getFruitsNum() + { + return fruitsNum; + } + public void setFruitsTime(String fruitsTime) + { + this.fruitsTime = fruitsTime; + } + + public String getFruitsTime() + { + return fruitsTime; + } + public void setFruitsRate(String fruitsRate) + { + this.fruitsRate = fruitsRate; + } + + public String getFruitsRate() + { + return fruitsRate; + } + public void setRiceNum(Long riceNum) + { + this.riceNum = riceNum; + } + + public Long getRiceNum() + { + return riceNum; + } + public void setRiceFull(Long riceFull) + { + this.riceFull = riceFull; + } + + public Long getRiceFull() + { + return riceFull; + } + public void setEatingSpeed(String eatingSpeed) + { + this.eatingSpeed = eatingSpeed; + } + + public String getEatingSpeed() + { + return eatingSpeed; + } + public void setSnacks(String snacks) + { + this.snacks = snacks; + } + + public String getSnacks() + { + return snacks; + } + public void setOtherSnacks(String otherSnacks) + { + this.otherSnacks = otherSnacks; + } + + public String getOtherSnacks() + { + return otherSnacks; + } + public void setHealthProductsFlag(Long healthProductsFlag) + { + this.healthProductsFlag = healthProductsFlag; + } + + public Long getHealthProductsFlag() + { + return healthProductsFlag; + } + public void setHealthProductsBrand(String healthProductsBrand) + { + this.healthProductsBrand = healthProductsBrand; + } + + public String getHealthProductsBrand() + { + return healthProductsBrand; + } + public void setHealthProductsName(String healthProductsName) + { + this.healthProductsName = healthProductsName; + } + + public String getHealthProductsName() + { + return healthProductsName; + } + public void setHealthProductsWeekRate(Long healthProductsWeekRate) + { + this.healthProductsWeekRate = healthProductsWeekRate; + } + + public Long getHealthProductsWeekRate() + { + return healthProductsWeekRate; + } + public void setHealthProductsDayRate(Long healthProductsDayRate) + { + this.healthProductsDayRate = healthProductsDayRate; + } + + public Long getHealthProductsDayRate() + { + return healthProductsDayRate; + } + public void setWaterNum(Long waterNum) + { + this.waterNum = waterNum; + } + + public Long getWaterNum() + { + return waterNum; + } + public void setWaterType(String waterType) + { + this.waterType = waterType; + } + + public String getWaterType() + { + return waterType; + } + public void setWaterHabit(String waterHabit) + { + this.waterHabit = waterHabit; + } + + public String getWaterHabit() + { + return waterHabit; + } + public void setDrinksNum(String drinksNum) + { + this.drinksNum = drinksNum; + } + + public String getDrinksNum() + { + return drinksNum; + } + public void setDrinkWineFlag(String drinkWineFlag) + { + this.drinkWineFlag = drinkWineFlag; + } + + public String getDrinkWineFlag() + { + return drinkWineFlag; + } + public void setDrinkWineClassify(String drinkWineClassify) + { + this.drinkWineClassify = drinkWineClassify; + } + + public String getDrinkWineClassify() + { + return drinkWineClassify; + } + public void setOtherWineClassify(String otherWineClassify) + { + this.otherWineClassify = otherWineClassify; + } + + public String getOtherWineClassify() + { + return otherWineClassify; + } + public void setDrinkWineAmount(String drinkWineAmount) + { + this.drinkWineAmount = drinkWineAmount; + } + + public String getDrinkWineAmount() + { + return drinkWineAmount; + } + public void setSmokeFlag(Long smokeFlag) + { + this.smokeFlag = smokeFlag; + } + + public Long getSmokeFlag() + { + return smokeFlag; + } + public void setSmokeRate(String smokeRate) + { + this.smokeRate = smokeRate; + } + + public String getSmokeRate() + { + return smokeRate; + } + public void setSecondSmoke(Long secondSmoke) + { + this.secondSmoke = secondSmoke; + } + + public Long getSecondSmoke() + { + return secondSmoke; + } + public void setWorkIndustry(String workIndustry) + { + this.workIndustry = workIndustry; + } + + public String getWorkIndustry() + { + return workIndustry; + } + public void setWorkType(String workType) + { + this.workType = workType; + } + + public String getWorkType() + { + return workType; + } + public void setDefecationNum(String defecationNum) + { + this.defecationNum = defecationNum; + } + + public String getDefecationNum() + { + return defecationNum; + } + public void setOtherDefecationNum(Long otherDefecationNum) + { + this.otherDefecationNum = otherDefecationNum; + } + + public Long getOtherDefecationNum() + { + return otherDefecationNum; + } + public void setDefecationTime(String defecationTime) + { + this.defecationTime = defecationTime; + } + + public String getDefecationTime() + { + return defecationTime; + } + public void setDefecationShape(String defecationShape) + { + this.defecationShape = defecationShape; + } + + public String getDefecationShape() + { + return defecationShape; + } + public void setDefecationSmell(String defecationSmell) + { + this.defecationSmell = defecationSmell; + } + + public String getDefecationSmell() + { + return defecationSmell; + } + public void setDefecationSpeed(String defecationSpeed) + { + this.defecationSpeed = defecationSpeed; + } + + public String getDefecationSpeed() + { + return defecationSpeed; + } + public void setDefecationColor(String defecationColor) + { + this.defecationColor = defecationColor; + } + + public String getDefecationColor() + { + return defecationColor; + } + public void setMotionNum(Long motionNum) + { + this.motionNum = motionNum; + } + + public Long getMotionNum() + { + return motionNum; + } + public void setMotionDuration(Long motionDuration) + { + this.motionDuration = motionDuration; + } + + public Long getMotionDuration() + { + return motionDuration; + } + public void setMotionTime(String motionTime) + { + this.motionTime = motionTime; + } + + public String getMotionTime() + { + return motionTime; + } + public void setAerobicMotionClassify(String aerobicMotionClassify) + { + this.aerobicMotionClassify = aerobicMotionClassify; + } + + public String getAerobicMotionClassify() + { + return aerobicMotionClassify; + } + public void setAnaerobicMotionClassify(String anaerobicMotionClassify) + { + this.anaerobicMotionClassify = anaerobicMotionClassify; + } + + public String getAnaerobicMotionClassify() + { + return anaerobicMotionClassify; + } + public void setAnaerobicAerobicMotionClassify(String anaerobicAerobicMotionClassify) + { + this.anaerobicAerobicMotionClassify = anaerobicAerobicMotionClassify; + } + + public String getAnaerobicAerobicMotionClassify() + { + return anaerobicAerobicMotionClassify; + } + public void setOtherMotionClassify(String otherMotionClassify) + { + this.otherMotionClassify = otherMotionClassify; + } + + public String getOtherMotionClassify() + { + return otherMotionClassify; + } + public void setMotionField(String motionField) + { + this.motionField = motionField; + } + + public String getMotionField() + { + return motionField; + } + public void setOtherMotionField(String otherMotionField) + { + this.otherMotionField = otherMotionField; + } + + public String getOtherMotionField() + { + return otherMotionField; + } + public void setSleepTime(String sleepTime) + { + this.sleepTime = sleepTime; + } + + public String getSleepTime() + { + return sleepTime; + } + public void setSleepQuality(String sleepQuality) + { + this.sleepQuality = sleepQuality; + } + + public String getSleepQuality() + { + return sleepQuality; + } + public void setSleepDrugFlag(Long sleepDrugFlag) + { + this.sleepDrugFlag = sleepDrugFlag; + } + + public Long getSleepDrugFlag() + { + return sleepDrugFlag; + } + public void setSleepDrug(String sleepDrug) + { + this.sleepDrug = sleepDrug; + } + + public String getSleepDrug() + { + return sleepDrug; + } + public void setStayupLateFlag(Long stayupLateFlag) + { + this.stayupLateFlag = stayupLateFlag; + } + + public Long getStayupLateFlag() + { + return stayupLateFlag; + } + public void setStayupLateWeekNum(Long stayupLateWeekNum) + { + this.stayupLateWeekNum = stayupLateWeekNum; + } + + public Long getStayupLateWeekNum() + { + return stayupLateWeekNum; + } + public void setFamilyIllnessHistory(String familyIllnessHistory) + { + this.familyIllnessHistory = familyIllnessHistory; + } + + public String getFamilyIllnessHistory() + { + return familyIllnessHistory; + } + public void setOtherFamilyIllnessHistory(String otherFamilyIllnessHistory) + { + this.otherFamilyIllnessHistory = otherFamilyIllnessHistory; + } + + public String getOtherFamilyIllnessHistory() + { + return otherFamilyIllnessHistory; + } + public void setOperationHistory(String operationHistory) + { + this.operationHistory = operationHistory; + } + + public String getOperationHistory() + { + return operationHistory; + } + public void setOtherOperationHistory(String otherOperationHistory) + { + this.otherOperationHistory = otherOperationHistory; + } + + public String getOtherOperationHistory() + { + return otherOperationHistory; + } + public void setNearOperationFlag(Long nearOperationFlag) + { + this.nearOperationFlag = nearOperationFlag; + } + + public Long getNearOperationFlag() + { + return nearOperationFlag; + } + public void setRecoveryeSituation(String recoveryeSituation) + { + this.recoveryeSituation = recoveryeSituation; + } + + public String getRecoveryeSituation() + { + return recoveryeSituation; + } + public void setLongEatDrugFlag(Long longEatDrugFlag) + { + this.longEatDrugFlag = longEatDrugFlag; + } + + public Long getLongEatDrugFlag() + { + return longEatDrugFlag; + } + public void setLongEatDrugClassify(String longEatDrugClassify) + { + this.longEatDrugClassify = longEatDrugClassify; + } + + public String getLongEatDrugClassify() + { + return longEatDrugClassify; + } + public void setOtherLongEatDrugClassify(String otherLongEatDrugClassify) + { + this.otherLongEatDrugClassify = otherLongEatDrugClassify; + } + + public String getOtherLongEatDrugClassify() + { + return otherLongEatDrugClassify; + } + public void setAllergyFlag(Long allergyFlag) + { + this.allergyFlag = allergyFlag; + } + + public Long getAllergyFlag() + { + return allergyFlag; + } + public void setAllergySituation(String allergySituation) + { + this.allergySituation = allergySituation; + } + + public String getAllergySituation() + { + return allergySituation; + } + public void setAllergen(String allergen) + { + this.allergen = allergen; + } + + public String getAllergen() + { + return allergen; + } + public void setOtherAllergen(String otherAllergen) + { + this.otherAllergen = otherAllergen; + } + + public String getOtherAllergen() + { + return otherAllergen; + } + public void setMedicalReport(String medicalReport) + { + this.medicalReport = medicalReport; + } + + public String getMedicalReport() + { + return medicalReport; + } + public void setDelFlag(Long delFlag) + { + this.delFlag = delFlag; + } + + public Long getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("customerId", getCustomerId()) + .append("conditioningProjectId", getConditioningProjectId()) + .append("sex", getSex()) + .append("age", getAge()) + .append("condiment", getCondiment()) + .append("otherCondiment", getOtherCondiment()) + .append("cookingStyle", getCookingStyle()) + .append("cookingStyleRate", getCookingStyleRate()) + .append("washVegetablesStyle", getWashVegetablesStyle()) + .append("otherWashVegetablesStyle", getOtherWashVegetablesStyle()) + .append("breakfastType", getBreakfastType()) + .append("breakfastFood", getBreakfastFood()) + .append("lunchType", getLunchType()) + .append("dinner", getDinner()) + .append("vegetableRate", getVegetableRate()) + .append("commonMeat", getCommonMeat()) + .append("dinnerTime", getDinnerTime()) + .append("supperNum", getSupperNum()) + .append("supperFood", getSupperFood()) + .append("dietHotAndCold", getDietHotAndCold()) + .append("dietFlavor", getDietFlavor()) + .append("vegetablesNum", getVegetablesNum()) + .append("vegetablesRateType", getVegetablesRateType()) + .append("fruitsNum", getFruitsNum()) + .append("fruitsTime", getFruitsTime()) + .append("fruitsRate", getFruitsRate()) + .append("riceNum", getRiceNum()) + .append("riceFull", getRiceFull()) + .append("eatingSpeed", getEatingSpeed()) + .append("snacks", getSnacks()) + .append("otherSnacks", getOtherSnacks()) + .append("healthProductsFlag", getHealthProductsFlag()) + .append("healthProductsBrand", getHealthProductsBrand()) + .append("healthProductsName", getHealthProductsName()) + .append("healthProductsWeekRate", getHealthProductsWeekRate()) + .append("healthProductsDayRate", getHealthProductsDayRate()) + .append("waterNum", getWaterNum()) + .append("waterType", getWaterType()) + .append("waterHabit", getWaterHabit()) + .append("drinksNum", getDrinksNum()) + .append("drinkWineFlag", getDrinkWineFlag()) + .append("drinkWineClassify", getDrinkWineClassify()) + .append("otherWineClassify", getOtherWineClassify()) + .append("drinkWineAmount", getDrinkWineAmount()) + .append("smokeFlag", getSmokeFlag()) + .append("smokeRate", getSmokeRate()) + .append("secondSmoke", getSecondSmoke()) + .append("workIndustry", getWorkIndustry()) + .append("workType", getWorkType()) + .append("defecationNum", getDefecationNum()) + .append("otherDefecationNum", getOtherDefecationNum()) + .append("defecationTime", getDefecationTime()) + .append("defecationShape", getDefecationShape()) + .append("defecationSmell", getDefecationSmell()) + .append("defecationSpeed", getDefecationSpeed()) + .append("defecationColor", getDefecationColor()) + .append("motionNum", getMotionNum()) + .append("motionDuration", getMotionDuration()) + .append("motionTime", getMotionTime()) + .append("aerobicMotionClassify", getAerobicMotionClassify()) + .append("anaerobicMotionClassify", getAnaerobicMotionClassify()) + .append("anaerobicAerobicMotionClassify", getAnaerobicAerobicMotionClassify()) + .append("otherMotionClassify", getOtherMotionClassify()) + .append("motionField", getMotionField()) + .append("otherMotionField", getOtherMotionField()) + .append("sleepTime", getSleepTime()) + .append("sleepQuality", getSleepQuality()) + .append("sleepDrugFlag", getSleepDrugFlag()) + .append("sleepDrug", getSleepDrug()) + .append("stayupLateFlag", getStayupLateFlag()) + .append("stayupLateWeekNum", getStayupLateWeekNum()) + .append("familyIllnessHistory", getFamilyIllnessHistory()) + .append("otherFamilyIllnessHistory", getOtherFamilyIllnessHistory()) + .append("operationHistory", getOperationHistory()) + .append("otherOperationHistory", getOtherOperationHistory()) + .append("nearOperationFlag", getNearOperationFlag()) + .append("recoveryeSituation", getRecoveryeSituation()) + .append("longEatDrugFlag", getLongEatDrugFlag()) + .append("longEatDrugClassify", getLongEatDrugClassify()) + .append("otherLongEatDrugClassify", getOtherLongEatDrugClassify()) + .append("allergyFlag", getAllergyFlag()) + .append("allergySituation", getAllergySituation()) + .append("allergen", getAllergen()) + .append("otherAllergen", getOtherAllergen()) + .append("medicalReport", getMedicalReport()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .append("delFlag", getDelFlag()) + .toString(); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java new file mode 100644 index 000000000..8b9d17154 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java @@ -0,0 +1,61 @@ +package com.stdiet.custom.mapper; + +import java.util.List; +import com.stdiet.custom.domain.SysCustomerHealthy; + +/** + * 客户健康Mapper接口 + * + * @author xzj + * @date 2021-01-23 + */ +public interface SysCustomerHealthyMapper +{ + /** + * 查询客户健康 + * + * @param id 客户健康ID + * @return 客户健康 + */ + public SysCustomerHealthy selectSysCustomerHealthyById(Long id); + + /** + * 查询客户健康列表 + * + * @param sysCustomerHealthy 客户健康 + * @return 客户健康集合 + */ + public List<SysCustomerHealthy> selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); + + /** + * 新增客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 修改客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 删除客户健康 + * + * @param id 客户健康ID + * @return 结果 + */ + public int deleteSysCustomerHealthyById(Long id); + + /** + * 批量删除客户健康 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysCustomerHealthyByIds(Long[] ids); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java new file mode 100644 index 000000000..8f491c06d --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java @@ -0,0 +1,61 @@ +package com.stdiet.custom.service; + +import java.util.List; +import com.stdiet.custom.domain.SysCustomerHealthy; + +/** + * 客户健康Service接口 + * + * @author xzj + * @date 2021-01-23 + */ +public interface ISysCustomerHealthyService +{ + /** + * 查询客户健康 + * + * @param id 客户健康ID + * @return 客户健康 + */ + public SysCustomerHealthy selectSysCustomerHealthyById(Long id); + + /** + * 查询客户健康列表 + * + * @param sysCustomerHealthy 客户健康 + * @return 客户健康集合 + */ + public List<SysCustomerHealthy> selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); + + /** + * 新增客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 修改客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + + /** + * 批量删除客户健康 + * + * @param ids 需要删除的客户健康ID + * @return 结果 + */ + public int deleteSysCustomerHealthyByIds(Long[] ids); + + /** + * 删除客户健康信息 + * + * @param id 客户健康ID + * @return 结果 + */ + public int deleteSysCustomerHealthyById(Long id); +} \ 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 new file mode 100644 index 000000000..3f1b86077 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java @@ -0,0 +1,96 @@ +package com.stdiet.custom.service.impl; + +import java.util.List; +import com.stdiet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.stdiet.custom.mapper.SysCustomerHealthyMapper; +import com.stdiet.custom.domain.SysCustomerHealthy; +import com.stdiet.custom.service.ISysCustomerHealthyService; + +/** + * 客户健康Service业务层处理 + * + * @author xzj + * @date 2021-01-23 + */ +@Service +public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService +{ + @Autowired + private SysCustomerHealthyMapper sysCustomerHealthyMapper; + + /** + * 查询客户健康 + * + * @param id 客户健康ID + * @return 客户健康 + */ + @Override + public SysCustomerHealthy selectSysCustomerHealthyById(Long id) + { + return sysCustomerHealthyMapper.selectSysCustomerHealthyById(id); + } + + /** + * 查询客户健康列表 + * + * @param sysCustomerHealthy 客户健康 + * @return 客户健康 + */ + @Override + public List<SysCustomerHealthy> selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy) + { + return sysCustomerHealthyMapper.selectSysCustomerHealthyList(sysCustomerHealthy); + } + + /** + * 新增客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + @Override + public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) + { + sysCustomerHealthy.setCreateTime(DateUtils.getNowDate()); + return sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy); + } + + /** + * 修改客户健康 + * + * @param sysCustomerHealthy 客户健康 + * @return 结果 + */ + @Override + public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) + { + sysCustomerHealthy.setUpdateTime(DateUtils.getNowDate()); + return sysCustomerHealthyMapper.updateSysCustomerHealthy(sysCustomerHealthy); + } + + /** + * 批量删除客户健康 + * + * @param ids 需要删除的客户健康ID + * @return 结果 + */ + @Override + public int deleteSysCustomerHealthyByIds(Long[] ids) + { + return sysCustomerHealthyMapper.deleteSysCustomerHealthyByIds(ids); + } + + /** + * 删除客户健康信息 + * + * @param id 客户健康ID + * @return 结果 + */ + @Override + public int deleteSysCustomerHealthyById(Long id) + { + return sysCustomerHealthyMapper.deleteSysCustomerHealthyById(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 new file mode 100644 index 000000000..352d6afbd --- /dev/null +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -0,0 +1,415 @@ +<?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.SysCustomerHealthyMapper"> + + <resultMap type="SysCustomerHealthy" id="SysCustomerHealthyResult"> + <result property="id" column="id" /> + <result property="customerId" column="customer_id" /> + <result property="conditioningProjectId" column="conditioning_project_id" /> + <result property="sex" column="sex" /> + <result property="age" column="age" /> + <result property="condiment" column="condiment" /> + <result property="otherCondiment" column="other_condiment" /> + <result property="cookingStyle" column="cooking_style" /> + <result property="cookingStyleRate" column="cooking_style_rate" /> + <result property="washVegetablesStyle" column="wash_vegetables_style" /> + <result property="otherWashVegetablesStyle" column="other_wash_vegetables_style" /> + <result property="breakfastType" column="breakfast_type" /> + <result property="breakfastFood" column="breakfast_food" /> + <result property="lunchType" column="lunch_type" /> + <result property="dinner" column="dinner" /> + <result property="vegetableRate" column="vegetable_rate" /> + <result property="commonMeat" column="common_meat" /> + <result property="dinnerTime" column="dinner_time" /> + <result property="supperNum" column="supper_num" /> + <result property="supperFood" column="supper_food" /> + <result property="dietHotAndCold" column="diet_hot_and_cold" /> + <result property="dietFlavor" column="diet_flavor" /> + <result property="vegetablesNum" column="vegetables_num" /> + <result property="vegetablesRateType" column="vegetables_rate_type" /> + <result property="fruitsNum" column="fruits_num" /> + <result property="fruitsTime" column="fruits_time" /> + <result property="fruitsRate" column="fruits_rate" /> + <result property="riceNum" column="rice_num" /> + <result property="riceFull" column="rice_full" /> + <result property="eatingSpeed" column="eating_speed" /> + <result property="snacks" column="snacks" /> + <result property="otherSnacks" column="other_snacks" /> + <result property="healthProductsFlag" column="health_products_flag" /> + <result property="healthProductsBrand" column="health_products_brand" /> + <result property="healthProductsName" column="health_products_name" /> + <result property="healthProductsWeekRate" column="health_products_week_rate" /> + <result property="healthProductsDayRate" column="health_products_day_rate" /> + <result property="waterNum" column="water_num" /> + <result property="waterType" column="water_type" /> + <result property="waterHabit" column="water_habit" /> + <result property="drinksNum" column="drinks_num" /> + <result property="drinkWineFlag" column="drink_wine_flag" /> + <result property="drinkWineClassify" column="drink_wine_classify" /> + <result property="otherWineClassify" column="other_wine_classify" /> + <result property="drinkWineAmount" column="drink_wine_amount" /> + <result property="smokeFlag" column="smoke_flag" /> + <result property="smokeRate" column="smoke_rate" /> + <result property="secondSmoke" column="second_smoke" /> + <result property="workIndustry" column="work_industry" /> + <result property="workType" column="work_type" /> + <result property="defecationNum" column="defecation_num" /> + <result property="otherDefecationNum" column="other_defecation_num" /> + <result property="defecationTime" column="defecation_time" /> + <result property="defecationShape" column="defecation_shape" /> + <result property="defecationSmell" column="defecation_smell" /> + <result property="defecationSpeed" column="defecation_speed" /> + <result property="defecationColor" column="defecation_color" /> + <result property="motionNum" column="motion_num" /> + <result property="motionDuration" column="motion_duration" /> + <result property="motionTime" column="motion_time" /> + <result property="aerobicMotionClassify" column="aerobic_motion_classify" /> + <result property="anaerobicMotionClassify" column="anaerobic_motion_classify" /> + <result property="anaerobicAerobicMotionClassify" column="anaerobic_aerobic_motion_classify" /> + <result property="otherMotionClassify" column="other_motion_classify" /> + <result property="motionField" column="motion_field" /> + <result property="otherMotionField" column="other_motion_field" /> + <result property="sleepTime" column="sleep_time" /> + <result property="sleepQuality" column="sleep_quality" /> + <result property="sleepDrugFlag" column="sleep_drug_flag" /> + <result property="sleepDrug" column="sleep_drug" /> + <result property="stayupLateFlag" column="stayup_late_flag" /> + <result property="stayupLateWeekNum" column="stayup_late_week_num" /> + <result property="familyIllnessHistory" column="family_illness_history" /> + <result property="otherFamilyIllnessHistory" column="other_family_illness_history" /> + <result property="operationHistory" column="operation_history" /> + <result property="otherOperationHistory" column="other_operation_history" /> + <result property="nearOperationFlag" column="near_operation_flag" /> + <result property="recoveryeSituation" column="recoverye_situation" /> + <result property="longEatDrugFlag" column="long_eat_drug_flag" /> + <result property="longEatDrugClassify" column="long_eat_drug_classify" /> + <result property="otherLongEatDrugClassify" column="other_long_eat_drug_classify" /> + <result property="allergyFlag" column="allergy_flag" /> + <result property="allergySituation" column="allergy_situation" /> + <result property="allergen" column="allergen" /> + <result property="otherAllergen" column="other_allergen" /> + <result property="medicalReport" column="medical_report" /> + <result property="createTime" column="create_time" /> + <result property="createBy" column="create_by" /> + <result property="updateTime" column="update_time" /> + <result property="updateBy" column="update_by" /> + <result property="delFlag" column="del_flag" /> + </resultMap> + + <sql id="selectSysCustomerHealthyVo"> + select id, customer_id, conditioning_project_id, sex, age, condiment, other_condiment, cooking_style, cooking_style_rate, wash_vegetables_style, other_wash_vegetables_style, breakfast_type, breakfast_food, lunch_type, dinner, vegetable_rate, common_meat, dinner_time, supper_num, supper_food, diet_hot_and_cold, diet_flavor, vegetables_num, vegetables_rate_type, fruits_num, fruits_time, fruits_rate, rice_num, rice_full, eating_speed, snacks, other_snacks, health_products_flag, health_products_brand, health_products_name, health_products_week_rate, health_products_day_rate, water_num, water_type, water_habit, drinks_num, drink_wine_flag, drink_wine_classify, other_wine_classify, drink_wine_amount, smoke_flag, smoke_rate, second_smoke, work_industry, work_type, defecation_num, other_defecation_num, defecation_time, defecation_shape, defecation_smell, defecation_speed, defecation_color, motion_num, motion_duration, motion_time, aerobic_motion_classify, anaerobic_motion_classify, anaerobic_aerobic_motion_classify, other_motion_classify, motion_field, other_motion_field, sleep_time, sleep_quality, sleep_drug_flag, sleep_drug, stayup_late_flag, stayup_late_week_num, family_illness_history, other_family_illness_history, operation_history, other_operation_history, near_operation_flag, recoverye_situation, long_eat_drug_flag, long_eat_drug_classify, other_long_eat_drug_classify, allergy_flag, allergy_situation, allergen, other_allergen, medical_report, create_time, create_by, update_time, update_by, del_flag from sys_customer_healthy + </sql> + + <select id="selectSysCustomerHealthyList" parameterType="SysCustomerHealthy" resultMap="SysCustomerHealthyResult"> + <include refid="selectSysCustomerHealthyVo"/> + <where> + <if test="conditioningProjectId != null "> and conditioning_project_id = #{conditioningProjectId}</if> + </where> + </select> + + <select id="selectSysCustomerHealthyById" parameterType="Long" resultMap="SysCustomerHealthyResult"> + <include refid="selectSysCustomerHealthyVo"/> + where id = #{id} + </select> + + <insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy"> + insert into sys_customer_healthy + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">id,</if> + <if test="customerId != null">customer_id,</if> + <if test="conditioningProjectId != null">conditioning_project_id,</if> + <if test="sex != null">sex,</if> + <if test="age != null">age,</if> + <if test="condiment != null">condiment,</if> + <if test="otherCondiment != null">other_condiment,</if> + <if test="cookingStyle != null">cooking_style,</if> + <if test="cookingStyleRate != null">cooking_style_rate,</if> + <if test="washVegetablesStyle != null">wash_vegetables_style,</if> + <if test="otherWashVegetablesStyle != null">other_wash_vegetables_style,</if> + <if test="breakfastType != null">breakfast_type,</if> + <if test="breakfastFood != null">breakfast_food,</if> + <if test="lunchType != null">lunch_type,</if> + <if test="dinner != null">dinner,</if> + <if test="vegetableRate != null">vegetable_rate,</if> + <if test="commonMeat != null">common_meat,</if> + <if test="dinnerTime != null">dinner_time,</if> + <if test="supperNum != null">supper_num,</if> + <if test="supperFood != null">supper_food,</if> + <if test="dietHotAndCold != null">diet_hot_and_cold,</if> + <if test="dietFlavor != null">diet_flavor,</if> + <if test="vegetablesNum != null">vegetables_num,</if> + <if test="vegetablesRateType != null">vegetables_rate_type,</if> + <if test="fruitsNum != null">fruits_num,</if> + <if test="fruitsTime != null">fruits_time,</if> + <if test="fruitsRate != null">fruits_rate,</if> + <if test="riceNum != null">rice_num,</if> + <if test="riceFull != null">rice_full,</if> + <if test="eatingSpeed != null">eating_speed,</if> + <if test="snacks != null">snacks,</if> + <if test="otherSnacks != null">other_snacks,</if> + <if test="healthProductsFlag != null">health_products_flag,</if> + <if test="healthProductsBrand != null">health_products_brand,</if> + <if test="healthProductsName != null">health_products_name,</if> + <if test="healthProductsWeekRate != null">health_products_week_rate,</if> + <if test="healthProductsDayRate != null">health_products_day_rate,</if> + <if test="waterNum != null">water_num,</if> + <if test="waterType != null">water_type,</if> + <if test="waterHabit != null">water_habit,</if> + <if test="drinksNum != null">drinks_num,</if> + <if test="drinkWineFlag != null">drink_wine_flag,</if> + <if test="drinkWineClassify != null">drink_wine_classify,</if> + <if test="otherWineClassify != null">other_wine_classify,</if> + <if test="drinkWineAmount != null">drink_wine_amount,</if> + <if test="smokeFlag != null">smoke_flag,</if> + <if test="smokeRate != null">smoke_rate,</if> + <if test="secondSmoke != null">second_smoke,</if> + <if test="workIndustry != null">work_industry,</if> + <if test="workType != null">work_type,</if> + <if test="defecationNum != null">defecation_num,</if> + <if test="otherDefecationNum != null">other_defecation_num,</if> + <if test="defecationTime != null">defecation_time,</if> + <if test="defecationShape != null">defecation_shape,</if> + <if test="defecationSmell != null">defecation_smell,</if> + <if test="defecationSpeed != null">defecation_speed,</if> + <if test="defecationColor != null">defecation_color,</if> + <if test="motionNum != null">motion_num,</if> + <if test="motionDuration != null">motion_duration,</if> + <if test="motionTime != null">motion_time,</if> + <if test="aerobicMotionClassify != null">aerobic_motion_classify,</if> + <if test="anaerobicMotionClassify != null">anaerobic_motion_classify,</if> + <if test="anaerobicAerobicMotionClassify != null">anaerobic_aerobic_motion_classify,</if> + <if test="otherMotionClassify != null">other_motion_classify,</if> + <if test="motionField != null">motion_field,</if> + <if test="otherMotionField != null">other_motion_field,</if> + <if test="sleepTime != null">sleep_time,</if> + <if test="sleepQuality != null">sleep_quality,</if> + <if test="sleepDrugFlag != null">sleep_drug_flag,</if> + <if test="sleepDrug != null">sleep_drug,</if> + <if test="stayupLateFlag != null">stayup_late_flag,</if> + <if test="stayupLateWeekNum != null">stayup_late_week_num,</if> + <if test="familyIllnessHistory != null">family_illness_history,</if> + <if test="otherFamilyIllnessHistory != null">other_family_illness_history,</if> + <if test="operationHistory != null">operation_history,</if> + <if test="otherOperationHistory != null">other_operation_history,</if> + <if test="nearOperationFlag != null">near_operation_flag,</if> + <if test="recoveryeSituation != null">recoverye_situation,</if> + <if test="longEatDrugFlag != null">long_eat_drug_flag,</if> + <if test="longEatDrugClassify != null">long_eat_drug_classify,</if> + <if test="otherLongEatDrugClassify != null">other_long_eat_drug_classify,</if> + <if test="allergyFlag != null">allergy_flag,</if> + <if test="allergySituation != null">allergy_situation,</if> + <if test="allergen != null">allergen,</if> + <if test="otherAllergen != null">other_allergen,</if> + <if test="medicalReport != null">medical_report,</if> + <if test="createTime != null">create_time,</if> + <if test="createBy != null">create_by,</if> + <if test="updateTime != null">update_time,</if> + <if test="updateBy != null">update_by,</if> + <if test="delFlag != null">del_flag,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null">#{id},</if> + <if test="customerId != null">#{customerId},</if> + <if test="conditioningProjectId != null">#{conditioningProjectId},</if> + <if test="sex != null">#{sex},</if> + <if test="age != null">#{age},</if> + <if test="condiment != null">#{condiment},</if> + <if test="otherCondiment != null">#{otherCondiment},</if> + <if test="cookingStyle != null">#{cookingStyle},</if> + <if test="cookingStyleRate != null">#{cookingStyleRate},</if> + <if test="washVegetablesStyle != null">#{washVegetablesStyle},</if> + <if test="otherWashVegetablesStyle != null">#{otherWashVegetablesStyle},</if> + <if test="breakfastType != null">#{breakfastType},</if> + <if test="breakfastFood != null">#{breakfastFood},</if> + <if test="lunchType != null">#{lunchType},</if> + <if test="dinner != null">#{dinner},</if> + <if test="vegetableRate != null">#{vegetableRate},</if> + <if test="commonMeat != null">#{commonMeat},</if> + <if test="dinnerTime != null">#{dinnerTime},</if> + <if test="supperNum != null">#{supperNum},</if> + <if test="supperFood != null">#{supperFood},</if> + <if test="dietHotAndCold != null">#{dietHotAndCold},</if> + <if test="dietFlavor != null">#{dietFlavor},</if> + <if test="vegetablesNum != null">#{vegetablesNum},</if> + <if test="vegetablesRateType != null">#{vegetablesRateType},</if> + <if test="fruitsNum != null">#{fruitsNum},</if> + <if test="fruitsTime != null">#{fruitsTime},</if> + <if test="fruitsRate != null">#{fruitsRate},</if> + <if test="riceNum != null">#{riceNum},</if> + <if test="riceFull != null">#{riceFull},</if> + <if test="eatingSpeed != null">#{eatingSpeed},</if> + <if test="snacks != null">#{snacks},</if> + <if test="otherSnacks != null">#{otherSnacks},</if> + <if test="healthProductsFlag != null">#{healthProductsFlag},</if> + <if test="healthProductsBrand != null">#{healthProductsBrand},</if> + <if test="healthProductsName != null">#{healthProductsName},</if> + <if test="healthProductsWeekRate != null">#{healthProductsWeekRate},</if> + <if test="healthProductsDayRate != null">#{healthProductsDayRate},</if> + <if test="waterNum != null">#{waterNum},</if> + <if test="waterType != null">#{waterType},</if> + <if test="waterHabit != null">#{waterHabit},</if> + <if test="drinksNum != null">#{drinksNum},</if> + <if test="drinkWineFlag != null">#{drinkWineFlag},</if> + <if test="drinkWineClassify != null">#{drinkWineClassify},</if> + <if test="otherWineClassify != null">#{otherWineClassify},</if> + <if test="drinkWineAmount != null">#{drinkWineAmount},</if> + <if test="smokeFlag != null">#{smokeFlag},</if> + <if test="smokeRate != null">#{smokeRate},</if> + <if test="secondSmoke != null">#{secondSmoke},</if> + <if test="workIndustry != null">#{workIndustry},</if> + <if test="workType != null">#{workType},</if> + <if test="defecationNum != null">#{defecationNum},</if> + <if test="otherDefecationNum != null">#{otherDefecationNum},</if> + <if test="defecationTime != null">#{defecationTime},</if> + <if test="defecationShape != null">#{defecationShape},</if> + <if test="defecationSmell != null">#{defecationSmell},</if> + <if test="defecationSpeed != null">#{defecationSpeed},</if> + <if test="defecationColor != null">#{defecationColor},</if> + <if test="motionNum != null">#{motionNum},</if> + <if test="motionDuration != null">#{motionDuration},</if> + <if test="motionTime != null">#{motionTime},</if> + <if test="aerobicMotionClassify != null">#{aerobicMotionClassify},</if> + <if test="anaerobicMotionClassify != null">#{anaerobicMotionClassify},</if> + <if test="anaerobicAerobicMotionClassify != null">#{anaerobicAerobicMotionClassify},</if> + <if test="otherMotionClassify != null">#{otherMotionClassify},</if> + <if test="motionField != null">#{motionField},</if> + <if test="otherMotionField != null">#{otherMotionField},</if> + <if test="sleepTime != null">#{sleepTime},</if> + <if test="sleepQuality != null">#{sleepQuality},</if> + <if test="sleepDrugFlag != null">#{sleepDrugFlag},</if> + <if test="sleepDrug != null">#{sleepDrug},</if> + <if test="stayupLateFlag != null">#{stayupLateFlag},</if> + <if test="stayupLateWeekNum != null">#{stayupLateWeekNum},</if> + <if test="familyIllnessHistory != null">#{familyIllnessHistory},</if> + <if test="otherFamilyIllnessHistory != null">#{otherFamilyIllnessHistory},</if> + <if test="operationHistory != null">#{operationHistory},</if> + <if test="otherOperationHistory != null">#{otherOperationHistory},</if> + <if test="nearOperationFlag != null">#{nearOperationFlag},</if> + <if test="recoveryeSituation != null">#{recoveryeSituation},</if> + <if test="longEatDrugFlag != null">#{longEatDrugFlag},</if> + <if test="longEatDrugClassify != null">#{longEatDrugClassify},</if> + <if test="otherLongEatDrugClassify != null">#{otherLongEatDrugClassify},</if> + <if test="allergyFlag != null">#{allergyFlag},</if> + <if test="allergySituation != null">#{allergySituation},</if> + <if test="allergen != null">#{allergen},</if> + <if test="otherAllergen != null">#{otherAllergen},</if> + <if test="medicalReport != null">#{medicalReport},</if> + <if test="createTime != null">#{createTime},</if> + <if test="createBy != null">#{createBy},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="delFlag != null">#{delFlag},</if> + </trim> + </insert> + + <update id="updateSysCustomerHealthy" parameterType="SysCustomerHealthy"> + update sys_customer_healthy + <trim prefix="SET" suffixOverrides=","> + <if test="customerId != null">customer_id = #{customerId},</if> + <if test="conditioningProjectId != null">conditioning_project_id = #{conditioningProjectId},</if> + <if test="sex != null">sex = #{sex},</if> + <if test="age != null">age = #{age},</if> + <if test="condiment != null">condiment = #{condiment},</if> + <if test="otherCondiment != null">other_condiment = #{otherCondiment},</if> + <if test="cookingStyle != null">cooking_style = #{cookingStyle},</if> + <if test="cookingStyleRate != null">cooking_style_rate = #{cookingStyleRate},</if> + <if test="washVegetablesStyle != null">wash_vegetables_style = #{washVegetablesStyle},</if> + <if test="otherWashVegetablesStyle != null">other_wash_vegetables_style = #{otherWashVegetablesStyle},</if> + <if test="breakfastType != null">breakfast_type = #{breakfastType},</if> + <if test="breakfastFood != null">breakfast_food = #{breakfastFood},</if> + <if test="lunchType != null">lunch_type = #{lunchType},</if> + <if test="dinner != null">dinner = #{dinner},</if> + <if test="vegetableRate != null">vegetable_rate = #{vegetableRate},</if> + <if test="commonMeat != null">common_meat = #{commonMeat},</if> + <if test="dinnerTime != null">dinner_time = #{dinnerTime},</if> + <if test="supperNum != null">supper_num = #{supperNum},</if> + <if test="supperFood != null">supper_food = #{supperFood},</if> + <if test="dietHotAndCold != null">diet_hot_and_cold = #{dietHotAndCold},</if> + <if test="dietFlavor != null">diet_flavor = #{dietFlavor},</if> + <if test="vegetablesNum != null">vegetables_num = #{vegetablesNum},</if> + <if test="vegetablesRateType != null">vegetables_rate_type = #{vegetablesRateType},</if> + <if test="fruitsNum != null">fruits_num = #{fruitsNum},</if> + <if test="fruitsTime != null">fruits_time = #{fruitsTime},</if> + <if test="fruitsRate != null">fruits_rate = #{fruitsRate},</if> + <if test="riceNum != null">rice_num = #{riceNum},</if> + <if test="riceFull != null">rice_full = #{riceFull},</if> + <if test="eatingSpeed != null">eating_speed = #{eatingSpeed},</if> + <if test="snacks != null">snacks = #{snacks},</if> + <if test="otherSnacks != null">other_snacks = #{otherSnacks},</if> + <if test="healthProductsFlag != null">health_products_flag = #{healthProductsFlag},</if> + <if test="healthProductsBrand != null">health_products_brand = #{healthProductsBrand},</if> + <if test="healthProductsName != null">health_products_name = #{healthProductsName},</if> + <if test="healthProductsWeekRate != null">health_products_week_rate = #{healthProductsWeekRate},</if> + <if test="healthProductsDayRate != null">health_products_day_rate = #{healthProductsDayRate},</if> + <if test="waterNum != null">water_num = #{waterNum},</if> + <if test="waterType != null">water_type = #{waterType},</if> + <if test="waterHabit != null">water_habit = #{waterHabit},</if> + <if test="drinksNum != null">drinks_num = #{drinksNum},</if> + <if test="drinkWineFlag != null">drink_wine_flag = #{drinkWineFlag},</if> + <if test="drinkWineClassify != null">drink_wine_classify = #{drinkWineClassify},</if> + <if test="otherWineClassify != null">other_wine_classify = #{otherWineClassify},</if> + <if test="drinkWineAmount != null">drink_wine_amount = #{drinkWineAmount},</if> + <if test="smokeFlag != null">smoke_flag = #{smokeFlag},</if> + <if test="smokeRate != null">smoke_rate = #{smokeRate},</if> + <if test="secondSmoke != null">second_smoke = #{secondSmoke},</if> + <if test="workIndustry != null">work_industry = #{workIndustry},</if> + <if test="workType != null">work_type = #{workType},</if> + <if test="defecationNum != null">defecation_num = #{defecationNum},</if> + <if test="otherDefecationNum != null">other_defecation_num = #{otherDefecationNum},</if> + <if test="defecationTime != null">defecation_time = #{defecationTime},</if> + <if test="defecationShape != null">defecation_shape = #{defecationShape},</if> + <if test="defecationSmell != null">defecation_smell = #{defecationSmell},</if> + <if test="defecationSpeed != null">defecation_speed = #{defecationSpeed},</if> + <if test="defecationColor != null">defecation_color = #{defecationColor},</if> + <if test="motionNum != null">motion_num = #{motionNum},</if> + <if test="motionDuration != null">motion_duration = #{motionDuration},</if> + <if test="motionTime != null">motion_time = #{motionTime},</if> + <if test="aerobicMotionClassify != null">aerobic_motion_classify = #{aerobicMotionClassify},</if> + <if test="anaerobicMotionClassify != null">anaerobic_motion_classify = #{anaerobicMotionClassify},</if> + <if test="anaerobicAerobicMotionClassify != null">anaerobic_aerobic_motion_classify = #{anaerobicAerobicMotionClassify},</if> + <if test="otherMotionClassify != null">other_motion_classify = #{otherMotionClassify},</if> + <if test="motionField != null">motion_field = #{motionField},</if> + <if test="otherMotionField != null">other_motion_field = #{otherMotionField},</if> + <if test="sleepTime != null">sleep_time = #{sleepTime},</if> + <if test="sleepQuality != null">sleep_quality = #{sleepQuality},</if> + <if test="sleepDrugFlag != null">sleep_drug_flag = #{sleepDrugFlag},</if> + <if test="sleepDrug != null">sleep_drug = #{sleepDrug},</if> + <if test="stayupLateFlag != null">stayup_late_flag = #{stayupLateFlag},</if> + <if test="stayupLateWeekNum != null">stayup_late_week_num = #{stayupLateWeekNum},</if> + <if test="familyIllnessHistory != null">family_illness_history = #{familyIllnessHistory},</if> + <if test="otherFamilyIllnessHistory != null">other_family_illness_history = #{otherFamilyIllnessHistory},</if> + <if test="operationHistory != null">operation_history = #{operationHistory},</if> + <if test="otherOperationHistory != null">other_operation_history = #{otherOperationHistory},</if> + <if test="nearOperationFlag != null">near_operation_flag = #{nearOperationFlag},</if> + <if test="recoveryeSituation != null">recoverye_situation = #{recoveryeSituation},</if> + <if test="longEatDrugFlag != null">long_eat_drug_flag = #{longEatDrugFlag},</if> + <if test="longEatDrugClassify != null">long_eat_drug_classify = #{longEatDrugClassify},</if> + <if test="otherLongEatDrugClassify != null">other_long_eat_drug_classify = #{otherLongEatDrugClassify},</if> + <if test="allergyFlag != null">allergy_flag = #{allergyFlag},</if> + <if test="allergySituation != null">allergy_situation = #{allergySituation},</if> + <if test="allergen != null">allergen = #{allergen},</if> + <if test="otherAllergen != null">other_allergen = #{otherAllergen},</if> + <if test="medicalReport != null">medical_report = #{medicalReport},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="delFlag != null">del_flag = #{delFlag},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteSysCustomerHealthyById" parameterType="Long"> + delete from sys_customer_healthy where id = #{id} + </delete> + + <delete id="deleteSysCustomerHealthyByIds" parameterType="String"> + delete from sys_customer_healthy where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> + +</mapper> \ No newline at end of file diff --git a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue index f4f4a7f64..7ed11ce32 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -3,109 +3,86 @@ <div style="padding: 16px; text-align: center"> <img :src="logo" style="width: 258px; height: 80px" alt="logo" /> </div> + <div style="margin: 20px 15px 20px 15px;" > + <el-steps :active="stepActive" finish-status="success"> + <el-step v-for="(item,index) in stepArray" title=""></el-step> + </el-steps> + </div> <el-form ref="form" label-position="top" :model="form" :rules="rules" label-width="100px" style="padding: 16px"> - <p class="p_title_1" style="margin-top: 5px;">基础信息</p> - <el-form-item label="真实姓名" prop="name" style="padding-top: 10px;"> - <el-input v-model="form.name" placeholder="请输入真实姓名" /> - </el-form-item> - <el-form-item label="性别" prop="sex"> - <el-radio-group v-model="form.sex" size="small" > - <el-radio :label="parseInt('0')" border>男</el-radio> - <el-radio :label="parseInt('1')" border>女</el-radio> - </el-radio-group> - </el-form-item> - <el-form-item label="年龄" prop="age"> - <el-input type="number" v-model.number="form.age" placeholder="请输入年龄" autocomplete="off"></el-input> - </el-form-item> - <el-form-item label="手机号" prop="phone" > - <el-input v-model="form.phone" placeholder="请输入手机号" /> - </el-form-item> - <p class="p_title_1">一、食品安全评估</p> + <div v-show="stepArray[0]"> + <p class="p_title_1" style="margin-top: 5px;">一、基础信息</p> + <el-form-item label="真实姓名" prop="name" style="padding-top: 10px;"> + <el-input v-model="form.name" placeholder="请输入真实姓名" maxlength="20"/> + </el-form-item> + <el-form-item label="性别" prop="sex"> + <el-radio-group v-model="form.sex" size="small" > + <el-radio :label="parseInt('0')" border>男</el-radio> + <el-radio :label="parseInt('1')" border>女</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="年龄" prop="age"> + <el-input type="number" v-model="form.age" placeholder="请输入年龄" autocomplete="off" maxlength="3"></el-input> + </el-form-item> + <el-form-item label="手机号" prop="phone" maxlength="20"> + <el-input type="number" v-model="form.phone" placeholder="请输入手机号" /> + </el-form-item> + </div> + + <div v-show="stepArray[1]"> + <p class="p_title_1">二、食品安全评估</p> <p class="p_title_2">1、家庭调味品</p> <el-form-item :label="'(1) 调味品种类'" prop="condiment" class="margin-left"> <el-checkbox-group v-model="form.condiment"> - <el-checkbox label="鸡精" key="1">鸡精</el-checkbox> - <el-checkbox label="耗油" key="2">耗油</el-checkbox> - <el-checkbox label="生抽" key="3">生抽</el-checkbox> - <el-checkbox label="老抽" key="4">老抽</el-checkbox> - <el-checkbox label="香油" key="5">香油</el-checkbox> - <el-checkbox label="浓汤宝" key="6">浓汤宝</el-checkbox> - <el-checkbox label="鸡粉" key="7">鸡粉</el-checkbox> - <el-checkbox label="花椒" key="8">花椒</el-checkbox> - <el-checkbox label="辣椒油" key="9">辣椒油</el-checkbox> + <el-checkbox v-for="(item, index) in condimentArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他调味品 </span><el-input style="margin-top: 10px;width:70%" v-model="form.otherCondiment" placeholder="请输入其他调味品名称" /></div> </el-form-item> <p class="p_title_2">2、喜好的烹调方式和周频次</p> <el-form-item :label="'(1) 喜好的烹调方式'" prop="cookingStyle" class="margin-left"> <el-checkbox-group v-model="form.cookingStyle"> - <el-checkbox label="煎">煎</el-checkbox> - <el-checkbox label="烤">烤</el-checkbox> - <el-checkbox label="炸" >炸</el-checkbox> - <el-checkbox label="卤">卤</el-checkbox> - <el-checkbox label="腌">腌</el-checkbox> - <el-checkbox label="腊">腊</el-checkbox> - <el-checkbox label="煲">煲</el-checkbox> - <el-checkbox label="炒">炒</el-checkbox> - <el-checkbox label="蒸">蒸</el-checkbox> - <el-checkbox label="刺身">刺身</el-checkbox> - <el-checkbox label="水煮">水煮</el-checkbox> + <el-checkbox v-for="(item,index) in cookingStyleArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item :label="'(2) 烹调方式的频次(每周)'" prop="cookingStyleRate" class="margin-left"> <div> - <span>煎 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[0]" :step="1" :min="0"></el-input-number><span> 次</span> - <span style="margin-left: 20px;">炸 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[1]" :step="1" :min="0" ></el-input-number><span> 次</span> + <span>煎 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[0]" :step="1" :min="0"></el-input-number><span> 次</span> + <span style="margin-left: 20px;">炸 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[1]" :step="1" :min="0" ></el-input-number><span> 次</span> </div> <div style="margin-top: 5px;"> <span>卤 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[2]" :step="1" :min="0" ></el-input-number><span> 次</span> - <span style="margin-left: 20px;">腌 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[3]" :step="1" :min="0" ></el-input-number><span> 次</span> + <span style="margin-left: 20px;">腌 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[3]" :step="1" :min="0" ></el-input-number><span> 次</span> </div> <div style="margin-top: 5px;"> - <span>腊 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[4]" :step="1" :min="0" ></el-input-number><span> 次</span> - <span style="margin-left: 20px;">煲 </span><el-input-number style="width:35%;" v-model="form.cookingStyleRate[5]" :step="1" :min="0" ></el-input-number><span> 次</span> + <span>腊 </span><el-input-number style="width:35%" v-model="form.cookingStyleRate[4]" :step="1" :min="0" ></el-input-number><span> 次</span> + <span style="margin-left: 20px;">煲 </span><el-input-number style="width:35%;" v-model="form.cookingStyleRate[5]" :step="1" :min="0" ></el-input-number><span> 次</span> </div> </el-form-item> <p class="p_title_2">3、洗菜方式</p> <el-form-item :label="'(1) 洗菜方式'" prop="washVegetablesStyle" class="margin-left"> <el-checkbox-group v-model="form.washVegetablesStyle"> - <el-checkbox label="先切后洗" key="1">先切后洗</el-checkbox> - <el-checkbox label="先洗后切" key="2">先洗后切</el-checkbox> - <el-checkbox label="切后浸泡" key="3">切后浸泡</el-checkbox> + <el-checkbox v-for="(item,index) in washVegetablesStyleArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他洗菜方式 </span><el-input style="margin-top: 10px;width:70%" v-model="form.otherWashVegetablesStyle" placeholder="请输入其他洗菜方式" /></div> </el-form-item> + </div> - - <p class="p_title_1">二、饮食结构评估</p> + <div v-show="stepArray[2]"> + <p class="p_title_1">三、饮食结构评估</p> <p class="p_title_2">1、您三餐的习惯</p> <el-form-item :label="'(1) 早餐习惯'" prop="breakfast" class="margin-left"> - <!--<el-checkbox-group v-model="form.breakfastType"> - <el-checkbox label="不吃" key="1">不吃</el-checkbox> - <el-checkbox label="偶尔吃" key="2">偶尔吃</el-checkbox> - <el-checkbox label="每天吃" key="3">每天吃</el-checkbox> - </el-checkbox-group>--> <el-radio-group v-model="form.breakfastType"> - <el-radio label="不吃">不吃</el-radio> - <el-radio label="偶尔吃">偶尔吃</el-radio> - <el-radio label="每天吃">每天吃</el-radio> + <el-radio v-for="(item,index) in breakfastTypeArray" :label="item.value" :key="index">{{item.name}}</el-radio> </el-radio-group> <div style="margin-top:8px;"><span>早餐通常吃 </span><el-input v-model="form.breakfastFood" style="width:70%" placeholder="请输入早餐名称" /></div> </el-form-item> <el-form-item :label="'(2) 午餐习惯'" prop="lunchType" class="margin-left"> <el-checkbox-group v-model="form.lunchType"> - <el-checkbox label="外卖" key="1">外卖</el-checkbox> - <el-checkbox label="自带餐" key="2">自带餐</el-checkbox> - <el-checkbox label="快餐" key="3">快餐</el-checkbox> - <el-checkbox label="餐厅" key="4">餐厅</el-checkbox> + <el-checkbox v-for="(item,index) in lunchTypeArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item :label="'(3) 晚餐习惯'" prop="dinner" class="margin-left"> <el-checkbox-group v-model="form.dinner"> - <el-checkbox label="餐馆吃" key="1">餐馆吃</el-checkbox> - <el-checkbox label="在家吃" key="2">在家吃</el-checkbox> - <el-checkbox label="丰盛" key="3">丰盛</el-checkbox> - <el-checkbox label="清淡" key="4">清淡</el-checkbox> + <el-checkbox v-for="(item,index) in dinnerArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item :label="'(4) 正餐荤素中素菜占比几成'" prop="eatSituation" class="margin-left"> @@ -116,7 +93,7 @@ </el-form-item> <p class="p_title_2">2、您晚餐时间点和夜宵习惯</p> <el-form-item :label="'(1) 晚餐时间点'" prop="dinnerTime" class="margin-left"> - <el-time-select v-model="form.dinnerTime" :picker-options="{ start: '00:00', step: '01:00', end: '12:00' }" placeholder="请选择时间" :editable="false"/> + <el-time-select v-model="form.dinnerTime" :picker-options="{ start: '17:00', step: '00:30', end: '24:00' }" placeholder="请选择时间" :editable="false"/> </el-form-item> <el-form-item :label="'(2) 您每周吃几次夜宵'" prop="supperNum" class="margin-left"> <el-input-number v-model="form.supperNum" :step="1" :min="0"></el-input-number> @@ -127,19 +104,12 @@ <p class="p_title_2">3、您的饮食偏好</p> <el-form-item :label="'(1) 冷热偏好'" prop="dietHotAndCold" class="margin-left"> <el-radio-group v-model="form.dietHotAndCold"> - <el-radio label="偏冷食">偏冷食</el-radio> - <el-radio label="偏烫食">偏烫食</el-radio> - <el-radio label="正常">正常</el-radio> + <el-radio v-for="(item,index) in dietHotAndColdArray" :label="item.value" :key="index">{{item.name}}</el-radio> </el-radio-group> </el-form-item> <el-form-item :label="'(2) 口味偏好'" prop="dietFlavor" class="margin-left"> <el-checkbox-group v-model="form.dietFlavor"> - <el-checkbox label="偏油" key="1">偏油</el-checkbox> - <el-checkbox label="偏咸" key="2">偏咸</el-checkbox> - <el-checkbox label="偏辣" key="3">偏辣</el-checkbox> - <el-checkbox label="偏甜" key="4">偏甜</el-checkbox> - <el-checkbox label="偏酸" key="5">偏酸</el-checkbox> - <el-checkbox label="清淡" key="6">清淡</el-checkbox> + <el-checkbox v-for="(item,index) in dietFlavorArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <p class="p_title_2">4、生食果蔬状况</p> @@ -148,28 +118,28 @@ </el-form-item> <el-form-item :label="'(2) 每周吃生/拌菜的频次'" prop="vegetablesRateType" class="margin-left"> <el-radio-group v-model="form.vegetablesRateType"> - <div><el-radio label="每天吃" key="1">每天吃</el-radio> - <el-radio label="经常吃" key="2">经常吃</el-radio> - <el-radio label="偶尔吃" key="3">偶尔吃</el-radio></div> - <div style="margin-top: 10px;"><el-radio label="从不吃" key="4">从不吃</el-radio></div> + <el-radio v-for="(item,index) in vegetablesRateTypeArray" :label="item.value" :key="index">{{item.name}}</el-radio> + <!-- <div><el-radio label="每天吃" key="1">每天吃</el-radio> + <el-radio label="经常吃" key="2">经常吃</el-radio> + <el-radio label="偶尔吃" key="3">偶尔吃</el-radio></div> + <div style="margin-top: 10px;"><el-radio label="从不吃" key="4">从不吃</el-radio></div>--> </el-radio-group> </el-form-item> <el-form-item :label="'(3) 平均每天吃水果几次以及时间'" prop="fruitsNum" class="margin-left"> <el-input-number v-model="form.fruitsNum" :step="1" :min="0"></el-input-number> <el-radio-group v-model="form.fruitsTime" style="margin-top: 15px;"> - <el-radio label="餐前" key="1">餐前</el-radio> - <el-radio label="餐后" key="2">餐后</el-radio> - <el-radio label="餐间" key="3">餐间</el-radio> + <el-radio v-for="(item,index) in fruitsTimeArray" :label="item.value" :key="index">{{item.name}}</el-radio> </el-radio-group> </el-form-item> <el-form-item label="(4) 平时吃水果的频次" prop="fruitsRate" class="margin-left"> <el-radio-group v-model="form.fruitsRate"> - <div> - <el-radio label="每天吃" key="1">每天吃</el-radio> - <el-radio label="经常吃" key="2">经常吃</el-radio> - <el-radio label="偶尔吃" key="3">偶尔吃</el-radio> - </div> - <div style="margin-top: 10px;"><el-radio label="从不吃" key="4">从不吃</el-radio></div> + <el-radio v-for="(item,index) in fruitsRateArray" :label="item.value" :key="index">{{item.name}}</el-radio> + <!--<div> + <el-radio label="每天吃" key="1">每天吃</el-radio> + <el-radio label="经常吃" key="2">经常吃</el-radio> + <el-radio label="偶尔吃" key="3">偶尔吃</el-radio> + </div> + <div style="margin-top: 10px;"><el-radio label="从不吃" key="4">从不吃</el-radio></div>--> </el-radio-group> </el-form-item> <p class="p_title_2">5、饮食习惯</p> @@ -181,32 +151,13 @@ </el-form-item> <el-form-item label="(2) 吃饭速度" prop="eatingSpeed" class="margin-left"> <el-radio-group v-model="form.eatingSpeed"> - <div> - <el-radio label="很快" key="1">很快</el-radio> - <el-radio label="偏快" key="2">偏快</el-radio> - <el-radio label="正常" key="3">正常</el-radio> - </div> - <div style="margin-top: 10px;"> - <el-radio label="偏慢" key="4">偏慢</el-radio> - <el-radio label="很慢" key="5">很慢</el-radio> - </div> + <el-radio v-for="(item,index) in eatingSpeedArray" :label="item.value" :key="index">{{item.name}}</el-radio> </el-radio-group> </el-form-item> <p class="p_title_2">6、您常吃的零食</p> <el-form-item label="(1) 常吃的零食" prop="snacks" class="margin-left"> <el-checkbox-group v-model="form.snacks"> - <el-checkbox label="面包" key="1">面包</el-checkbox> - <el-checkbox label="蛋糕" key="2">蛋糕</el-checkbox> - <el-checkbox label="饼干" key="3">饼干</el-checkbox> - <el-checkbox label="冰淇淋" key="4">冰淇淋</el-checkbox> - <el-checkbox label="糖果" key="5">糖果</el-checkbox> - <el-checkbox label="巧克力" key="6">巧克力</el-checkbox> - <el-checkbox label="方便面" key="7">方便面</el-checkbox> - <el-checkbox label="薯条" key="8">薯条</el-checkbox> - <el-checkbox label="肉干" key="10">肉干</el-checkbox> - <el-checkbox label="坚果" key="11">饮料</el-checkbox> - <el-checkbox label="果脯" key="12">果脯</el-checkbox> - <el-checkbox label="牛奶" key="13">牛奶</el-checkbox> + <el-checkbox v-for="(item,index) in snacksArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他零食 </span><el-input style="margin-top: 10px;width:70%" v-model="form.otherSnacks" placeholder="请输入其他零食名称" /></div> </el-form-item> @@ -225,26 +176,21 @@ <el-input-number style="width:35%;margin-left: 20px;" v-model="form.healthProductsDayRate" :step="1" ::min="0" ></el-input-number><span> 次/天</span> </div> </el-form-item> - - <p class="p_title_1">三、生活习惯评估</p> + </div> + <div v-show="stepArray[3]"> + <p class="p_title_1">四、生活习惯评估</p> <p class="p_title_2">1、您每天的饮水习惯</p> <el-form-item label="(1) 每天饮水量(毫升)" prop="waterNum" class="margin-left"> <el-input-number v-model="form.waterNum" :step="50" :min="0"></el-input-number> </el-form-item> <el-form-item label="(2) 喜欢喝什么水" prop="waterType" class="margin-left"> <el-checkbox-group v-model="form.waterType"> - <el-checkbox label="冰水" key="1">冰水</el-checkbox> - <el-checkbox label="温水" key="2">温水</el-checkbox> - <el-checkbox label="常温水" key="3">常温水</el-checkbox> + <el-checkbox v-for="(item,index) in waterTypeArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item label="(3) 喝水习惯" prop="waterHabit" class="margin-left"> <el-checkbox-group v-model="form.waterHabit"> - <el-checkbox label="均匀地喝" key="1">均匀地喝</el-checkbox> - <el-checkbox label="餐前多喝" key="2">餐前多喝</el-checkbox> - <el-checkbox label="餐后多喝" key="3">餐后多喝</el-checkbox> - <el-checkbox label="餐间多喝" key="4">餐间多喝</el-checkbox> - <el-checkbox label="随时喝" key="5">随时喝</el-checkbox> + <el-checkbox v-for="(item,index) in waterHabitArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <p class="p_title_2">2、您常喝的饮品和每周频次</p> @@ -277,16 +223,12 @@ <p class="p_title_2">3、您的饮酒习惯</p> <el-form-item label="(1) 是否喝酒" prop="drinkWineFlag" class="margin-left"> <el-radio-group v-model="form.drinkWineFlag"> - <el-radio label="经常饮酒" key="1">经常饮酒</el-radio> - <el-radio label="不饮酒" key="2">不饮酒</el-radio> - <el-radio label="偶尔" key="3">偶尔</el-radio> + <el-radio v-for="(item,index) in drinkWineFlagArray" :label="item.value" :key="index">{{item.name}}</el-radio> </el-radio-group> </el-form-item> <el-form-item label="(2) 通常喝什么酒" prop="drinkWineClassify" class="margin-left"> <el-checkbox-group v-model="form.drinkWineClassify"> - <el-checkbox label="白酒" key="1">白酒</el-checkbox> - <el-checkbox label="红酒" key="2">红酒</el-checkbox> - <el-checkbox label="啤酒" key="3">啤酒</el-checkbox> + <el-checkbox v-for="(item,index) in drinkWineClassifyArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他酒 </span><el-input style="margin-top: 10px;width:70%" v-model="form.otherWineClassify" placeholder="请输入其他酒名称" /></div> </el-form-item> @@ -334,13 +276,7 @@ </el-form-item> <el-form-item label="(2) 工作性质" prop="workType" style="padding-top: 10px;"> <el-checkbox-group v-model="form.workType"> - <el-checkbox label="工作时间长" key="1">工作时间长</el-checkbox> - <el-checkbox label="久坐" key="2">久坐</el-checkbox> - <el-checkbox label="久站" key="3">久站</el-checkbox> - <el-checkbox label="走动多" key="4">走动多</el-checkbox> - <el-checkbox label="强度大" key="5">强度大</el-checkbox> - <el-checkbox label="用电脑多" key="6">用电脑多</el-checkbox> - <el-checkbox label="体力工作多" key="7">体力工作多</el-checkbox> + <el-checkbox v-for="(item,index) in workTypeArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <p class="p_title_2">4、您的排便状况</p> @@ -355,12 +291,9 @@ <el-form-item label="(2) 排便时间" prop="defecationTime" style="padding-top: 10px;"> <el-checkbox-group v-model="form.defecationTime"> - <el-checkbox label="上午" key="1">上午</el-checkbox> - <el-checkbox label="中午" key="2">中午</el-checkbox> - <el-checkbox label="晚上" key="3">晚上</el-checkbox> + <el-checkbox v-for="(item,index) in defecationTimeArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> - <el-form-item label="(2) 排便情况" prop="defecationSituation" style="padding-top: 10px;"> <div> <span>形状</span><el-input class="width-70-left-8-right-5" v-model="form.defecationShape" placeholder="请输入形状" /> @@ -375,8 +308,9 @@ <span>颜色</span><el-input class="width-70-left-8-right-5" v-model="form.defecationColor" placeholder="请输入颜色" /> </div> </el-form-item> - - <p class="p_title_1">四、运动习惯评估</p> + </div> + <div v-show="stepArray[4]"> + <p class="p_title_1">五、运动习惯评估</p> <p class="p_title_2">1、运动频率</p> <el-form-item label="(1) 每周运动情况" prop="motionSituation" class="margin-left"> <div> @@ -390,58 +324,47 @@ </div> </el-form-item> <p class="p_title_2">2、运动方式、项目</p> - <el-form-item label="(1) 运动方式" prop="motionMode" class="margin-left"> + <!--<el-form-item label="(1) 运动方式" prop="motionMode" class="margin-left"> <el-radio-group v-model="form.motionMode"> <el-radio label="有氧" key="1">有氧</el-radio> <el-radio label="无氧" key="2">无氧</el-radio> <el-radio label="有氧无氧相结合" key="3">有氧无氧相结合</el-radio> </el-radio-group> - </el-form-item> - <el-form-item label="(2) 运动项目" prop="motionProject" class="margin-left"> + </el-form-item>--> + <el-form-item label="(1) 运动方式、项目" prop="motionProject" class="margin-left"> <div><span>有氧运动</span> <el-checkbox-group v-model="form.aerobicMotionClassify"> - <el-checkbox label="跳绳" key="1">跳绳</el-checkbox> - <el-checkbox label="跑步" key="2">跑步</el-checkbox> - <el-checkbox label="游泳" key="3">游泳</el-checkbox> + <el-checkbox v-for="(item,index) in aerobicMotionClassifyArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </div> <div><span>有氧运动</span> <el-checkbox-group v-model="form.anaerobicMotionClassify"> - <el-checkbox label="撸铁" key="1">撸铁</el-checkbox> - <el-checkbox label="俯卧撑" key="2">俯卧撑</el-checkbox> + <el-checkbox v-for="(item,index) in anaerobicMotionClassifyArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </div> <div><span>有氧无氧结合运动</span> <el-checkbox-group v-model="form.anaerobicAerobicMotionClassify"> - <el-checkbox label="拳击" key="1">拳击</el-checkbox> - <el-checkbox label="瑜伽" key="2">瑜伽</el-checkbox> + <el-checkbox v-for="(item,index) in anaerobicAerobicMotionClassifyArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </div> <div><span>其他项目 </span><el-input style="margin-top: 10px;width:70%" v-model="form.otherMotionClassify" placeholder="请输入其他运动项目名称" /></div> </el-form-item> <el-form-item label="(2) 运动场地" prop="motionField" class="margin-left"> <el-checkbox-group v-model="form.motionField"> - <el-checkbox label="居家" key="1">居家</el-checkbox> - <el-checkbox label="健身房" key="2">健身房</el-checkbox> - <el-checkbox label="户外" key="3">居家</el-checkbox> - <el-checkbox label="瑜伽馆" key="4">健身房</el-checkbox> + <el-checkbox v-for="(item,index) in motionFieldArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他场地 </span><el-input style="margin-top: 10px;width:70%" v-model="form.otherMotionField" placeholder="请输入其他运动场地名称" /></div> </el-form-item> - - <p class="p_title_1">五、睡眠质量评估</p> + </div> + <div v-show="stepArray[5]"> + <p class="p_title_1">六、睡眠质量评估</p> <p class="p_title_2">1、您的睡眠状况</p> <el-form-item label="(1) 一般晚上几点睡" prop="sleepTime" class="margin-left"> <el-time-select v-model="form.sleepTime" :picker-options="{ start: '00:00', step: '01:00', end: '24:00' }" placeholder="请选择时间" :editable="false"/> </el-form-item> <el-form-item label="(2) 睡眠质量" prop="sleepQuality" class="margin-left"> <el-checkbox-group v-model="form.sleepQuality"> - <el-checkbox label="好" key="1">好</el-checkbox> - <el-checkbox label="一般" key="2">一般</el-checkbox> - <el-checkbox label="入睡难" key="3">入睡难</el-checkbox> - <el-checkbox label="失眠" key="4">失眠</el-checkbox> - <el-checkbox label="易醒" key="5">易醒</el-checkbox> - <el-checkbox label="多梦" key="6">多梦</el-checkbox> + <el-checkbox v-for="(item,index) in sleepQualityArray" :label="item.value" :key="index">{{item.name}}</el-checkbox> </el-checkbox-group> </el-form-item> <p class="p_title_2">2、辅助入睡药物情况</p> @@ -462,12 +385,13 @@ <span>熬夜频率 </span><el-input-number type="number" class="width-50-left-8-right-5" v-model="form.stayupLateWeekNum" :step="1" :min="0"></el-input-number><span>次/周</span> </div> </el-form-item> - - <p class="p_title_1">六、既往病史/用药史评估</p> + </div> + <div v-show="stepArray[6]"> + <p class="p_title_1">七、既往病史/用药史评估</p> <p class="p_title_2">1、家族疾病史情况</p> <el-form-item label="(1)家族疾病史(直系亲属例如爸爸妈妈、爷爷奶奶、外公外婆有相关疾病)(可多选)" prop="familyIllnessHistory" class="margin-left"> <el-checkbox-group v-model="form.familyIllnessHistory"> - <el-checkbox v-for="(item, index) in familyIllnessHistoryArray" :key="index" :label="item" key="1">{{item}}</el-checkbox> + <el-checkbox v-for="(item, index) in familyIllnessHistoryArray" :key="index" :label="item.value" >{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他家族病史</span> <el-input @@ -483,7 +407,7 @@ <p class="p_title_2">2、手术情况</p> <el-form-item label="(1) 手术史,因病进行过手术治疗,手术的部分(可多选)" prop="familyIllnessHistory" class="margin-left"> <el-checkbox-group v-model="form.operationHistory"> - <el-checkbox v-for="(item, index) in operationHistoryArray" :key="index" :label="item" key="1">{{item}}</el-checkbox> + <el-checkbox v-for="(item, index) in operationHistoryArray" :key="index" :label="item.value" >{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他手术史</span> <el-input @@ -520,7 +444,7 @@ </el-form-item> <el-form-item label="(2) 长期服用药物有(可多选)" prop="longEatDrugClassify" class="margin-left"> <el-checkbox-group v-model="form.longEatDrugClassify"> - <el-checkbox v-for="(item, index) in longEatDrugClassifyArray" :key="index" :label="item" key="1">{{item}}</el-checkbox> + <el-checkbox v-for="(item, index) in longEatDrugClassifyArray" :key="index" :label="item.value">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他长期服用的药物</span> <el-input @@ -553,7 +477,7 @@ <el-form-item label="(2) 引起过敏源(可多选)" prop="allergen" class="margin-left"> <el-checkbox-group v-model="form.allergen"> - <el-checkbox v-for="(item, index) in allergenArray" :key="index" :label="item" key="1">{{item}}</el-checkbox> + <el-checkbox v-for="(item, index) in allergenArray" :key="index" :label="item.value">{{item.name}}</el-checkbox> </el-checkbox-group> <div><span>其他过敏源</span> <el-input @@ -566,19 +490,50 @@ ></el-input> </div> </el-form-item> + </div> - <el-form-item style="text-align: center; margin: 30px auto"> + <div v-show="stepArray[7]"> + <p class="p_title_1">八、调理项目和提交报告</p> + <p class="p_title_2">1、调理项目</p> + <el-form-item label="(1) 请选择调理项目" prop="conditioningProjectId"> + <el-select v-model="form.conditioningProjectId" placeholder="请选择"> + <el-option + v-for="dict in conditioningProjectIdOption" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="parseInt(dict.dictValue)" + /> + </el-select> + </el-form-item> + </div> + <el-form-item style="text-align: center; margin: 30px auto" > + <el-button + @click="nextStep(-1)" + style="margin-right: 10px;width: 40%" + v-show="stepActive != 0" + >上一步</el-button + > + <el-button + type="primary" + @click="nextStep(1)" + style="width: 40%" + v-show="stepActive != stepArray.length-1" + >下一步</el-button + > <el-button type="primary" @click="addCustomer()" - style="margin-right: 50px" - >已填写完成,提交数据</el-button + style="width: 40%" + v-show="stepActive == stepArray.length-1" + >提交数据</el-button > </el-form-item> + </el-form> </section> </template> <script> +import { getDictData } from "@/api/custom/customerInvestigation"; const logo = require("@/assets/logo/st_logo.png"); export default { name: "index", @@ -586,42 +541,163 @@ export default { return { logo, submitFlag: false, - familyIllnessHistoryArray:["高血压病","脑卒中","冠心病","外周血管病","心力衰竭","糖尿病","肥胖症","慢性肾脏疾病","骨质疏松", "痛风","精神疾病","恶性肿瘤","慢性阻塞性肺病","风湿性免疫性疾病"], - operationHistoryArray:["头颅(含脑)","眼","耳鼻咽喉","颌面部及口腔","颈部或甲状腺","胸部(含肺部)","心脏(含心脏介入)","外周血管","胃肠","肝胆","肾脏","脊柱","四肢及关节","前列腺","妇科","乳腺","膀胱"], - longEatDrugClassifyArray:["降压药","降糖药","降尿酸药","抗心律失常药","缓解哮喘药物","抗压郁药物","雌激素类药物","利尿剂", - "中草药","避孕药","强的松类药物","镇静剂或安眠药","调值药(降脂药)","解热镇痛药(如布洛芬等)"], - allergenArray:["青霉素","磺胺类","链霉素","头孢类","鸡蛋","牛奶","海鲜","花粉或尘螨","粉尘","洗洁剂","化妆品"], + //调味品种类 + condimentArray:[ + {"name":"鸡精", "value":"1"}, + {"name":"耗油", "value":"2"}, + {"name":"生抽", "value":"3"}, + {"name":"老抽", "value":"4"}, + {"name":"香油", "value":"5"}, + {"name":"浓汤宝", "value":"6"}, + {"name":"鸡粉", "value":"7"}, + {"name":"花椒", "value":"8"}, + {"name":"辣椒油", "value":"9"} + ], + cookingStyleArray:[ + {"name":"煎","value":"1"},{"name":"烤","value":"2"},{"name":"炸","value":"3"},{"name":"卤","value":"4"}, + {"name":"腌","value":"5"},{"name":"腊","value":"6"},{"name":"煲","value":"7"},{"name":"炒","value":"8"}, + {"name":"蒸","value":"9"},{"name":"刺身","value":"10"},{"name":"水煮","value":"11"} + ], + cookingStyleRateArray:["煎","炸","卤","腌","腊","煲"], + washVegetablesStyleArray:[ + {"name":"先切后洗","value": "1"},{"name":"先洗后切","value": "2"},{"name":"切后浸泡","value": "3"} + ], + breakfastTypeArray:[ + {"name":"不吃","value": "1"},{"name":"偶尔吃","value": "2"},{"name":"每天吃","value": "3"} + ], + lunchTypeArray:[ + {"name":"外卖","value":"1"},{"name":"自带餐","value":"2"},{"name":"快餐","value":"3"},{"name":"餐厅","value":"4"} + ], + dinnerArray:[ + {"name":"餐馆吃","value":"1"},{"name":"在家吃","value":"2"},{"name":"丰盛","value":"3"},{"name":"清淡","value":"4"} + ], + dietHotAndColdArray:[ + {"name":"偏冷食","value":"1"},{"name":"偏冷食","value":"2"},{"name":"正常","value":"3"} + ], + dietFlavorArray:[ + {"name":"偏油","value":"1"},{"name":"偏咸","value":"2"},{"name":"偏辣","value":"3"}, + {"name":"偏甜","value":"4"},{"name":"偏酸","value":"5"},{"name":"清淡","value":"6"} + ], + vegetablesRateTypeArray:[ + {"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} + ], + fruitsTimeArray:[ + {"name":"餐前","value":"1"},{"name":"餐后","value":"2"},{"name":"餐间","value":"3"} + ], + fruitsRateArray:[ + {"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} + ], + eatingSpeedArray:[ + {"name":"很快","value":"1"},{"name":"偏快","value":"2"},{"name":"正常","value":"3"},{"name":"偏慢","value":"4"} + ,{"name":"很慢","value":"5"} + ], + snacksArray:[ + {"name":"面包","value":"1"},{"name":"蛋糕","value":"2"},{"name":"饼干","value":"3"},{"name":"冰淇淋","value":"4"} + ,{"name":"糖果","value":"5"},{"name":"巧克力","value":"6"},{"name":"方便面","value":"7"},{"name":"薯条","value":"8"},{"name":"肉干","value":"9"}, + {"name":"坚果","value":"10"},{"name":"饮料","value":"11"},{"name":"果脯","value":"12"},{"name":"牛奶","value":"13"} + ], + waterTypeArray:[ + {"name":"冰水","value":"1"},{"name":"温水","value":"2"},{"name":"常温水","value":"3"} + ], + waterHabitArray:[ + {"name":"均匀地喝","value":"1"},{"name":"餐前多喝","value":"2"},{"name":"餐后多喝","value":"3"},{"name":"餐间多喝","value":"4"}, + {"name":"随时喝","value":"5"} + ], + drinksNumArray:["老火汤","咖啡","浓茶","奶茶","冷饮","碳酸饮料","甜饮料","鲜榨果汁"], + drinkWineFlagArray:[ + {"name":"经常饮酒","value": "1"},{"name":"不饮酒","value": "2"},{"name":"偶尔","value": "3"} + ], + drinkWineClassifyArray:[ + {"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"} + ], + drinkWineAmountArray:["白酒","啤酒","红酒","其他"], + smokeRateArray:["每天抽烟","烟龄","已戒烟"], + workTypeArray:[ + {"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"}, + {"name":"走动多","value": "4"},{"name":"强度大","value": "5"},{"name":"用电脑多","value": "6"},{"name":"体力工作多","value": "7"} + ], + defecationTimeArray:[ + {"name":"上午","value": "1"},{"name":"中午","value": "2"},{"name":"晚上","value": "3"} + ], + aerobicMotionClassifyArray:[ + {"name":"跳绳","value": "1"},{"name":"跑步","value": "2"},{"name":"游泳","value": "3"} + ], + anaerobicMotionClassifyArray:[ + {"name":"撸铁","value": "1"},{"name":"俯卧撑","value": "2"} + ], + anaerobicAerobicMotionClassifyArray:[ + {"name":"拳击","value": "1"},{"name":"瑜伽","value": "2"} + ], + motionFieldArray:[ + {"name":"居家","value": "1"},{"name":"健身房","value": "2"},{"name":"户外","value": "3"}, {"name":"健身房","value": "4"} + ], + sleepQualityArray:[ + {"name":"好","value": "1"},{"name":"一般","value": "2"},{"name":"入睡难","value": "3"}, + {"name":"失眠","value": "4"},{"name":"易醒","value": "5"},{"name":"多梦","value": "6"} + ], + familyIllnessHistoryArray:[ + {"name":"高血压病","value": "1"},{"name":"脑卒中","value": "2"},{"name":"冠心病","value": "3"}, + {"name":"外周血管病","value": "4"},{"name":"心力衰竭","value": "5"},{"name":"冠心病","value": "6"}, + {"name":"肥胖症","value": "7"},{"name":"慢性肾脏疾病","value": "8"},{"name":"骨质疏松","value": "9"}, + {"name":"痛风","value": "10"},{"name":"精神疾病","value": "11"},{"name":"恶性肿瘤","value": "12"}, + {"name":"慢性阻塞性肺病","value": "13"},{"name":"风湿性免疫性疾病","value": "14"}, + ], + operationHistoryArray:[ + {"name":"头颅(含脑)","value": "1"},{"name":"眼","value": "2"},{"name":"耳鼻咽喉","value": "3"}, + {"name":"颌面部及口腔","value": "4"},{"name":"颈部或甲状腺","value": "5"},{"name":"胸部(含肺部)","value": "6"}, + {"name":"心脏(含心脏介入)","value": "7"},{"name":"外周血管","value": "8"},{"name":"胃肠","value": "9"}, + {"name":"肝胆","value": "10"},{"name":"肾脏","value": "11"},{"name":"脊柱","value": "12"}, + {"name":"四肢及关节","value": "13"},{"name":"前列腺","value": "14"},{"name":"妇科","value": "15"},{"name":"乳腺","value": "16"} + ,{"name":"膀胱","value": "17"} + ], + longEatDrugClassifyArray:[ + {"name":"降压药","value": "1"},{"name":"降糖药","value": "2"},{"name":"降尿酸药","value": "3"}, + {"name":"抗心律失常药","value": "4"},{"name":"缓解哮喘药物","value": "5"},{"name":"抗压郁药物","value": "6"}, + {"name":"雌激素类药物","value": "7"},{"name":"利尿剂","value": "8"},{"name":"中草药","value": "9"}, + {"name":"避孕药","value": "10"},{"name":"强的松类药物","value": "11"},{"name":"镇静剂或安眠药","value": "12"}, + {"name":"调值药(降脂药)","value": "13"},{"name":"解热镇痛药(如布洛芬等)","value": "14"} + ], + allergenArray:[ + {"name":"青霉素","value": "1"},{"name":"磺胺类","value": "2"},{"name":"链霉素","value": "3"}, + {"name":"头孢类","value": "4"},{"name":"鸡蛋","value": "5"},{"name":"牛奶","value": "6"}, + {"name":"海鲜","value": "7"},{"name":"花粉或尘螨","value": "8"},{"name":"粉尘","value": "9"}, + {"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} + ], + conditioningProjectIdOption:[], + stepArray: [true,false,false,false,false,false,false,false], + stepActive: 0, form: { name: null, phone: null, + conditioningProjectId: 0, sex: 1, age: null, - condiment:["耗油","香油","辣椒油","浓汤宝","鸡精","生抽"], + condiment:["1","5","9","6","1","3"], otherCondiment:null, - cookingStyle: ["炒","蒸","卤","水煮"], + cookingStyle: ["8","9","4","11"], cookingStyleRate:[1,1,1,1,1,1], - washVegetablesStyle:["先洗后切"], + washVegetablesStyle:["2"], otherWashVegetablesStyle: null, - breakfastType:"不吃", + breakfastType:"1", breakfastFood: null, - lunchType:["快餐"], - dinner:["在家吃"], + lunchType:["3"], + dinner:["2"], vegetableRate: 5, commonMeat: null, dinnerTime: "07:00", supperNum:1, supperFood:null, - dietHotAndCold: "正常", - dietFlavor: ["偏油","偏咸"], + dietHotAndCold: "3", + dietFlavor: ["1","2"], vegetablesNum: 1, - vegetablesRateType: "偶尔吃", + vegetablesRateType: "3", fruitsNum: 1, - fruitsTime: "餐后", - fruitsRate: "经常吃", + fruitsTime: "2", + fruitsRate: "2", riceNum: 1, riceFull: 8, - eatingSpeed: "正常", - snacks: ["坚果","饮料","牛奶","果脯","饼干","面包"], + eatingSpeed: "3", + snacks: ["10","11","13","12","3","1"], otherSnacks:null, healthProductsFlag: 0, healthProductsBrand:null, @@ -630,21 +706,21 @@ export default { healthProductsDayRate:0, waterNum: 1500, - waterType: ["温水"], - waterHabit: ["随时喝"], + waterType: ["2"], + waterHabit: ["5"], drinksNum:[0,0,0,0,0,0,0,0], - drinkWineFlag: "偶尔", - drinkWineClassify:["啤酒"], + drinkWineFlag: "3", + drinkWineClassify:["3"], otherWineClassify: null, drinkWineAmount:[0,0,0,0], smokeFlag: 0, smokeRate:[0,0,0], secondSmoke: 0, workIndustry: null, - workType:["久坐"], + workType:["2"], defecationNum: 1, otherDefecationNum:0, - defecationTime: ["上午"], + defecationTime: ["1"], defecationShape: null, defecationSmell: null, defecationSpeed: null, @@ -653,16 +729,16 @@ export default { motionNum: 3, motionDuration: 40, motionTime: "08:00", - motionMode:"有氧", - aerobicMotionClassify:["跑步"], + //motionMode:"有氧", + aerobicMotionClassify:["2"], anaerobicMotionClassify:[], anaerobicAerobicMotionClassify:[], otherMotionClassify: null, - motionField:["居家"], + motionField:["1"], otherMotionField:null, sleepTime: "23:00", - sleepQuality:["一般"], + sleepQuality:["2"], sleepDrugFlag: 0, sleepDrug: null, stayupLateFlag: 0, @@ -683,7 +759,33 @@ export default { otherAllergen:null }, rules: { - + name: [ + { required: true, trigger: "blur", message: "请填写姓名" }, + { min: 1, max: 20, trigger: "blur", message: "姓名过长" }, + ], + sex: [{ required: true, trigger: "blur", message: "请选择性别" }], + age: [ + { required: true, trigger: "blur", message: "请填写年龄" }, + { + required: true, + trigger: "blur", + pattern: /^[1-9]\d*$/, + message: "年龄格式不正确", + }, + ], + phone: [ + { required: true, trigger: "blur", message: "请填写手机号" }, + { required: true, trigger: "blur", message: "请填写正确的手机号" }, + { + required: true, + trigger: "blur", + pattern: /^[0-9]{5,11}$/, + message: "手机号格式不正确", + }, + ], + conditioningProjectId:[ + { required: true, trigger: "blur", message: "请选择调理项目" } + ] }, physicalSignsList: [], bloodDataList: [], @@ -693,13 +795,56 @@ export default { }, methods: { addCustomer(){ - console.log(this.form.sex); - console.log(this.form.condiment); - console.log(this.form.cookingStyle); + this.$refs.form.validate((valid) => { + if (valid) { + if(stepActive == stepArray.length-1){ + /*addCustomer(cusMessage).then((response) => { + if (response.code === 200) { + console.log("成功"); + this.$notify({ + title: "提交成功", + message: "", + type: "success", + }); + this.submitFlag = true; + } + });*/ + } + } else { + this.$message({ + message: "数据未填写完整", + type: "warning", + }); + } + }); + + }, + nextStep(step){ + this.$refs.form.validate((valid) => { + if(valid || step < 0){ + this.stepArray[this.stepActive] = false; + this.stepActive = this.stepActive + step; + this.stepArray[this.stepActive] = true; + this.goTop(); + }else{ + this.$message({ + message: "数据未填写完整", + type: "warning", + }); + } + }); + }, + goTop (){ + window.scroll(0, 0); + }, + getDict(type){ + getDictData(type).then(response => { + this.conditioningProjectIdOption = response.data; + }); } }, created() { - + this.getDict("conditioning_project"); }, beforeCreate() { document.title = this.$route.meta.title; From ca989a633636ac9390c754f698c3a4becc894635 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Mon, 25 Jan 2021 00:22:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/CommonController.java | 20 ++ .../common/InvestigateController.java | 18 +- .../framework/config/SecurityConfig.java | 3 +- .../src/api/custom/customerInvestigation.js | 9 + .../custom/investigate/questionnaire.vue | 10 +- .../custom/subhealthy/investigation/index.vue | 210 ++++++++++++++---- 6 files changed, 225 insertions(+), 45 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java index 4bfa9b404..f2636c7f5 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/CommonController.java @@ -78,6 +78,26 @@ public class CommonController { } } + /** + * 通用上传请求(无需登录认证) + */ + @PostMapping("/common/customerUploadFile") + public AjaxResult customerUploadFile(MultipartFile file) throws Exception { + try { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String url = serverConfig.getUrl() + fileName; + AjaxResult ajax = AjaxResult.success(); + ajax.put("fileName", fileName); + ajax.put("url", url); + return ajax; + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + /** * 本地资源通用下载 */ diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java index 20fc13e2d..a70738998 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java @@ -4,18 +4,21 @@ import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.page.TableDataInfo; import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.domain.SysCustomerHealthy; import com.stdiet.custom.domain.SysPhysicalSigns; import com.stdiet.custom.dto.request.CustomerInvestigateRequest; +import com.stdiet.custom.service.ISysCustomerHealthyService; import com.stdiet.custom.service.ISysCustomerService; import com.stdiet.custom.service.ISysPhysicalSignsService; import com.stdiet.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import java.util.List; /** - * 客户信息调查Controller + * 客户相关信息调查Controller * * @author xzj * @date 2020-12-31 @@ -33,6 +36,9 @@ public class InvestigateController extends BaseController { @Autowired private ISysDictTypeService dictTypeService; + @Autowired + private ISysCustomerHealthyService sysCustomerHealthyService; + /** * 建立客户信息档案 */ @@ -68,6 +74,14 @@ public class InvestigateController extends BaseController { return AjaxResult.success(dictTypeService.selectDictDataByType(dictType)); } - + /** + * 新增客户健康 + */ + @PostMapping("/addCustomerHealthy") + public AjaxResult addCustomerHealthy(@RequestBody SysCustomerHealthy sysCustomerHealthy) + { + System.out.println(sysCustomerHealthy.getSex()); + return toAjax(1); + } } diff --git a/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java b/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java index c677b63fc..6e78cbf75 100644 --- a/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java +++ b/stdiet-framework/src/main/java/com/stdiet/framework/config/SecurityConfig.java @@ -101,7 +101,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/custom/contract/file/**", "/custom/wxUserInfo/wx/**", "/custom/wxUserLog/wx/**", - "/investigate/**" + "/investigate/**", + "/common/customerUploadFile" ).anonymous() .antMatchers( HttpMethod.GET, diff --git a/stdiet-ui/src/api/custom/customerInvestigation.js b/stdiet-ui/src/api/custom/customerInvestigation.js index 7c184e9ab..57c739566 100644 --- a/stdiet-ui/src/api/custom/customerInvestigation.js +++ b/stdiet-ui/src/api/custom/customerInvestigation.js @@ -25,3 +25,12 @@ export function getDictData(dictType) { method: 'get' }) } + +// 新增客户健康 +export function addCustomerHealthy(data) { + return request({ + url: '/investigate/addCustomerHealthy', + method: 'post', + data: data + }) +} diff --git a/stdiet-ui/src/views/custom/investigate/questionnaire.vue b/stdiet-ui/src/views/custom/investigate/questionnaire.vue index 4a14780a2..12f3734f5 100644 --- a/stdiet-ui/src/views/custom/investigate/questionnaire.vue +++ b/stdiet-ui/src/views/custom/investigate/questionnaire.vue @@ -376,10 +376,15 @@ export default { }, addCustomer() { if (this.submitFlag) { - return; + this.$message({ + message: "请勿重复提交", + type: "warning", + }); + return; } this.$refs.form.validate((valid) => { if (valid) { + this.submitFlag = true; let cusMessage = Object.assign({}, this.form); cusMessage.bloodData = cusMessage.bloodData != null @@ -404,7 +409,8 @@ export default { message: "", type: "success", }); - this.submitFlag = true; + }else{ + this.submitFlag = false; } }); } else { diff --git a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue index 7ed11ce32..2da2c118d 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -26,6 +26,17 @@ <el-form-item label="手机号" prop="phone" maxlength="20"> <el-input type="number" v-model="form.phone" placeholder="请输入手机号" /> </el-form-item> + + <el-form-item label="调理项目" prop="conditioningProjectId"> + <el-select v-model="form.conditioningProjectId" placeholder="请选择"> + <el-option + v-for="dict in conditioningProjectIdOption" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="parseInt(dict.dictValue)" + /> + </el-select> + </el-form-item> </div> <div v-show="stepArray[1]"> @@ -493,17 +504,28 @@ </div> <div v-show="stepArray[7]"> - <p class="p_title_1">八、调理项目和提交报告</p> - <p class="p_title_2">1、调理项目</p> - <el-form-item label="(1) 请选择调理项目" prop="conditioningProjectId"> - <el-select v-model="form.conditioningProjectId" placeholder="请选择"> - <el-option - v-for="dict in conditioningProjectIdOption" - :key="dict.dictValue" - :label="dict.dictLabel" - :value="parseInt(dict.dictValue)" - /> - </el-select> + <p class="p_title_1">八、体检报告</p> + <p class="p_title_2">1、体检报告</p> + <el-form-item label="(1) 请上传相应的体检报告" prop="fileList" class="margin-left"> + <el-upload style="margin-left: 20px;" + class="upload-demo" + ref="upload" + :action="upload.url" + :limit="upload.limit" + :disabled="upload.isUploading" + :file-list="upload.fileList" + :multiple="upload.multiple" + :on-change="handleFileChange" + :on-exceed="handleFileexceed" + :on-progress="handleFileUploadProgress" + :on-success="handleFileSuccess" + :on-error="handleFileFail" + :data="upload.data" + :auto-upload="false"> + <el-button slot="trigger" size="small" type="primary">选取文件</el-button> + <el-button style="margin-left: 10px;" size="small" @click="upload.fileList = []">重置</el-button> + <div slot="tip" class="el-upload__tip">提示:最多可上传三份,且每份文件不超过5M</div> + </el-upload> </el-form-item> </div> <el-form-item style="text-align: center; margin: 30px auto" > @@ -522,7 +544,7 @@ > <el-button type="primary" - @click="addCustomer()" + @click="submit()" style="width: 40%" v-show="stepActive == stepArray.length-1" >提交数据</el-button @@ -533,11 +555,17 @@ </section> </template> <script> -import { getDictData } from "@/api/custom/customerInvestigation"; +import { getDictData,addCustomerHealthy } from "@/api/custom/customerInvestigation"; const logo = require("@/assets/logo/st_logo.png"); export default { name: "index", data() { + const checkReportFile = (rule, value, callback) => { + if (this.upload.fileList == null || this.upload.fileList.length === 0) { + return callback(new Error('请选择需要上传的体检报告')) + } + callback(); + }; return { logo, submitFlag: false, @@ -664,14 +692,14 @@ export default { {"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} ], conditioningProjectIdOption:[], - stepArray: [true,false,false,false,false,false,false,false], - stepActive: 0, + stepArray: [false,false,false,false,false,false,false,true], + stepActive: 7, form: { - name: null, - phone: null, + name: "jun", + phone: "152708980", conditioningProjectId: 0, sex: 1, - age: null, + age: 18, condiment:["1","5","9","6","1","3"], otherCondiment:null, cookingStyle: ["8","9","4","11"], @@ -756,7 +784,26 @@ export default { allergyFlag: 0, allergySituation: null, allergen:[], - otherAllergen:null + otherAllergen:null, + fileNameList:[] + }, + upload: { + // 是否禁用上传 + isUploading: false, + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/common/customerUploadFile", + // 设置上传的请求头部 + headers: {}, + // 其他需要携带的数据 + data:{}, + //文件列表 + fileList:[], + //同时上传文件上限 + limit: 3, + //每个文件大小 + fileSize: 1024 * 1024 * 5, + //是否支持同时选择多张 + multiple: true }, rules: { name: [ @@ -783,33 +830,41 @@ export default { message: "手机号格式不正确", }, ], - conditioningProjectId:[ - { required: true, trigger: "blur", message: "请选择调理项目" } - ] + conditioningProjectId:[ + { required: true, trigger: "blur", message: "请选择调理项目" } + ], + /*fileList:[ + {required: true, trigger: "blur", validator: checkReportFile} + ]*/ }, - physicalSignsList: [], - bloodDataList: [], - moistureDataList: [], + //需要将数组转成字符串的属性名称 + arrayName:[ + "condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor", + "snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate", + "workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", + "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "fileNameList" + ] }; }, methods: { - addCustomer(){ + submit(){ + if (this.submitFlag) { + this.$message({ + message: "请勿重复提交", + type: "warning", + }); + return; + } this.$refs.form.validate((valid) => { if (valid) { - if(stepActive == stepArray.length-1){ - /*addCustomer(cusMessage).then((response) => { - if (response.code === 200) { - console.log("成功"); - this.$notify({ - title: "提交成功", - message: "", - type: "success", - }); - this.submitFlag = true; - } - });*/ - } + this.submitFlag = true; + this.form.fileNameList = []; + if(this.upload.fileList.length > 0){ + this.$refs.upload.submit(); + }else{ + this.addCustomerHealthy(); + } } else { this.$message({ message: "数据未填写完整", @@ -818,6 +873,27 @@ export default { } }); + }, + addCustomerHealthy(){ + //数据处理 + let cusMessage = Object.assign({}, this.form); + this.arrayName.forEach(function (item, index) { + cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null; + }) + addCustomerHealthy(cusMessage).then((response) => { + if (response.code === 200) { + this.$notify({ + title: "提交成功", + message: "", + type: "success", + }); + }else{ + this.submitFlag = false; + this.upload.isUploading = false; + } + }); + console.log(cusMessage.cookingStyleRate); + console.log(cusMessage.washVegetablesStyle); }, nextStep(step){ this.$refs.form.validate((valid) => { @@ -841,7 +917,61 @@ export default { getDictData(type).then(response => { this.conditioningProjectIdOption = response.data; }); - } + }, + //监控上传文件列表 + handleFileChange(file, fileList) { + /*console.log("------------") + let existFile = fileList.slice(0, fileList.length - 1).find(f => f.name === file.name); + if (existFile) { + this.$message({ + message: "当前文件已经存在", + type: "warning", + }); + fileList.pop(); + }*/ + let sizeFlag = file.size > this.upload.fileSize; + if (sizeFlag) { + this.$message({ + message: "当前文件过大", + type: "warning", + }); + fileList.pop(); + } + this.upload.fileList = fileList; + + }, + // 文件数量超过限度 + handleFileexceed(file, fileList){ + //console.log(this.upload.fileList.length); + this.$message({ + message: "最多可上传"+ this.upload.limit +"份文件", + type: "warning", + }); + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + if(response != null && response.code === 200){ + this.form.fileNameList.push(response.fileName); + if(this.form.fileNameList.length === this.upload.fileList.length){ + //文件全部上传成功,则调用添加客户信息方法 + this.addCustomerHealthy(); + } + }else{ + this.upload.isUploading = false; + this.submitFlag = false; + this.$message.error('文件上传失败'); + } + }, + // 文件上传失败处理 + handleFileFail(err, file, fileList){ + this.$message.error('文件上传失败'); + this.upload.isUploading = false; + this.submitFlag = false; + } }, created() { this.getDict("conditioning_project"); From bc63f7bbf4fc70c97fd67f8f52afaf7cb7417aae Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Mon, 25 Jan 2021 16:13:32 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E4=BD=93=E5=BE=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=81=E5=AE=A2=E6=88=B7=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/InvestigateController.java | 13 +- .../custom/SysCustomerController.java | 56 +- .../custom/SysCustomerHealthyController.java | 16 +- .../custom/domain/SysCustomerHealthy.java | 26 +- .../domain/SysCustomerPhysicalSigns.java | 28 +- .../request/CustomerInvestigateRequest.java | 54 +- .../mapper/SysCustomerHealthyMapper.java | 9 + .../custom/mapper/SysCustomerMapper.java | 10 - .../SysCustomerPhysicalSignsMapper.java | 27 +- .../service/ISysCustomerHealthyService.java | 21 +- .../ISysCustomerPhysicalSignsService.java | 36 +- .../custom/service/ISysCustomerService.java | 33 - .../impl/SysCustomerHealthyServiceImpl.java | 92 ++- .../SysCustomerPhysicalSignsServiceImpl.java | 108 ++- .../service/impl/SysCustomerServiceImpl.java | 73 -- .../custom/SysCustomerHealthyMapper.xml | 41 +- .../mapper/custom/SysCustomerMapper.xml | 88 --- .../custom/SysCustomerPhysicalSignsMapper.xml | 115 +-- stdiet-ui/src/api/custom/healthy.js | 53 ++ stdiet-ui/src/views/custom/customer/index.vue | 120 ++- stdiet-ui/src/views/custom/healthy/index.vue | 697 ++++++++++++++++++ .../custom/investigate/questionnaire.vue | 1 - stdiet-ui/src/views/custom/order/index.vue | 8 +- .../custom/subhealthy/investigation/index.vue | 10 +- 24 files changed, 1216 insertions(+), 519 deletions(-) create mode 100644 stdiet-ui/src/api/custom/healthy.js create mode 100644 stdiet-ui/src/views/custom/healthy/index.vue diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java index a70738998..4651865cd 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/common/InvestigateController.java @@ -8,6 +8,7 @@ import com.stdiet.custom.domain.SysCustomerHealthy; import com.stdiet.custom.domain.SysPhysicalSigns; import com.stdiet.custom.dto.request.CustomerInvestigateRequest; import com.stdiet.custom.service.ISysCustomerHealthyService; +import com.stdiet.custom.service.ISysCustomerPhysicalSignsService; import com.stdiet.custom.service.ISysCustomerService; import com.stdiet.custom.service.ISysPhysicalSignsService; import com.stdiet.system.service.ISysDictTypeService; @@ -28,7 +29,7 @@ import java.util.List; public class InvestigateController extends BaseController { @Autowired - private ISysCustomerService iSysCustomerService; + private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService; @Autowired private ISysPhysicalSignsService iSysPhysicalSignsService; @@ -45,13 +46,8 @@ public class InvestigateController extends BaseController { @PostMapping("/customerInvestigate") public AjaxResult customerInvestigate(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception { - //验证是否已存在该手机号 - SysCustomer phoneCustomer = iSysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); - if(phoneCustomer != null){ - return AjaxResult.error("该手机号已存在"); - } customerInvestigateRequest.setId(null); //只能添加,无法修改 - return AjaxResult.success(iSysCustomerService.addOrupdateCustomerAndSign(customerInvestigateRequest)); + return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); } /** @@ -80,8 +76,7 @@ public class InvestigateController extends BaseController { @PostMapping("/addCustomerHealthy") public AjaxResult addCustomerHealthy(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - System.out.println(sysCustomerHealthy.getSex()); - return toAjax(1); + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); } } diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java index 494186207..83a989f04 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java @@ -4,12 +4,14 @@ import java.util.ArrayList; import java.util.List; import com.stdiet.common.utils.StringUtils; +import com.stdiet.custom.domain.SysCustomerPhysicalSigns; import com.stdiet.custom.domain.SysPhysicalSigns; import com.stdiet.common.utils.bean.ObjectUtils; import com.stdiet.custom.domain.SysRecipesPlan; import com.stdiet.custom.dto.request.CustomerInvestigateRequest; import com.stdiet.custom.dto.response.CustomerListResponse; +import com.stdiet.custom.service.ISysCustomerPhysicalSignsService; import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -36,17 +38,20 @@ public class SysCustomerController extends BaseController @Autowired private ISysCustomerService sysCustomerService; + @Autowired + private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService; + /** * 查询客户信息列表 */ @PreAuthorize("@ss.hasPermi('custom:customer:list')") @GetMapping("/list") - public TableDataInfo list(SysCustomer sysCustomer) + public TableDataInfo list(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) { startPage(); - List<SysCustomer> list = sysCustomerService.selectSysCustomerAndSignList(sysCustomer); + List<SysCustomerPhysicalSigns> list = sysCustomerPhysicalSignsService.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); if(list != null && list.size() > 0){ - for(SysCustomer sysCus : list){ + for(SysCustomerPhysicalSigns sysCus : list){ if(StringUtils.isNotEmpty(sysCus.getPhone())){ sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone())); } @@ -61,22 +66,21 @@ public class SysCustomerController extends BaseController @PreAuthorize("@ss.hasPermi('custom:customer:export')") @Log(title = "客户体征", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(SysCustomer sysCustomer) throws Exception + public AjaxResult export(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) throws Exception { - List<SysCustomer> list = sysCustomerService.selectSysCustomerAndSignList(sysCustomer); + List<SysCustomerPhysicalSigns> list = sysCustomerPhysicalSignsService.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); List<CustomerListResponse> responsesList = new ArrayList<>(); CustomerListResponse customerListResponse = null; - for (SysCustomer customer : list) { - customerListResponse = ObjectUtils.getObjectByObject(customer.getSign(), CustomerListResponse.class); - customerListResponse.setCreateTime(customer.getCreateTime()); - customerListResponse.setName(customer.getName()); - if(StringUtils.isNotEmpty(customer.getPhone())){ - customerListResponse.setPhone(StringUtils.hiddenPhoneNumber(customer.getPhone())); + for(SysCustomerPhysicalSigns sysCus : list){ + customerListResponse = ObjectUtils.getObjectByObject(sysCus, CustomerListResponse.class); + customerListResponse.setCreateTime(sysCus.getCreateTime()); + if(StringUtils.isNotEmpty(sysCus.getPhone())){ + customerListResponse.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone())); } StringBuilder signStr = new StringBuilder(); - if(customer.getSign().getSignList() != null && customer.getSign().getSignList().size() > 0){ + if(sysCus.getSignList() != null && sysCus.getSignList().size() > 0){ int i = 0; - for (SysPhysicalSigns s : customer.getSign().getSignList()) { + for (SysPhysicalSigns s : sysCus.getSignList()) { signStr.append((i != 0 ? "," : "") + s.getName()); i++; } @@ -95,7 +99,7 @@ public class SysCustomerController extends BaseController @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return AjaxResult.success(sysCustomerService.getCustomerAndSignById(id)); + return AjaxResult.success(sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsById(id)); } /** @@ -106,12 +110,7 @@ public class SysCustomerController extends BaseController @PostMapping public AjaxResult add(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception { - //验证是否已存在该手机号 - SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); - if(phoneCustomer != null){ - return AjaxResult.error("该手机号已存在"); - } - return toAjax(sysCustomerService.addOrupdateCustomerAndSign(customerInvestigateRequest)); + return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); } /** @@ -122,15 +121,7 @@ public class SysCustomerController extends BaseController @PutMapping public AjaxResult edit(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception { - SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(customerInvestigateRequest.getId()); - if(oldCustomer != null && !oldCustomer.getPhone().equals(customerInvestigateRequest.getPhone())){ - //验证是否已存在该手机号 - SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); - if(phoneCustomer != null){ - return AjaxResult.error("该手机号已存在"); - } - } - return toAjax(sysCustomerService.addOrupdateCustomerAndSign(customerInvestigateRequest)); + return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest); } /** @@ -141,10 +132,9 @@ public class SysCustomerController extends BaseController @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(sysCustomerService.delCustomerAndSignById(ids)); + return toAjax(sysCustomerPhysicalSignsService.deleteSysCustomerPhysicalSignsByIds(ids)); } - /** * 根据手机号查看用户体征 */ @@ -152,9 +142,9 @@ public class SysCustomerController extends BaseController @PreAuthorize("@ss.hasPermi('custom:customer:query')") public AjaxResult getCustomerAndSignByPhone(@RequestParam("phone")String phone) { - SysCustomer sysCustomer = null; + SysCustomerPhysicalSigns sysCustomer = null; if(StringUtils.isNotEmpty(phone)){ - sysCustomer = sysCustomerService.selectSysCustomerAndSignByPhone(phone); + sysCustomer = sysCustomerPhysicalSignsService.selectSysCustomerAndSignByPhone(phone); } return AjaxResult.success(sysCustomer); } diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java index b61f9e02f..5ad21ebe8 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java @@ -27,7 +27,7 @@ import com.stdiet.common.core.page.TableDataInfo; * @date 2021-01-23 */ @RestController -@RequestMapping("/customer/healthy") +@RequestMapping("/custom/healthy") public class SysCustomerHealthyController extends BaseController { @Autowired @@ -36,7 +36,7 @@ public class SysCustomerHealthyController extends BaseController /** * 查询客户健康列表 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:list')") + @PreAuthorize("@ss.hasPermi('custom:healthy:list')") @GetMapping("/list") public TableDataInfo list(SysCustomerHealthy sysCustomerHealthy) { @@ -48,7 +48,7 @@ public class SysCustomerHealthyController extends BaseController /** * 导出客户健康列表 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:export')") + @PreAuthorize("@ss.hasPermi('custom:healthy:export')") @Log(title = "客户健康", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(SysCustomerHealthy sysCustomerHealthy) @@ -61,7 +61,7 @@ public class SysCustomerHealthyController extends BaseController /** * 获取客户健康详细信息 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:query')") + @PreAuthorize("@ss.hasPermi('custom:healthy:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -76,24 +76,24 @@ public class SysCustomerHealthyController extends BaseController @PostMapping public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - return toAjax(sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy)); + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); } /** * 修改客户健康 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:edit')") + @PreAuthorize("@ss.hasPermi('custom:healthy:edit')") @Log(title = "客户健康", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - return toAjax(sysCustomerHealthyService.updateSysCustomerHealthy(sysCustomerHealthy)); + return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy); } /** * 删除客户健康 */ - @PreAuthorize("@ss.hasPermi('customer:healthy:remove')") + @PreAuthorize("@ss.hasPermi('custom:healthy:remove')") @Log(title = "客户健康", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) 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 b8e32cfcd..b56dfea86 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 @@ -19,9 +19,17 @@ public class SysCustomerHealthy extends BaseEntity private Long id; /** 客户ID */ - @Excel(name = "客户ID") + //@Excel(name = "客户ID") private Long customerId; + /** 客户姓名,非持久化字段 */ + @Excel(name = "客户姓名") + private String name; + + /** 客户手机号,非持久化字段 */ + @Excel(name = "客户手机号") + private String phone; + /** 调理项目id */ @Excel(name = "调理项目id") private Long conditioningProjectId; @@ -1145,6 +1153,22 @@ public class SysCustomerHealthy extends BaseEntity return delFlag; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java index 007388233..17ec598c0 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java @@ -17,13 +17,21 @@ public class SysCustomerPhysicalSigns extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** 体征ID */ private Long id; /** 客户id */ - @Excel(name = "客户id") + //@Excel(name = "客户id") private Long customerId; + /** 客户姓名,非持久化字段 */ + @Excel(name = "客户姓名") + private String name; + + /** 客户手机号,非持久化字段 */ + @Excel(name = "客户手机号") + private String phone; + /** 客户性别 0男 1女 */ @Excel(name = "客户性别 0男 1女") private Integer sex; @@ -425,6 +433,22 @@ public class SysCustomerPhysicalSigns extends BaseEntity this.delFlag = delFlag; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java b/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java index 0f30aa7b0..e5eef9e9e 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/dto/request/CustomerInvestigateRequest.java @@ -15,9 +15,12 @@ public class CustomerInvestigateRequest extends BaseEntity //基础信息 - /** $column.columnComment */ + /** 体征信息ID */ private Long id; + /** 客户ID */ + private Long customerId; + /** 名字 */ @Excel(name = "名字") private String name; @@ -26,16 +29,7 @@ public class CustomerInvestigateRequest extends BaseEntity @Excel(name = "手机号") private String phone; - /** 邮箱 */ - @Excel(name = "邮箱") - private String email; - - /** 地址 */ - @Excel(name = "地址") - private String address; - //体征信息 - /** 客户性别 0男 1女 */ @Excel(name = "客户性别 0男 1女") private Integer sex; @@ -152,42 +146,34 @@ public class CustomerInvestigateRequest extends BaseEntity return id; } - public String getName() { - return name; - } - - public String getPhone() { - return phone; - } - - public String getEmail() { - return email; - } - - public String getAddress() { - return address; - } - public void setId(Long id) { this.id = id; } + public Long getCustomerId() { + return customerId; + } + + public void setCustomerId(Long customerId) { + this.customerId = customerId; + } + + public String getName() { + return name; + } + public void setName(String name) { this.name = name; } + public String getPhone() { + return phone; + } + public void setPhone(String phone) { this.phone = phone; } - public void setEmail(String email) { - this.email = email; - } - - public void setAddress(String address) { - this.address = address; - } - public Integer getSex() { return sex; } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java index 8b9d17154..9850eb379 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerHealthyMapper.java @@ -1,7 +1,10 @@ package com.stdiet.custom.mapper; import java.util.List; + +import com.stdiet.custom.domain.SysCustomer; import com.stdiet.custom.domain.SysCustomerHealthy; +import org.apache.ibatis.annotations.Param; /** * 客户健康Mapper接口 @@ -58,4 +61,10 @@ public interface SysCustomerHealthyMapper * @return 结果 */ public int deleteSysCustomerHealthyByIds(Long[] ids); + + /** + * 根据手机号查询客户健康评估信息 + * @param phone + */ + SysCustomerHealthy selectSysCustomerHealthyByPhone(@Param("phone") String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java index c10c14829..388e7b86c 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerMapper.java @@ -67,14 +67,4 @@ public interface SysCustomerMapper * @return 结果 */ SysCustomer getCustomerByPhone(@Param("phone")String phone); - - //查询客户基础信息以及体征信息 - List<SysCustomer> selectSysCustomerAndSignList(SysCustomer sysCustomer); - - /** - * 根据手机号查询客户以及体征 - * @param phone - * @return - */ - SysCustomer selectSysCustomerAndSignByPhone(String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java index 79d1e7d14..6f88b4ceb 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysCustomerPhysicalSignsMapper.java @@ -1,6 +1,8 @@ package com.stdiet.custom.mapper; import java.util.List; + +import com.stdiet.custom.domain.SysCustomer; import com.stdiet.custom.domain.SysCustomerPhysicalSigns; import org.apache.ibatis.annotations.Param; @@ -20,14 +22,6 @@ public interface SysCustomerPhysicalSignsMapper */ public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id); - /** - * 查询客户体征信息列表 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 客户体征信息集合 - */ - public List<SysCustomerPhysicalSigns> selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); - /** * 新增客户体征信息 * @@ -60,13 +54,14 @@ public interface SysCustomerPhysicalSignsMapper */ public int deleteSysCustomerPhysicalSignsByIds(Long[] ids); - /** - * 根据客户id修改客户体征信息 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 结果 - */ - int updateSysCustomerPhysicalSignsByCustomerId(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); - int deleteSysCustomerPhysicalSignsByCustomerIds(Long[] ids); + //查询客户体征信息 + List<SysCustomerPhysicalSigns> selectSysCustomerAndSignList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); + + /** + * 根据手机号查询客户以及体征 + * @param phone + * @return + */ + SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java index 8f491c06d..4713cd90b 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java @@ -1,7 +1,10 @@ package com.stdiet.custom.service; import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.custom.domain.SysCustomerHealthy; +import org.apache.ibatis.annotations.Param; /** * 客户健康Service接口 @@ -28,20 +31,12 @@ public interface ISysCustomerHealthyService public List<SysCustomerHealthy> selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); /** - * 新增客户健康 + * 新增或修改客户健康 * * @param sysCustomerHealthy 客户健康 * @return 结果 */ - public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); - - /** - * 修改客户健康 - * - * @param sysCustomerHealthy 客户健康 - * @return 结果 - */ - public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); /** * 批量删除客户健康 @@ -58,4 +53,10 @@ public interface ISysCustomerHealthyService * @return 结果 */ public int deleteSysCustomerHealthyById(Long id); + + /** + * 根据手机号查询客户健康评估信息 + * @param phone + */ + SysCustomerHealthy selectSysCustomerHealthyByPhone(String phone); } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java index 0a49bd856..2083ad21b 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerPhysicalSignsService.java @@ -1,7 +1,11 @@ package com.stdiet.custom.service; import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.custom.domain.SysCustomer; import com.stdiet.custom.domain.SysCustomerPhysicalSigns; +import com.stdiet.custom.dto.request.CustomerInvestigateRequest; /** * 客户体征信息Service接口 @@ -18,14 +22,6 @@ public interface ISysCustomerPhysicalSignsService { */ public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id); - /** - * 查询客户体征信息列表 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 客户体征信息集合 - */ - public List<SysCustomerPhysicalSigns> selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); - /** * 新增客户体征信息 * @@ -57,4 +53,28 @@ public interface ISysCustomerPhysicalSignsService { * @return 结果 */ public int deleteSysCustomerPhysicalSignsById(Long id); + + /** + * 客户体征资料填写 + * + * @param customerInvestigateRequest 客户建档相关资料 + * @return 结果 + */ + AjaxResult addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception; + + /** + * 查询客户基础信息以及体征信息列表 + * + * @param sysCustomerPhysicalSigns 查询条件 + * @return 结果 + */ + List<SysCustomerPhysicalSigns> selectSysCustomerAndSignList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns); + + /** + * 根据手机号查询客户以及体征 + * @param phone + * @return + */ + SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone); + } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java index c35403c4a..213a46ac2 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerService.java @@ -67,37 +67,4 @@ public interface ISysCustomerService * @return 结果 */ SysCustomer getCustomerByPhone(String phone); - - /** - * 客户建档资料填写 - * - * @param customerInvestigateRequest 客户建档相关资料 - * @return 结果 - */ - int addOrupdateCustomerAndSign( CustomerInvestigateRequest customerInvestigateRequest) throws Exception; - - /** - * 查询客户基础信息以及体征信息列表 - * - * @param sysCustomer 查询条件 - * @return 结果 - */ - List<SysCustomer> selectSysCustomerAndSignList(SysCustomer sysCustomer); - - /** - * 根据id查询客户信息(基础信息以及体征信息) - * - * @param id 客户id - * @return 结果 - */ - SysCustomer getCustomerAndSignById(Long id); - - int delCustomerAndSignById(Long[] ids); - - /** - * 根据手机号查询客户以及体征 - * @param phone - * @return - */ - SysCustomer selectSysCustomerAndSignByPhone(String phone); } \ 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 3f1b86077..55a32214c 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 @@ -1,7 +1,12 @@ package com.stdiet.custom.service.impl; import java.util.List; -import com.stdiet.common.utils.DateUtils; + +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.common.utils.bean.ObjectUtils; +import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.domain.SysCustomerPhysicalSigns; +import com.stdiet.custom.service.ISysCustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.stdiet.custom.mapper.SysCustomerHealthyMapper; @@ -20,6 +25,9 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService @Autowired private SysCustomerHealthyMapper sysCustomerHealthyMapper; + @Autowired + private ISysCustomerService sysCustomerService; + /** * 查询客户健康 * @@ -51,23 +59,64 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService * @return 结果 */ @Override - public int insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) + public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) { - sysCustomerHealthy.setCreateTime(DateUtils.getNowDate()); - return sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy); - } - - /** - * 修改客户健康 - * - * @param sysCustomerHealthy 客户健康 - * @return 结果 - */ - @Override - public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) - { - sysCustomerHealthy.setUpdateTime(DateUtils.getNowDate()); - return sysCustomerHealthyMapper.updateSysCustomerHealthy(sysCustomerHealthy); + //当前登录用户 + //LoginUser loginUser = SecurityUtils.getLoginUser(); + Long cutomerId = 0L; + //新增 + if(sysCustomerHealthy.getId() == null){ + //根据手机号查询客户健康信息,判断是否已存在 + SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByPhone(sysCustomerHealthy.getPhone()); + if(customerHealthy != null){ + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(sysCustomerHealthy.getPhone()); + if(phoneCustomer != null){ + if(!sysCustomerHealthy.getName().equals(phoneCustomer.getName())){ + return AjaxResult.error("该手机号与姓名不符"); + } + cutomerId = phoneCustomer.getId(); + }else{ + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setName(sysCustomerHealthy.getName()); + newSysCustomer.setPhone(sysCustomerHealthy.getPhone()); + if(sysCustomerService.insertSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + } + //更新 + else{ + SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(sysCustomerHealthy.getCustomerId()); + //如果修改了手机号,则需要判断手机号是否已经存在 + if(oldCustomer != null && !oldCustomer.getPhone().equals(sysCustomerHealthy.getPhone())) { + //验证该手机号是否已存在客户健康信息 + SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByPhone(sysCustomerHealthy.getPhone()); + if (customerHealthy != null) { + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(sysCustomerHealthy.getPhone()); + if(phoneCustomer != null) { + return AjaxResult.error("该手机号已存在"); + } + } + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setId(sysCustomerHealthy.getCustomerId()); + newSysCustomer.setName(sysCustomerHealthy.getName()); + newSysCustomer.setPhone(sysCustomerHealthy.getPhone()); + if(sysCustomerService.updateSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + int rows = 0; + if(cutomerId != null && cutomerId > 0){ + sysCustomerHealthy.setCustomerId(cutomerId); + rows = sysCustomerHealthy.getId() == null ? sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy) : sysCustomerHealthyMapper.updateSysCustomerHealthy(sysCustomerHealthy); + } + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); } /** @@ -93,4 +142,13 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService { return sysCustomerHealthyMapper.deleteSysCustomerHealthyById(id); } + + /** + * 根据手机号查询客户健康评估信息 + * @param phone + */ + @Override + public SysCustomerHealthy selectSysCustomerHealthyByPhone(String phone){ + return sysCustomerHealthyMapper.selectSysCustomerHealthyByPhone(phone); + } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java index 653b19da0..2a2de8674 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java @@ -1,7 +1,13 @@ package com.stdiet.custom.service.impl; import java.util.List; + +import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.utils.DateUtils; +import com.stdiet.common.utils.bean.ObjectUtils; +import com.stdiet.custom.domain.SysCustomer; +import com.stdiet.custom.dto.request.CustomerInvestigateRequest; +import com.stdiet.custom.service.ISysCustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper; @@ -20,6 +26,9 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical @Autowired private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper; + @Autowired + private ISysCustomerService sysCustomerService; + /** * 查询客户体征信息 * @@ -32,18 +41,6 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsById(id); } - /** - * 查询客户体征信息列表 - * - * @param sysCustomerPhysicalSigns 客户体征信息 - * @return 客户体征信息 - */ - @Override - public List<SysCustomerPhysicalSigns> selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns) - { - return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsList(sysCustomerPhysicalSigns); - } - /** * 新增客户体征信息 * @@ -93,4 +90,91 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical { return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsById(id); } + + /** + * 客户体征资料填写 + * + * @param customerInvestigateRequest 客户体征资料 + * @return 结果 + */ + public AjaxResult addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception{ + //当前登录用户 + //LoginUser loginUser = SecurityUtils.getLoginUser(); + Long cutomerId = 0L; + //新增 + if(customerInvestigateRequest.getId() == null){ + //根据手机号查询客户体征信息,判断是否已存在 + SysCustomerPhysicalSigns sysCustomerPhysicalSigns = selectSysCustomerAndSignByPhone(customerInvestigateRequest.getPhone()); + if(sysCustomerPhysicalSigns != null){ + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); + if(phoneCustomer != null){ + if(!customerInvestigateRequest.getName().equals(phoneCustomer.getName())){ + return AjaxResult.error("该手机号与姓名不符"); + } + cutomerId = phoneCustomer.getId(); + }else{ + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setName(customerInvestigateRequest.getName()); + newSysCustomer.setPhone(customerInvestigateRequest.getPhone()); + if(sysCustomerService.insertSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + } + //更新 + else{ + SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(customerInvestigateRequest.getCustomerId()); + //如果修改了手机号,则需要判断手机号是否已经存在 + if(oldCustomer != null && !oldCustomer.getPhone().equals(customerInvestigateRequest.getPhone())) { + //验证该手机号是否已存在客户体征信息 + SysCustomerPhysicalSigns sysCustomerPhysicalSigns = selectSysCustomerAndSignByPhone(customerInvestigateRequest.getPhone()); + if (sysCustomerPhysicalSigns != null) { + return AjaxResult.error("该手机号已存在"); + } + //根据手机号查询客户基础信息,判断是否已存在 + SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(customerInvestigateRequest.getPhone()); + if(phoneCustomer != null) { + return AjaxResult.error("该手机号已存在"); + } + } + SysCustomer newSysCustomer = new SysCustomer(); + newSysCustomer.setId(customerInvestigateRequest.getCustomerId()); + newSysCustomer.setName(customerInvestigateRequest.getName()); + newSysCustomer.setPhone(customerInvestigateRequest.getPhone()); + if(sysCustomerService.updateSysCustomer(newSysCustomer) > 0){ + cutomerId = newSysCustomer.getId(); + } + } + int rows = 0; + if(cutomerId != null && cutomerId > 0){ + SysCustomerPhysicalSigns customerSigns = ObjectUtils.getObjectByObject(customerInvestigateRequest, SysCustomerPhysicalSigns.class); + customerSigns.setCustomerId(cutomerId); + customerSigns.setId(customerInvestigateRequest.getId()); + rows = customerInvestigateRequest.getId() == null ? insertSysCustomerPhysicalSigns(customerSigns) : updateSysCustomerPhysicalSigns(customerSigns); + } + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + + /** + * 查询客户基础信息以及体征信息列表 + * + * @param sysCustomerPhysicalSigns 查询条件 + * @return 结果 + */ + public List<SysCustomerPhysicalSigns> selectSysCustomerAndSignList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns){ + return sysCustomerPhysicalSignsMapper.selectSysCustomerAndSignList(sysCustomerPhysicalSigns); + } + + /** + * 根据手机号查询客户以及体征 + * @param phone + * @return + */ + @Override + public SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone){ + return sysCustomerPhysicalSignsMapper.selectSysCustomerAndSignByPhone(phone); + } } \ No newline at end of file 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 37e4f655f..096395324 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 @@ -115,77 +115,4 @@ public class SysCustomerServiceImpl implements ISysCustomerService public SysCustomer getCustomerByPhone(String phone){ return sysCustomerMapper.getCustomerByPhone(phone); } - - /** - * 客户建档资料填写 - * - * @param customerInvestigateRequest 客户建档相关资料 - * @return 结果 - */ - public int addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception{ - //当前登录用户 - //LoginUser loginUser = SecurityUtils.getLoginUser(); - SysCustomer sysCustomer = new SysCustomer(); - sysCustomer.setId(customerInvestigateRequest.getId()); - sysCustomer.setName(customerInvestigateRequest.getName()); - sysCustomer.setPhone(customerInvestigateRequest.getPhone()); - //添加人、更新人 - /*if(loginUser != null){ - if(customerInvestigateRequest.getId() == null){ - sysCustomer.setCreateBy(loginUser.getUser().getUserId()+""); - }else{ - sysCustomer.setUpdateBy(loginUser.getUser().getUserId()+""); - } - }*/ - //sysCustomer.setEmail(customerInvestigateRequest.getEmail()); - //sysCustomer.setAddress(customerInvestigateRequest.getAddress()); - int addOrUpdateRow = customerInvestigateRequest.getId() == null ? insertSysCustomer(sysCustomer) : updateSysCustomer(sysCustomer); - if(addOrUpdateRow > 0){ - SysCustomerPhysicalSigns customerSigns = ObjectUtils.getObjectByObject(customerInvestigateRequest, SysCustomerPhysicalSigns.class); - customerSigns.setCustomerId(sysCustomer.getId()); - customerSigns.setId(null); - addOrUpdateRow = customerInvestigateRequest.getId() == null ? sysCustomerPhysicalSignsMapper.insertSysCustomerPhysicalSigns(customerSigns) : sysCustomerPhysicalSignsMapper.updateSysCustomerPhysicalSignsByCustomerId(customerSigns); - } - return addOrUpdateRow; - } - - /** - * 查询客户基础信息以及体征信息列表 - * - * @param sysCustomer 查询条件 - * @return 结果 - */ - public List<SysCustomer> selectSysCustomerAndSignList(SysCustomer sysCustomer){ - return sysCustomerMapper.selectSysCustomerAndSignList(sysCustomer); - } - - /** - * 根据id查询客户信息(基础信息以及体征信息) - * - * @param id 客户id - * @return 结果 - */ - public SysCustomer getCustomerAndSignById(Long id){ - SysCustomer sysCustomer = new SysCustomer(); - sysCustomer.setId(id); - List<SysCustomer> list = sysCustomerMapper.selectSysCustomerAndSignList(sysCustomer); - return list.size() > 0 ? list.get(0) : null; - } - - public int delCustomerAndSignById(Long[] ids){ - if(deleteSysCustomerByIds(ids) > 0){ - return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsByCustomerIds(ids); - } - return 0; - } - - /** - * 根据手机号查询客户以及体征 - * @param phone - * @return - */ - @Override - public SysCustomer selectSysCustomerAndSignByPhone(String phone){ - return sysCustomerMapper.selectSysCustomerAndSignByPhone(phone); - } } \ 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 352d6afbd..26df193b7 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -7,6 +7,10 @@ <resultMap type="SysCustomerHealthy" id="SysCustomerHealthyResult"> <result property="id" column="id" /> <result property="customerId" column="customer_id" /> + <!-- 非持久化字段 --> + <result property="name" column="name"></result> + <!-- 非持久化字段 --> + <result property="phone" column="phone"></result> <result property="conditioningProjectId" column="conditioning_project_id" /> <result property="sex" column="sex" /> <result property="age" column="age" /> @@ -99,19 +103,22 @@ </resultMap> <sql id="selectSysCustomerHealthyVo"> - select id, customer_id, conditioning_project_id, sex, age, condiment, other_condiment, cooking_style, cooking_style_rate, wash_vegetables_style, other_wash_vegetables_style, breakfast_type, breakfast_food, lunch_type, dinner, vegetable_rate, common_meat, dinner_time, supper_num, supper_food, diet_hot_and_cold, diet_flavor, vegetables_num, vegetables_rate_type, fruits_num, fruits_time, fruits_rate, rice_num, rice_full, eating_speed, snacks, other_snacks, health_products_flag, health_products_brand, health_products_name, health_products_week_rate, health_products_day_rate, water_num, water_type, water_habit, drinks_num, drink_wine_flag, drink_wine_classify, other_wine_classify, drink_wine_amount, smoke_flag, smoke_rate, second_smoke, work_industry, work_type, defecation_num, other_defecation_num, defecation_time, defecation_shape, defecation_smell, defecation_speed, defecation_color, motion_num, motion_duration, motion_time, aerobic_motion_classify, anaerobic_motion_classify, anaerobic_aerobic_motion_classify, other_motion_classify, motion_field, other_motion_field, sleep_time, sleep_quality, sleep_drug_flag, sleep_drug, stayup_late_flag, stayup_late_week_num, family_illness_history, other_family_illness_history, operation_history, other_operation_history, near_operation_flag, recoverye_situation, long_eat_drug_flag, long_eat_drug_classify, other_long_eat_drug_classify, allergy_flag, allergy_situation, allergen, other_allergen, medical_report, create_time, create_by, update_time, update_by, del_flag from sys_customer_healthy + select sch.id, customer_id, conditioning_project_id, sex, age, condiment, other_condiment, cooking_style, cooking_style_rate, wash_vegetables_style, other_wash_vegetables_style, breakfast_type, breakfast_food, lunch_type, dinner, vegetable_rate, common_meat, dinner_time, supper_num, supper_food, diet_hot_and_cold, diet_flavor, vegetables_num, vegetables_rate_type, fruits_num, fruits_time, fruits_rate, rice_num, rice_full, eating_speed, snacks, other_snacks, health_products_flag, health_products_brand, health_products_name, health_products_week_rate, health_products_day_rate, water_num, water_type, water_habit, drinks_num, drink_wine_flag, drink_wine_classify, other_wine_classify, drink_wine_amount, smoke_flag, smoke_rate, second_smoke, work_industry, work_type, defecation_num, other_defecation_num, defecation_time, defecation_shape, defecation_smell, defecation_speed, defecation_color, motion_num, motion_duration, motion_time, aerobic_motion_classify, anaerobic_motion_classify, anaerobic_aerobic_motion_classify, other_motion_classify, motion_field, other_motion_field, sleep_time, sleep_quality, sleep_drug_flag, sleep_drug, stayup_late_flag, stayup_late_week_num, family_illness_history, other_family_illness_history, operation_history, other_operation_history, near_operation_flag, recoverye_situation, long_eat_drug_flag, long_eat_drug_classify, other_long_eat_drug_classify, allergy_flag, allergy_situation, allergen, other_allergen, medical_report, sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag </sql> <select id="selectSysCustomerHealthyList" parameterType="SysCustomerHealthy" resultMap="SysCustomerHealthyResult"> - <include refid="selectSysCustomerHealthyVo"/> - <where> - <if test="conditioningProjectId != null "> and conditioning_project_id = #{conditioningProjectId}</if> - </where> + <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone + from sys_customer_healthy as sch + left join sys_customer sc on sc.id = sch.customer_id + where sch.del_flag = 0 and sc.del_flag = 0 + <if test="conditioningProjectId != null "> and sch.conditioning_project_id = #{conditioningProjectId}</if> </select> <select id="selectSysCustomerHealthyById" parameterType="Long" resultMap="SysCustomerHealthyResult"> - <include refid="selectSysCustomerHealthyVo"/> - where id = #{id} + <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone + from sys_customer_healthy as sch + left join sys_customer sc on sc.id = sch.customer_id + where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id} </select> <insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy"> @@ -401,15 +408,23 @@ where id = #{id} </update> - <delete id="deleteSysCustomerHealthyById" parameterType="Long"> - delete from sys_customer_healthy where id = #{id} - </delete> + <update id="deleteSysCustomerHealthyById" parameterType="Long"> + update sys_customer_healthy set del_flag = 1 where id = #{id} + </update> - <delete id="deleteSysCustomerHealthyByIds" parameterType="String"> - delete from sys_customer_healthy where id in + <update id="deleteSysCustomerHealthyByIds" parameterType="String"> + update sys_customer_healthy set del_flag = 1 where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> - </delete> + </update> + + <!-- 根据手机号查询客户健康评估信息 --> + <select id="selectSysCustomerHealthyByPhone" parameterType="String" resultMap="SysCustomerHealthyResult"> + <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone from sys_customer_healthy as sch + left join sys_customer sc on sc.id = sch.customer_id + where sch.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1 + </select> + </mapper> \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml index 4a24643fd..78d64845e 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml @@ -26,62 +26,6 @@ <result property="updateBy" column="update_by" /> </resultMap> - <resultMap type="SysCustomer" id="SysCustomerSignResult"> - <result property="id" column="id" /> - <result property="name" column="name" /> - <result property="phone" column="phone" /> - <result property="email" column="email" /> - <result property="address" column="address" /> - <result property="payDate" column="pay_date" /> - <result property="startDate" column="start_date" /> - <result property="purchaseNum" column="purchase_num" /> - <result property="payTotal" column="pay_total" /> - <result property="mainDietitian" column="main_dietitian" /> - <result property="assistantDietitian" column="assistant_dietitian" /> - <result property="afterDietitian" column="after_dietitian" /> - <result property="salesman" column="salesman" /> - <result property="chargePerson" column="charge_person" /> - <result property="followStatus" column="follow_status" /> - <result property="createTime" column="create_time" /> - <result property="createBy" column="create_by" /> - <result property="updateTime" column="update_time" /> - <result property="updateBy" column="update_by" /> - <association property="sign" javaType="com.stdiet.custom.domain.SysCustomerPhysicalSigns"> - <result property="id" column="id" /> - <result property="customerId" column="customer_id" /> - <result property="sex" column="sex" /> - <result property="age" column="age" /> - <result property="tall" column="tall" /> - <result property="weight" column="weight" /> - <result property="physicalSignsId" column="physical_signs_id" /> - <result property="dishesIngredientId" column="dishes_ingredient_id" /> - <result property="photo" column="photo" /> - <result property="constipation" column="constipation" /> - <result property="staylate" column="stayLate" /> - <result property="motion" column="motion" /> - <result property="makeFoodType" column="make_food_type" /> - <result property="makeFoodTaste" column="make_food_taste" /> - <result property="walk" column="walk" /> - <result property="difficulty" column="difficulty" /> - <result property="weakness" column="weakness" /> - <result property="rebound" column="rebound" /> - <result property="crux" column="crux" /> - <result property="position" column="position" /> - <result property="sleepTime" column="sleep_time" /> - <result property="getupTime" column="getup_time" /> - <result property="connectTime" column="connect_time" /> - <result property="remarks" column="remarks" /> - <result property="bloodData" column="blood_data" /> - <result property="moistureDate" column="moisture_date" /> - <result property="vocation" column="vocation" /> - <result property="night" column="night" /> - <result property="experience" column="experience" /> - <result property="comments" column="comments"/> - <!-- column是传的参数, select是调用的查询 --> - <association property="signList" column="physical_signs_id" select="getSignByIds"/> - </association> - </resultMap> - <sql id="selectSysCustomerVo"> select id, name, phone, email, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by from sys_customer </sql> @@ -184,38 +128,6 @@ where phone = #{phone} and del_flag = 0 </select> - <sql id="selectSysCustomerAndSign"> - <!--sc.email, sc.address, sc.pay_date, sc.start_date, sc.purchase_num, sc.pay_total, sc.main_dietitian, sc.assistant_dietitian, - sc.after_dietitian, sc.salesman, sc.charge_person, sc.follow_status, --> - select sc.id, sc.name, sc.phone, sc.create_time, sc.create_by, sc.update_time, sc.update_by, - <include refid="selectSysCustomerPhysicalSigns"></include> - from sys_customer sc - left join sys_customer_physical_signs scps on scps.customer_id = sc.id and scps.del_flag = 0 - </sql> - <sql id="selectSysCustomerPhysicalSigns"> - scps.sex, scps.age, scps.tall, scps.weight, scps.physical_signs_id, scps.dishes_ingredient_id, scps.photo, scps.constipation, - scps.stayLate, scps.motion, scps.make_food_type, scps.make_food_taste, scps.walk, scps.difficulty, scps.weakness, scps.rebound, scps.crux, scps.position, - scps.sleep_time, scps.getup_time, scps.connect_time, scps.remarks, scps.blood_data, scps.moisture_date, scps.vocation, - scps.night, scps.experience, scps.comments - </sql> - - <select id="selectSysCustomerAndSignList" parameterType="SysCustomer" resultMap="SysCustomerSignResult"> - <include refid="selectSysCustomerAndSign"/> where sc.del_flag = 0 - <if test="id != null"> and sc.id = #{id} </if> - <if test="name != null and name != ''"> and sc.name like concat('%', #{name}, '%')</if> - <if test="phone != null and phone != ''"> and sc.phone like concat('%', #{phone}, '%')</if> - order by sc.create_time desc - </select> - - <!-- 根据体征id获取体征 --> - <select id="getSignByIds" parameterType="String" resultType="SysPhysicalSigns"> - select * from sys_physical_signs sps where FIND_IN_SET(id, #{physical_signs_id}) - </select> - - <!-- 根据手机号查询体征 --> - <select id="selectSysCustomerAndSignByPhone" parameterType="String" resultMap="SysCustomerSignResult"> - <include refid="selectSysCustomerAndSign"/> where sc.del_flag = 0 and sc.phone = #{phone} limit 1 - </select> </mapper> \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml index 601d5bc3d..fc22489a2 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml @@ -4,9 +4,13 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper"> - <resultMap type="SysCustomerPhysicalSigns" id="SysCustomerPhysicalSignsResult"> + <resultMap type="SysCustomerPhysicalSigns" id="SysCustomerSignResult"> <result property="id" column="id" /> <result property="customerId" column="customer_id" /> + <!-- 非持久化字段 --> + <result property="name" column="name"/> + <!-- 非持久化字段 --> + <result property="phone" column="phone" /> <result property="sex" column="sex" /> <result property="age" column="age" /> <result property="tall" column="tall" /> @@ -39,48 +43,28 @@ <result property="updateTime" column="update_time" /> <result property="updateBy" column="update_by" /> <result property="comments" column="comments"/> + <!-- column是传的参数, select是调用的查询 --> + <association property="signList" column="physical_signs_id" select="getSignByIds"/> </resultMap> - <sql id="selectSysCustomerPhysicalSignsVo"> - select id, customer_id, sex, age, tall, weight, physical_signs_id, dishes_ingredient_id, photo, constipation, stayLate, motion, make_food_type, make_food_taste, walk, difficulty, weakness, rebound, crux, position, sleep_time, getup_time, connect_time, remarks, blood_data, moisture_date, vocation, - night, experience, comments, create_time, create_by, update_time, update_by from sys_customer_physical_signs + <sql id="selectSysCustomerPhysicalSigns"> + select scps.id,scps.customer_id,scps.sex, scps.age, scps.tall, scps.weight, scps.physical_signs_id, scps.dishes_ingredient_id, scps.photo, scps.constipation, + scps.stayLate, scps.motion, scps.make_food_type, scps.make_food_taste, scps.walk, scps.difficulty, scps.weakness, scps.rebound, scps.crux, scps.position, + scps.sleep_time, scps.getup_time, scps.connect_time, scps.remarks, scps.blood_data, scps.moisture_date, scps.vocation, + scps.night, scps.experience, scps.comments, scps.create_time, sc.name, sc.phone + from sys_customer_physical_signs scps + left join sys_customer sc on scps.customer_id = sc.id </sql> - <select id="selectSysCustomerPhysicalSignsList" parameterType="SysCustomerPhysicalSigns" resultMap="SysCustomerPhysicalSignsResult"> - <include refid="selectSysCustomerPhysicalSignsVo"/> where del_flag = 0 - <if test="customerId != null "> and customer_id = #{customerId}</if> - <if test="sex != null "> and sex = #{sex}</if> - <if test="age != null "> and age = #{age}</if> - <if test="tall != null "> and tall = #{tall}</if> - <if test="weight != null "> and weight = #{weight}</if> - <if test="physicalSignsId != null and physicalSignsId != ''"> and physical_signs_id = #{physicalSignsId}</if> - <if test="dishesIngredientId != null and dishesIngredientId != ''"> and dishes_ingredient_id = #{dishesIngredientId}</if> - <if test="photo != null and photo != ''"> and photo = #{photo}</if> - <if test="constipation != null "> and constipation = #{constipation}</if> - <if test="staylate != null "> and stayLate = #{staylate}</if> - <if test="motion != null "> and motion = #{motion}</if> - <if test="makeFoodType != null "> and make_food_type = #{makeFoodType}</if> - <if test="makeFoodTaste != null "> and make_food_taste = #{makeFoodTaste}</if> - <if test="walk != null "> and walk = #{walk}</if> - <if test="difficulty != null and difficulty != ''"> and difficulty = #{difficulty}</if> - <if test="weakness != null "> and weakness = #{weakness}</if> - <if test="rebound != null "> and rebound = #{rebound}</if> - <if test="crux != null "> and crux = #{crux}</if> - <if test="position != null "> and position = #{position}</if> - <if test="sleepTime != null "> and sleep_time = #{sleepTime}</if> - <if test="getupTime != null "> and getup_time = #{getupTime}</if> - <if test="connectTime != null "> and connect_time = #{connectTime}</if> - <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> - <if test="bloodData != null and bloodData != ''"> and blood_data = #{bloodData}</if> - <if test="moistureDate != null and moistureDate != ''"> and moisture_date = #{moistureDate}</if> - <if test="vocation != null and vocation != ''"> and vocation = #{vocation}</if> - <if test="night != null "> and night = #{night}</if> - <if test="experience != null and experience != ''"> and experience = #{experience}</if> + <select id="selectSysCustomerAndSignList" parameterType="SysCustomerPhysicalSigns" resultMap="SysCustomerSignResult"> + <include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 + <if test="name != null and name != ''"> and sc.name like concat('%', #{name}, '%')</if> + <if test="phone != null and phone != ''"> and sc.phone like concat('%', #{phone}, '%')</if> + order by scps.create_time desc </select> - <select id="selectSysCustomerPhysicalSignsById" parameterType="Long" resultMap="SysCustomerPhysicalSignsResult"> - <include refid="selectSysCustomerPhysicalSignsVo"/> - where id = #{id} and del_flag = 0 + <select id="selectSysCustomerPhysicalSignsById" parameterType="Long" resultMap="SysCustomerSignResult"> + <include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and scps.id = #{id} </select> <insert id="insertSysCustomerPhysicalSigns" parameterType="SysCustomerPhysicalSigns" useGeneratedKeys="true" keyProperty="id"> @@ -198,61 +182,24 @@ </update> <update id="deleteSysCustomerPhysicalSignsById" parameterType="Long"> - update sys_customer_physical_signs set del_flag = 0 where id = #{id} + update sys_customer_physical_signs set del_flag = 1 where id = #{id} </update> <update id="deleteSysCustomerPhysicalSignsByIds" parameterType="String"> - update sys_customer_physical_signs set del_flag = 0 where id in + update sys_customer_physical_signs set del_flag = 1 where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </update> - <!-- 根据客户id更新体征信息 --> - <update id="updateSysCustomerPhysicalSignsByCustomerId" parameterType="SysCustomerPhysicalSigns"> - update sys_customer_physical_signs - <trim prefix="SET" suffixOverrides=","> - <if test="sex != null">sex = #{sex},</if> - <if test="age != null">age = #{age},</if> - <if test="tall != null">tall = #{tall},</if> - <if test="weight != null">weight = #{weight},</if> - <if test="physicalSignsId != null">physical_signs_id = #{physicalSignsId},</if> - <if test="dishesIngredientId != null">dishes_ingredient_id = #{dishesIngredientId},</if> - <if test="photo != null">photo = #{photo},</if> - <if test="constipation != null">constipation = #{constipation},</if> - <if test="staylate != null">stayLate = #{staylate},</if> - <if test="motion != null">motion = #{motion},</if> - <if test="makeFoodType != null">make_food_type = #{makeFoodType},</if> - <if test="makeFoodTaste != null">make_food_taste = #{makeFoodTaste},</if> - <if test="walk != null">walk = #{walk},</if> - <if test="difficulty != null">difficulty = #{difficulty},</if> - <if test="weakness != null">weakness = #{weakness},</if> - <if test="rebound != null">rebound = #{rebound},</if> - <if test="crux != null">crux = #{crux},</if> - <if test="position != null">position = #{position},</if> - <if test="sleepTime != null">sleep_time = #{sleepTime},</if> - <if test="getupTime != null">getup_time = #{getupTime},</if> - <if test="connectTime != null">connect_time = #{connectTime},</if> - <if test="remarks != null">remarks = #{remarks},</if> - <if test="bloodData != null">blood_data = #{bloodData},</if> - <if test="moistureDate != null">moisture_date = #{moistureDate},</if> - <if test="vocation != null">vocation = #{vocation},</if> - <if test="night != null">night = #{night},</if> - <if test="experience != null">experience = #{experience},</if> - <if test="comments != null">comments = #{comments},</if> - <if test="createTime != null">create_time = #{createTime},</if> - <if test="createBy != null">create_by = #{createBy},</if> - <if test="updateTime != null">update_time = #{updateTime},</if> - <if test="updateBy != null">update_by = #{updateBy},</if> - </trim> - where customer_id = #{customerId} - </update> + <!-- 根据体征id获取体征 --> + <select id="getSignByIds" parameterType="String" resultType="SysPhysicalSigns"> + select * from sys_physical_signs sps where FIND_IN_SET(id, #{physical_signs_id}) + </select> - <update id="deleteSysCustomerPhysicalSignsByCustomerIds" parameterType="String"> - update sys_customer_physical_signs set del_flag = 0 where customer_id in - <foreach item="id" collection="array" open="(" separator="," close=")"> - #{id} - </foreach> - </update> + <!-- 根据手机号查询体征 --> + <select id="selectSysCustomerAndSignByPhone" parameterType="String" resultMap="SysCustomerSignResult"> + <include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1 + </select> </mapper> \ No newline at end of file diff --git a/stdiet-ui/src/api/custom/healthy.js b/stdiet-ui/src/api/custom/healthy.js new file mode 100644 index 000000000..e0b25c6d0 --- /dev/null +++ b/stdiet-ui/src/api/custom/healthy.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询客户健康列表 +export function listHealthy(query) { + return request({ + url: '/custom/healthy/list', + method: 'get', + params: query + }) +} + +// 查询客户健康详细 +export function getHealthy(id) { + return request({ + url: '/custom/healthy/' + id, + method: 'get' + }) +} + +// 新增客户健康 +export function addHealthy(data) { + return request({ + url: '/custom/healthy', + method: 'post', + data: data + }) +} + +// 修改客户健康 +export function updateHealthy(data) { + return request({ + url: '/custom/healthy', + method: 'put', + data: data + }) +} + +// 删除客户健康 +export function delHealthy(id) { + return request({ + url: '/custom/healthy/' + id, + method: 'delete' + }) +} + +// 导出客户健康 +export function exportHealthy(query) { + return request({ + url: '/custom/healthy/export', + method: 'get', + params: query + }) +} diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index 8a1c6e99e..e23500606 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -84,133 +84,133 @@ </el-table-column> <el-table-column label="姓名" align="center" prop="name" width="120" fixed="left"/> <el-table-column label="手机号" align="center" prop="phone" width="120" fixed="left"/> - <el-table-column label="性别" align="center" prop="sign.sex" width="100"> + <el-table-column label="性别" align="center" prop="sex" width="100"> <template slot-scope="scope"> - {{scope.row.sign.sex == 0 ? `男` : '女'}} + {{scope.row.sex == 0 ? `男` : '女'}} </template> </el-table-column> - <el-table-column label="年龄(岁)" align="center" prop="sign.age" width="100"/> - <el-table-column label="身高(厘米)" align="center" prop="sign.tall" width="100"/> - <el-table-column label="体重(斤)" align="center" prop="sign.weight" width="100"/> - <el-table-column label="北方、南方" align="center" prop="sign.position" width="100"> + <el-table-column label="年龄(岁)" align="center" prop="age" width="100"/> + <el-table-column label="身高(厘米)" align="center" prop="tall" width="100"/> + <el-table-column label="体重(斤)" align="center" prop="weight" width="100"/> + <el-table-column label="北方、南方" align="center" prop="position" width="100"> <template slot-scope="scope"> - {{scope.row.sign.position == 0 ? `南方` : '北方'}} + {{scope.row.position == 0 ? `南方` : '北方'}} </template> </el-table-column> - <el-table-column label="病史" align="center" prop="sign.signList" width="120"> + <el-table-column label="病史" align="center" prop="signList" width="120"> <template slot-scope="scope"> - <el-button v-show="getSignString(scope.row.sign.signList).length > 10" type="text" @click="openFormDialog('病史', getSignString(scope.row.sign.signList))">点击查看</el-button> - <span v-show="getSignString(scope.row.sign.signList).length <= 10">{{getSignString(scope.row.sign.signList)}}</span> + <el-button v-show="getSignString(scope.row.signList).length > 10" type="text" @click="openFormDialog('病史', getSignString(scope.row.signList))">点击查看</el-button> + <span v-show="getSignString(scope.row.signList).length <= 10">{{getSignString(scope.row.signList)}}</span> </template> </el-table-column> - <el-table-column label="忌口或过敏源" align="center" prop="sign.dishesIngredientId" width="120"> + <el-table-column label="忌口或过敏源" align="center" prop="dishesIngredientId" width="120"> <template slot-scope="scope"> - <el-button v-show="scope.row.sign.dishesIngredientId.length > 10" type="text" @click="openFormDialog('忌口或过敏源', scope.row.sign.dishesIngredientId)">点击查看</el-button> - <span v-show="scope.row.sign.dishesIngredientId.length <= 10">{{scope.row.sign.dishesIngredientId}}</span> + <el-button v-show="scope.row.dishesIngredientId.length > 10" type="text" @click="openFormDialog('忌口或过敏源', scope.row.dishesIngredientId)">点击查看</el-button> + <span v-show="scope.row.dishesIngredientId.length <= 10">{{scope.row.dishesIngredientId}}</span> </template> </el-table-column> - <el-table-column label="是否便秘" align="center" prop="sign.constipation" width="100"> + <el-table-column label="是否便秘" align="center" prop="constipation" width="100"> <template slot-scope="scope"> - {{scope.row.sign.constipation == 0 ? `是` : '否'}} + {{scope.row.constipation == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="是否熬夜失眠" align="center" prop="sign.staylate" width="100"> + <el-table-column label="是否熬夜失眠" align="center" prop="staylate" width="100"> <template slot-scope="scope"> - {{scope.row.sign.staylate == 0 ? `是` : '否'}} + {{scope.row.staylate == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="是否经常运动" align="center" prop="sign.motion" width="100"> + <el-table-column label="是否经常运动" align="center" prop="motion" width="100"> <template slot-scope="scope"> - {{scope.row.sign.motion == 0 ? `是` : '否'}} + {{scope.row.motion == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="饮食方式" align="center" prop="sign.makeFoodType" width="100"> + <el-table-column label="饮食方式" align="center" prop="makeFoodType" width="100"> <template slot-scope="scope"> - {{scope.row.sign.makeFoodType == 0 ? `自己做` : '外面吃'}} + {{scope.row.makeFoodType == 0 ? `自己做` : '外面吃'}} </template> </el-table-column> - <el-table-column label="饮食备注" align="center" prop="sign.remarks" width="100"> + <el-table-column label="饮食备注" align="center" prop="remarks" width="100"> <template slot-scope="scope"> - <el-button v-show="scope.row.sign.remarks != null && scope.row.sign.remarks.length > 10" type="text" @click="openFormDialog('饮食备注', scope.row.sign.remarks)">点击查看</el-button> - <span v-show="scope.row.sign.remarks == null && scope.row.sign.remarks.length <= 10">{{scope.row.sign.remarks}}</span> + <el-button v-show="scope.row.remarks != null && scope.row.remarks.length > 10" type="text" @click="openFormDialog('饮食备注', scope.row.remarks)">点击查看</el-button> + <span v-show="scope.row.remarks == null && scope.row.remarks.length <= 10">{{scope.row.remarks}}</span> </template> </el-table-column> - <el-table-column label="饮食特点" align="center" prop="sign.makeFoodTaste" width="100"> + <el-table-column label="饮食特点" align="center" prop="makeFoodTaste" width="100"> <template slot-scope="scope"> - {{scope.row.sign.makeFoodTaste == 0 ? `清淡` : '重口味'}} + {{scope.row.makeFoodTaste == 0 ? `清淡` : '重口味'}} </template> </el-table-column> - <el-table-column label="工作职业" align="center" prop="sign.vocation" width="100"> + <el-table-column label="工作职业" align="center" prop="vocation" width="100"> <template slot-scope="scope"> - {{scope.row.sign.vocation}} + {{scope.row.vocation}} </template> </el-table-column> - <el-table-column label="是否上夜班" align="center" prop="sign.night" width="100"> + <el-table-column label="是否上夜班" align="center" prop="night" width="100"> <template slot-scope="scope"> - {{scope.row.sign.night == 0 ? `是` : '否'}} + {{scope.row.night == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="久坐多还是运动多" align="center" prop="sign.walk" width="100"> + <el-table-column label="久坐多还是运动多" align="center" prop="walk" width="100"> <template slot-scope="scope"> - {{scope.row.sign.walk == 0 ? `久坐多` : '走动多'}} + {{scope.row.walk == 0 ? `久坐多` : '走动多'}} </template> </el-table-column> - <el-table-column label="是否浑身乏力" align="center" prop="sign.weakness" width="100"> + <el-table-column label="是否浑身乏力" align="center" prop="weakness" width="100"> <template slot-scope="scope"> - {{scope.row.sign.weakness == 0 ? `是` : '否'}} + {{scope.row.weakness == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="是否减脂反弹" align="center" prop="sign.rebound" width="100"> + <el-table-column label="是否减脂反弹" align="center" prop="rebound" width="100"> <template slot-scope="scope"> - {{scope.row.sign.rebound == 0 ? `是` : '否'}} + {{scope.row.rebound == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="意识到生活习惯是减脂关键" align="center" prop="sign.crux" width="100"> + <el-table-column label="意识到生活习惯是减脂关键" align="center" prop="crux" width="100"> <template slot-scope="scope"> - {{scope.row.sign.crux == 0 ? `是` : '否'}} + {{scope.row.crux == 0 ? `是` : '否'}} </template> </el-table-column> - <el-table-column label="睡觉时间" align="center" prop="sign.sleepTime" width="100"> + <el-table-column label="睡觉时间" align="center" prop="sleepTime" width="100"> <template slot-scope="scope"> - {{scope.row.sign.sleepTime}}点 + {{scope.row.sleepTime}}点 </template> </el-table-column> - <el-table-column label="起床时间" align="center" prop="sign.getupTime" width="100"> + <el-table-column label="起床时间" align="center" prop="getupTime" width="100"> <template slot-scope="scope"> - {{scope.row.sign.getupTime}}点 + {{scope.row.getupTime}}点 </template> </el-table-column> - <el-table-column label="方便沟通时间" align="center" prop="sign.connectTime" width="100"> + <el-table-column label="方便沟通时间" align="center" prop="connectTime" width="100"> <template slot-scope="scope"> - {{scope.row.sign.connectTime}}点 + {{scope.row.connectTime}}点 </template> </el-table-column> - <el-table-column label="湿气数据" align="center" prop="sign.bloodData" width="100"> + <el-table-column label="湿气数据" align="center" prop="bloodData" width="100"> <template slot-scope="scope"> - {{scope.row.sign.bloodData}} + {{scope.row.bloodData}} </template> </el-table-column> - <el-table-column label="气血数据" align="center" prop="sign.moistureDate" width="120"> + <el-table-column label="气血数据" align="center" prop="moistureDate" width="120"> <template slot-scope="scope"> - {{scope.row.sign.moistureDate}} + {{scope.row.moistureDate}} </template> </el-table-column> - <el-table-column label="减脂经历" align="center" prop="sign.experience" width="100"> + <el-table-column label="减脂经历" align="center" prop="experience" width="100"> <template slot-scope="scope"> - <el-button v-show="scope.row.sign.experience != null && scope.row.sign.experience.length > 10" type="text" @click="openFormDialog('减脂经历', scope.row.sign.experience)">点击查看</el-button> - <span v-show="scope.row.sign.experience == null || scope.row.sign.experience.length <= 10">{{scope.row.sign.experience}}</span> + <el-button v-show="scope.row.experience != null && scope.row.experience.length > 10" type="text" @click="openFormDialog('减脂经历', scope.row.experience)">点击查看</el-button> + <span v-show="scope.row.experience == null || scope.row.experience.length <= 10">{{scope.row.experience}}</span> </template> </el-table-column> - <el-table-column label="减脂遇到的困难" align="center" prop="sign.difficulty" width="100"> + <el-table-column label="减脂遇到的困难" align="center" prop="difficulty" width="100"> <template slot-scope="scope"> - <el-button v-show="scope.row.sign.difficulty != null && scope.row.sign.difficulty.length > 10" type="text" @click="openFormDialog('减脂遇到的困难', scope.row.sign.difficulty)">点击查看</el-button> - <span v-show="scope.row.sign.difficulty == null || scope.row.sign.difficulty.length <= 10">{{scope.row.sign.difficulty}}</span> + <el-button v-show="scope.row.difficulty != null && scope.row.difficulty.length > 10" type="text" @click="openFormDialog('减脂遇到的困难', scope.row.difficulty)">点击查看</el-button> + <span v-show="scope.row.difficulty == null || scope.row.difficulty.length <= 10">{{scope.row.difficulty}}</span> </template> </el-table-column> - <el-table-column label="备注" align="center" prop="sign.comments" width="100"> + <el-table-column label="备注" align="center" prop="comments" width="100"> <template slot-scope="scope"> - <el-button v-show="scope.row.sign.comments != null && scope.row.sign.comments.length > 10" type="text" @click="openFormDialog('备注', scope.row.sign.comments)">点击查看</el-button> - <span v-show="scope.row.sign.comments == null || scope.row.sign.comments.length <= 10">{{scope.row.sign.comments}}</span> + <el-button v-show="scope.row.comments != null && scope.row.comments.length > 10" type="text" @click="openFormDialog('备注', scope.row.comments)">点击查看</el-button> + <span v-show="scope.row.comments == null || scope.row.comments.length <= 10">{{scope.row.comments}}</span> </template> </el-table-column> <!--<el-table-column label="主营养师" align="center" prop="mainDietitian" /> @@ -584,6 +584,7 @@ reset() { this.form = { id: null, + customerId: null, name: '', phone: '', address: "", @@ -645,8 +646,7 @@ this.reset(); const id = row.id || this.ids getCustomer(id).then(response => { - let cusMessage = response.data.sign; - cusMessage.id = response.data.id; + let cusMessage = response.data; cusMessage.bloodData = (cusMessage.bloodData != null && cusMessage.bloodData.trim() != "") ? cusMessage.bloodData.split(",") : []; cusMessage.moistureDate = (cusMessage.moistureDate != null && cusMessage.moistureDate.trim() != "") ? cusMessage.moistureDate.split(",") : []; cusMessage.physicalSignsId = (cusMessage.physicalSignsId != null && cusMessage.physicalSignsId.trim() != "") ? cusMessage.physicalSignsId.split(",") : []; @@ -657,8 +657,6 @@ cusMessage.sleepTime = this.deltime(cusMessage.sleepTime); cusMessage.getupTime = this.deltime(cusMessage.getupTime); cusMessage.connectTime = this.deltime(cusMessage.connectTime); - cusMessage.name = response.data.name; - cusMessage.phone = response.data.phone; this.form = cusMessage; this.open = true; this.title = "修改客户体征"; diff --git a/stdiet-ui/src/views/custom/healthy/index.vue b/stdiet-ui/src/views/custom/healthy/index.vue new file mode 100644 index 000000000..f611c1524 --- /dev/null +++ b/stdiet-ui/src/views/custom/healthy/index.vue @@ -0,0 +1,697 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="调理项目id" prop="conditioningProjectId"> + <el-input + v-model="queryParams.conditioningProjectId" + placeholder="请输入调理项目id" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item> + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['custom:healthy:add']" + >新增</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['custom:healthy:edit']" + >修改</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['custom:healthy:remove']" + >删除</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['custom:healthy:export']" + >导出</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="healthyList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="调理项目id" align="center" prop="id" /> + <el-table-column label="客户ID" align="center" prop="customerId" /> + <el-table-column label="调理项目id" align="center" prop="conditioningProjectId" /> + <el-table-column label="0男 1女 2未知,默认2" align="center" prop="sex" /> + <el-table-column label="年龄" align="center" prop="age" /> + <el-table-column label="调味品种类,使用 , 隔开" align="center" prop="condiment" /> + <el-table-column label="其他调味品种类" align="center" prop="otherCondiment" /> + <el-table-column label="喜好的烹调方式,使用 , 隔开" align="center" prop="cookingStyle" /> + <el-table-column label="烹调方式对应频次,每周几次,使用 , 隔开" align="center" prop="cookingStyleRate" /> + <el-table-column label="洗菜方式,使用 , 隔开" align="center" prop="washVegetablesStyle" /> + <el-table-column label="其他洗菜方式" align="center" prop="otherWashVegetablesStyle" /> + <el-table-column label="早餐习惯" align="center" prop="breakfastType" /> + <el-table-column label="早餐吃的食物" align="center" prop="breakfastFood" /> + <el-table-column label="午餐习惯,使用 , 隔开" align="center" prop="lunchType" /> + <el-table-column label="晚餐习惯,使用 , 隔开" align="center" prop="dinner" /> + <el-table-column label="早餐当中素菜占比" align="center" prop="vegetableRate" /> + <el-table-column label="最常吃的肉类" align="center" prop="commonMeat" /> + <el-table-column label="晚餐时间" align="center" prop="dinnerTime" /> + <el-table-column label="每周吃夜宵次数,默认0" align="center" prop="supperNum" /> + <el-table-column label="夜宵通常吃的食物" align="center" prop="supperFood" /> + <el-table-column label="食物的冷热偏好" align="center" prop="dietHotAndCold" /> + <el-table-column label="食物的口味偏好,使用 , 隔开" align="center" prop="dietFlavor" /> + <el-table-column label="平均每周吃生菜几次" align="center" prop="vegetablesNum" /> + <el-table-column label="每周吃生菜的频次类型" align="center" prop="vegetablesRateType" /> + <el-table-column label="平均每天吃水果次数,默认0" align="center" prop="fruitsNum" /> + <el-table-column label="吃水果的时间段" align="center" prop="fruitsTime" /> + <el-table-column label="平时吃水果的频次" align="center" prop="fruitsRate" /> + <el-table-column label="一餐吃几碗饭" align="center" prop="riceNum" /> + <el-table-column label="吃几成饱" align="center" prop="riceFull" /> + <el-table-column label="吃饭速度" align="center" prop="eatingSpeed" /> + <el-table-column label="常吃的零食,使用 , 隔开" align="center" prop="snacks" /> + <el-table-column label="其他零食" align="center" prop="otherSnacks" /> + <el-table-column label="有无服用营养保健品,0无 1有" align="center" prop="healthProductsFlag" /> + <el-table-column label="营养保健品品牌名" align="center" prop="healthProductsBrand" /> + <el-table-column label="营养保健品产品名" align="center" prop="healthProductsName" /> + <el-table-column label="服用营养保健品频次,每周几次" align="center" prop="healthProductsWeekRate" /> + <el-table-column label="服用营养保健品频次,每天几次" align="center" prop="healthProductsDayRate" /> + <el-table-column label="每天的饮水量,单位:毫升" align="center" prop="waterNum" /> + <el-table-column label="喜欢喝什么水,使用 , 隔开" align="center" prop="waterType" /> + <el-table-column label="喝水习惯,使用 , 隔开" align="center" prop="waterHabit" /> + <el-table-column label="常喝的饮品的每周频次,使用,隔开" align="center" prop="drinksNum" /> + <el-table-column label="是否喝酒" align="center" prop="drinkWineFlag" /> + <el-table-column label="喝酒种类,使用,隔开" align="center" prop="drinkWineClassify" /> + <el-table-column label="其他酒种类" align="center" prop="otherWineClassify" /> + <el-table-column label="对应酒的量" align="center" prop="drinkWineAmount" /> + <el-table-column label="是否抽烟,0否 1是,默认0" align="center" prop="smokeFlag" /> + <el-table-column label="抽烟频次和烟龄,戒烟几年,使用,隔开" align="center" prop="smokeRate" /> + <el-table-column label="是否经常抽二手烟 0否 1是,默认0" align="center" prop="secondSmoke" /> + <el-table-column label="工作行业" align="center" prop="workIndustry" /> + <el-table-column label="工作性质,使用,隔开" align="center" prop="workType" /> + <el-table-column label="排便次数" align="center" prop="defecationNum" /> + <el-table-column label="其他手动输入的排便次数" align="center" prop="otherDefecationNum" /> + <el-table-column label="排便时间段,使用,隔开" align="center" prop="defecationTime" /> + <el-table-column label="排便的形状" align="center" prop="defecationShape" /> + <el-table-column label="排便的气味" align="center" prop="defecationSmell" /> + <el-table-column label="排便的速度" align="center" prop="defecationSpeed" /> + <el-table-column label="排便的颜色" align="center" prop="defecationColor" /> + <el-table-column label="每周运动次数" align="center" prop="motionNum" /> + <el-table-column label="每次运动的时长,分钟" align="center" prop="motionDuration" /> + <el-table-column label="每天运动的时间,24小时制" align="center" prop="motionTime" /> + <el-table-column label="有氧运动项目,使用,隔开" align="center" prop="aerobicMotionClassify" /> + <el-table-column label="无氧运动项目,使用,隔开" align="center" prop="anaerobicMotionClassify" /> + <el-table-column label="无氧有氧项目,使用,隔开" align="center" prop="anaerobicAerobicMotionClassify" /> + <el-table-column label="其他运动项目,使用,隔开" align="center" prop="otherMotionClassify" /> + <el-table-column label="运动场地,使用,隔开" align="center" prop="motionField" /> + <el-table-column label="其他运动场地" align="center" prop="otherMotionField" /> + <el-table-column label="睡觉时间,24小时制" align="center" prop="sleepTime" /> + <el-table-column label="睡眠质量" align="center" prop="sleepQuality" /> + <el-table-column label="是否有辅助入睡药物,0否 1是,默认0" align="center" prop="sleepDrugFlag" /> + <el-table-column label="辅助睡眠类药物名称" align="center" prop="sleepDrug" /> + <el-table-column label="是否经常熬夜" align="center" prop="stayupLateFlag" /> + <el-table-column label="熬夜频次,每周几次" align="center" prop="stayupLateWeekNum" /> + <el-table-column label="家族疾病史,使用,隔开" align="center" prop="familyIllnessHistory" /> + <el-table-column label="其他家族病史" align="center" prop="otherFamilyIllnessHistory" /> + <el-table-column label="手术史,使用,隔开" align="center" prop="operationHistory" /> + <el-table-column label="其他手术史" align="center" prop="otherOperationHistory" /> + <el-table-column label="近期是否做过手术,0否 1是,默认0" align="center" prop="nearOperationFlag" /> + <el-table-column label="手术恢复情况" align="center" prop="recoveryeSituation" /> + <el-table-column label="是否长期服用药物,0否 1是,默认0" align="center" prop="longEatDrugFlag" /> + <el-table-column label="长期服用的药物,使用,隔开" align="center" prop="longEatDrugClassify" /> + <el-table-column label="其他长期服用的药物" align="center" prop="otherLongEatDrugClassify" /> + <el-table-column label="是否出现过过敏症状,0否 1是,默认0" align="center" prop="allergyFlag" /> + <el-table-column label="过敏症状" align="center" prop="allergySituation" /> + <el-table-column label="过敏源,使用,隔开" align="center" prop="allergen" /> + <el-table-column label="其他过敏源" align="center" prop="otherAllergen" /> + <el-table-column label="体检报告" align="center" prop="medicalReport" /> + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['custom:healthy:edit']" + >修改</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['custom:healthy:remove']" + >删除</el-button> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 添加或修改客户健康对话框 --> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="客户ID" prop="customerId"> + <el-input v-model="form.customerId" placeholder="请输入客户ID" /> + </el-form-item> + <el-form-item label="调理项目id" prop="conditioningProjectId"> + <el-input v-model="form.conditioningProjectId" placeholder="请输入调理项目id" /> + </el-form-item> + <el-form-item label="0男 1女 2未知,默认2" prop="sex"> + <el-select v-model="form.sex" placeholder="请选择0男 1女 2未知,默认2"> + <el-option label="请选择字典生成" value="" /> + </el-select> + </el-form-item> + <el-form-item label="年龄" prop="age"> + <el-input v-model="form.age" placeholder="请输入年龄" /> + </el-form-item> + <el-form-item label="调味品种类,使用 , 隔开" prop="condiment"> + <el-input v-model="form.condiment" placeholder="请输入调味品种类,使用 , 隔开" /> + </el-form-item> + <el-form-item label="其他调味品种类" prop="otherCondiment"> + <el-input v-model="form.otherCondiment" placeholder="请输入其他调味品种类" /> + </el-form-item> + <el-form-item label="喜好的烹调方式,使用 , 隔开" prop="cookingStyle"> + <el-input v-model="form.cookingStyle" placeholder="请输入喜好的烹调方式,使用 , 隔开" /> + </el-form-item> + <el-form-item label="烹调方式对应频次,每周几次,使用 , 隔开" prop="cookingStyleRate"> + <el-input v-model="form.cookingStyleRate" placeholder="请输入烹调方式对应频次,每周几次,使用 , 隔开" /> + </el-form-item> + <el-form-item label="洗菜方式,使用 , 隔开" prop="washVegetablesStyle"> + <el-input v-model="form.washVegetablesStyle" placeholder="请输入洗菜方式,使用 , 隔开" /> + </el-form-item> + <el-form-item label="其他洗菜方式" prop="otherWashVegetablesStyle"> + <el-input v-model="form.otherWashVegetablesStyle" placeholder="请输入其他洗菜方式" /> + </el-form-item> + <el-form-item label="早餐习惯" prop="breakfastType"> + <el-select v-model="form.breakfastType" placeholder="请选择早餐习惯"> + <el-option label="请选择字典生成" value="" /> + </el-select> + </el-form-item> + <el-form-item label="早餐吃的食物" prop="breakfastFood"> + <el-input v-model="form.breakfastFood" placeholder="请输入早餐吃的食物" /> + </el-form-item> + <el-form-item label="午餐习惯,使用 , 隔开" prop="lunchType"> + <el-select v-model="form.lunchType" placeholder="请选择午餐习惯,使用 , 隔开"> + <el-option label="请选择字典生成" value="" /> + </el-select> + </el-form-item> + <el-form-item label="晚餐习惯,使用 , 隔开" prop="dinner"> + <el-input v-model="form.dinner" placeholder="请输入晚餐习惯,使用 , 隔开" /> + </el-form-item> + <el-form-item label="早餐当中素菜占比" prop="vegetableRate"> + <el-input v-model="form.vegetableRate" placeholder="请输入早餐当中素菜占比" /> + </el-form-item> + <el-form-item label="最常吃的肉类" prop="commonMeat"> + <el-input v-model="form.commonMeat" placeholder="请输入最常吃的肉类" /> + </el-form-item> + <el-form-item label="晚餐时间" prop="dinnerTime"> + <el-input v-model="form.dinnerTime" placeholder="请输入晚餐时间" /> + </el-form-item> + <el-form-item label="每周吃夜宵次数,默认0" prop="supperNum"> + <el-input v-model="form.supperNum" placeholder="请输入每周吃夜宵次数,默认0" /> + </el-form-item> + <el-form-item label="夜宵通常吃的食物" prop="supperFood"> + <el-input v-model="form.supperFood" placeholder="请输入夜宵通常吃的食物" /> + </el-form-item> + <el-form-item label="食物的冷热偏好" prop="dietHotAndCold"> + <el-input v-model="form.dietHotAndCold" placeholder="请输入食物的冷热偏好" /> + </el-form-item> + <el-form-item label="食物的口味偏好,使用 , 隔开" prop="dietFlavor"> + <el-input v-model="form.dietFlavor" placeholder="请输入食物的口味偏好,使用 , 隔开" /> + </el-form-item> + <el-form-item label="平均每周吃生菜几次" prop="vegetablesNum"> + <el-input v-model="form.vegetablesNum" placeholder="请输入平均每周吃生菜几次" /> + </el-form-item> + <el-form-item label="每周吃生菜的频次类型" prop="vegetablesRateType"> + <el-select v-model="form.vegetablesRateType" placeholder="请选择每周吃生菜的频次类型"> + <el-option label="请选择字典生成" value="" /> + </el-select> + </el-form-item> + <el-form-item label="平均每天吃水果次数,默认0" prop="fruitsNum"> + <el-input v-model="form.fruitsNum" placeholder="请输入平均每天吃水果次数,默认0" /> + </el-form-item> + <el-form-item label="吃水果的时间段" prop="fruitsTime"> + <el-input v-model="form.fruitsTime" placeholder="请输入吃水果的时间段" /> + </el-form-item> + <el-form-item label="平时吃水果的频次" prop="fruitsRate"> + <el-input v-model="form.fruitsRate" placeholder="请输入平时吃水果的频次" /> + </el-form-item> + <el-form-item label="一餐吃几碗饭" prop="riceNum"> + <el-input v-model="form.riceNum" placeholder="请输入一餐吃几碗饭" /> + </el-form-item> + <el-form-item label="吃几成饱" prop="riceFull"> + <el-input v-model="form.riceFull" placeholder="请输入吃几成饱" /> + </el-form-item> + <el-form-item label="吃饭速度" prop="eatingSpeed"> + <el-input v-model="form.eatingSpeed" placeholder="请输入吃饭速度" /> + </el-form-item> + <el-form-item label="常吃的零食,使用 , 隔开" prop="snacks"> + <el-input v-model="form.snacks" placeholder="请输入常吃的零食,使用 , 隔开" /> + </el-form-item> + <el-form-item label="其他零食" prop="otherSnacks"> + <el-input v-model="form.otherSnacks" placeholder="请输入其他零食" /> + </el-form-item> + <el-form-item label="有无服用营养保健品,0无 1有" prop="healthProductsFlag"> + <el-input v-model="form.healthProductsFlag" placeholder="请输入有无服用营养保健品,0无 1有" /> + </el-form-item> + <el-form-item label="营养保健品品牌名" prop="healthProductsBrand"> + <el-input v-model="form.healthProductsBrand" placeholder="请输入营养保健品品牌名" /> + </el-form-item> + <el-form-item label="营养保健品产品名" prop="healthProductsName"> + <el-input v-model="form.healthProductsName" placeholder="请输入营养保健品产品名" /> + </el-form-item> + <el-form-item label="服用营养保健品频次,每周几次" prop="healthProductsWeekRate"> + <el-input v-model="form.healthProductsWeekRate" placeholder="请输入服用营养保健品频次,每周几次" /> + </el-form-item> + <el-form-item label="服用营养保健品频次,每天几次" prop="healthProductsDayRate"> + <el-input v-model="form.healthProductsDayRate" placeholder="请输入服用营养保健品频次,每天几次" /> + </el-form-item> + <el-form-item label="每天的饮水量,单位:毫升" prop="waterNum"> + <el-input v-model="form.waterNum" placeholder="请输入每天的饮水量,单位:毫升" /> + </el-form-item> + <el-form-item label="喜欢喝什么水,使用 , 隔开" prop="waterType"> + <el-select v-model="form.waterType" placeholder="请选择喜欢喝什么水,使用 , 隔开"> + <el-option label="请选择字典生成" value="" /> + </el-select> + </el-form-item> + <el-form-item label="喝水习惯,使用 , 隔开" prop="waterHabit"> + <el-input v-model="form.waterHabit" placeholder="请输入喝水习惯,使用 , 隔开" /> + </el-form-item> + <el-form-item label="常喝的饮品的每周频次,使用,隔开" prop="drinksNum"> + <el-input v-model="form.drinksNum" placeholder="请输入常喝的饮品的每周频次,使用,隔开" /> + </el-form-item> + <el-form-item label="是否喝酒" prop="drinkWineFlag"> + <el-input v-model="form.drinkWineFlag" placeholder="请输入是否喝酒" /> + </el-form-item> + <el-form-item label="喝酒种类,使用,隔开" prop="drinkWineClassify"> + <el-input v-model="form.drinkWineClassify" placeholder="请输入喝酒种类,使用,隔开" /> + </el-form-item> + <el-form-item label="其他酒种类" prop="otherWineClassify"> + <el-input v-model="form.otherWineClassify" placeholder="请输入其他酒种类" /> + </el-form-item> + <el-form-item label="对应酒的量" prop="drinkWineAmount"> + <el-input v-model="form.drinkWineAmount" placeholder="请输入对应酒的量" /> + </el-form-item> + <el-form-item label="是否抽烟,0否 1是,默认0" prop="smokeFlag"> + <el-input v-model="form.smokeFlag" placeholder="请输入是否抽烟,0否 1是,默认0" /> + </el-form-item> + <el-form-item label="抽烟频次和烟龄,戒烟几年,使用,隔开" prop="smokeRate"> + <el-input v-model="form.smokeRate" placeholder="请输入抽烟频次和烟龄,戒烟几年,使用,隔开" /> + </el-form-item> + <el-form-item label="是否经常抽二手烟 0否 1是,默认0" prop="secondSmoke"> + <el-input v-model="form.secondSmoke" placeholder="请输入是否经常抽二手烟 0否 1是,默认0" /> + </el-form-item> + <el-form-item label="工作行业" prop="workIndustry"> + <el-input v-model="form.workIndustry" placeholder="请输入工作行业" /> + </el-form-item> + <el-form-item label="工作性质,使用,隔开" prop="workType"> + <el-select v-model="form.workType" placeholder="请选择工作性质,使用,隔开"> + <el-option label="请选择字典生成" value="" /> + </el-select> + </el-form-item> + <el-form-item label="排便次数" prop="defecationNum"> + <el-input v-model="form.defecationNum" placeholder="请输入排便次数" /> + </el-form-item> + <el-form-item label="其他手动输入的排便次数" prop="otherDefecationNum"> + <el-input v-model="form.otherDefecationNum" placeholder="请输入其他手动输入的排便次数" /> + </el-form-item> + <el-form-item label="排便时间段,使用,隔开" prop="defecationTime"> + <el-input v-model="form.defecationTime" placeholder="请输入排便时间段,使用,隔开" /> + </el-form-item> + <el-form-item label="排便的形状" prop="defecationShape"> + <el-input v-model="form.defecationShape" placeholder="请输入排便的形状" /> + </el-form-item> + <el-form-item label="排便的气味" prop="defecationSmell"> + <el-input v-model="form.defecationSmell" placeholder="请输入排便的气味" /> + </el-form-item> + <el-form-item label="排便的速度" prop="defecationSpeed"> + <el-input v-model="form.defecationSpeed" placeholder="请输入排便的速度" /> + </el-form-item> + <el-form-item label="排便的颜色" prop="defecationColor"> + <el-input v-model="form.defecationColor" placeholder="请输入排便的颜色" /> + </el-form-item> + <el-form-item label="每周运动次数" prop="motionNum"> + <el-input v-model="form.motionNum" placeholder="请输入每周运动次数" /> + </el-form-item> + <el-form-item label="每次运动的时长,分钟" prop="motionDuration"> + <el-input v-model="form.motionDuration" placeholder="请输入每次运动的时长,分钟" /> + </el-form-item> + <el-form-item label="每天运动的时间,24小时制" prop="motionTime"> + <el-input v-model="form.motionTime" placeholder="请输入每天运动的时间,24小时制" /> + </el-form-item> + <el-form-item label="有氧运动项目,使用,隔开" prop="aerobicMotionClassify"> + <el-input v-model="form.aerobicMotionClassify" placeholder="请输入有氧运动项目,使用,隔开" /> + </el-form-item> + <el-form-item label="无氧运动项目,使用,隔开" prop="anaerobicMotionClassify"> + <el-input v-model="form.anaerobicMotionClassify" placeholder="请输入无氧运动项目,使用,隔开" /> + </el-form-item> + <el-form-item label="无氧有氧项目,使用,隔开" prop="anaerobicAerobicMotionClassify"> + <el-input v-model="form.anaerobicAerobicMotionClassify" placeholder="请输入无氧有氧项目,使用,隔开" /> + </el-form-item> + <el-form-item label="其他运动项目,使用,隔开" prop="otherMotionClassify"> + <el-input v-model="form.otherMotionClassify" placeholder="请输入其他运动项目,使用,隔开" /> + </el-form-item> + <el-form-item label="运动场地,使用,隔开" prop="motionField"> + <el-input v-model="form.motionField" placeholder="请输入运动场地,使用,隔开" /> + </el-form-item> + <el-form-item label="其他运动场地" prop="otherMotionField"> + <el-input v-model="form.otherMotionField" placeholder="请输入其他运动场地" /> + </el-form-item> + <el-form-item label="睡觉时间,24小时制" prop="sleepTime"> + <el-input v-model="form.sleepTime" placeholder="请输入睡觉时间,24小时制" /> + </el-form-item> + <el-form-item label="睡眠质量" prop="sleepQuality"> + <el-input v-model="form.sleepQuality" placeholder="请输入睡眠质量" /> + </el-form-item> + <el-form-item label="是否有辅助入睡药物,0否 1是,默认0" prop="sleepDrugFlag"> + <el-input v-model="form.sleepDrugFlag" placeholder="请输入是否有辅助入睡药物,0否 1是,默认0" /> + </el-form-item> + <el-form-item label="辅助睡眠类药物名称" prop="sleepDrug"> + <el-input v-model="form.sleepDrug" placeholder="请输入辅助睡眠类药物名称" /> + </el-form-item> + <el-form-item label="是否经常熬夜" prop="stayupLateFlag"> + <el-input v-model="form.stayupLateFlag" placeholder="请输入是否经常熬夜" /> + </el-form-item> + <el-form-item label="熬夜频次,每周几次" prop="stayupLateWeekNum"> + <el-input v-model="form.stayupLateWeekNum" placeholder="请输入熬夜频次,每周几次" /> + </el-form-item> + <el-form-item label="家族疾病史,使用,隔开" prop="familyIllnessHistory"> + <el-input v-model="form.familyIllnessHistory" placeholder="请输入家族疾病史,使用,隔开" /> + </el-form-item> + <el-form-item label="其他家族病史" prop="otherFamilyIllnessHistory"> + <el-input v-model="form.otherFamilyIllnessHistory" placeholder="请输入其他家族病史" /> + </el-form-item> + <el-form-item label="手术史,使用,隔开" prop="operationHistory"> + <el-input v-model="form.operationHistory" placeholder="请输入手术史,使用,隔开" /> + </el-form-item> + <el-form-item label="其他手术史" prop="otherOperationHistory"> + <el-input v-model="form.otherOperationHistory" placeholder="请输入其他手术史" /> + </el-form-item> + <el-form-item label="近期是否做过手术,0否 1是,默认0" prop="nearOperationFlag"> + <el-input v-model="form.nearOperationFlag" placeholder="请输入近期是否做过手术,0否 1是,默认0" /> + </el-form-item> + <el-form-item label="手术恢复情况" prop="recoveryeSituation"> + <el-input v-model="form.recoveryeSituation" placeholder="请输入手术恢复情况" /> + </el-form-item> + <el-form-item label="是否长期服用药物,0否 1是,默认0" prop="longEatDrugFlag"> + <el-input v-model="form.longEatDrugFlag" placeholder="请输入是否长期服用药物,0否 1是,默认0" /> + </el-form-item> + <el-form-item label="长期服用的药物,使用,隔开" prop="longEatDrugClassify"> + <el-input v-model="form.longEatDrugClassify" placeholder="请输入长期服用的药物,使用,隔开" /> + </el-form-item> + <el-form-item label="其他长期服用的药物" prop="otherLongEatDrugClassify"> + <el-input v-model="form.otherLongEatDrugClassify" placeholder="请输入其他长期服用的药物" /> + </el-form-item> + <el-form-item label="是否出现过过敏症状,0否 1是,默认0" prop="allergyFlag"> + <el-input v-model="form.allergyFlag" placeholder="请输入是否出现过过敏症状,0否 1是,默认0" /> + </el-form-item> + <el-form-item label="过敏症状" prop="allergySituation"> + <el-input v-model="form.allergySituation" placeholder="请输入过敏症状" /> + </el-form-item> + <el-form-item label="过敏源,使用,隔开" prop="allergen"> + <el-input v-model="form.allergen" placeholder="请输入过敏源,使用,隔开" /> + </el-form-item> + <el-form-item label="其他过敏源" prop="otherAllergen"> + <el-input v-model="form.otherAllergen" placeholder="请输入其他过敏源" /> + </el-form-item> + <el-form-item label="体检报告" prop="medicalReport"> + <el-input v-model="form.medicalReport" placeholder="请输入体检报告" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">确 定</el-button> + <el-button @click="cancel">取 消</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> + import { listHealthy, getHealthy, delHealthy, addHealthy, updateHealthy, exportHealthy } from "@/api/custom/healthy"; + + export default { + name: "Healthy", + data() { + return { + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 显示搜索条件 + showSearch: true, + // 总条数 + total: 0, + // 客户健康表格数据 + healthyList: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + // 查询参数 + queryParams: { + pageNum: 1, + pageSize: 10, + conditioningProjectId: null, + }, + // 表单参数 + form: {}, + // 表单校验 + rules: { + vegetableRate: [ + { required: true, message: "早餐当中素菜占比不能为空", trigger: "blur" } + ], + } + }; + }, + created() { + this.getList(); + }, + methods: { + /** 查询客户健康列表 */ + getList() { + this.loading = true; + listHealthy(this.queryParams).then(response => { + this.healthyList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + id: null, + customerId: null, + conditioningProjectId: null, + sex: null, + age: null, + condiment: null, + otherCondiment: null, + cookingStyle: null, + cookingStyleRate: null, + washVegetablesStyle: null, + otherWashVegetablesStyle: null, + breakfastType: null, + breakfastFood: null, + lunchType: null, + dinner: null, + vegetableRate: null, + commonMeat: null, + dinnerTime: null, + supperNum: null, + supperFood: null, + dietHotAndCold: null, + dietFlavor: null, + vegetablesNum: null, + vegetablesRateType: null, + fruitsNum: null, + fruitsTime: null, + fruitsRate: null, + riceNum: null, + riceFull: null, + eatingSpeed: null, + snacks: null, + otherSnacks: null, + healthProductsFlag: null, + healthProductsBrand: null, + healthProductsName: null, + healthProductsWeekRate: null, + healthProductsDayRate: null, + waterNum: null, + waterType: null, + waterHabit: null, + drinksNum: null, + drinkWineFlag: null, + drinkWineClassify: null, + otherWineClassify: null, + drinkWineAmount: null, + smokeFlag: null, + smokeRate: null, + secondSmoke: null, + workIndustry: null, + workType: null, + defecationNum: null, + otherDefecationNum: null, + defecationTime: null, + defecationShape: null, + defecationSmell: null, + defecationSpeed: null, + defecationColor: null, + motionNum: null, + motionDuration: null, + motionTime: null, + aerobicMotionClassify: null, + anaerobicMotionClassify: null, + anaerobicAerobicMotionClassify: null, + otherMotionClassify: null, + motionField: null, + otherMotionField: null, + sleepTime: null, + sleepQuality: null, + sleepDrugFlag: null, + sleepDrug: null, + stayupLateFlag: null, + stayupLateWeekNum: null, + familyIllnessHistory: null, + otherFamilyIllnessHistory: null, + operationHistory: null, + otherOperationHistory: null, + nearOperationFlag: null, + recoveryeSituation: null, + longEatDrugFlag: null, + longEatDrugClassify: null, + otherLongEatDrugClassify: null, + allergyFlag: null, + allergySituation: null, + allergen: null, + otherAllergen: null, + medicalReport: null, + createTime: null, + createBy: null, + updateTime: null, + updateBy: null, + delFlag: null + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 新增按钮操作 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "添加客户健康"; + }, + /** 修改按钮操作 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getHealthy(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "修改客户健康"; + }); + }, + /** 提交按钮 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateHealthy(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("修改成功"); + this.open = false; + this.getList(); + } + }); + } else { + addHealthy(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("新增成功"); + this.open = false; + this.getList(); + } + }); + } + } + }); + }, + /** 删除按钮操作 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$confirm('是否确认删除客户健康编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(function() { + return delHealthy(ids); + }).then(() => { + this.getList(); + this.msgSuccess("删除成功"); + }).catch(function() {}); + }, + /** 导出按钮操作 */ + handleExport() { + const queryParams = this.queryParams; + this.$confirm('是否确认导出所有客户健康数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(function() { + return exportHealthy(queryParams); + }).then(response => { + this.download(response.msg); + }).catch(function() {}); + } + } + }; +</script> diff --git a/stdiet-ui/src/views/custom/investigate/questionnaire.vue b/stdiet-ui/src/views/custom/investigate/questionnaire.vue index 12f3734f5..a485b0128 100644 --- a/stdiet-ui/src/views/custom/investigate/questionnaire.vue +++ b/stdiet-ui/src/views/custom/investigate/questionnaire.vue @@ -280,7 +280,6 @@ export default { ], phone: [ { required: true, trigger: "blur", message: "请填写手机号" }, - { required: true, trigger: "blur", message: "请填写正确的手机号" }, { required: true, trigger: "blur", diff --git a/stdiet-ui/src/views/custom/order/index.vue b/stdiet-ui/src/views/custom/order/index.vue index 76074813a..cf8a9b1e2 100644 --- a/stdiet-ui/src/views/custom/order/index.vue +++ b/stdiet-ui/src/views/custom/order/index.vue @@ -718,7 +718,13 @@ {required: true, message: "金额不能为空", trigger: "blur"} ], phone: [ - {required: true, message: "手机号不能为空", trigger: "blur"} + {required: true, message: "手机号不能为空", trigger: "blur"}, + { + required: true, + trigger: "blur", + pattern: /^[0-9]{5,11}$/, + message: "手机号格式不正确", + } ], orderTime: [ {required: true, message: "成交时间不能为空", trigger: "blur"}, diff --git a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue index 2da2c118d..9166db6d3 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -692,14 +692,14 @@ export default { {"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} ], conditioningProjectIdOption:[], - stepArray: [false,false,false,false,false,false,false,true], - stepActive: 7, + stepArray: [true,false,false,false,false,false,false,false], + stepActive: 0, form: { - name: "jun", - phone: "152708980", + name: null, + phone: null, conditioningProjectId: 0, sex: 1, - age: 18, + age: null, condiment:["1","5","9","6","1","3"], otherCondiment:null, cookingStyle: ["8","9","4","11"], From e53ac00fbdab650c5c555bca1e93ccf1eecc6ee0 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Mon, 25 Jan 2021 21:31:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/domain/SysCustomerHealthy.java | 14 +- .../custom/SysCustomerHealthyMapper.xml | 14 +- stdiet-ui/src/utils/healthyData.js | 177 ++++++++++++ stdiet-ui/src/views/custom/customer/index.vue | 2 +- stdiet-ui/src/views/custom/healthy/index.vue | 270 ++++++++++++++++-- .../custom/subhealthy/investigation/index.vue | 28 +- 6 files changed, 460 insertions(+), 45 deletions(-) create mode 100644 stdiet-ui/src/utils/healthyData.js 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 b56dfea86..6a7a7e9cd 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 @@ -31,9 +31,13 @@ public class SysCustomerHealthy extends BaseEntity private String phone; /** 调理项目id */ - @Excel(name = "调理项目id") + //@Excel(name = "调理项目id") private Long conditioningProjectId; + /** 调理项目名称 ,非持久化字段*/ + @Excel(name = "调理项目") + private String conditioningProject; + /** 0男 1女 2未知,默认2 */ @Excel(name = "0男 1女 2未知,默认2") private Long sex; @@ -1169,6 +1173,14 @@ public class SysCustomerHealthy extends BaseEntity this.phone = phone; } + public String getConditioningProject() { + return conditioningProject; + } + + public void setConditioningProject(String conditioningProject) { + this.conditioningProject = conditioningProject; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml index 26df193b7..ebe0212e6 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -7,11 +7,13 @@ <resultMap type="SysCustomerHealthy" id="SysCustomerHealthyResult"> <result property="id" column="id" /> <result property="customerId" column="customer_id" /> - <!-- 非持久化字段 --> + <!-- 非持久化字段,客户姓名 --> <result property="name" column="name"></result> - <!-- 非持久化字段 --> + <!-- 非持久化字段,客户手机号 --> <result property="phone" column="phone"></result> <result property="conditioningProjectId" column="conditioning_project_id" /> + <!-- 非持久化字段,调理项目名称 --> + <result property="conditioningProject" column="conditioning_project" /> <result property="sex" column="sex" /> <result property="age" column="age" /> <result property="condiment" column="condiment" /> @@ -107,17 +109,19 @@ </sql> <select id="selectSysCustomerHealthyList" parameterType="SysCustomerHealthy" resultMap="SysCustomerHealthyResult"> - <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone + <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project from sys_customer_healthy as sch - left join sys_customer sc on sc.id = sch.customer_id + LEFT JOIN sys_customer sc on sc.id = sch.customer_id + LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id where sch.del_flag = 0 and sc.del_flag = 0 <if test="conditioningProjectId != null "> and sch.conditioning_project_id = #{conditioningProjectId}</if> </select> <select id="selectSysCustomerHealthyById" parameterType="Long" resultMap="SysCustomerHealthyResult"> - <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone + <include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project from sys_customer_healthy as sch left join sys_customer sc on sc.id = sch.customer_id + LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id} </select> diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js new file mode 100644 index 000000000..50c160819 --- /dev/null +++ b/stdiet-ui/src/utils/healthyData.js @@ -0,0 +1,177 @@ +export const condimentArray = [ + {"name":"鸡精", "value":"1"}, + {"name":"耗油", "value":"2"}, + {"name":"生抽", "value":"3"}, + {"name":"老抽", "value":"4"}, + {"name":"香油", "value":"5"}, + {"name":"浓汤宝", "value":"6"}, + {"name":"鸡粉", "value":"7"}, + {"name":"花椒", "value":"8"}, + {"name":"辣椒油", "value":"9"} +] + +export const cookingStyleArray = [ + {"name":"煎","value":"1"},{"name":"烤","value":"2"},{"name":"炸","value":"3"},{"name":"卤","value":"4"}, + {"name":"腌","value":"5"},{"name":"腊","value":"6"},{"name":"煲","value":"7"},{"name":"炒","value":"8"}, + {"name":"蒸","value":"9"},{"name":"刺身","value":"10"},{"name":"水煮","value":"11"} +] + +export const cookingStyleRateArray = ["煎","炸","卤","腌","腊","煲"] + +export const washVegetablesStyleArray = [ + {"name":"先切后洗","value": "1"},{"name":"先洗后切","value": "2"},{"name":"切后浸泡","value": "3"} +] + +export const breakfastTypeArray = [ + {"name":"不吃","value": "1"},{"name":"偶尔吃","value": "2"},{"name":"每天吃","value": "3"} +] + +export const lunchTypeArray = [ + {"name":"外卖","value":"1"},{"name":"自带餐","value":"2"},{"name":"快餐","value":"3"},{"name":"餐厅","value":"4"} +] + +export const dinnerArray = [ + {"name":"餐馆吃","value":"1"},{"name":"在家吃","value":"2"},{"name":"丰盛","value":"3"},{"name":"清淡","value":"4"} +] + +export const dietHotAndColdArray = [ + {"name":"偏冷食","value":"1"},{"name":"偏冷食","value":"2"},{"name":"正常","value":"3"} +] + +export const dietFlavorArray = [ + {"name":"偏油","value":"1"},{"name":"偏咸","value":"2"},{"name":"偏辣","value":"3"}, + {"name":"偏甜","value":"4"},{"name":"偏酸","value":"5"},{"name":"清淡","value":"6"} +] + +export const vegetablesRateTypeArray = [ + {"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} +] + +export const fruitsTimeArray = [ + {"name":"餐前","value":"1"},{"name":"餐后","value":"2"},{"name":"餐间","value":"3"} +] + + +export const fruitsRateArray = [ + {"name":"每天吃","value":"1"},{"name":"经常吃","value":"2"},{"name":"偶尔吃","value":"3"},{"name":"从不吃","value":"4"} +] + +export const eatingSpeedArray = [ + {"name":"很快","value":"1"},{"name":"偏快","value":"2"},{"name":"正常","value":"3"},{"name":"偏慢","value":"4"} + ,{"name":"很慢","value":"5"} +] + +export const snacksArray = [ + {"name":"面包","value":"1"},{"name":"蛋糕","value":"2"},{"name":"饼干","value":"3"},{"name":"冰淇淋","value":"4"} + ,{"name":"糖果","value":"5"},{"name":"巧克力","value":"6"},{"name":"方便面","value":"7"},{"name":"薯条","value":"8"},{"name":"肉干","value":"9"}, + {"name":"坚果","value":"10"},{"name":"饮料","value":"11"},{"name":"果脯","value":"12"},{"name":"牛奶","value":"13"} +] + + +export const waterTypeArray = [ + {"name":"冰水","value":"1"},{"name":"温水","value":"2"},{"name":"常温水","value":"3"} +] + + +export const waterHabitArray = [ + {"name":"均匀地喝","value":"1"},{"name":"餐前多喝","value":"2"},{"name":"餐后多喝","value":"3"},{"name":"餐间多喝","value":"4"}, + {"name":"随时喝","value":"5"} +] + +export const drinksNumArray = ["老火汤","咖啡","浓茶","奶茶","冷饮","碳酸饮料","甜饮料","鲜榨果汁"] + + +export const drinkWineFlagArray = [ + {"name":"经常饮酒","value": "1"},{"name":"不饮酒","value": "2"},{"name":"偶尔","value": "3"} +] + + +export const drinkWineClassifyArray = [ + {"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"} +] + +export const drinkWineAmountArray = ["白酒","啤酒","红酒"] + +export const drinkWineAmountUnitArray = ["两","瓶","毫升"] + +export const smokeRateArray = ["每天抽烟","烟龄","已戒烟"] +export const smokeRateUnitArray = ["次","年","年"] + +export const workTypeArray = [ + {"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"}, + {"name":"走动多","value": "4"},{"name":"强度大","value": "5"},{"name":"用电脑多","value": "6"},{"name":"体力工作多","value": "7"} +] + +export const defecationTimeArray = [ + {"name":"上午","value": "1"},{"name":"中午","value": "2"},{"name":"晚上","value": "3"} +] + +export const aerobicMotionClassifyArray = [ + {"name":"跳绳","value": "1"},{"name":"跑步","value": "2"},{"name":"游泳","value": "3"} +] +export const anaerobicMotionClassifyArray = [ + {"name":"撸铁","value": "1"},{"name":"俯卧撑","value": "2"} +] + +export const anaerobicAerobicMotionClassifyArray = [ + {"name":"拳击","value": "1"},{"name":"瑜伽","value": "2"} +] + +export const motionFieldArray = [ + {"name":"居家","value": "1"},{"name":"健身房","value": "2"},{"name":"户外","value": "3"}, {"name":"健身房","value": "4"} +] + +export const sleepQualityArray = [ + {"name":"好","value": "1"},{"name":"一般","value": "2"},{"name":"入睡难","value": "3"}, + {"name":"失眠","value": "4"},{"name":"易醒","value": "5"},{"name":"多梦","value": "6"} +] + +export const familyIllnessHistoryArray = [ + {"name":"高血压病","value": "1"},{"name":"脑卒中","value": "2"},{"name":"冠心病","value": "3"}, + {"name":"外周血管病","value": "4"},{"name":"心力衰竭","value": "5"},{"name":"冠心病","value": "6"}, + {"name":"肥胖症","value": "7"},{"name":"慢性肾脏疾病","value": "8"},{"name":"骨质疏松","value": "9"}, + {"name":"痛风","value": "10"},{"name":"精神疾病","value": "11"},{"name":"恶性肿瘤","value": "12"}, + {"name":"慢性阻塞性肺病","value": "13"},{"name":"风湿性免疫性疾病","value": "14"}, +] + +export const operationHistoryArray = [ + {"name":"头颅(含脑)","value": "1"},{"name":"眼","value": "2"},{"name":"耳鼻咽喉","value": "3"}, + {"name":"颌面部及口腔","value": "4"},{"name":"颈部或甲状腺","value": "5"},{"name":"胸部(含肺部)","value": "6"}, + {"name":"心脏(含心脏介入)","value": "7"},{"name":"外周血管","value": "8"},{"name":"胃肠","value": "9"}, + {"name":"肝胆","value": "10"},{"name":"肾脏","value": "11"},{"name":"脊柱","value": "12"}, + {"name":"四肢及关节","value": "13"},{"name":"前列腺","value": "14"},{"name":"妇科","value": "15"},{"name":"乳腺","value": "16"} + ,{"name":"膀胱","value": "17"} +] + +export const longEatDrugClassifyArray = [ + {"name":"降压药","value": "1"},{"name":"降糖药","value": "2"},{"name":"降尿酸药","value": "3"}, + {"name":"抗心律失常药","value": "4"},{"name":"缓解哮喘药物","value": "5"},{"name":"抗压郁药物","value": "6"}, + {"name":"雌激素类药物","value": "7"},{"name":"利尿剂","value": "8"},{"name":"中草药","value": "9"}, + {"name":"避孕药","value": "10"},{"name":"强的松类药物","value": "11"},{"name":"镇静剂或安眠药","value": "12"}, + {"name":"调值药(降脂药)","value": "13"},{"name":"解热镇痛药(如布洛芬等)","value": "14"} +] + + export const allergenArray = [ + {"name":"青霉素","value": "1"},{"name":"磺胺类","value": "2"},{"name":"链霉素","value": "3"}, + {"name":"头孢类","value": "4"},{"name":"鸡蛋","value": "5"},{"name":"牛奶","value": "6"}, + {"name":"海鲜","value": "7"},{"name":"花粉或尘螨","value": "8"},{"name":"粉尘","value": "9"}, + {"name":"洗洁剂","value": "10"},{"name":"化妆品","value": "11"} +] + +//需要将数组转成字符串的属性名称,包含对象数组、字符串数组 +export const arrayName = [ + "condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor", + "snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate", + "workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", + "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "medicalReport" +] + +//需要将数字下标转成中文含义的属性名 +export const needAttrName = [ + "condiment","cookingStyle", "washVegetablesStyle","breakfastType","lunchType","dinner","dietFlavor","vegetablesRateType","dietHotAndCold", + "fruitsTime","fruitsRate","eatingSpeed", + "snacks","waterType","waterHabit","drinkWineFlag","drinkWineClassify", + "workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", + "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen" +] + diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index e23500606..d8330d6c7 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -69,7 +69,7 @@ <el-button type="primary" size="mini" - ><a href="http://sign.shengtangdiet.com/question" target='_blank'>营养体征调查</a></a></el-button> + ><a href="http://sign.shengtangdiet.com/question" target='_blank'>营养体征调查</a></el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> diff --git a/stdiet-ui/src/views/custom/healthy/index.vue b/stdiet-ui/src/views/custom/healthy/index.vue index f611c1524..cdec7b63e 100644 --- a/stdiet-ui/src/views/custom/healthy/index.vue +++ b/stdiet-ui/src/views/custom/healthy/index.vue @@ -1,10 +1,10 @@ <template> <div class="app-container"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="调理项目id" prop="conditioningProjectId"> + <!--<el-form-item label="调理项目" prop="conditioningProjectId"> <el-input v-model="queryParams.conditioningProjectId" - placeholder="请输入调理项目id" + placeholder="请输入调理项目" clearable size="small" @keyup.enter.native="handleQuery" @@ -13,11 +13,11 @@ <el-form-item> <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> - </el-form-item> + </el-form-item>--> </el-form> <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> + <!--<el-col :span="1.5"> <el-button type="primary" icon="el-icon-plus" @@ -25,8 +25,8 @@ @click="handleAdd" v-hasPermi="['custom:healthy:add']" >新增</el-button> - </el-col> - <el-col :span="1.5"> + </el-col>--> + <!--<el-col :span="1.5"> <el-button type="success" icon="el-icon-edit" @@ -35,8 +35,8 @@ @click="handleUpdate" v-hasPermi="['custom:healthy:edit']" >修改</el-button> - </el-col> - <el-col :span="1.5"> + </el-col>--> + <!--<el-col :span="1.5"> <el-button type="danger" icon="el-icon-delete" @@ -54,18 +54,34 @@ @click="handleExport" v-hasPermi="['custom:healthy:export']" >导出</el-button> + </el-col>--> + <el-col :span="1.5" title="客户健康评估表链接"> + <el-button + type="primary" + size="mini" + ><a href="http://sign.shengtangdiet.com/subhealthyInvestigation" target='_blank'>客户健康评估表</a></el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table v-loading="loading" :data="healthyList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="调理项目id" align="center" prop="id" /> - <el-table-column label="客户ID" align="center" prop="customerId" /> - <el-table-column label="调理项目id" align="center" prop="conditioningProjectId" /> - <el-table-column label="0男 1女 2未知,默认2" align="center" prop="sex" /> + <el-table-column label="创建时间" align="center" prop="createTime"fixed="left"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="调理项目" align="center" prop="conditioningProject" fixed="left"/> + <el-table-column label="姓名" align="center" prop="name" fixed="left"/> + <el-table-column label="手机号" align="center" prop="phone" fixed="left"/> + <el-table-column label="性别" align="center" prop="sex" > + <template slot-scope="scope"> + {{scope.row.sex == 0 ? `男` : '女'}} + </template> + </el-table-column> + <el-table-column label="年龄" align="center" prop="age" /> - <el-table-column label="调味品种类,使用 , 隔开" align="center" prop="condiment" /> + <!--<el-table-column label="调味品种类,使用 , 隔开" align="center" prop="condiment" /> <el-table-column label="其他调味品种类" align="center" prop="otherCondiment" /> <el-table-column label="喜好的烹调方式,使用 , 隔开" align="center" prop="cookingStyle" /> <el-table-column label="烹调方式对应频次,每周几次,使用 , 隔开" align="center" prop="cookingStyleRate" /> @@ -145,23 +161,30 @@ <el-table-column label="过敏症状" align="center" prop="allergySituation" /> <el-table-column label="过敏源,使用,隔开" align="center" prop="allergen" /> <el-table-column label="其他过敏源" align="center" prop="otherAllergen" /> - <el-table-column label="体检报告" align="center" prop="medicalReport" /> - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> + <el-table-column label="体检报告" align="center" prop="medicalReport" />--> + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right" > <template slot-scope="scope"> - <el-button + <!--<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['custom:healthy:edit']" - >修改</el-button> + >修改</el-button>--> <el-button + size="mini" + type="text" + icon="el-icon-c-scale-to-original" + @click="handleLookDetail(scope.row)" + v-hasPermi="['custom:healthy:query']" + >查看详情</el-button> + <!--<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['custom:healthy:remove']" - >删除</el-button> + >删除</el-button>--> </template> </el-table-column> </el-table> @@ -173,7 +196,6 @@ :limit.sync="queryParams.pageSize" @pagination="getList" /> - <!-- 添加或修改客户健康对话框 --> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> @@ -225,7 +247,7 @@ <el-form-item label="晚餐习惯,使用 , 隔开" prop="dinner"> <el-input v-model="form.dinner" placeholder="请输入晚餐习惯,使用 , 隔开" /> </el-form-item> - <el-form-item label="早餐当中素菜占比" prop="vegetableRate"> + <el-form-item label="正餐中素菜占比" prop="vegetableRate"> <el-input v-model="form.vegetableRate" placeholder="请输入早餐当中素菜占比" /> </el-form-item> <el-form-item label="最常吃的肉类" prop="commonMeat"> @@ -450,11 +472,38 @@ <el-button @click="cancel">取 消</el-button> </div> </el-dialog> + + <!-- 查看详情 --> + <el-dialog title="客户健康评估表" v-if="healthyDetailOpen" :visible.sync="healthyDetailOpen" width="1000px" style="overflow: auto;" append-to-body> + <el-table :show-header="false" v-for="(item,index) in healthyDetailList" :data="item" border :cell-style="columnStyle" style="width: 100%;margin-top:20px;"> + <el-table-column width="140" prop="attr_name_one"> + </el-table-column> + <el-table-column prop="value_one"> + <template slot-scope="scope"> + <AutoHideMessage :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/> + </template> + </el-table-column> + <el-table-column width="140" prop="attr_name_two"></el-table-column> + <el-table-column prop="value_two"> + <template slot-scope="scope"> + <AutoHideMessage :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/> + </template> + </el-table-column> + <el-table-column width="140" prop="attr_name_three"></el-table-column> + <el-table-column prop="value_three"> + <template slot-scope="scope"> + <AutoHideMessage :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/> + </template> + </el-table-column> + </el-table> + </el-dialog> </div> </template> <script> import { listHealthy, getHealthy, delHealthy, addHealthy, updateHealthy, exportHealthy } from "@/api/custom/healthy"; + import AutoHideMessage from "@/components/AutoHideMessage"; + import * as healthyData from "@/utils/healthyData"; export default { name: "Healthy", @@ -491,22 +540,186 @@ vegetableRate: [ { required: true, message: "早餐当中素菜占比不能为空", trigger: "blur" } ], - } + }, + healthyDetailOpen:false, + healthyDetailList:[[]], + healthyTitleData:[ + [["创建时间","客户姓名","手机号"],["调理项目","性别","年龄"]], + [["调味品种","烹调方式","烹调频次"],["洗菜方式","",""]], + [ + ["早餐习惯","早餐吃的食物","午餐习惯"],["晚餐习惯","正餐中素菜占比","最常吃的肉类"], + ["晚餐时间","每周吃夜宵次数","夜宵通常吃的食物"],["食物的冷热偏好","食物的口味偏好","平均每周吃生菜几次"], + ["每周吃生菜的频次类型","平均每天吃水果次数","吃水果的时间段"],["平时吃水果的频次","一餐吃几碗饭","吃几成饱"], + ["吃饭速度","常吃的零食","有无服用营养保健品"],["营养保健品品牌名","营养保健品产品名","服用营养保健品频次"] + ], + [ + ["每天的饮水量","喜欢喝什么水","喝水习惯"],["常喝的饮品的每周频次","是否喝酒","喝酒种类"],["对应酒的量","是否抽烟","抽烟频次和烟龄"], + ["是否经常抽二手烟","工作行业","工作性质"],["排便次数","排便时间段","排便的形状"],["排便的气味","排便的速度","排便的颜色"] + ], + [ + ["每周运动次数","每次运动的时长","每天运动的时间"],["运动","运动场地","睡觉时间"],["睡眠质量","是否有辅助入睡药物","辅助睡眠类药物名称"], + ["是否经常熬夜","熬夜频次","家族疾病史"],["手术史","近期是否做过手术","手术恢复情况"], + ["是否长期服用药物","长期服用的药物","是否出现过过敏症状"],["过敏症状","过敏源",""] + ] + ], + //健康详情的属性名称,与标题对应,按竖显示 + healthyValueData:[ + [["createTime","name","phone"],["conditioningProject","sex","age"]], + [["condiment","cookingStyle","cookingStyleRate"],["washVegetablesStyle","",""]], + [ + ["breakfastType","breakfastFood","lunchType"],["dinner","vegetableRate","commonMeat"], + ["dinnerTime","supperNum","supperFood"],["dietHotAndCold","dietFlavor","vegetablesNum"], + ["vegetablesRateType","fruitsNum","fruitsTime"],["fruitsRate","riceNum","riceNum"],["eatingSpeed","snacks","healthProductsFlag"], + ["healthProductsBrand","healthProductsName","healthProductsWeekRate"] + ], + [ + ["waterNum","waterType","waterHabit"],["drinksNum","drinkWineFlag","drinkWineClassify"],["drinkWineAmount","smokeFlag","smokeRate"], + ["secondSmoke","workIndustry","workType"],["defecationNum","defecationTime","defecationShape"],["defecationSmell","defecationSpeed","defecationColor"] + ], + [ + ["motionNum","motionDuration","motionTime"],["motion","motionField","sleepTime"],["sleepQuality","sleepDrugFlag","sleepDrug"], + ["stayupLateFlag","stayupLateWeekNum","familyIllnessHistory"],["operationHistory","nearOperationFlag","recoveryeSituation"], + ["longEatDrugFlag","longEatDrugClassify","allergyFlag"],["allergySituation","allergen",""] + ] + ] + + }; }, created() { this.getList(); }, + components: { + AutoHideMessage + }, methods: { /** 查询客户健康列表 */ getList() { this.loading = true; listHealthy(this.queryParams).then(response => { this.healthyList = response.rows; - this.total = response.total; - this.loading = false; + this.total = response.total; + this.loading = false; }); }, + /** 查看按钮操作 */ + handleLookDetail(row) { + const id = row.id || this.ids + getHealthy(id).then(response => { + let detailHealthy = this.dealHealthy(response.data); + //性别 + detailHealthy.sex = detailHealthy.sex == 0 ? "男" : (detailHealthy.sex == 1 ? "女" : "未知"); + //调味品 + detailHealthy.condiment += detailHealthy.otherCondiment ? (","+detailHealthy.otherCondiment) : ""; + //烹饪频次 + let cookingStyleRate = ""; + console.log(detailHealthy.cookingStyleRate); + if(detailHealthy.cookingStyleRate != null){ + detailHealthy.cookingStyleRate.split(",").forEach(function(item, index){ + cookingStyleRate += (cookingStyleRate != "" ? "," : "") + (healthyData["cookingStyleRateArray"][index])+item +"次"; + }); + } + detailHealthy.cookingStyleRate = cookingStyleRate; + //洗菜方式 + detailHealthy.washVegetablesStyle += detailHealthy.otherWashVegetablesStyle ? (","+detailHealthy.otherWashVegetablesStyle) : ""; + //素菜占比 + detailHealthy.vegetableRate += "成"; + //零食 + detailHealthy.snacks += detailHealthy.otherSnacks ? ("," + detailHealthy.otherSnacks) : ""; + detailHealthy.healthProductsFlag = detailHealthy.healthProductsFlag == 1 ? "有" : "无"; + detailHealthy.healthProductsWeekRate = detailHealthy.healthProductsDayRate+"次/天,"+detailHealthy.healthProductsWeekRate+"次/周"; + detailHealthy.waterNum += "毫升"; + //饮品 + let drinksNumString = ""; + if(detailHealthy.drinksNum != null){ + detailHealthy.drinksNum.split(",").forEach(function(item, index){ + drinksNumString += (drinksNumString != "" ? "," : "") + (healthyData["drinksNumArray"][index])+item +"次"; + }); + } + detailHealthy.drinksNum = drinksNumString; + detailHealthy.drinkWineClassify += detailHealthy.otherWineClassify ? (","+detailHealthy.otherWineClassify) : ""; + let drinkWineAmountString = ""; + if(detailHealthy.drinkWineAmount != null){ + detailHealthy.drinkWineAmount.split(",").forEach(function(item, index){ + drinkWineAmountString += (drinkWineAmountString != "" ? "," : "") + (healthyData["drinkWineAmountArray"][index])+item + healthyData["drinkWineAmountUnitArray"][index]; + }); + } + detailHealthy.drinkWineAmount = drinkWineAmountString; + detailHealthy.smokeFlag = detailHealthy.smokeFlag == 1 ? "是" : "否"; + detailHealthy.secondSmoke = detailHealthy.secondSmoke == 1 ? "是" : "否"; + + let smokeRateString = ""; + if(detailHealthy.smokeRate != null){ + detailHealthy.smokeRate.split(",").forEach(function(item, index){ + smokeRateString += (smokeRateString != "" ? "," : "") + (healthyData["smokeRateArray"][index])+item + healthyData["smokeRateUnitArray"][index]; + }); + } + detailHealthy.smokeRate = smokeRateString; + detailHealthy.defecationNum = detailHealthy.defecationNum + "次/天"; + detailHealthy.motionDuration = detailHealthy.motionDuration +"分钟"; + + let motionStr = ""; + if(detailHealthy.aerobicMotionClassify != null){ + detailHealthy.aerobicMotionClassify.split(",").forEach(function(item, index){ + motionStr += item ? ((motionStr != "" ? "," : "") + item) : ""; + }); + } + if(detailHealthy.anaerobicMotionClassify != null){ + detailHealthy.anaerobicMotionClassify.split(",").forEach(function(item, index){ + motionStr += item ? ((motionStr != "" ? "," : "") + item) : ""; + }); + } + if(detailHealthy.anaerobicAerobicMotionClassify != null){ + detailHealthy.anaerobicAerobicMotionClassify.split(",").forEach(function(item, index){ + motionStr += item ? ((motionStr != "" ? "," : "") + item) : ""; + }); + } + detailHealthy.motion = motionStr + (detailHealthy.otherMotionClassify ? ( ","+ detailHealthy.otherMotionClassify) : ""); + detailHealthy.motionField += detailHealthy.otherMotionField ? (","+detailHealthy.otherMotionField) : ""; + + detailHealthy.sleepDrugFlag = detailHealthy.sleepDrugFlag == 1 ? "有" : "无"; + detailHealthy.stayupLateFlag = detailHealthy.stayupLateFlag == 1 ? "有" : "无"; + detailHealthy.stayupLateWeekNum += "次/周"; + detailHealthy.familyIllnessHistory += detailHealthy.otherFamilyIllnessHistory ? ("," + detailHealthy.otherFamilyIllnessHistory) : ""; + detailHealthy.operationHistory += detailHealthy.otherOperationHistory ? ("," + detailHealthy.otherOperationHistory) : ""; + detailHealthy.nearOperationFlag = detailHealthy.nearOperationFlag == 1 ? "有" : "无"; + + detailHealthy.longEatDrugFlag = detailHealthy.longEatDrugFlag == 1 ? "有" : "无"; + detailHealthy.longEatDrugClassify += detailHealthy.otherLongEatDrugClassify ? ("," + detailHealthy.otherLongEatDrugClassify) : ""; + + detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无"; + detailHealthy.allergen += detailHealthy.otherAllergen ? ("," +detailHealthy.otherAllergen) : ""; + + 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]],"attr_name_two": this.healthyTitleData[i][j][1],"value_two": detailHealthy[this.healthyValueData[i][j][1]],"attr_name_three": this.healthyTitleData[i][j][2],"value_three": detailHealthy[this.healthyValueData[i][j][2]]}); + } + this.healthyDetailList[i] = stepArray; + } + this.healthyDetailOpen = true; + }); + }, + //健康信息处理 + dealHealthy(customerHealthy){ + let array = healthyData["needAttrName"]; + for(let i = 0; i < array.length; i++){ + customerHealthy[array[i]] = this.getHealthyStringByArray(array[i]+"Array", customerHealthy[array[i]]); + } + return customerHealthy; + }, + getHealthyStringByArray(key, valueArray){ + var str = ""; + if(valueArray != null && valueArray.split(",").length > 0){ + valueArray.split(",").forEach(function (item, index) { + let data = healthyData[key].find(opt => opt.value == item); + if(data != null){ + str += (str != "" ? "," : "") + data.name; + } + }) + } + return str; + }, // 取消按钮 cancel() { this.open = false; @@ -691,7 +904,16 @@ }).then(response => { this.download(response.msg); }).catch(function() {}); - } + }, + // 自定义列背景色 + columnStyle({ row, column, rowIndex, columnIndex }) { + if (columnIndex == 0 || columnIndex == 2 || columnIndex == 4 || columnIndex == 6) { + //第三第四列的背景色就改变了2和3都是列数的下标 + return "background:#f3f6fc;font-weight:bold"; + }else{ + return "background:#ffffff;"; + } + }, } }; </script> diff --git a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue index 9166db6d3..46674b665 100644 --- a/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue +++ b/stdiet-ui/src/views/custom/subhealthy/investigation/index.vue @@ -97,7 +97,7 @@ </el-checkbox-group> </el-form-item> <el-form-item :label="'(4) 正餐荤素中素菜占比几成'" prop="eatSituation" class="margin-left"> - <el-input-number v-model="form.vegetableRate" :step="1" :min="0"></el-input-number> + <el-input-number v-model="form.vegetableRate" :step="1" :min="0" :max="10"></el-input-number> </el-form-item> <el-form-item :label="'(4) 最常吃的肉类'" prop="eatSituation" class="margin-left"> <el-input v-model="form.commonMeat" placeholder="请输入肉类名称"></el-input> @@ -253,9 +253,9 @@ <div class="margin-top-10"> <span>红酒</span><el-input-number class="width-50-left-8-right-5" type="number" v-model="form.drinkWineAmount[2]" :step="100" :min="0"></el-input-number><span> 毫升</span> </div> - <div class="margin-top-10"> + <!--<div class="margin-top-10"> <span>其他</span><el-input-number class="width-50-left-8-right-5" type="number" v-model="form.drinkWineAmount[3]" :step="100" :min="0"></el-input-number><span> 毫升</span> - </div> + </div>--> </el-form-item> <p class="p_title_2">4、您的吸烟习惯</p> <el-form-item label="(1) 是否吸烟" prop="smokeFlag" class="margin-left"> @@ -292,12 +292,12 @@ </el-form-item> <p class="p_title_2">4、您的排便状况</p> <el-form-item label="(1) 排便次数" prop="defecationNum" style="padding-top: 10px;"> - <el-radio-group v-model="form.defecationNum"> + <!--<el-radio-group v-model="form.defecationNum"> <el-radio :label="1" key="1">1次/天</el-radio> <el-radio :label="2" key="2">2次/天</el-radio> <el-radio :label="3" key="3">3次/天</el-radio> - </el-radio-group> - <div class="margin-top-10"><span>其他次数 </span><el-input-number style="width:35%;margin-right: 10px;" type="number" v-model="form.otherDefecationNum" :step="1" :min="0"></el-input-number><span>次/天</span></div> + </el-radio-group>--> + <div class="margin-top-10"><span>排便次数 </span><el-input-number style="width:35%;margin-right: 10px;" type="number" v-model="form.defecationNum" :step="1" :min="0"></el-input-number><span>次/天</span></div> </el-form-item> <el-form-item label="(2) 排便时间" prop="defecationTime" style="padding-top: 10px;"> @@ -638,7 +638,7 @@ export default { drinkWineClassifyArray:[ {"name":"白酒","value": "1"},{"name":"红酒","value": "2"},{"name":"啤酒","value": "3"} ], - drinkWineAmountArray:["白酒","啤酒","红酒","其他"], + drinkWineAmountArray:["白酒","啤酒","红酒"], smokeRateArray:["每天抽烟","烟龄","已戒烟"], workTypeArray:[ {"name":"工作时间长","value": "1"},{"name":"久坐","value": "2"},{"name":"久站","value": "3"}, @@ -712,7 +712,7 @@ export default { dinner:["2"], vegetableRate: 5, commonMeat: null, - dinnerTime: "07:00", + dinnerTime: "19:00", supperNum:1, supperFood:null, dietHotAndCold: "3", @@ -740,7 +740,7 @@ export default { drinkWineFlag: "3", drinkWineClassify:["3"], otherWineClassify: null, - drinkWineAmount:[0,0,0,0], + drinkWineAmount:[0,0,0], smokeFlag: 0, smokeRate:[0,0,0], secondSmoke: 0, @@ -785,7 +785,7 @@ export default { allergySituation: null, allergen:[], otherAllergen:null, - fileNameList:[] + medicalReport:[] }, upload: { // 是否禁用上传 @@ -842,7 +842,7 @@ export default { "condiment","cookingStyle","cookingStyleRate", "washVegetablesStyle","lunchType","dinner","dietFlavor", "snacks","waterType","waterHabit","drinksNum","drinkWineClassify","drinkWineAmount","smokeRate", "workType","defecationTime","aerobicMotionClassify","anaerobicMotionClassify","anaerobicAerobicMotionClassify", - "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "fileNameList" + "motionField","sleepQuality", "familyIllnessHistory", "operationHistory", "longEatDrugClassify", "allergen", "medicalReport" ] }; @@ -859,7 +859,7 @@ export default { this.$refs.form.validate((valid) => { if (valid) { this.submitFlag = true; - this.form.fileNameList = []; + this.form.medicalReport = []; if(this.upload.fileList.length > 0){ this.$refs.upload.submit(); }else{ @@ -955,8 +955,8 @@ export default { // 文件上传成功处理 handleFileSuccess(response, file, fileList) { if(response != null && response.code === 200){ - this.form.fileNameList.push(response.fileName); - if(this.form.fileNameList.length === this.upload.fileList.length){ + this.form.medicalReport.push(response.fileName); + if(this.form.medicalReport.length === this.upload.fileList.length){ //文件全部上传成功,则调用添加客户信息方法 this.addCustomerHealthy(); }