提成加上合计、Excel导出;打卡记录加上姓名、营养师;体征调查加上备注项

This commit is contained in:
xiezhijun 2021-01-13 18:39:17 +08:00
parent c07fddf510
commit cf56395dab
19 changed files with 267 additions and 165 deletions
stdiet-admin/src/main/java/com/stdiet/web/controller/custom
stdiet-common/src/main/java/com/stdiet/common/utils
stdiet-custom/src/main
stdiet-ui/src
api/custom
views/custom
commision/detail_day
customer
investigate
wxUserLog

@ -198,5 +198,15 @@ public class SysCommisionController extends BaseController {
return getDataTable(sysCommissionDayService.calculateCommissionByDay(sysCommision));
}
/**
* 导出按天计算提成详细列表
*/
@PreAuthorize("@ss.hasPermi('commisionDay:detail:export')")
@Log(title = "导出按天计算提成详细列表", businessType = BusinessType.EXPORT)
@GetMapping("/exportDetailDay")
public AjaxResult exportDetailDay(SysCommision sysCommision) {
ExcelUtil<SysCommissionDayDetail> util = new ExcelUtil<>(SysCommissionDayDetail.class);
List<SysCommissionDayDetail> list = sysCommissionDayService.calculateCommissionByDay(sysCommision);
return util.exportExcel(list, "commision");
}
}

@ -3,6 +3,7 @@ package com.stdiet.web.controller.custom;
import java.util.ArrayList;
import java.util.List;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.custom.domain.SysPhysicalSigns;
import com.stdiet.common.utils.bean.ObjectUtils;
@ -49,6 +50,13 @@ public class SysCustomerController extends BaseController
{
startPage();
List<SysCustomer> list = sysCustomerService.selectSysCustomerAndSignList(sysCustomer);
if(list != null && list.size() > 0){
for(SysCustomer sysCus : list){
if(StringUtils.isNotEmpty(sysCus.getPhone())){
sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone()));
}
}
}
return getDataTable(list);
}

@ -4,6 +4,7 @@ import com.stdiet.common.annotation.Log;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.core.domain.entity.SysUser;
import com.stdiet.common.enums.BusinessType;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.common.utils.poi.ExcelUtil;
import com.stdiet.custom.controller.OrderBaseController;
import com.stdiet.custom.domain.SysOrder;
@ -77,9 +78,9 @@ public class SysOrderController extends OrderBaseController {
order.setOperatorAssis(user.getNickName());
}
}
/*if (order.getPhone() != null && !order.getPhone().equals("")) {
order.setPhone(order.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
}*/
if (StringUtils.isNotEmpty(order.getPhone())) {
order.setPhone(StringUtils.hiddenPhoneNumber(order.getPhone()));
}
}
return getOrderDataTable(list, totalAmount);
}

@ -77,8 +77,6 @@ public class SysOrderPauseController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody SysOrderPause sysOrderPause)
{
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
System.out.println(simpleDateFormat.format(sysOrderPause.getPauseStartDate()));
return toAjax(sysOrderPauseService.insertSysOrderPause(sysOrderPause));
}

