客户体征优化、客户健康修改
This commit is contained in:
parent
789f835f72
commit
bc63f7bbf4
stdiet-admin/src/main/java/com/stdiet/web/controller
stdiet-custom/src/main
java/com/stdiet/custom
domain
dto/request
mapper
service
resources/mapper/custom
stdiet-ui/src
api/custom
views/custom
customer
healthy
investigate
order
subhealthy/investigation
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
108
stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerPhysicalSignsServiceImpl.java
108
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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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>
|
@ -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>
|
@ -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>
|
53
stdiet-ui/src/api/custom/healthy.js
Normal file
53
stdiet-ui/src/api/custom/healthy.js
Normal file
@ -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
|
||||
})
|
||||
}
|
@ -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 = "修改客户体征";
|
||||
|
697
stdiet-ui/src/views/custom/healthy/index.vue
Normal file
697
stdiet-ui/src/views/custom/healthy/index.vue
Normal file
@ -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>
|
@ -280,7 +280,6 @@ export default {
|
||||
],
|
||||
phone: [
|
||||
{ required: true, trigger: "blur", message: "请填写手机号" },
|
||||
{ required: true, trigger: "blur", message: "请填写正确的手机号" },
|
||||
{
|
||||
required: true,
|
||||
trigger: "blur",
|
||||
|
@ -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"},
|
||||
|
@ -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"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user