Merge branch 'master' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
commit
8ae2f83ef9
@ -19,7 +19,7 @@ stdiet:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8091
|
||||
port: 8090
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@ -186,5 +186,6 @@ aliyun:
|
||||
|
||||
lucene:
|
||||
index:
|
||||
nutritionQuestion: D:\develop\LuceneIndex\nutritionQuestion
|
||||
# nutritionQuestion: D:\develop\LuceneIndex\nutritionQuestion
|
||||
nutritionQuestion: /Users/wonder/Documents/Workspaces/java/ShengtangManage/running/uploadPath/nutritionQuestion
|
||||
|
||||
|
@ -3,8 +3,10 @@ package com.stdiet.web.controller.custom;
|
||||
import com.stdiet.common.annotation.Log;
|
||||
import com.stdiet.common.core.controller.BaseController;
|
||||
import com.stdiet.common.core.domain.AjaxResult;
|
||||
import com.stdiet.common.core.domain.entity.SysUser;
|
||||
import com.stdiet.common.core.page.TableDataInfo;
|
||||
import com.stdiet.common.enums.BusinessType;
|
||||
import com.stdiet.common.utils.SecurityUtils;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||
import com.stdiet.common.utils.sign.AesUtils;
|
||||
@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -44,7 +47,16 @@ public class SysCustomerController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysCustomer sysCustomer) {
|
||||
startPage();
|
||||
List<SysCustomer> list = sysCustomerService.selectSysCustomerList(sysCustomer);
|
||||
List<SysCustomer> list = new ArrayList<>();
|
||||
if (SecurityUtils.getLoginUser().getUser().getRoles().get(0).getRoleKey().equals("partner")) {
|
||||
String remark = SecurityUtils.getLoginUser().getUser().getRemark();
|
||||
if (StringUtils.isEmpty(remark)) {
|
||||
return getDataTable(list);
|
||||
} else if (remark.contains("|") && sysCustomer.getChannelId() == null) {
|
||||
sysCustomer.setChannels(remark.split("\\|"));
|
||||
}
|
||||
}
|
||||
list = sysCustomerService.selectSysCustomerList(sysCustomer);
|
||||
if (list != null && list.size() > 0) {
|
||||
for (SysCustomer sysCus : list) {
|
||||
if (StringUtils.isNotEmpty(sysCus.getPhone())) {
|
||||
|
@ -5,7 +5,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.SecurityUtils;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||
import com.stdiet.custom.controller.OrderBaseController;
|
||||
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLDecoder;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -50,37 +50,42 @@ public class SysOrderController extends OrderBaseController {
|
||||
public OrderTableDataInfo list(SysOrder sysOrder) {
|
||||
startPage();
|
||||
dealOrderType(sysOrder);
|
||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
List<SysOrder> list = new ArrayList<>();
|
||||
if (SecurityUtils.getLoginUser().getUser().getRoles().get(0).getRoleKey().equals("partner")) {
|
||||
String remark = SecurityUtils.getLoginUser().getUser().getRemark();
|
||||
if (StringUtils.isEmpty(remark)) {
|
||||
return getOrderDataTable(list, new BigDecimal(0));
|
||||
} else if (remark.contains("|") && StringUtils.isEmpty(sysOrder.getAccount())) {
|
||||
sysOrder.setAccRange(remark.split("\\|"));
|
||||
}
|
||||
}
|
||||
|
||||
list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
List<SysUser> userList = userService.selectAllUser();
|
||||
BigDecimal totalAmount = sysOrderService.selectAllOrderAmount(sysOrder);
|
||||
if (totalAmount == null) {
|
||||
totalAmount = new BigDecimal(0);
|
||||
}
|
||||
for (SysOrder order : list) {
|
||||
initUserNickNameAndOrderType(userList,order);
|
||||
initUserNickNameAndOrderType(userList, order);
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理订单类型
|
||||
*
|
||||
* @param sysOrder
|
||||
*/
|
||||
private void dealOrderType(SysOrder sysOrder) {
|
||||
if(StringUtils.isNotEmpty(sysOrder.getOrderType())){
|
||||
if (StringUtils.isNotEmpty(sysOrder.getOrderType())) {
|
||||
try {
|
||||
JSONArray array = JSONArray.parseArray(URLDecoder.decode(sysOrder.getOrderType(),"UTF-8"));
|
||||
JSONArray array = JSONArray.parseArray(URLDecoder.decode(sysOrder.getOrderType(), "UTF-8"));
|
||||
sysOrder.setSearchOrderTypeArray(array.size() > 0 ? array : null);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -96,7 +101,7 @@ public class SysOrderController extends OrderBaseController {
|
||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
List<SysUser> userList = userService.selectAllUser();
|
||||
for (SysOrder order : list) {
|
||||
initUserNickNameAndOrderType(userList,order);
|
||||
initUserNickNameAndOrderType(userList, order);
|
||||
if (StringUtils.isNotEmpty(order.getPhone())) {
|
||||
order.setPhone(StringUtils.hiddenPhoneNumber(order.getPhone()));
|
||||
}
|
||||
@ -123,12 +128,12 @@ public class SysOrderController extends OrderBaseController {
|
||||
SysOrder order = sysOrderService.selectSysOrderById(orderId);
|
||||
if (order != null) {
|
||||
List<SysUser> userList = userService.selectAllUser();
|
||||
initUserNickNameAndOrderType(userList,order);
|
||||
initUserNickNameAndOrderType(userList, order);
|
||||
}
|
||||
return AjaxResult.success(order);
|
||||
}
|
||||
|
||||
private void initUserNickNameAndOrderType(List<SysUser> userList, SysOrder order){
|
||||
private void initUserNickNameAndOrderType(List<SysUser> userList, SysOrder order) {
|
||||
for (SysUser user : userList) {
|
||||
if (user.getUserId().equals(order.getPreSaleId())) {
|
||||
order.setPreSale(user.getNickName());
|
||||
|
@ -97,4 +97,9 @@ public class SysCustomer extends BaseEntity
|
||||
/** 体征数据,非持久化字段 */
|
||||
private SysCustomerPhysicalSigns sign;
|
||||
|
||||
@Excel(name = "进粉渠道")
|
||||
private Long channelId;
|
||||
|
||||
private String[] channels;
|
||||
|
||||
}
|
@ -134,6 +134,8 @@ public class SysOrder extends BaseEntity {
|
||||
@Excel(name = "账号")
|
||||
private String account;
|
||||
|
||||
private String[] accRange;
|
||||
|
||||
/**
|
||||
* 策划
|
||||
*/
|
||||
|
@ -26,10 +26,11 @@
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCustomerVo">
|
||||
select id, name, phone, email, fans_time, fans_channel, 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
|
||||
select id, name, phone, email, fans_time, fans_channel, 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, channel_id from sys_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
||||
@ -45,6 +46,13 @@
|
||||
<if test="assistantDietitian != null and assistantDietitian != ''"> and assistant_dietitian = #{assistantDietitian}</if>
|
||||
<if test="assistantDietitian == 0"> and (isnull(assistant_dietitian) or assistant_dietitian=0)</if>
|
||||
<if test="fansChannel != null "> and fans_channel = #{fansChannel}</if>
|
||||
<if test="channelId != null "> and channel_id = #{channelId}</if>
|
||||
<if test="channels != null">
|
||||
and channel_id in
|
||||
<foreach collection="channels" item="cn" separator="," open="(" close=")">
|
||||
#{cn}
|
||||
</foreach>
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@ -76,6 +84,7 @@
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="channelId != null">channel_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
@ -98,6 +107,7 @@
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="channelId != null">#{channelId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -124,6 +134,7 @@
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
@ -41,14 +41,14 @@
|
||||
<result property="serverEndTime" column="server_end_time"/>
|
||||
<result property="becomeFanTime" column="become_fan_time"/>
|
||||
|
||||
<result property="onSaleId" column="on_sale_id" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="orderCountType" column="order_count_type" />
|
||||
<result property="orderMoneyType" column="order_money_type" />
|
||||
<result property="mainOrderId" column="main_order_id" />
|
||||
<result property="afterSaleCommissOrder" column="after_sale_commiss_order" />
|
||||
<result property="commissStartTime" column="commiss_start_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="onSaleId" column="on_sale_id"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
<result property="orderCountType" column="order_count_type"/>
|
||||
<result property="orderMoneyType" column="order_money_type"/>
|
||||
<result property="mainOrderId" column="main_order_id"/>
|
||||
<result property="afterSaleCommissOrder" column="after_sale_commiss_order"/>
|
||||
<result property="commissStartTime" column="commiss_start_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="afterSale" column="afterSale_name"></result><!-- 售后名称 -->
|
||||
@ -73,7 +73,7 @@
|
||||
<sql id="searchOrderType">
|
||||
<if test="searchOrderTypeArray != null">
|
||||
<trim prefix="AND (" suffix=")" suffixOverrides="or">
|
||||
<foreach collection="searchOrderTypeArray" separator="or" item="typeArray" index="i">
|
||||
<foreach collection="searchOrderTypeArray" separator="or" item="typeArray" index="i">
|
||||
(
|
||||
<foreach collection="typeArray" separator="and" item="type" index="j">
|
||||
<if test="j == 0">
|
||||
@ -99,8 +99,14 @@
|
||||
<if test="customer != null and customer != ''">
|
||||
and (customer like concat('%',#{customer},'%') or phone like concat('%',#{customer},'%'))
|
||||
</if>
|
||||
<if test="accRange != null">
|
||||
and account_id in
|
||||
<foreach collection="accRange" separator="," item="acc" open="(" close=")" >
|
||||
#{acc}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||
<!-- <if test="phone != null and phone != ''">and phone = #{phone}</if>-->
|
||||
<!-- <if test="phone != null and phone != ''">and phone = #{phone}</if>-->
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||
@ -113,8 +119,12 @@
|
||||
<if test="operatorId != null ">and operator_id = #{operatorId}</if>
|
||||
<if test="operatorAssisId != null ">and operator_assis_id = #{operatorAssisId}</if>
|
||||
<if test="recommender != null and recommender != ''">and recommender = #{recommender}</if>
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >=
|
||||
date_format(#{beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <=
|
||||
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="amountFlag != null">
|
||||
@ -141,7 +151,13 @@
|
||||
<if test="customer != null and customer != ''">
|
||||
and (sc.name like concat('%',#{customer},'%') or sc.phone like concat('%',#{customer},'%'))
|
||||
</if>
|
||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||
<if test="accRange != null">
|
||||
and account_id in
|
||||
<foreach collection="accRange" separator="," item="acc" open="(" close=")">
|
||||
#{acc}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||
<if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
@ -155,8 +171,12 @@
|
||||
<if test="operatorId != null ">and operator_id = #{operatorId}</if>
|
||||
<if test="operatorAssisId != null ">and operator_assis_id = #{operatorAssisId}</if>
|
||||
<if test="recommender != null and recommender != ''">and recommender = #{recommender}</if>
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
||||
<if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >=
|
||||
date_format(#{beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <=
|
||||
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="amountFlag != null">
|
||||
@ -319,10 +339,10 @@
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysOrderByIds" parameterType="String">
|
||||
<!-- delete from sys_order where order_id in-->
|
||||
<!-- <foreach item="orderId" collection="array" open="(" separator="," close=")">-->
|
||||
<!-- #{orderId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- delete from sys_order where order_id in-->
|
||||
<!-- <foreach item="orderId" collection="array" open="(" separator="," close=")">-->
|
||||
<!-- #{orderId}-->
|
||||
<!-- </foreach>-->
|
||||
</delete>
|
||||
|
||||
<resultMap type="SysOrder" id="SysOrderResultExtended">
|
||||
@ -362,14 +382,14 @@
|
||||
<result property="serverEndTime" column="server_end_time"/>
|
||||
<result property="becomeFanTime" column="become_fan_time"/>
|
||||
|
||||
<result property="onSaleId" column="on_sale_id" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="orderCountType" column="order_count_type" />
|
||||
<result property="orderMoneyType" column="order_money_type" />
|
||||
<result property="mainOrderId" column="main_order_id" />
|
||||
<result property="afterSaleCommissOrder" column="after_sale_commiss_order" />
|
||||
<result property="commissStartTime" column="commiss_start_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="onSaleId" column="on_sale_id"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
<result property="orderCountType" column="order_count_type"/>
|
||||
<result property="orderMoneyType" column="order_money_type"/>
|
||||
<result property="mainOrderId" column="main_order_id"/>
|
||||
<result property="afterSaleCommissOrder" column="after_sale_commiss_order"/>
|
||||
<result property="commissStartTime" column="commiss_start_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="afterSale" column="afterSale_name"></result><!-- 售后名称 -->
|
||||
@ -378,17 +398,17 @@
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="SysOrderPause" id="SysOrderPauseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="pauseStartDate" column="pause_start_date" />
|
||||
<result property="pauseEndDate" column="pause_end_date" />
|
||||
<result property="reason" column="reason" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="pauseStartDate" column="pause_start_date"/>
|
||||
<result property="pauseEndDate" column="pause_end_date"/>
|
||||
<result property="reason" column="reason"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getOrderPauseByOrderId" parameterType="Long" resultMap="SysOrderPauseResult">
|
||||
@ -398,34 +418,15 @@
|
||||
|
||||
<!-- 查询2021年开始的已审核的订单信息(用于计算提成,请勿随意改动) -->
|
||||
<select id="selectSimpleOrderMessage" resultMap="SysOrderResultExtended" parameterType="SysCommision">
|
||||
select o.order_id,o.order_time,o.commiss_start_time,o.server_end_time,o.customer,o.review_status,o.amount,o.serve_time_id,o.give_serve_day,o.after_sale_id,su_sale.nick_name as afterSale_name,o.nutritionist_id,su_nutritionist.nick_name as nutritionist_name
|
||||
from sys_order o
|
||||
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
||||
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag = 0
|
||||
where o.order_time >= '2021-01-01' and o.del_flag = 0 and (su_sale.user_id is not null OR su_nutritionist.user_id is not null)
|
||||
and o.amount is not null
|
||||
<if test="reviewStatus != null and reviewStatus != ''">
|
||||
and review_status = #{reviewStatus}
|
||||
</if>
|
||||
<if test="userId != null"><!-- 限于营养师、售后不可能同一个的情况下 -->
|
||||
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(o.order_time,'%Y-%m-%d') <= #{endTime}
|
||||
</if>
|
||||
<if test="serverScopeEndTime != null and serverScopeEndTime != ''">
|
||||
AND #{serverScopeEndTime} >= DATE_FORMAT(o.commiss_start_time,'%Y-%m-%d')
|
||||
</if>
|
||||
order by o.order_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询2021年开始的已审核的订单信息的总条数(用于计算提成,请勿随意改动) -->
|
||||
<select id="selectSimpleOrderMessageCount" resultType="int" parameterType="SysCommision">
|
||||
select count(o.order_id) as orderCount
|
||||
select
|
||||
o.order_id,o.order_time,o.commiss_start_time,o.server_end_time,o.customer,o.review_status,o.amount,o.serve_time_id,o.give_serve_day,o.after_sale_id,su_sale.nick_name
|
||||
as afterSale_name,o.nutritionist_id,su_nutritionist.nick_name as nutritionist_name
|
||||
from sys_order o
|
||||
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
||||
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag = 0
|
||||
where o.order_time >= '2021-01-01' and o.del_flag = 0 and (su_sale.user_id is not null OR su_nutritionist.user_id is not null)
|
||||
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag =
|
||||
0
|
||||
where o.order_time >= '2021-01-01' and o.del_flag = 0 and (su_sale.user_id is not null OR
|
||||
su_nutritionist.user_id is not null)
|
||||
and o.amount is not null
|
||||
<if test="reviewStatus != null and reviewStatus != ''">
|
||||
and review_status = #{reviewStatus}
|
||||
@ -437,31 +438,59 @@
|
||||
AND DATE_FORMAT(o.order_time,'%Y-%m-%d') <= #{endTime}
|
||||
</if>
|
||||
<if test="serverScopeEndTime != null and serverScopeEndTime != ''">
|
||||
AND #{serverScopeEndTime} >= DATE_FORMAT(o.commiss_start_time,'%Y-%m-%d')
|
||||
AND #{serverScopeEndTime} >= DATE_FORMAT(o.commiss_start_time,'%Y-%m-%d')
|
||||
</if>
|
||||
order by o.order_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询2021年开始的已审核的订单信息的总条数(用于计算提成,请勿随意改动) -->
|
||||
<select id="selectSimpleOrderMessageCount" resultType="int" parameterType="SysCommision">
|
||||
select count(o.order_id) as orderCount
|
||||
from sys_order o
|
||||
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
||||
left join sys_user su_nutritionist on su_nutritionist.user_id = o.nutritionist_id and su_nutritionist.del_flag =
|
||||
0
|
||||
where o.order_time >= '2021-01-01' and o.del_flag = 0 and (su_sale.user_id is not null OR
|
||||
su_nutritionist.user_id is not null)
|
||||
and o.amount is not null
|
||||
<if test="reviewStatus != null and reviewStatus != ''">
|
||||
and review_status = #{reviewStatus}
|
||||
</if>
|
||||
<if test="userId != null"><!-- 限于营养师、售后不可能同一个的情况下 -->
|
||||
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(o.order_time,'%Y-%m-%d') <= #{endTime}
|
||||
</if>
|
||||
<if test="serverScopeEndTime != null and serverScopeEndTime != ''">
|
||||
AND #{serverScopeEndTime} >= DATE_FORMAT(o.commiss_start_time,'%Y-%m-%d')
|
||||
</if>
|
||||
order by o.order_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询售后、营养师的每个月服务总金额 -->
|
||||
<select id="getTotalAmountByUserId" parameterType="SysCommision" resultType="com.stdiet.custom.dto.response.EveryMonthTotalAmount">
|
||||
<select id="getTotalAmountByUserId" parameterType="SysCommision"
|
||||
resultType="com.stdiet.custom.dto.response.EveryMonthTotalAmount">
|
||||
SELECT s.yearMonth,SUM(s.amount) AS totalAmount FROM
|
||||
(
|
||||
SELECT CONCAT(YEAR(o.order_time),'',MONTH(o.order_time)) AS yearMonth,o.amount
|
||||
FROM sys_order o
|
||||
LEFT JOIN sys_user su_sale ON su_sale.user_id = o.after_sale_id AND su_sale.del_flag = 0
|
||||
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = o.nutritionist_id AND su_nutritionist.del_flag = 0
|
||||
where o.order_time >= '2021-01-01' and o.del_flag = 0 and (su_sale.user_id is not null OR su_nutritionist.user_id is not null)
|
||||
and o.amount is not null
|
||||
<if test="reviewStatus != null and reviewStatus != ''">
|
||||
SELECT CONCAT(YEAR(o.order_time),'',MONTH(o.order_time)) AS yearMonth,o.amount
|
||||
FROM sys_order o
|
||||
LEFT JOIN sys_user su_sale ON su_sale.user_id = o.after_sale_id AND su_sale.del_flag = 0
|
||||
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = o.nutritionist_id AND su_nutritionist.del_flag =
|
||||
0
|
||||
where o.order_time >= '2021-01-01' and o.del_flag = 0 and (su_sale.user_id is not null OR
|
||||
su_nutritionist.user_id is not null)
|
||||
and o.amount is not null
|
||||
<if test="reviewStatus != null and reviewStatus != ''">
|
||||
and o.review_status = #{reviewStatus}
|
||||
</if>
|
||||
<if test="userId != null"><!-- 限于营养师、售后不可能同一个的情况下 -->
|
||||
</if>
|
||||
<if test="userId != null"><!-- 限于营养师、售后不可能同一个的情况下 -->
|
||||
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(o.order_time,'%Y-%m-%d') <= #{endTime}
|
||||
</if>
|
||||
ORDER BY o.order_time ASC
|
||||
</if>
|
||||
ORDER BY o.order_time ASC
|
||||
) s
|
||||
GROUP BY s.yearMonth
|
||||
</select>
|
||||
|
@ -53,8 +53,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="accountId">
|
||||
<el-select v-model="form.accountId" placeholder="请选择">
|
||||
<el-form-item label="进粉渠道" prop="accountId">
|
||||
<el-select
|
||||
v-model="form.accountId"
|
||||
placeholder="请选择"
|
||||
@change="handleOnChanelIdChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -157,10 +161,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8" v-show="orderRateOptionsShow">
|
||||
<el-form-item label="拆分比例" prop="nutritionistRate">
|
||||
<el-select
|
||||
v-model="form.nutritionistRate"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-select v-model="form.nutritionistRate" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in orderRateOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -672,12 +673,15 @@ export default {
|
||||
handleOrderTypeChange() {
|
||||
// console.log(this.form.orderTypeList);
|
||||
},
|
||||
handleOnChanelIdChange(val) {
|
||||
this.initPlanningAndOperation();
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// 监听收款账号的变化
|
||||
"form.accountId": function (newVal, oldVal) {
|
||||
this.initPlanningAndOperation();
|
||||
},
|
||||
// "form.accountId": function (newVal, oldVal) {
|
||||
// this.initPlanningAndOperation();
|
||||
// },
|
||||
"form.orderTypeList": function (newVal, oldVal) {
|
||||
//判断订单类型是否选择了二开
|
||||
if (newVal[1] == 1) {
|
||||
@ -697,11 +701,11 @@ export default {
|
||||
}
|
||||
//判断是否选择了体验单
|
||||
if (newVal[0] == 2) {
|
||||
this.afterNutiShow = false;
|
||||
this.form.onSaleId = parseInt(this.onSaleIdOptions[1].dictValue);
|
||||
this.form.serveTimeId = 7;
|
||||
this.form.conditioningProjectId = 12;
|
||||
}else{
|
||||
this.afterNutiShow = false;
|
||||
this.form.onSaleId = parseInt(this.onSaleIdOptions[1].dictValue);
|
||||
this.form.serveTimeId = 7;
|
||||
this.form.conditioningProjectId = 12;
|
||||
} else {
|
||||
this.form.onSaleId = null;
|
||||
this.form.serveTimeId = 90;
|
||||
this.afterNutiShow = true;
|
||||
|
@ -212,6 +212,7 @@ export default {
|
||||
this.$refs.cusCreateOrderDialogRef.showDialog(
|
||||
{
|
||||
customer: this.data.name,
|
||||
accountId: this.data.channelId,
|
||||
cusId: this.data.id,
|
||||
preSaleId: this.data.salesman,
|
||||
afterSaleId: this.data.afterDietitian,
|
||||
|
@ -11,7 +11,11 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="订单类型" prop="orderTypeName">
|
||||
<el-input v-model="form.orderTypeName" placeholder="" :disabled="true"/>
|
||||
<el-input
|
||||
v-model="form.orderTypeName"
|
||||
placeholder=""
|
||||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -32,8 +36,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="accountId">
|
||||
<el-select v-model="form.accountId" placeholder="请选择">
|
||||
<el-form-item label="进粉渠道" prop="accountId">
|
||||
<el-select
|
||||
v-model="form.accountId"
|
||||
placeholder="请选择"
|
||||
@change="handleOnChannelIdChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -389,7 +397,7 @@ export default {
|
||||
//是否显示售后、营养师、营养师助理
|
||||
afterSaleNutriAssShow: true,
|
||||
//是否显示策划、策划助理、运营、运营助理
|
||||
planOperatorShow: true
|
||||
planOperatorShow: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -571,9 +579,9 @@ export default {
|
||||
this.resetForm("form");
|
||||
// console.log("--"+obj.orderType);
|
||||
this.onSaleShow = this.form.orderType == "2";
|
||||
this.afterSaleNutriAssShow = this.form.orderType != "2" && this.form.afterSaleCommissOrder == 0;
|
||||
this.afterSaleNutriAssShow =
|
||||
this.form.orderType != "2" && this.form.afterSaleCommissOrder == 0;
|
||||
this.planOperatorShow = this.form.afterSaleCommissOrder == 0;
|
||||
|
||||
},
|
||||
handleOnClosed() {
|
||||
this.reset();
|
||||
@ -609,13 +617,17 @@ export default {
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// 监听收款账号的变化
|
||||
"form.accountId": function (newVal, oldVal) {
|
||||
// console.log("updte");
|
||||
handleOnChannelIdChange(val) {
|
||||
console.log(val);
|
||||
this.initPlanningAndOperation();
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// 监听收款账号的变化
|
||||
// "form.accountId": function (newVal, oldVal) {
|
||||
// // console.log("updte");
|
||||
// this.initPlanningAndOperation();
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -11,6 +11,7 @@ const getters = {
|
||||
roles: state => state.user.roles,
|
||||
permissions: state => state.user.permissions,
|
||||
userId: state => state.user.userId,
|
||||
userRemark: state => state.user.remark,
|
||||
permission_routes: state => state.permission.routes,
|
||||
//
|
||||
nutritionistIdOptions: state => state.global.nutritionistIdOptions,
|
||||
|
@ -1,100 +1,117 @@
|
||||
import { login, logout, getInfo } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import { login, logout, getInfo } from "@/api/login";
|
||||
import { getToken, setToken, removeToken } from "@/utils/auth";
|
||||
|
||||
const user = {
|
||||
state: {
|
||||
token: getToken(),
|
||||
name: '',
|
||||
avatar: '',
|
||||
name: "",
|
||||
avatar: "",
|
||||
remark: "",
|
||||
roles: [],
|
||||
permissions: []
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_TOKEN: (state, token) => {
|
||||
state.token = token
|
||||
state.token = token;
|
||||
},
|
||||
SET_NAME: (state, name) => {
|
||||
state.name = name
|
||||
state.name = name;
|
||||
},
|
||||
SET_AVATAR: (state, avatar) => {
|
||||
state.avatar = avatar
|
||||
state.avatar = avatar;
|
||||
},
|
||||
SET_ROLES: (state, roles) => {
|
||||
state.roles = roles
|
||||
state.roles = roles;
|
||||
},
|
||||
SET_PERMISSIONS: (state, permissions) => {
|
||||
state.permissions = permissions
|
||||
state.permissions = permissions;
|
||||
},
|
||||
SET_USERID: (state, userId) => {
|
||||
state.userId = userId
|
||||
state.userId = userId;
|
||||
},
|
||||
SET_REMARK: (state, remark) => {
|
||||
state.remark = remark;
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 登录
|
||||
Login({ commit }, userInfo) {
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password
|
||||
const code = userInfo.code
|
||||
const uuid = userInfo.uuid
|
||||
const username = userInfo.username.trim();
|
||||
const password = userInfo.password;
|
||||
const code = userInfo.code;
|
||||
const uuid = userInfo.uuid;
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
setToken(res.token)
|
||||
commit('SET_TOKEN', res.token)
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
login(username, password, code, uuid)
|
||||
.then(res => {
|
||||
setToken(res.token);
|
||||
commit("SET_TOKEN", res.token);
|
||||
resolve();
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo(state.token).then(res => {
|
||||
const user = res.user
|
||||
const avatar = user.avatar == "" ? require("@/assets/image/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
commit('SET_ROLES', res.roles)
|
||||
commit('SET_PERMISSIONS', res.permissions)
|
||||
} else {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_AVATAR', avatar)
|
||||
commit('SET_USERID', user.userId)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
getInfo(state.token)
|
||||
.then(res => {
|
||||
const user = res.user;
|
||||
const avatar =
|
||||
user.avatar == ""
|
||||
? require("@/assets/image/profile.jpg")
|
||||
: process.env.VUE_APP_BASE_API + user.avatar;
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
commit("SET_ROLES", res.roles);
|
||||
commit("SET_PERMISSIONS", res.permissions);
|
||||
} else {
|
||||
commit("SET_ROLES", ["ROLE_DEFAULT"]);
|
||||
}
|
||||
commit("SET_NAME", user.userName);
|
||||
commit("SET_AVATAR", avatar);
|
||||
commit("SET_USERID", user.userId);
|
||||
commit("SET_REMARK", user.remark);
|
||||
resolve(res);
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 退出系统
|
||||
LogOut({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_ROLES', [])
|
||||
commit('SET_PERMISSIONS', [])
|
||||
removeToken()
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
logout(state.token)
|
||||
.then(() => {
|
||||
commit("SET_TOKEN", "");
|
||||
commit("SET_ROLES", []);
|
||||
commit("SET_PERMISSIONS", []);
|
||||
commit("SET_USERID", "");
|
||||
commit("SET_REMARK", "");
|
||||
removeToken();
|
||||
resolve();
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 前端 登出
|
||||
FedLogOut({ commit }) {
|
||||
return new Promise(resolve => {
|
||||
commit('SET_TOKEN', '')
|
||||
removeToken()
|
||||
resolve()
|
||||
})
|
||||
commit("SET_TOKEN", "");
|
||||
removeToken();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default user
|
||||
export default user;
|
||||
|
@ -16,8 +16,7 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="进粉渠道" prop="fansChannel">
|
||||
<!-- <el-form-item label="进粉方式" prop="fansChannel">
|
||||
<el-select v-model="queryParams.fansChannel" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in fansChannelOptions"
|
||||
@ -26,8 +25,18 @@
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="进粉渠道" prop="channelId">
|
||||
<el-select v-model="queryParams.channelId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="营养师" prop="mainDietitian">
|
||||
<el-form-item label="营养师" prop="mainDietitian" v-if="!isPartner">
|
||||
<el-select v-model="queryParams.mainDietitian" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
@ -37,7 +46,11 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="营养师助理" prop="assistantDietitian">
|
||||
<el-form-item
|
||||
label="营养师助理"
|
||||
prop="assistantDietitian"
|
||||
v-if="!isPartner"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.assistantDietitian"
|
||||
placeholder="请选择"
|
||||
@ -50,7 +63,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售人员" prop="salesman">
|
||||
<el-form-item label="销售人员" prop="salesman" v-if="!isPartner">
|
||||
<el-select v-model="queryParams.salesman" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
@ -60,7 +73,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="售后营养师" prop="afterDietitian">
|
||||
<el-form-item label="售后营养师" prop="afterDietitian" v-if="!isPartner">
|
||||
<el-select v-model="queryParams.afterDietitian" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in afterSaleIdOptions"
|
||||
@ -132,13 +145,18 @@
|
||||
<span>{{ parseTime(scope.row.fansTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="进粉渠道"
|
||||
<!-- <el-table-column
|
||||
label="进粉方式"
|
||||
align="center"
|
||||
prop="fansChannel"
|
||||
:formatter="fansChannelFormat"
|
||||
>
|
||||
</el-table-column>
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="进粉渠道"
|
||||
align="center"
|
||||
prop="channelId"
|
||||
:formatter="channelFormat"
|
||||
/>
|
||||
<el-table-column label="客户姓名" align="center" prop="name" />
|
||||
<el-table-column label="手机号" align="center" prop="phone" />
|
||||
<el-table-column
|
||||
@ -250,13 +268,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
fixed="right"
|
||||
width="120"
|
||||
class-name="small-padding fixed-width"
|
||||
v-if="!isPartner"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -363,10 +381,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="进粉渠道" prop="fansChannel">
|
||||
<el-select v-model="form.fansChannel" placeholder="请选择">
|
||||
<el-form-item label="进粉渠道" prop="channelId">
|
||||
<el-select v-model="form.channelId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in fansChannelOptions"
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
@ -393,7 +411,9 @@
|
||||
<!-- 食谱计划抽屉 -->
|
||||
<RecipesPlanDrawer ref="recipesPlanDrawerRef" />
|
||||
<!-- 客户打卡记录 -->
|
||||
<CustomerPunchLogDrawer ref="customerPunchLogDrawerRef"></CustomerPunchLogDrawer>
|
||||
<CustomerPunchLogDrawer
|
||||
ref="customerPunchLogDrawerRef"
|
||||
></CustomerPunchLogDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -413,7 +433,7 @@ import PhysicalSignsDialog from "@/components/PhysicalSignsDialog";
|
||||
import ContractDrawer from "@/components/ContractDrawer";
|
||||
import HeatStatisticsDrawer from "@/components/HeatStatisticsDrawer";
|
||||
import RecipesPlanDrawer from "@/components/RecipesPlanDrawer";
|
||||
import CustomerPunchLogDrawer from "@/components/PunchLog/CustomerPunchLog";
|
||||
import CustomerPunchLogDrawer from "@/components/PunchLog/CustomerPunchLog";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
@ -424,7 +444,7 @@ export default {
|
||||
"contract-drawer": ContractDrawer,
|
||||
heatStatisticsDrawer: HeatStatisticsDrawer,
|
||||
RecipesPlanDrawer,
|
||||
CustomerPunchLogDrawer
|
||||
CustomerPunchLogDrawer,
|
||||
},
|
||||
data() {
|
||||
const userId = store.getters && store.getters.userId;
|
||||
@ -446,6 +466,8 @@ export default {
|
||||
customerCenterList: [],
|
||||
//
|
||||
fansChannelOptions: [],
|
||||
//
|
||||
accountIdOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@ -493,6 +515,9 @@ export default {
|
||||
fansTime: [
|
||||
{ required: true, message: "进粉时间不能为空", trigger: "blur" },
|
||||
],
|
||||
channelId: [
|
||||
{ required: true, message: "进粉渠道不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
fanPickerOptions: {
|
||||
disabledDate(time) {
|
||||
@ -505,9 +530,26 @@ export default {
|
||||
this.getDicts("customer_fans_channel").then((response) => {
|
||||
this.fansChannelOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_account").then((response) => {
|
||||
if (this.isPartner) {
|
||||
const accRange = this.userRemark.split("|");
|
||||
this.accountIdOptions = accRange.reduce((arr, accId) => {
|
||||
const tarObj = response.data.find((obj) => obj.dictValue === accId);
|
||||
if (tarObj) {
|
||||
arr.push(tarObj);
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
} else {
|
||||
this.accountIdOptions = response.data;
|
||||
}
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
computed: {
|
||||
isPartner() {
|
||||
return this.roles && this.roles.includes("partner");
|
||||
},
|
||||
...mapGetters([
|
||||
// 售前字典
|
||||
"preSaleIdOptions",
|
||||
@ -517,6 +559,10 @@ export default {
|
||||
"nutritionistIdOptions",
|
||||
// 助理营养师字典
|
||||
"nutriAssisIdOptions",
|
||||
//
|
||||
"userRemark",
|
||||
//
|
||||
"roles",
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
@ -554,6 +600,9 @@ export default {
|
||||
fansChannelFormat(row, column) {
|
||||
return this.selectDictLabel(this.fansChannelOptions, row.fansChannel);
|
||||
},
|
||||
channelFormat(row, column) {
|
||||
return this.selectDictLabel(this.accountIdOptions, row.channelId);
|
||||
},
|
||||
handleOnOrderClick(row) {
|
||||
this.$refs["cusOrderDrawerRef"].showDrawer(row);
|
||||
},
|
||||
@ -576,7 +625,7 @@ export default {
|
||||
handleClickCustomerPunchLog(row) {
|
||||
this.$refs["customerPunchLogDrawerRef"].showDrawer(row);
|
||||
},
|
||||
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
|
@ -19,7 +19,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select
|
||||
v-model="queryParams.payTypeId"
|
||||
@ -37,10 +37,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="收款账号" prop="accountId">
|
||||
<el-form-item label="进粉渠道" prop="accountId">
|
||||
<el-select
|
||||
v-model="queryParams.accountId"
|
||||
placeholder="请选择账号"
|
||||
placeholder="请选择渠道"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
@ -70,7 +70,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="销售" prop="preSaleId">
|
||||
<el-select
|
||||
v-model="queryParams.preSaleId"
|
||||
@ -88,7 +88,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select
|
||||
v-model="queryParams.afterSaleId"
|
||||
@ -106,7 +106,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select
|
||||
v-model="queryParams.nutritionistId"
|
||||
@ -124,7 +124,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item
|
||||
label="营养师助理"
|
||||
prop="nutriAssisId"
|
||||
@ -147,7 +147,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select
|
||||
v-model="queryParams.plannerId"
|
||||
@ -165,7 +165,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select
|
||||
v-model="queryParams.plannerAssisId"
|
||||
@ -183,7 +183,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select
|
||||
v-model="queryParams.operatorId"
|
||||
@ -201,7 +201,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="运营助理" prop="operatorAssisId">
|
||||
<el-select
|
||||
v-model="queryParams.operatorAssisId"
|
||||
@ -235,7 +235,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="订单金额" prop="amountFlag">
|
||||
<el-select
|
||||
v-model="queryParams.amountFlag"
|
||||
@ -356,7 +356,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="收款账号"
|
||||
label="进粉渠道"
|
||||
align="center"
|
||||
prop="account"
|
||||
width="90"
|
||||
@ -586,6 +586,9 @@ export default {
|
||||
isMobile() {
|
||||
return this.device === "mobile";
|
||||
},
|
||||
isPartner() {
|
||||
return this.roles && this.roles.includes("partner");
|
||||
},
|
||||
...mapGetters([
|
||||
// 售前字典
|
||||
"preSaleIdOptions",
|
||||
@ -606,6 +609,10 @@ export default {
|
||||
//
|
||||
"userId",
|
||||
//
|
||||
"userRemark",
|
||||
//
|
||||
"roles",
|
||||
//
|
||||
"device",
|
||||
]),
|
||||
},
|
||||
@ -615,7 +622,18 @@ export default {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_account").then((response) => {
|
||||
this.accountIdOptions = response.data;
|
||||
if (this.isPartner) {
|
||||
const accRange = this.userRemark.split("|");
|
||||
this.accountIdOptions = accRange.reduce((arr, accId) => {
|
||||
const tarObj = response.data.find((obj) => obj.dictValue === accId);
|
||||
if (tarObj) {
|
||||
arr.push(tarObj);
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
} else {
|
||||
this.accountIdOptions = response.data;
|
||||
}
|
||||
});
|
||||
this.getDicts("cus_serve_time").then((response) => {
|
||||
this.serveTimeIdOption = response.data;
|
||||
|
@ -19,21 +19,26 @@ export function getProcessMenuData(menuData) {
|
||||
igdList: cur.igdList.reduce((igdArr, igdData) => {
|
||||
if (igdData.id > 0) {
|
||||
const tarDetail = cur.detail.find(obj => obj.id === igdData.id);
|
||||
if (tarDetail) {
|
||||
igdArr.push({
|
||||
id: igdData.id,
|
||||
name: igdData.name,
|
||||
carbonRatio: igdData.carbonRatio,
|
||||
fatRatio: igdData.fatRatio,
|
||||
proteinRatio: igdData.proteinRatio,
|
||||
cusUnit: tarDetail.cus_unit,
|
||||
cusWeight: tarDetail.cus_weight,
|
||||
weight: parseFloat(tarDetail.weight),
|
||||
notRec: igdData.notRec,
|
||||
rec: igdData.rec,
|
||||
type: igdData.type
|
||||
});
|
||||
|
||||
if (tarDetail && tarDetail.weight === -1) {
|
||||
return igdArr;
|
||||
}
|
||||
|
||||
igdArr.push({
|
||||
id: igdData.id,
|
||||
name: igdData.name,
|
||||
carbonRatio: igdData.carbonRatio,
|
||||
fatRatio: igdData.fatRatio,
|
||||
proteinRatio: igdData.proteinRatio,
|
||||
cusUnit: tarDetail ? tarDetail.cus_unit : igdData.cusUnit,
|
||||
cusWeight: tarDetail ? tarDetail.cus_weight : igdData.cusWeight,
|
||||
weight: tarDetail
|
||||
? parseFloat(tarDetail.weight)
|
||||
: parseFloat(igdData.weight),
|
||||
notRec: igdData.notRec,
|
||||
rec: igdData.rec,
|
||||
type: igdData.type
|
||||
});
|
||||
}
|
||||
return igdArr;
|
||||
}, [])
|
||||
|
Loading…
x
Reference in New Issue
Block a user