@ -47,8 +47,14 @@ public class SysWxUserLogController extends BaseController {
List<SysWxUserLog> list = sysWxUserLogService.selectSysWxUserLogList(sysWxUserLog);
for (SysWxUserLog userLog : list) {
if(userLog.getCustomerMessage() != null){
String[] message = userLog.getCustomerMessage().split(",");
userLog.setCustomer(message[0]);
userLog.setNutritionist(message.length > 1 ? message[1] : "");
}
if (StringUtils.isNotEmpty(userLog.getPhone())) {
userLog.setPhone(userLog.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
userLog.setPhone(StringUtils.hiddenPhoneNumber(userLog.getPhone()));
//userLog.setPhone(userLog.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
}
}

@ -456,4 +456,11 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
{
return (T) obj;
}
/**
* 手机号隐式处理
* */
public static String hiddenPhoneNumber(String phoneNumber){
return phoneNumber.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
}
}

@ -1,5 +1,6 @@
package com.stdiet.custom.domain;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
import java.math.BigDecimal;
@ -14,6 +15,7 @@ public class SysCommissionDayDetail extends BaseEntity {
private Long userId;
//用户姓名
@Excel(name = "业务员")
private String nickName;
//用户账户
@ -23,38 +25,20 @@ public class SysCommissionDayDetail extends BaseEntity {
private Long postId;
//岗位名称
@Excel(name = "岗位名称")
private String postName;
@Excel(name = "总提成")
private BigDecimal totalCommissionAmount;
@Excel(name = "已发放提成")
private BigDecimal totalHasSentCommissionAmount;
@Excel(name = "未发放提成")
private BigDecimal totalNotSentCommissionAmount;
private List<Map<String, Object>> sendDetailList;
//提成比例
private Float rate;
//订单成交总额
private BigDecimal orderTotalAmount;
//服务总天数
private Integer serverTotalDay;
//服务总额每笔订单的服务天数 * 每天金额相加
private BigDecimal serverTotalAmount;
//服务订单总数量
private Integer serverOrderTotalCount;
//服务暂停总天数
private Integer serverOrderPauseTotalDay;
//服务提成金额
private BigDecimal commissionTotalAmount;
public Long getUserId() {
return userId;
}
@ -71,68 +55,12 @@ public class SysCommissionDayDetail extends BaseEntity {
this.nickName = nickName;
}
public String getPostName() {
return postName;
public String getUserName() {
return userName;
}
public void setPostName(String postName) {
this.postName = postName;
}
public Float getRate() {
return rate;
}
public void setRate(Float rate) {
this.rate = rate;
}
public BigDecimal getOrderTotalAmount() {
return orderTotalAmount;
}
public void setOrderTotalAmount(BigDecimal orderTotalAmount) {
this.orderTotalAmount = orderTotalAmount;
}
public Integer getServerTotalDay() {
return serverTotalDay;
}
public void setServerTotalDay(Integer serverTotalDay) {
this.serverTotalDay = serverTotalDay;
}
public BigDecimal getServerTotalAmount() {
return serverTotalAmount;
}
public void setServerTotalAmount(BigDecimal serverTotalAmount) {
this.serverTotalAmount = serverTotalAmount;
}
public Integer getServerOrderTotalCount() {
return serverOrderTotalCount;
}
public void setServerOrderTotalCount(Integer serverOrderTotalCount) {
this.serverOrderTotalCount = serverOrderTotalCount;
}
public Integer getServerOrderPauseTotalDay() {
return serverOrderPauseTotalDay;
}
public void setServerOrderPauseTotalDay(Integer serverOrderPauseTotalDay) {
this.serverOrderPauseTotalDay = serverOrderPauseTotalDay;
}
public BigDecimal getCommissionTotalAmount() {
return commissionTotalAmount;
}
public void setCommissionTotalAmount(BigDecimal commissionTotalAmount) {
this.commissionTotalAmount = commissionTotalAmount;
public void setUserName(String userName) {
this.userName = userName;
}
public Long getPostId() {
@ -143,12 +71,12 @@ public class SysCommissionDayDetail extends BaseEntity {
this.postId = postId;
}
public String getUserName() {
return userName;
public String getPostName() {
return postName;
}
public void setUserName(String userName) {
this.userName = userName;
public void setPostName(String postName) {
this.postName = postName;
}
public BigDecimal getTotalCommissionAmount() {

@ -68,6 +68,21 @@ public class SysWxUserLog extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
private Date logTime;
/** 非持久字段,客户姓名 + 营养师姓名,使用 , 隔开用于接收sql查询返回字段 */
private String customerMessage;
/**
* 非持久化字段营养师
*/
@Excel(name = "姓名")
private String customer;
/**
* 非持久化字段营养师
*/
@Excel(name = "营养师")
private String nutritionist;
public void setLogTime(Date logTime) {
this.logTime = logTime;
}
@ -185,6 +200,30 @@ public class SysWxUserLog extends BaseEntity
return water;
}
public String getCustomerMessage() {
return customerMessage;
}
public void setCustomerMessage(String customerMessage) {
this.customerMessage = customerMessage;
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
public String getNutritionist() {
return nutritionist;
}
public void setNutritionist(String nutritionist) {
this.nutritionist = nutritionist;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -144,6 +144,10 @@ public class CustomerInvestigateRequest extends BaseEntity
@Excel(name = "减脂经历")
private String experience;
/** 备注 */
@Excel(name = "备注")
private String comments;
public Long getId() {
return id;
}
@ -399,4 +403,12 @@ public class CustomerInvestigateRequest extends BaseEntity
public void setExperience(String experience) {
this.experience = experience;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
}

@ -136,6 +136,10 @@ public class CustomerListResponse extends BaseEntity
@Excel(name = "减脂遇到的困难")
private String difficulty;
/** 备注 */
@Excel(name = "备注")
private String comments;
public Long getId() {
return id;
}
@ -377,4 +381,12 @@ public class CustomerListResponse extends BaseEntity
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
}

@ -5,6 +5,7 @@ import com.stdiet.custom.domain.SysCommissionDayDetail;
import com.stdiet.custom.domain.SysOrder;
import com.stdiet.custom.domain.SysOrderCommisionDayDetail;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -17,6 +18,18 @@ import java.util.Map;
*/
public interface ISysCommissionDayService {
/**
* 根据订单列表按天计算营养师售后提成
* @param sysCommision
* @return
*/
List<SysCommissionDayDetail> calculateCommissionByDay(SysCommision sysCommision);
/**
* 根据订单ID计算该笔订单的服务到期时间
* @param orderId
* @return
*/
LocalDate getServerEndDate(Long orderId);
}

@ -32,6 +32,11 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
List<SysCommissionDayDetail> result = new ArrayList<>();
//查询用户
List<SysCommision> list = sysCommisionMapper.selectSysCommisionDayDetail(sysCommision);
//合计
SysCommissionDayDetail total = new SysCommissionDayDetail();
total.setTotalCommissionAmount(new BigDecimal(0));
total.setTotalHasSentCommissionAmount(new BigDecimal(0));
total.setTotalNotSentCommissionAmount(new BigDecimal(0));
if(list != null && list.size() > 0){
Map<Long, List<SysOrderCommisionDayDetail>> orderDetailMap = getOrderByList(sysCommision.getUserId());
SysCommissionDayDetail sysCommissionDayDetail = null;
@ -41,16 +46,37 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
sysCommissionDayDetail.setNickName(commision.getUserName());
sysCommissionDayDetail.setPostId(commision.getPostId());
sysCommissionDayDetail.setPostName(commision.getPostName());
sysCommissionDayDetail.setOrderTotalAmount(commision.getAmount());
//获取查询时间
//LocalDate localDate = StringUtils.isEmpty(sysCommision.getBeginTime()) ? LocalDate.now() : LocalDate.parse(sysCommision.getBeginTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
dealServerOrderCommissionDetail(orderDetailMap.get(sysCommissionDayDetail.getUserId()), sysCommissionDayDetail);
result.add(sysCommissionDayDetail);
//统计所以用户总提成已发放提成未发放提成
total.setTotalCommissionAmount(total.getTotalCommissionAmount().add(sysCommissionDayDetail.getTotalCommissionAmount()));
total.setTotalHasSentCommissionAmount(total.getTotalHasSentCommissionAmount().add(sysCommissionDayDetail.getTotalHasSentCommissionAmount()));
total.setTotalNotSentCommissionAmount(total.getTotalNotSentCommissionAmount().add(sysCommissionDayDetail.getTotalNotSentCommissionAmount()));
}
}
total.setPostName("胜唐体控");
total.setNickName("合计");
result.add(total);
return result;
}
@Override
public LocalDate getServerEndDate(Long orderId){
SysOrder sysOrder = sysOrderMapper.selectSysOrderById(orderId);
if(sysOrder != null){
SysOrderPause sysOrderPause = new SysOrderPause();
sysOrderPause.setOrderId(orderId);
List<SysOrderPause> pausesList = sysOrderPauseMapper.selectSysOrderPauseList(sysOrderPause);
//每年每月暂停天数key为年份加月份:2021年1月=20211
Map<String, Integer> everyYearMonthPauseDay = getEveryYearMonthPauseDay(pausesList);
//该笔订单暂停总天数
int pauseTotalDay = getTotalByMap(everyYearMonthPauseDay);
return getServerEndDate(DateUtils.dateToLocalDate(sysOrder.getStartTime()), sysOrder.getServeTimeId().intValue()/30, sysOrder.getGiveServeDay(), pauseTotalDay);
}
return null;
}
/**
* 根据用户ID统计出该用户在该月所有订单的服务数量服务总天数服务订单总额暂停总天数
@ -60,8 +86,6 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
BigDecimal totalCommissionAmount = new BigDecimal(0);
//已发放提成
BigDecimal totalHasSentCommissionAmount = new BigDecimal(0);
//未发放提成
BigDecimal totalNotSentCommissionAmount = new BigDecimal(0);
//未发放提成记录
List<Map<String, Object>> sendDetailList = new ArrayList<>();
if(orderDetailList != null){
@ -116,6 +140,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
}
sysCommissionDayDetail.setTotalCommissionAmount(totalCommissionAmount);
sysCommissionDayDetail.setTotalHasSentCommissionAmount(totalHasSentCommissionAmount);
//未发放提成 = 总提成 - 已发放提成
sysCommissionDayDetail.setTotalNotSentCommissionAmount(totalCommissionAmount.subtract(totalHasSentCommissionAmount));
sysCommissionDayDetail.setSendDetailList(sendDetailList);
}

@ -76,6 +76,7 @@
<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>
@ -196,7 +197,7 @@
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.night, scps.experience, scps.comments
</sql>
<select id="selectSysCustomerAndSignList" parameterType="SysCustomer" resultMap="SysCustomerSignResult">

@ -24,6 +24,8 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<!-- 非持久字段 -->
<result property="customerMessage" column="customer_message"></result>
</resultMap>
<resultMap type="com.stdiet.custom.page.WxLogInfo" id="WxLogInfo">
@ -42,15 +44,23 @@
select openid, weight, appid, phone, log_time, sleep_time, wakeup_time, sport, avatar_url, diet, insomnia, defecation, water, create_by, create_time, update_by, update_time, remark from sys_wx_user_log
</sql>
<sql id="selectBaseField">
swul.openid, swul.weight, swul.appid, swul.phone, swul.log_time, swul.sleep_time, swul.wakeup_time, swul.sport, swul.avatar_url, swul.diet, swul.insomnia,
swul.defecation, swul.water, swul.create_by, swul.create_time, swul.update_by, swul.update_time, swul.remark
</sql>
<select id="checkWxLogInfoCount" parameterType="String" resultType="Integer">
select count(*) from sys_wx_user_log where to_days(log_time) = to_days(now()) and openid = #{openid}
</select>
<select id="selectSysWxUserLogList" parameterType="SysWxUserLog" resultMap="SysWxUserLogResult">
<include refid="selectSysWxUserLogVo"/>
select <include refid="selectBaseField"></include>,
(select CONCAT(IFNULL(so.customer,''),',',IFNULL(su.nick_name,'')) from (select * from sys_order s where s.phone = swul.phone order by order_id desc limit 1) as so
left join sys_user su on su.user_id = so.nutritionist_id and su.del_flag = 0) as customer_message
from sys_wx_user_log swul
<where>
<if test="openid != null and openid != ''">and openid = #{openid}</if>
<if test="phone != null and phone != ''">or phone = #{phone}</if>
<if test="openid != null and openid != ''">and swul.openid = #{openid}</if>
<if test="phone != null and phone != ''">or swul.phone = #{phone}</if>
</where>
order by create_time desc
</select>

@ -77,3 +77,13 @@ export function detailDayCommision(query) {
params: query
})
}
// 导出按天计算提成明细
export function exportDayCommision(query) {
return request({
url: '/custom/commision/exportDetailDay',
method: 'get',
params: query
})
}

@ -36,21 +36,21 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['commision:detail:export']"
v-hasPermi="['commisionDay:detail:export']"
>导出
</el-button>
</el-col>-->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="commisionList"
@selection-change="handleSelectionChange">
@selection-change="handleSelectionChange" stripe :row-class-name="tableRowClassName">
<el-table-column label="业务员" align="center" prop="nickName">
<template slot-scope="scope">
<span>{{ scope.row.nickName }}</span>
@ -108,11 +108,20 @@
</div>
</template>
<style>
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
/*background: #1890FF;*/
color: #1890FF
}
</style>
<script>
import {
detailDayCommision,
exportCommision,
} from "@/api/custom/commision";
detailDayCommision, exportDayCommision} from "@/api/custom/commision";
import {getOptions} from "@/api/custom/order";
@ -232,7 +241,7 @@
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportCommision(queryParams);
return exportDayCommision(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function () {
@ -283,6 +292,12 @@
}
});
return sums;
},
tableRowClassName({row, rowIndex}) {
if(this.commisionList.length == rowIndex+1){
return "success-row";
}
return '';
}
}
};

@ -132,7 +132,7 @@
<el-table-column label="饮食备注" align="center" prop="sign.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>
<span v-show="scope.row.sign.remarks == null && scope.row.sign.remarks.length <= 10">{{scope.row.sign.remarks}}</span>
</template>
</el-table-column>
<el-table-column label="饮食特点" align="center" prop="sign.makeFoodTaste" width="100">
@ -203,10 +203,16 @@
</el-table-column>
<el-table-column label="减脂遇到的困难" align="center" prop="sign.difficulty" width="100">
<template slot-scope="scope">
<el-button v-show="scope.row.sign.difficulty == null != null && scope.row.sign.difficulty.length > 10" type="text" @click="openFormDialog('减脂遇到的困难', scope.row.sign.difficulty)">点击查看</el-button>
<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>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="sign.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>
</template>
</el-table-column>
<!--<el-table-column label="主营养师" align="center" prop="mainDietitian" />
<el-table-column label="营养师助理" align="center" prop="assistantDietitian" />
<el-table-column label="售后营养师" align="center" prop="afterDietitian" />
@ -249,7 +255,7 @@
</el-dialog>
<!-- 添加或修改客户信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" v-if="open" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<!--<p>现在要先为您建立更加详细的档案以便为您定制专属的减脂计划</p>-->
<el-form-item label="真实姓名" prop="name">
@ -266,8 +272,8 @@
</el-form-item>-->
<el-form-item label="性别" prop="sex">
<el-select v-model="form.sex" placeholder="请选择性别">
<el-option label="男" value="0" />
<el-option label="女" value="1" />
<el-option label="男" :value="parseInt('0')" />
<el-option label="女" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="年龄(岁)" prop="age">
@ -281,8 +287,8 @@
</el-form-item>
<el-form-item label="南方人还是北方人" prop="position">
<el-select v-model="form.position" placeholder="请选择">
<el-option label="南方" value="0" />
<el-option label="北方" value="1" />
<el-option label="南方" :value="parseInt('0')" />
<el-option label="北方" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="病史(多选)" prop="physicalSignsId">
@ -301,26 +307,26 @@
</el-form-item>-->
<el-form-item label="是否便秘" prop="constipation">
<el-select v-model="form.constipation" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="是否熬夜、失眠" prop="staylate">
<el-select v-model="form.staylate" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="是否经常运动" prop="motion">
<el-select v-model="form.motion" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="饮食方式" prop="makeFoodType">
<el-select v-model="form.makeFoodType" placeholder="请选择">
<el-option label="自己做" value="0" />
<el-option label="外面吃" value="1" />
<el-option label="自己做" :value="parseInt('0')" />
<el-option label="外面吃" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="饮食备注" prop="remarks">
@ -329,8 +335,8 @@
</el-form-item>
<el-form-item label="饮食特点" prop="makeFoodTaste">
<el-select v-model="form.makeFoodTaste" placeholder="请选择">
<el-option label="清淡" value="0" />
<el-option label="重口味" value="1" />
<el-option label="清淡" :value="parseInt('0')" />
<el-option label="重口味" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="工作职业" prop="vocation">
@ -338,33 +344,33 @@
</el-form-item>
<el-form-item label="是否上夜班" prop="night">
<el-select v-model="form.night" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="平时久坐多还是走动多" prop="walk">
<el-select v-model="form.walk" placeholder="请选择">
<el-option label="久坐多" value="0" />
<el-option label="走动多" value="1" />
<el-option label="久坐多" :value="parseInt('0')" />
<el-option label="走动多" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="是否浑身乏力" prop="weakness">
<el-select v-model="form.weakness" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="是否减脂反弹" prop="rebound">
<el-select v-model="form.rebound" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="是否意识到生活习惯是减脂关键" prop="crux">
<el-select v-model="form.crux" placeholder="请选择">
<el-option label="是" value="0" />
<el-option label="否" value="1" />
<el-option label="是" :value="parseInt('0')" />
<el-option label="否" :value="parseInt('1')" />
</el-select>
</el-form-item>
<el-form-item label="睡觉时间" prop="sleepTime">
@ -397,6 +403,9 @@
<el-form-item label="减脂遇到的困难" prop="difficulty">
<el-input type="textarea" placeholder="请输入内容" v-model="form.difficulty" maxlength="200" show-word-limit rows="5"></el-input>
</el-form-item>
<el-form-item label="备注" prop="comments">
<el-input type="textarea" placeholder="请输入其他需要反馈的内容" v-model="form.comments" maxlength="200" show-word-limit rows="5"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -409,7 +418,7 @@
<script>
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, exportCustomer } from "@/api/custom/customer";
import { listPhysicalSigns } from "@/api/custom/physicalSigns";
import dayjs from 'dayjs';
export default {
name: "Customer",
data() {
@ -578,33 +587,34 @@
name: '',
phone: '',
address: "",
sex: "1",
sex: 1,
age: null,
tall: null,
weight: null,
physicalSignsId: [],
dishesIngredientId: null,
photo: null,
constipation: "0",
staylate: "0",
motion: "1",
makeFoodType: "1",
makeFoodTaste: "1",
walk: "0",
constipation: 0,
staylate: 0,
motion: 1,
makeFoodType: 1,
makeFoodTaste: 1,
walk: 0,
difficulty: null,
weakness: "0",
rebound: "0",
crux: "0",
position: "1",
weakness: 0,
rebound: 0,
crux: 0,
position: 1,
sleepTime: null,
getupTime: null,
connectTime: null,
remarks: null,
bloodData: [],
moistureDate: [],
night: "0",
night: 0,
vocation: null,
experience: null
experience: null,
comments: null
};
this.resetForm("form");
},
@ -649,18 +659,6 @@
cusMessage.connectTime = this.deltime(cusMessage.connectTime);
cusMessage.name = response.data.name;
cusMessage.phone = response.data.phone;
cusMessage.sex += '';
cusMessage.constipation += '';
cusMessage.staylate += '';
cusMessage.motion += '';
cusMessage.makeFoodType += '';
cusMessage.makeFoodTaste += '';
cusMessage.walk += '';
cusMessage.weakness += '';
cusMessage.rebound += '';
cusMessage.crux += '';
cusMessage.position += '';
cusMessage.night += '';
this.form = cusMessage;
this.open = true;
this.title = "修改客户体征";

