Merge remote-tracking branch 'origin/master'

This commit is contained in:
huangdeliang 2021-01-22 10:00:28 +08:00
commit 41d09f0d57
15 changed files with 315 additions and 212 deletions

View File

@ -70,7 +70,9 @@ public class SysCustomerController extends BaseController
customerListResponse = ObjectUtils.getObjectByObject(customer.getSign(), CustomerListResponse.class);
customerListResponse.setCreateTime(customer.getCreateTime());
customerListResponse.setName(customer.getName());
customerListResponse.setPhone(customer.getPhone());
if(StringUtils.isNotEmpty(customer.getPhone())){
customerListResponse.setPhone(StringUtils.hiddenPhoneNumber(customer.getPhone()));
}
StringBuilder signStr = new StringBuilder();
if(customer.getSign().getSignList() != null && customer.getSign().getSignList().size() > 0){
int i = 0;

View File

@ -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.DateUtils;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.common.utils.poi.ExcelUtil;
import com.stdiet.custom.controller.OrderBaseController;
@ -17,6 +18,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.temporal.ChronoUnit;
import java.util.List;
/**
@ -81,6 +83,12 @@ public class SysOrderController extends OrderBaseController {
if (StringUtils.isNotEmpty(order.getPhone())) {
order.setPhone(StringUtils.hiddenPhoneNumber(order.getPhone()));
}
//根据服务时长赠送天数计算服务天数
int month = order.getServeTimeId() != null ? order.getServeTimeId().intValue()/30 : 0;
if(order.getStartTime() != null && order.getServerEndTime() != null && order.getServeTimeId() != null && month > 0){
long serverDay = ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(order.getStartTime()), DateUtils.dateToLocalDate(order.getStartTime()).plusMonths(month).plusDays(order.getGiveServeDay() == null ? 0 : order.getGiveServeDay())) + 1;
order.setServerDay(Integer.parseInt(serverDay + ""));
}
}
return getOrderDataTable(list, totalAmount);
}
@ -123,6 +131,9 @@ public class SysOrderController extends OrderBaseController {
order.setOperatorAssis(user.getNickName());
}
}
if (StringUtils.isNotEmpty(order.getPhone())) {
order.setPhone(StringUtils.hiddenPhoneNumber(order.getPhone()));
}
}
ExcelUtil<SysOrder> util = new ExcelUtil<SysOrder>(SysOrder.class);
return util.exportExcel(list, "order");

View File

@ -1,6 +1,8 @@
package com.stdiet.web.controller.custom;
import java.util.List;
import com.stdiet.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -35,6 +37,11 @@ public class SysRecipesPlanController extends BaseController
{
startPage();
List<SysRecipesPlan> list = sysRecipesPlanService.selectPlanListByCondition(sysRecipesPlan);
for(SysRecipesPlan plan : list){
if(StringUtils.isNotEmpty(plan.getPhone())){
plan.setHidePhone(StringUtils.hiddenPhoneNumber(plan.getPhone()));
}
}
return getDataTable(list);
}
@ -80,6 +87,11 @@ public class SysRecipesPlanController extends BaseController
public AjaxResult export(SysRecipesPlan sysRecipesPlan)
{
List<SysRecipesPlan> list = sysRecipesPlanService.selectPlanListByCondition(sysRecipesPlan);
for(SysRecipesPlan plan : list){
if(StringUtils.isNotEmpty(plan.getPhone())){
plan.setHidePhone(StringUtils.hiddenPhoneNumber(plan.getPhone()));
}
}
ExcelUtil<SysRecipesPlan> util = new ExcelUtil<SysRecipesPlan>(SysRecipesPlan.class);
return util.exportExcel(list, "recipesPlan");
}

View File

@ -46,7 +46,7 @@ public class SysWxUserInfoController extends BaseController {
for (SysWxUserInfo userInfo : list) {
if (StringUtils.isNotEmpty(userInfo.getPhone())) {
userInfo.setPhone(userInfo.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
userInfo.setPhone(StringUtils.hiddenPhoneNumber(userInfo.getPhone()));
}
}
@ -61,6 +61,11 @@ public class SysWxUserInfoController extends BaseController {
@GetMapping("/export")
public AjaxResult export(SysWxUserInfo sysWxUserInfo) {
List<SysWxUserInfo> list = sysWxUserInfoService.selectSysWxUserInfoList(sysWxUserInfo);
for (SysWxUserInfo userInfo : list) {
if (StringUtils.isNotEmpty(userInfo.getPhone())) {
userInfo.setPhone(StringUtils.hiddenPhoneNumber(userInfo.getPhone()));
}
}
ExcelUtil<SysWxUserInfo> util = new ExcelUtil<SysWxUserInfo>(SysWxUserInfo.class);
return util.exportExcel(list, "wxUserInfo");
}

View File

@ -37,6 +37,9 @@ public class SysCommissionDayDetail extends BaseEntity {
@Excel(name = "未发放提成")
private BigDecimal totalNotSentCommissionAmount;
@Excel(name = "下月应发提成")
private BigDecimal nextMonthCommission;
private List<Map<String, Object>> sendDetailList;
public Long getUserId() {
@ -110,4 +113,12 @@ public class SysCommissionDayDetail extends BaseEntity {
public void setSendDetailList(List<Map<String, Object>> sendDetailList) {
this.sendDetailList = sendDetailList;
}
public BigDecimal getNextMonthCommission() {
return nextMonthCommission;
}
public void setNextMonthCommission(BigDecimal nextMonthCommission) {
this.nextMonthCommission = nextMonthCommission;
}
}

View File

@ -213,6 +213,12 @@ public class SysOrder extends BaseEntity {
@Excel(name = "进粉时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date becomeFanTime;
/**
* 服务天数
*/
@Excel(name = "服务结束时间", width = 30)
private Integer serverDay;
/**
* 订单暂停记录 非持久化字段
* */
@ -525,6 +531,14 @@ public class SysOrder extends BaseEntity {
this.becomeFanTime = becomeFanTime;
}
public Integer getServerDay() {
return serverDay;
}
public void setServerDay(Integer serverDay) {
this.serverDay = serverDay;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -29,9 +29,12 @@ public class SysRecipesPlan extends BaseEntity
private String customer;
//非持久化字段客户手机号
@Excel(name = "客户手机号")
private String phone;
@Excel(name = "客户手机号")
//处理过的客户手机号
private String hidePhone;
/** 食谱开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "食谱开始日期", width = 30, dateFormat = "yyyy-MM-dd")
@ -217,6 +220,14 @@ public class SysRecipesPlan extends BaseEntity
this.phone = phone;
}
public String getHidePhone() {
return hidePhone;
}
public void setHidePhone(String hidePhone) {
this.hidePhone = hidePhone;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,5 +1,6 @@
package com.stdiet.custom.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.custom.domain.*;
import com.stdiet.custom.mapper.SysCommisionMapper;
@ -37,6 +38,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
total.setTotalCommissionAmount(new BigDecimal(0));
total.setTotalHasSentCommissionAmount(new BigDecimal(0));
total.setTotalNotSentCommissionAmount(new BigDecimal(0));
total.setNextMonthCommission(new BigDecimal(0));
if(list != null && list.size() > 0){
Map<Long, List<SysOrderCommisionDayDetail>> orderDetailMap = getOrderByList(sysCommision.getUserId());
SysCommissionDayDetail sysCommissionDayDetail = null;
@ -52,6 +54,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
total.setTotalCommissionAmount(total.getTotalCommissionAmount().add(sysCommissionDayDetail.getTotalCommissionAmount()));
total.setTotalHasSentCommissionAmount(total.getTotalHasSentCommissionAmount().add(sysCommissionDayDetail.getTotalHasSentCommissionAmount()));
total.setTotalNotSentCommissionAmount(total.getTotalNotSentCommissionAmount().add(sysCommissionDayDetail.getTotalNotSentCommissionAmount()));
total.setNextMonthCommission(total.getNextMonthCommission().add(sysCommissionDayDetail.getNextMonthCommission()));
}
}
total.setPostName("胜唐体控");
@ -104,6 +107,14 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
* 根据用户ID统计出该用户在该月所有订单的服务数量服务总天数服务订单总额暂停总天数
* **/
public void dealServerOrderCommissionDetail(List<SysOrderCommisionDayDetail> orderDetailList, SysCommissionDayDetail sysCommissionDayDetail){
/*System.out.println("------------------开始--------------");
if(orderDetailList != null){
for(SysOrderCommisionDayDetail sysOrderCommisionDayDetail : orderDetailList){
System.out.println("姓名:"+sysOrderCommisionDayDetail.getName() + " 总天数:"+sysOrderCommisionDayDetail.getServerDay()
+" 每天金额:"+sysOrderCommisionDayDetail.getDayMoney() + " 一月服务天数:"+sysOrderCommisionDayDetail.getEveryYearMonthServerDay().get("20211")
+" 一月对应金额:"+ sysOrderCommisionDayDetail.getEveryYearMonthServerMoney().get("20211"));
}
}*/
//总提成
BigDecimal totalCommissionAmount = new BigDecimal(0);
//已发放提成
@ -166,6 +177,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
//未发放提成 = 总提成 - 已发放提成
sysCommissionDayDetail.setTotalNotSentCommissionAmount(totalCommissionAmount.subtract(totalHasSentCommissionAmount));
sysCommissionDayDetail.setSendDetailList(sendDetailList);
sysCommissionDayDetail.setNextMonthCommission(sendDetailList.size() > 0 ? (BigDecimal)sendDetailList.get(0).get("yearMonthCommission") : new BigDecimal(0));
}
/**判断该月提成是否已发放*/
@ -437,7 +449,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
* double转为BigDecimal保留一位小数向下舍去
* */
public BigDecimal getMoney(Double money, int n){
return new BigDecimal(money.toString()).setScale(n, BigDecimal.ROUND_DOWN);
return new BigDecimal(money.toString()).setScale(3, BigDecimal.ROUND_HALF_UP);
}
/**
@ -472,10 +484,6 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
/*System.out.println(ts(109792.8 * 6 / 100D, 1));
System.out.println(ts(6587.8,2).doubleValue());*/
System.out.println(ts(1.919,1).doubleValue());
}
public static BigDecimal ts(Double money, int n){
return new BigDecimal(money.toString()).setScale(n, BigDecimal.ROUND_DOWN);
}
}