@ -150,6 +150,11 @@
<el-form-item label="减脂遇到的困难" prop="difficulty">
<el-input type="textarea" placeholder="请输入内容" v-model="form.difficulty" maxlength="200" show-word-limit rows="5"></el-input>
</el-form-item>
<el-form-item label="备注" prop="comments">
<el-input type="textarea" placeholder="请输入其他需要反馈的内容" v-model="form.comments" maxlength="200" show-word-limit rows="5"></el-input>
</el-form-item>
<el-form-item style="text-align:center;margin:0 auto;">
<el-button type="primary" @click="addCustomer()" style="margin-right:50px;">已填写完成提交数据</el-button>
</el-form-item>
@ -198,7 +203,8 @@
moistureDate: [],
night: "0",
vocation: null,
experience: null
experience: null,
comments: null
},
rules: {
name: [

@ -85,8 +85,11 @@
<span>{{`${scope.row.weight}` }}</span>
</template>
</el-table-column>
<el-table-column label="微信应用" align="center" prop="appid" :formatter="appidFormat"/>
<el-table-column label="微信应用" align="center" prop="appid" width="120" :formatter="appidFormat"/>
<el-table-column label="姓名" align="center" prop="customer"/>
<el-table-column label="手机号" align="center" prop="phone" width="180"/>
<el-table-column label="营养师" align="center" prop="nutritionist"/>
<el-table-column label="打卡日期" align="center" prop="logTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.logTime, '{y}-{m}-{d}') }}</span>