View File

@ -78,6 +78,7 @@
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')</if>
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
</where>
</select>

View File

@ -0,0 +1,48 @@
<template>
<div class="autohideinfo_wrapper">
<div>
{{ data.substring(0,maxLength) }}<span v-if="data.length > maxLength">...</span>
</div>
<div v-if="data.length > maxLength">
<!--<div>...</div>-->
<el-popover placement="top-start" width="300" height="400px" popper-class="autohideinfo_detial" trigger="hover">
<div>{{ data }}</div>
<el-button type="text" slot="reference">详情</el-button>
</el-popover>
</div>
</div>
</template>
<script>
export default {
name: "AutoHideMessage",
data() {
return {
};
},
props: {
data: {
type: String,
default: ''
},
maxLength: {
type: Number,
default: 10
}
},
computed: {
}
};
</script>
<style>
.autohideinfo_wrapper {
}
.autohideinfo_detial {
max-height: 340px;
//overflow: auto;
}
</style>

View File

@ -65,7 +65,7 @@
</el-table-column>
<el-table-column label="提成" align="center" prop="commision">
<template scope="scope">
{{scope.row.commision.toFixed(2)}}
{{scope.row.commision.toFixed(3)}}
</template>
</el-table-column>

View File

@ -36,7 +36,9 @@
</el-form>
<div><span style="color:#E6A23C;font-family:PingFang SC">
注意事项
<br/>12021年1月开始的订单才开始按天计算提成</span></div>
<br/>12021年1月开始的订单才开始按天计算提成
<br/>2发工资日期定为每月15号若当前日期大于15号则认定上个月的工资已发放
</span></div>
<el-row :gutter="10" class="mb8" style="margin-top:10px;">
<el-col :span="1.5">
<el-button
@ -63,17 +65,23 @@
<el-table-column label="岗位" align="center" prop="postName"/>
<el-table-column label="总提成" align="center" prop="totalCommissionAmount">
<template scope="scope">
{{scope.row.totalCommissionAmount}}
{{scope.row.totalCommissionAmount.toFixed(3)}}
</template>
</el-table-column>
<el-table-column label="已发放提成" align="center" prop="totalHasSentCommissionAmount">
<template scope="scope">
{{scope.row.totalHasSentCommissionAmount}}
{{scope.row.totalHasSentCommissionAmount.toFixed(3)}}
</template>
</el-table-column>
<el-table-column label="未发放提成" align="center" prop="totalNotSentCommissionAmount">
<template scope="scope">
{{scope.row.totalNotSentCommissionAmount}}
{{scope.row.totalNotSentCommissionAmount.toFixed(3)}}
</template>
</el-table-column>
<el-table-column label="下月应发提成" align="center" prop="nextMonthCommission">
<template scope="scope">
{{scope.row.nextMonthCommission.toFixed(3)}}
</template>
</el-table-column>
@ -104,7 +112,11 @@
{{scope.row.yearMonth.substring(0, 4)}}{{scope.row.yearMonth.substring(4)}}
</template>
</el-table-column>
<el-table-column property="yearMonthCommission" label="提成金额" width="100"></el-table-column>
<el-table-column property="yearMonthCommission" label="提成金额" width="100">
<template scope="scope">
{{scope.row.yearMonthCommission.toFixed(3)}}
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>

View File

@ -143,6 +143,18 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="服务时长" prop="serveTimeId">
<el-select v-model="queryParams.serveTimeId" placeholder="请选服务时长">
<el-option
v-for="dict in serveTimeIdOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成交日期" prop="orderTime">
<el-date-picker
@ -159,6 +171,7 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini"
@ -265,6 +278,11 @@
<span>{{ parseTime(scope.row.serverEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="服务天数" align="center" prop="serverDay" width="80">
<template slot-scope="scope">
{{scope.row.serverDay ? `${scope.row.serverDay}` : '0天'}}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" width="120"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300" fixed="right">
<template slot-scope="scope">
@ -582,6 +600,30 @@
export default {
name: "Order",
data() {
const checkStartTime = (rule, value, callback) => {
if (!value) {
return callback(new Error('开始时间不能为空'))
}
if (!this.form.orderTime) {
return callback(new Error('请先选择成交时间'))
}
if(dayjs(this.form.startTime).diff(dayjs(this.form.orderTime),'day') < 0){
return callback(new Error('开始时间不能小于成交时间'))
}
callback();
};
const checkOrderTime = (rule, value, callback) => {
if (!value) {
return callback(new Error('成交时间不能为空'))
}
if (!this.form.becomeFanTime) {
return callback(new Error('请先填写进粉时间'))
}
if(dayjs(this.form.orderTime).diff(dayjs(this.form.becomeFanTime),'day') < 0){
return callback(new Error('成交时间不能小于进粉时间'))
}
callback();
}
return {
//
loading: true,
@ -660,6 +702,7 @@
operatorAssisId: null,
recommender: null,
reviewStatus: null,
serveTimeId: null
},
//
form: {},
@ -677,8 +720,13 @@
phone: [
{required: true, message: "手机号不能为空", trigger: "blur"}
],
orderTime: [
{required: true, message: "成交时间不能为空", trigger: "blur"},
{required: true, trigger: "blur", validator: checkOrderTime}
],
startTime: [
{required: true, message: "开始时间不能为空", trigger: "blur"}
{required: true, message: "开始时间不能为空", trigger: "blur"},
{required: true, trigger: "blur", validator: checkStartTime}
],
becomeFanTime: [
{required: true, message: "进粉时间不能为空", trigger: "blur"}
@ -863,7 +911,7 @@
phone: null,
amount: null,
weight: null,
startTime: dayjs().format("YYYY-MM-DD"),
startTime: dayjs().add(3, 'day').format("YYYY-MM-DD"),
pauseTime: null,
payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null,
preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null,

View File

@ -73,11 +73,11 @@
<el-table v-loading="loading" :data="recipesPlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="客户姓名" align="center" prop="customer" />
<el-table-column label="客户手机号" align="center" prop="phone" />
<el-table-column label="客户手机号" align="center" prop="hidePhone" width="180"/>
<el-table-column label="食谱日期范围" align="center" prop="scopeDate" width="200"/>
<el-table-column label="营养师" align="center" prop="nutritionist" />
<el-table-column label="营养师助理" align="center" prop="nutritionistAssis" />
<el-table-column label="食谱是否发送" align="center" prop="sendFlag">
<el-table-column label="营养师助理" align="center" prop="nutritionistAssis" width="180"/>
<el-table-column label="是否发送" align="center" prop="sendFlag">
<!--<template slot-scope="scope">
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
</template>(.sendFlag == 1) ? 'success' : 'warning'-->
@ -179,7 +179,7 @@
<!--<el-table-column label="营养师名称" align="center" prop="nutritionist" />
<el-table-column label="营养师助理名称" align="center" prop="nutritionistAssis" />-->
<el-table-column label="食谱时间范围" align="center" prop="scopeDate" width="200"/>
<el-table-column label="食谱时间范围" align="center" prop="scopeDate" width="250"/>
<el-table-column label="食谱是否发送" align="center" prop="sendFlag">
<!--<template slot-scope="scope">
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
@ -214,206 +214,57 @@
<!-- 查看体征 -->
<el-dialog title="客户体征" v-if="customerOpen" :visible.sync="customerOpen" width="1000px" append-to-body>
<el-table v-loading="loading" :data="customerSign" width="900px">
<el-table-column label="姓名" align="center" prop="name" />
<!--<el-table-column label="手机号" align="center" prop="phone" width="120" fixed="left"/>-->
<el-table-column label="性别" align="center" prop="sign.sex" >
<el-table :show-header="false" :data="customerSignList" border :cell-style="columnStyle" style="width: 100%;">
<el-table-column width="140" prop="attr_name_one">
</el-table-column>
<el-table-column prop="value_one">
<template slot-scope="scope">
{{scope.row.sign.sex == 0 ? `` : '女'}}
<AutoHideMessage :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
</template>
</el-table-column>
<el-table-column label="年龄(岁)" align="center" prop="sign.age" />
<el-table-column label="身高(厘米)" align="center" prop="sign.tall" />
<el-table-column label="体重(斤)" align="center" prop="sign.weight"/>
<el-table-column label="北方、南方" align="center" prop="sign.position">
<el-table-column width="140" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope">
{{scope.row.sign.position == 0 ? `南方` : '北方'}}
<AutoHideMessage :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
</template>
</el-table-column>
<el-table-column label="病史" align="center" prop="sign.signList">
<el-table-column width="140" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope">
<span>{{getSignString(scope.row.sign.signList)}}</span>
<AutoHideMessage :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
</template>
</el-table-column>
</el-table>
<el-table v-loading="loading" :data="customerSign" width="900px">
<el-table-column label="忌口或过敏源" align="center" prop="sign.dishesIngredientId" width="120"></el-table-column>
<el-table-column label="是否便秘" align="center" prop="sign.constipation">
<template slot-scope="scope">
{{scope.row.sign.constipation == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="是否熬夜失眠" align="center" prop="sign.staylate">
<template slot-scope="scope">
{{scope.row.sign.staylate == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="是否经常运动" align="center" prop="sign.motion">
<template slot-scope="scope">
{{scope.row.sign.motion == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="饮食方式" align="center" prop="sign.makeFoodType" >
<template slot-scope="scope">
{{scope.row.sign.makeFoodType == 0 ? `自己做` : '外面吃'}}
</template>
</el-table-column>
<el-table-column label="饮食备注" align="center" prop="sign.remarks"></el-table-column>
<el-table-column label="饮食特点" align="center" prop="sign.makeFoodTaste">
<template slot-scope="scope">
{{scope.row.sign.makeFoodTaste == 0 ? `清淡` : '重口味'}}
</template>
</el-table-column>
</el-table>
<el-table v-loading="loading" :data="customerSign" width="900px">
<el-table-column label="工作职业" align="center" prop="sign.vocation">
<template slot-scope="scope">
{{scope.row.sign.vocation}}
</template>
</el-table-column>
<el-table-column label="是否上夜班" align="center" prop="sign.night">
<template slot-scope="scope">
{{scope.row.sign.night == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="久坐多还是运动多" align="center" prop="sign.walk">
<template slot-scope="scope">
{{scope.row.sign.walk == 0 ? `久坐多` : '走动多'}}
</template>
</el-table-column>
<el-table-column label="是否浑身乏力" align="center" prop="sign.weakness">
<template slot-scope="scope">
{{scope.row.sign.weakness == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="是否减脂反弹" align="center" prop="sign.rebound">
<template slot-scope="scope">
{{scope.row.sign.rebound == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="意识到生活习惯是减脂关键" align="center" prop="sign.crux">
<template slot-scope="scope">
{{scope.row.sign.crux == 0 ? `` : '否'}}
</template>
</el-table-column>
<el-table-column label="睡觉时间" align="center" prop="sign.sleepTime">
<template slot-scope="scope">
{{scope.row.sign.sleepTime}}
</template>
</el-table-column>
</el-table>
<el-table v-loading="loading" :data="customerSign" width="900px">
<el-table-column label="起床时间" align="center" prop="sign.getupTime" >
<template slot-scope="scope">
{{scope.row.sign.getupTime}}
</template>
</el-table-column>
<el-table-column label="方便沟通时间" align="center" prop="sign.connectTime">
<template slot-scope="scope">
{{scope.row.sign.connectTime}}
</template>
</el-table-column>
<el-table-column label="湿气数据" align="center" prop="sign.bloodData">
<template slot-scope="scope">
{{scope.row.sign.bloodData}}
</template>
</el-table-column>
<el-table-column label="气血数据" align="center" prop="sign.moistureDate" >
<template slot-scope="scope">
{{scope.row.sign.moistureDate}}
</template>
</el-table-column>
<el-table-column label="减脂经历" align="center" prop="sign.experience" ></el-table-column>
<el-table-column label="减脂遇到的困难" align="center" prop="sign.difficulty" ></el-table-column>
<el-table-column label="备注" align="center" prop="sign.comments"></el-table-column>
</el-table>
<!--<div slot="footer" class="dialog-footer">
<el-button @click="customerOpen = false"> </el-button>
</div>-->
</el-dialog>
<!-- 查看订单 -->
<el-dialog title="订单详情" v-if="orderDetailOpen" :visible.sync="orderDetailOpen" width="1000px" append-to-body>
<el-table v-loading="loading" :data="orderDetailList" >
<el-table-column label="订单状态" align="center" prop="orderId">
<template slot-scope="scope">
<el-tag
:type="scope.row.reviewStatus === '2' ? 'success' : scope.row.status ==='0'? '': 'danger'"
disable-transitions>
{{scope.row.reviewStatus === '2' ? '已完成': scope.row.status ==='0'? '进行中': '已暂停'}}
<el-table :show-header="false" :data="orderDetailList" border :cell-style="columnStyle" style="width: 100%;">
<el-table-column width="120" prop="attr_name_one">
</el-table-column>
<el-table-column prop="value_one">
<template slot-scope="scope" >
<el-tag v-if="scope.row.attr_name_one === '订单状态'" :type="scope.row.value_two === '2' ? 'success' : scope.row.value_one === '0'? '': 'danger'" disable-transitions>
{{scope.row.value_two === '2' ? '已完成': scope.row.value_one ==='0'? '进行中': '已暂停'}}
</el-tag>
<AutoHideMessage v-else :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="reviewStatus">
<template slot-scope="scope">
<el-tag
:type="scope.row.reviewStatus === 'yes' ? 'success' : 'danger'"
disable-transitions>
{{scope.row.reviewStatus === 'yes' ? '已审核':'未审核'}}
<el-table-column width="120" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope" >
<el-tag v-if="scope.row.attr_name_two === '审核状态'" :type="scope.row.value_two === 'yes' ? 'success' : 'danger'">
{{scope.row.value_two === 'yes' ? '已审核' : '未审核'}}
</el-tag>
<AutoHideMessage v-else :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
</template>
</el-table-column>
<el-table-column label="成交时间" align="center" prop="orderTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="customer"/>
<el-table-column label="金额" align="center" prop="amount">
<template slot-scope="scope">
{{toThousands(scope.row.amount)}}
</template>
</el-table-column>
<el-table-column label="体重" align="center" prop="weight">
<template slot-scope="scope">
{{scope.row.weight ? `${scope.row.weight}` : ''}}
<el-table-column width="120" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope" >
<AutoHideMessage :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
</template>
</el-table-column>
</el-table>
<el-table v-loading="loading" :data="orderDetailList" >
<el-table-column label="手机号" align="center" prop="phone"/>
<el-table-column label="服务时长" align="center" prop="serveTime"/>
<el-table-column label="赠送时长" align="center" prop="giveServeDay">
<template slot-scope="scope">
{{scope.row.giveServeDay ? `${scope.row.giveServeDay}` : '0天'}}
</template>
</el-table-column>
<el-table-column label="调理项目" align="center" prop="conditioningProject"/>
<el-table-column label="收款方式" align="center" prop="payType"/>
<el-table-column label="售前" align="center" prop="preSale"/>
</el-table>
<el-table v-loading="loading" :data="orderDetailList" >
<el-table-column label="售后" align="center" prop="afterSale"/>
<el-table-column label="主营养师" align="center" prop="nutritionist"/>
<el-table-column label="助理营养师" align="center" prop="nutriAssis" />
<el-table-column label="账号" align="center" prop="account"/>
<el-table-column label="策划" align="center" prop="planner"/>
<el-table-column label="策划助理" align="center" prop="plannerAssis"/>
</el-table>
<el-table v-loading="loading" :data="orderDetailList" >
<el-table-column label="运营" align="center" prop="operator"/>
<el-table-column label="运营助理" align="center" prop="operatorAssis"/>
<!--<el-table-column label="推荐人" align="center" prop="recommender"/>-->
<el-table-column label="进粉时间" align="center" prop="becomeFanTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.becomeFanTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="开始时间" align="center" prop="startTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="serverEndTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.serverEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
</el-table>
<!--<div slot="footer" class="dialog-footer">
<el-button @click="orderDetailOpen = false"> </el-button>
</div>-->
</el-dialog>
</div>
</template>
@ -422,6 +273,7 @@
import { listRecipesPlan, getRecipesPlan, updateRecipesPlan,exportRecipesPlan } from "@/api/custom/recipesPlan";
import { getCustomerAndSignByPhone } from "@/api/custom/customer";
import {getInfoDetail,getOptions} from "@/api/custom/order";
import AutoHideMessage from "@/components/AutoHideMessage";
import dayjs from 'dayjs';
import store from "@/store";
const nextDate = dayjs().add(1, 'day').format("YYYY-MM-DD");
@ -490,8 +342,23 @@
//
nutritionistIdOptions:[],
//
nutriAssisIdOptions:[]
nutriAssisIdOptions:[],
//
orderTitleData:[["订单状态","审核状态","成交时间"],["姓名","金额","体重"],["手机号","服务时长","赠送时长"],["调理项目","收款方式","售前"],
["售后","营养师","助理营养师"],["账号","策划","策划助理"],["运营","运营助理","进粉时间"],["开始时间","结束时间","备注"]],
//
orderValueData:[["status","reviewStatus","orderTime"],["customer","amount","weight"],["phone","serveTime","giveServeDay"],["conditioningProject","payType","preSale"],
["afterSale","nutritionist","nutriAssis"],["account","planner","plannerAssis"],["operator","operatorAssis","becomeFanTime"],["startTime","serverEndTime","serverEndTime"]],
signTitleData:[["姓名","手机号","性别"],["年龄(岁)","身高(厘米)","体重(斤)"],["南、北方","病史","忌口或过敏源"],["是否便秘","是否熬夜失眠","是否经常运动"],
["饮食方式","饮食备注","饮食特点"],["工作职业","是否上夜班","久坐多还是运动多"],["是否浑身乏力","是否减脂反弹","意识到生活习惯是减脂的关键"],
["睡觉时间","起床时间","方便沟通时间"],["湿气数据","气血数据","减脂经历"],["减脂遇到的困难","备注","创建时间"]],
signValueData:[["name","phone","sex"],["age","tall","weight"],["position","signString","dishesIngredientId"],["constipation","staylate","motion"],
["makeFoodType","remarks","makeFoodTaste"],["vocation","night","walk"],["weakness","rebound","crux"],["sleepTime","getupTime","connectTime"],["bloodData","moistureDate","experience"],["difficulty","comments","createTime"]]
};
},
components: {
AutoHideMessage
},
created() {
getOptions().then(response => {
@ -537,24 +404,44 @@
},
/** 查询客户体征 */
getCustomerSign(row) {
this.customerSign = [];
this.customerSignList = [];
let message = "未找到该客户,请检查订单手机号与客户体征手机号是否一致";
if(row.phone == null || row.phone == ""){
this.alert(message);
return;
}
getCustomerAndSignByPhone({"phone": row.phone}).then(response => {
this.customerSign[0] = response.data;
if(this.customerSign[0] == null){
if(response.data == null){
this.alert(message);
}else{
this.customerOpen = true;
return;
}
let sign = response.data.sign;
sign.name = response.data.name;
sign.phone = response.data.phone;
sign.createTime = response.data.createTime;
sign.sex = sign.sex == 0 ? `` : '女';
sign.position = sign.position == 0 ? `南方` : '北方';
sign.signString = this.getSignString(sign.signList);
sign.constipation = sign.constipation == 0 ? "是" : "否";
sign.staylate = sign.staylate == 0 ? "是" : "否";
sign.motion = sign.motion == 0 ? "是" : "否";
sign.makeFoodType = sign.makeFoodType == 0 ? `自己做` : '外面吃';
sign.makeFoodTaste = sign.makeFoodTaste == 0 ? "清淡" : '重口味';
sign.night = sign.night == 0 ? `` : '否';
sign.walk = sign.walk == 0 ? `久坐多` : '走动多';
sign.weakness = sign.weakness == 0 ? `` : '否';
sign.rebound = sign.rebound == 0 ? `` : '否';
sign.crux = sign.crux == 0 ? `` : '否';
sign.sleepTime = sign.sleepTime+"点";
sign.getupTime = sign.getupTime + "点";
sign.connectTime = sign.connectTime +"点";
for(let i = 0; i < this.signTitleData.length; i++){
this.customerSignList.push({"attr_name_one": this.signTitleData[i][0],"value_one": sign[this.signValueData[i][0]],"attr_name_two": this.signTitleData[i][1],"value_two": sign[this.signValueData[i][1]],"attr_name_three": this.signTitleData[i][2],"value_three": sign[this.signValueData[i][2]]});
}
this.customerOpen = true;
});
},
getAllPlanByOrderId(){
//console.log(this.allRecipesPlanQueryParam.sendFlag);
//console.log(this.allRecipesPlanQueryParam.sendFlag === "");
if(this.allRecipesPlanQueryParam.sendFlag === ""){
this.allRecipesPlanQueryParam.sendFlag = null;
}
@ -570,12 +457,16 @@
getOrderDetail(row){
this.orderDetailList = [];
getInfoDetail({'orderId': row.orderId}).then(response => {
this.orderDetailList[0] = response.data;
response.data.weight = response.data.weight != null ? (response.data.weight +"斤") : "";
response.data.giveServeDay = response.data.giveServeDay != null ? (response.data.giveServeDay +"天") : "";
for(let i = 0; i < this.orderTitleData.length; i++){
this.orderDetailList.push({"attr_name_one": this.orderTitleData[i][0],"value_one": response.data[this.orderValueData[i][0]],"attr_name_two": this.orderTitleData[i][1],"value_two": response.data[this.orderValueData[i][1]],"attr_name_three": this.orderTitleData[i][2],"value_three": response.data[this.orderValueData[i][2]]});
}
this.orderDetailOpen = true;
});
},
alert(value){
this.$alert(value, '提示', {confirmButtonText: '确定'});
this.$alert(value, '提示', {confirmButtonText: '关闭'});
},
getSignString(signList){
if(signList == null){
@ -671,10 +562,36 @@
if(row.sendFlag == 1) {
return "success";
}
if(dayjs(row.startDate+"").diff(dayjs(),'day') <= 1){
return "danger";
/* if(dayjs(row.startDate+"").diff(dayjs(),'day') <= 1){
return "danger";
}
return '';
return '';*/
},
//
columnStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 0 || columnIndex == 2 || columnIndex == 4 || columnIndex == 6) {
//23
return "background:#f3f6fc;font-weight:bold";
}else{
return "background:#ffffff;";
}
},
//
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex % 4 === 0) {
return {
rowspan: 4,
colspan: 1
};
} else {
return {
rowspan: 0,
colspan: 0
};
}
}
}
}
};

View File

@ -166,7 +166,8 @@
const checkcusId = (rule, value, callback) => {
if (!value) {
return callback(new Error('证件号码不能为空'))
callback();
//return callback(new Error(''))
}
setTimeout(() => {
const {code, msg} = validatorIDCard(value, this.idType);
@ -214,7 +215,7 @@
{required: true, trigger: "blur", validator: checkPhone}
],
cusId: [
{required: true, trigger: "blur", validator: checkcusId}
{required: false, trigger: "blur", validator: checkcusId}
]
}
}
@ -243,8 +244,10 @@
})
},
submitForm() {
console.log("chdkscjksdc1");
this.$refs["form"].validate(valid => {
if (valid) {
console.log("chdkscjksdc2");
signContract(this.form).then(result => {
if (result.code === 200) {
window.location.href = window.location.origin + result.url;