Merge branch 'develop' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
		| @@ -8,6 +8,7 @@ import java.util.Map; | |||||||
| import java.util.TreeMap; | import java.util.TreeMap; | ||||||
|  |  | ||||||
| import com.stdiet.common.utils.DateUtils; | import com.stdiet.common.utils.DateUtils; | ||||||
|  | import com.stdiet.common.utils.StringUtils; | ||||||
| import com.stdiet.custom.domain.SysCommissionDayDetail; | import com.stdiet.custom.domain.SysCommissionDayDetail; | ||||||
| import com.stdiet.custom.domain.SysOrder; | import com.stdiet.custom.domain.SysOrder; | ||||||
| import com.stdiet.custom.domain.SysOrderCommisionDayDetail; | import com.stdiet.custom.domain.SysOrderCommisionDayDetail; | ||||||
| @@ -169,12 +170,45 @@ public class SysCommisionController extends BaseController { | |||||||
|     public TableDataInfo getDetail(SysCommision sysCommision) { |     public TableDataInfo getDetail(SysCommision sysCommision) { | ||||||
|         startPage(); |         startPage(); | ||||||
|         if(sysCommision.getPostId() != null && sysCommision.getPostId().intValue() > 0){ |         if(sysCommision.getPostId() != null && sysCommision.getPostId().intValue() > 0){ | ||||||
|             //查询售后所有ID |             String postCodeId = ""; | ||||||
|             SysCommision param = new SysCommision(); |             switch (sysCommision.getPostId().intValue()){ | ||||||
|             param.setPostId(sysCommision.getPostId()); |                 case 5: | ||||||
|             List<Long> userIds = sysCommisionService.getAfterSaleId(param); |                     postCodeId = "pre_sale_id"; | ||||||
|             sysCommision.setUserIds(userIds.size() == 0 ? null : userIds); |                     break; | ||||||
|  |                 case 18: | ||||||
|  |                     postCodeId = "push_pre_sale_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 16: | ||||||
|  |                     postCodeId = "on_sale_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 6: | ||||||
|  |                     postCodeId = "after_sale_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 9: | ||||||
|  |                     postCodeId = "nutritionist_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 10: | ||||||
|  |                     postCodeId = "nutri_assis_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 11: | ||||||
|  |                     postCodeId = "operator_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 13: | ||||||
|  |                     postCodeId = "operator_assis_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 7: | ||||||
|  |                     postCodeId = "planner_id"; | ||||||
|  |                     break; | ||||||
|  |                 case 8: | ||||||
|  |                     postCodeId = "planner_assis_id"; | ||||||
|  |                     break; | ||||||
|  |                 default: | ||||||
|  |             } | ||||||
|  |             if(StringUtils.isEmpty(postCodeId)){ | ||||||
|                 sysCommision.setPostId(null); |                 sysCommision.setPostId(null); | ||||||
|  |             }else{ | ||||||
|  |                 sysCommision.setPostCode(postCodeId); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|         List<SysCommision> list = sysCommisionService.selectSysCommisionDetail(sysCommision); |         List<SysCommision> list = sysCommisionService.selectSysCommisionDetail(sysCommision); | ||||||
|         for (SysCommision detail : list) { |         for (SysCommision detail : list) { | ||||||
|   | |||||||
| @@ -154,12 +154,12 @@ public class SysImportFanRecordController extends BaseController | |||||||
|      */ |      */ | ||||||
|     @PreAuthorize("@ss.hasPermi('custom:importFanRecord:add')") |     @PreAuthorize("@ss.hasPermi('custom:importFanRecord:add')") | ||||||
|     @GetMapping(value = "/getWxAccountAndSale") |     @GetMapping(value = "/getWxAccountAndSale") | ||||||
|     public AjaxResult getWxAccountAndSale(SysImportFanWxAccount sysImportFanWxAccount){ |     public AjaxResult getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount){ | ||||||
|         Map<String, Object> result = new HashMap<>(); |         Map<String, Object> result = new HashMap<>(); | ||||||
|         List<SysWxSaleAccount> list = sysWxSaleAccountService.getWxAccountAndSale(); |         List<SysWxSaleAccount> list = sysWxSaleAccountService.getWxAccountAndSale(sysWxSaleAccount); | ||||||
|         List<Map<String,Object>> fanNumList = sysImportFanWxAccountService.getTotalImportFanNum(sysImportFanWxAccount); |         //List<Map<String,Object>> fanNumList = sysImportFanWxAccountService.getTotalImportFanNum(sysImportFanWxAccount); | ||||||
|         result.put("wxSaleAccountList", list); |         result.put("wxSaleAccountList", list); | ||||||
|         result.put("fanNumList", fanNumList); |         //result.put("fanNumList", fanNumList); | ||||||
|         return AjaxResult.success(result); |         return AjaxResult.success(result); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -162,6 +162,9 @@ public class SysOrderController extends OrderBaseController { | |||||||
|             if (user.getUserId().equals(order.getOperatorAssisId())) { |             if (user.getUserId().equals(order.getOperatorAssisId())) { | ||||||
|                 order.setOperatorAssis(user.getNickName()); |                 order.setOperatorAssis(user.getNickName()); | ||||||
|             } |             } | ||||||
|  |             if (user.getUserId().equals(order.getPushPreSaleId())) { | ||||||
|  |                 order.setPushPreSale(user.getNickName()); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|         order.setOrderTypeName(OrderUtils.getOrderTypeName(order)); |         order.setOrderTypeName(OrderUtils.getOrderTypeName(order)); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -38,6 +38,11 @@ public class SysCommision extends BaseEntity { | |||||||
|      */ |      */ | ||||||
|     private Long postId; |     private Long postId; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 岗位编码code | ||||||
|  |      */ | ||||||
|  |     private String postCode; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 业务员 |      * 业务员 | ||||||
|      */ |      */ | ||||||
|   | |||||||
| @@ -39,4 +39,7 @@ public class SysImportFanWxAccount extends BaseEntity | |||||||
|     //导粉日期 |     //导粉日期 | ||||||
|     @JsonFormat(pattern = "yyyy-MM-dd") |     @JsonFormat(pattern = "yyyy-MM-dd") | ||||||
|     private Date importFanDate; |     private Date importFanDate; | ||||||
|  |  | ||||||
|  |     //售前 | ||||||
|  |     private Long preSaleId; | ||||||
| } | } | ||||||
| @@ -84,6 +84,17 @@ public class SysOrder extends BaseEntity { | |||||||
|     @Excel(name = "售前") |     @Excel(name = "售前") | ||||||
|     private String preSale; |     private String preSale; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 售前推送人(售中一开单才存在) | ||||||
|  |      */ | ||||||
|  |     //@Excel(name = "售前推送人") | ||||||
|  |     private Long pushPreSaleId; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 售前推送人(售中一开单才存在) | ||||||
|  |      */ | ||||||
|  |     private String pushPreSale; | ||||||
|  |  | ||||||
|     /** 售中ID */ |     /** 售中ID */ | ||||||
|     private Long onSaleId; |     private Long onSaleId; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -45,6 +45,12 @@ public class SysWxSaleAccount extends BaseEntity | |||||||
|  |  | ||||||
|     private Integer useCount; |     private Integer useCount; | ||||||
|  |  | ||||||
|  |     //进粉渠道 | ||||||
|  |     private Integer channel; | ||||||
|  |  | ||||||
|  |     //销售ID | ||||||
|  |     private Long saleId; | ||||||
|  |  | ||||||
|     //销售昵称 |     //销售昵称 | ||||||
|     private String saleName; |     private String saleName; | ||||||
| } | } | ||||||
| @@ -76,5 +76,5 @@ public interface SysWxSaleAccountMapper | |||||||
|      * 获取可接粉的微信号以及分配的销售昵称 |      * 获取可接粉的微信号以及分配的销售昵称 | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     List<SysWxSaleAccount> getWxAccountAndSale(); |     List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount); | ||||||
| } | } | ||||||
| @@ -70,4 +70,11 @@ public interface SysWxUserInfoMapper | |||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     public SysWxUserInfo getSysWxUserInfoByPhone(@Param("phone")String phone); |     public SysWxUserInfo getSysWxUserInfoByPhone(@Param("phone")String phone); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 根据openid移除对应绑定的cusId | ||||||
|  |      * @param openid | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public int removeCusIdByOpenId(@Param("openid")String openid); | ||||||
| } | } | ||||||
| @@ -77,5 +77,5 @@ public interface ISysWxSaleAccountService | |||||||
|      * 获取可接粉的微信号以及分配的销售昵称 |      * 获取可接粉的微信号以及分配的销售昵称 | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     List<SysWxSaleAccount> getWxAccountAndSale(); |     List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount); | ||||||
| } | } | ||||||
| @@ -70,5 +70,12 @@ public interface ISysWxUserInfoService | |||||||
|      */ |      */ | ||||||
|     public SysWxUserInfo getSysWxUserInfoByPhone(String phone); |     public SysWxUserInfo getSysWxUserInfoByPhone(String phone); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 根据openid移除对应绑定的cusId | ||||||
|  |      * @param openid | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public int removeCusIdByOpenId(String openid); | ||||||
|  |  | ||||||
|  |  | ||||||
| } | } | ||||||
| @@ -198,11 +198,33 @@ public class SysCustomerServiceImpl implements ISysCustomerService { | |||||||
|         if(newCustomer == null || newCustomer.getId() == null || StringUtils.isEmpty(newCustomer.getPhone())){ |         if(newCustomer == null || newCustomer.getId() == null || StringUtils.isEmpty(newCustomer.getPhone())){ | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |         //先根据cusId查询是否已经绑定过微信用户 | ||||||
|  |         SysWxUserInfo cusIdWxUserInfo = sysWxUserInfoService.selectSysWxUserInfoByCusId(newCustomer.getId()); | ||||||
|         //根据手机号查询微信用户记录 |         //根据手机号查询微信用户记录 | ||||||
|         SysWxUserInfo wxUserInfo = sysWxUserInfoService.getSysWxUserInfoByPhone(newCustomer.getPhone()); |         SysWxUserInfo phoneWxUserInfo = sysWxUserInfoService.getSysWxUserInfoByPhone(newCustomer.getPhone()); | ||||||
|         if(wxUserInfo != null && (wxUserInfo.getCusId() == null || wxUserInfo.getCusId().longValue() != newCustomer.getId())){ |         if(cusIdWxUserInfo != null) { | ||||||
|             wxUserInfo.setCusId(newCustomer.getId()); |             if(phoneWxUserInfo != null){ | ||||||
|             sysWxUserInfoService.updateSysWxUserInfo(wxUserInfo); |                 if(!cusIdWxUserInfo.getOpenid().equals(phoneWxUserInfo.getOpenid())){ | ||||||
|  |                     //解绑之前记录 | ||||||
|  |                     sysWxUserInfoService.removeCusIdByOpenId(cusIdWxUserInfo.getOpenid()); | ||||||
|  |                     //更新 | ||||||
|  |                     SysWxUserInfo param = new SysWxUserInfo(); | ||||||
|  |                     param.setOpenid(phoneWxUserInfo.getOpenid()); | ||||||
|  |                     param.setCusId(newCustomer.getId()); | ||||||
|  |                     sysWxUserInfoService.updateSysWxUserInfo(param); | ||||||
|  |                 } | ||||||
|  |             }else{ | ||||||
|  |                 //解绑之前记录 | ||||||
|  |                 sysWxUserInfoService.removeCusIdByOpenId(cusIdWxUserInfo.getOpenid()); | ||||||
|  |             } | ||||||
|  |         }else{ | ||||||
|  |             if(phoneWxUserInfo != null){ | ||||||
|  |                 //更新 | ||||||
|  |                 SysWxUserInfo param = new SysWxUserInfo(); | ||||||
|  |                 param.setOpenid(phoneWxUserInfo.getOpenid()); | ||||||
|  |                 param.setCusId(newCustomer.getId()); | ||||||
|  |                 sysWxUserInfoService.updateSysWxUserInfo(param); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -105,7 +105,7 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|                 row = sysOrderMapper.insertSysOrder(sysOrder); |                 row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
|                 //需要自动创建售后二开提成单 |                 //需要自动创建售后二开提成单 | ||||||
|                 if(row > 0 && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ |                 if(row > 0 && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ | ||||||
|                     autoCreateSecondAfterSaleOrder(sysOrder); |                     row = autoCreateSecondAfterSaleOrder(sysOrder); | ||||||
|                 } |                 } | ||||||
|             }else{ |             }else{ | ||||||
|                 row = sysOrderMapper.insertSysOrder(sysOrder); |                 row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
| @@ -143,7 +143,7 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|             //二开,是否需要自动创建售后二开提成单 |             //二开,是否需要自动创建售后二开提成单 | ||||||
|             if(row > 0 && "1".equals(sysOrder.getOrderCountType()) && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ |             if(row > 0 && "1".equals(sysOrder.getOrderCountType()) && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ | ||||||
|                 sysOrder.setAmount(amount); |                 sysOrder.setAmount(amount); | ||||||
|                 autoCreateSecondAfterSaleOrder(sysOrder); |                 row = autoCreateSecondAfterSaleOrder(sysOrder); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         //体验单 |         //体验单 | ||||||
| @@ -155,6 +155,64 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|             sysOrder.setNutriAssisId(null); |             sysOrder.setNutriAssisId(null); | ||||||
|             row = sysOrderMapper.insertSysOrder(sysOrder); |             row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
|         } |         } | ||||||
|  |         //售中单 | ||||||
|  |         else if("3".equals(sysOrder.getOrderType())){ | ||||||
|  |             sysOrder.setPreSaleId(null); | ||||||
|  |             //一开、二开 | ||||||
|  |            if("0".equals(sysOrder.getOrderCountType()) || "1".equals(sysOrder.getOrderCountType())){ | ||||||
|  |                 sysOrder.setNutritionistId((sysOrder.getNutritionistIdList() != null && sysOrder.getNutritionistIdList().length > 0) ? sysOrder.getNutritionistIdList()[0] : null); | ||||||
|  |                 sysOrder.setMainOrderId(0L); | ||||||
|  |                 sysOrder.setAfterSaleCommissOrder(0); | ||||||
|  |                 if("0".equals(sysOrder.getOrderCountType())){ | ||||||
|  |                     row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
|  |                 }else{ | ||||||
|  |                     //二开单不存在售前推荐人 | ||||||
|  |                     sysOrder.setPushPreSaleId(null); | ||||||
|  |                     row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
|  |                     //需要自动创建售后二开提成单 | ||||||
|  |                     if(row > 0 && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ | ||||||
|  |                         row = autoCreateSecondAfterSaleOrder(sysOrder); | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |            }else{ | ||||||
|  |                sysOrder.setAfterSaleCommissOrder(0); | ||||||
|  |                String rate = sysOrder.getNutritionistRate(); | ||||||
|  |                if(StringUtils.isEmpty(rate) || rate.indexOf(",") == -1 || "0,10".equals(rate) || sysOrder.getNutritionistIdList().length != 2){ | ||||||
|  |                    return 0; | ||||||
|  |                } | ||||||
|  |                String[] rateArray = rate.split(","); | ||||||
|  |                if(Integer.parseInt(rateArray[0]) + Integer.parseInt(rateArray[1]) != 10){ | ||||||
|  |                    return 0; | ||||||
|  |                } | ||||||
|  |                BigDecimal amount = sysOrder.getAmount(); | ||||||
|  |                //获取主单的数组下标 | ||||||
|  |                int mainIndex = 0; | ||||||
|  |                if(Integer.parseInt(rateArray[1]) > Integer.parseInt(rateArray[0])){ | ||||||
|  |                    mainIndex = 1; | ||||||
|  |                } | ||||||
|  |                //添加主单 | ||||||
|  |                sysOrder.setNutritionistId(sysOrder.getNutritionistIdList()[mainIndex]); | ||||||
|  |                sysOrder.setAmount(BigDecimal.valueOf(amount.doubleValue()*Integer.parseInt(rateArray[mainIndex])/10)); | ||||||
|  |                sysOrder.setMainOrderId(0L); | ||||||
|  |                //拆分二开单 | ||||||
|  |                if("3".equals(sysOrder.getOrderCountType())){ | ||||||
|  |                    //二开单不存在售前推荐人 | ||||||
|  |                    sysOrder.setPushPreSaleId(null); | ||||||
|  |                } | ||||||
|  |                row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
|  |                //添加副单 | ||||||
|  |                sysOrder.setMainOrderId(sysOrder.getOrderId()); | ||||||
|  |                sysOrder.setOrderId(sysOrder.getOrderId()+1); | ||||||
|  |                sysOrder.setNutritionistId(sysOrder.getNutritionistIdList()[1-mainIndex]); | ||||||
|  |                sysOrder.setAmount(BigDecimal.valueOf(amount.doubleValue()*Integer.parseInt(rateArray[1-mainIndex])/10)); | ||||||
|  |                row = sysOrderMapper.insertSysOrder(sysOrder); | ||||||
|  |                //拆分二开单 | ||||||
|  |                if(row > 0 && "3".equals(sysOrder.getOrderCountType()) && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ | ||||||
|  |                    sysOrder.setAmount(amount); | ||||||
|  |                    row = autoCreateSecondAfterSaleOrder(sysOrder); | ||||||
|  |                } | ||||||
|  |            } | ||||||
|  |         } | ||||||
|         return row; |         return row; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -166,6 +224,8 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|     private int autoCreateSecondAfterSaleOrder(SysOrder sysOrder){ |     private int autoCreateSecondAfterSaleOrder(SysOrder sysOrder){ | ||||||
|         if(sysOrder != null){ |         if(sysOrder != null){ | ||||||
|             sysOrder.setPreSaleId(sysOrder.getAfterSaleId()); |             sysOrder.setPreSaleId(sysOrder.getAfterSaleId()); | ||||||
|  |             sysOrder.setOnSaleId(null); | ||||||
|  |             sysOrder.setPushPreSaleId(null); | ||||||
|             sysOrder.setAfterSaleId(null); |             sysOrder.setAfterSaleId(null); | ||||||
|             sysOrder.setNutritionistId(null); |             sysOrder.setNutritionistId(null); | ||||||
|             sysOrder.setNutriAssisId(null); |             sysOrder.setNutriAssisId(null); | ||||||
| @@ -173,6 +233,7 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|             sysOrder.setPlannerAssisId(null); |             sysOrder.setPlannerAssisId(null); | ||||||
|             sysOrder.setOperatorId(null); |             sysOrder.setOperatorId(null); | ||||||
|             sysOrder.setOperatorAssisId(null); |             sysOrder.setOperatorAssisId(null); | ||||||
|  |             sysOrder.setMainOrderId(0L); | ||||||
|             sysOrder.setAfterSaleCommissOrder(1); |             sysOrder.setAfterSaleCommissOrder(1); | ||||||
|             sysOrder.setOrderId(sysOrder.getOrderId()+1); |             sysOrder.setOrderId(sysOrder.getOrderId()+1); | ||||||
|             return sysOrderMapper.insertSysOrder(sysOrder); |             return sysOrderMapper.insertSysOrder(sysOrder); | ||||||
| @@ -208,6 +269,9 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|             sysOrder.setOperatorId(null); |             sysOrder.setOperatorId(null); | ||||||
|             sysOrder.setOperatorAssisId(null); |             sysOrder.setOperatorAssisId(null); | ||||||
|         } |         } | ||||||
|  |         if("3".equals(sysOrder.getOrderType())){ | ||||||
|  |             sysOrder.setPreSaleId(null); | ||||||
|  |         } | ||||||
|         if(oldSysOrder.getStartTime() == null){//确保提成计算时间不为空 |         if(oldSysOrder.getStartTime() == null){//确保提成计算时间不为空 | ||||||
|             sysOrder.setCommissStartTime(sysOrder.getOrderTime()); |             sysOrder.setCommissStartTime(sysOrder.getOrderTime()); | ||||||
|         } |         } | ||||||
| @@ -313,7 +377,7 @@ public class SysOrderServiceImpl implements ISysOrderService { | |||||||
|             for (SysOrder sysOrder : orderList) { |             for (SysOrder sysOrder : orderList) { | ||||||
|                 LocalDate newStartTime = null; |                 LocalDate newStartTime = null; | ||||||
|                 //判断是否提成单,拆分单中的副单,体验单,定金单 |                 //判断是否提成单,拆分单中的副单,体验单,定金单 | ||||||
|                 if(sysOrder.getStartTime() == null || sysOrder.getAfterSaleCommissOrder().intValue() == 1 || ("1".equals(sysOrder.getOrderType()) && sysOrder.getMainOrderId().intValue() != 0) || |                 if(sysOrder.getStartTime() == null || sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 || | ||||||
|                         "2".equals(sysOrder.getOrderType()) || "1".equals(sysOrder.getOrderMoneyType())){ |                         "2".equals(sysOrder.getOrderType()) || "1".equals(sysOrder.getOrderMoneyType())){ | ||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
|   | |||||||
| @@ -170,7 +170,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService { | |||||||
|                             continue; |                             continue; | ||||||
|                         } |                         } | ||||||
|                         //判断是否提成单,拆分单中的副单,体验单,定金单 |                         //判断是否提成单,拆分单中的副单,体验单,定金单 | ||||||
|                         if (sysOrder.getAfterSaleCommissOrder().intValue() == 1 || ("1".equals(sysOrder.getOrderType()) && sysOrder.getMainOrderId().intValue() != 0) || |                         if (sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 || | ||||||
| //                                "2".equals(sysOrder.getOrderType()) || // 体验单也需要生成计划 2021.05.29 | //                                "2".equals(sysOrder.getOrderType()) || // 体验单也需要生成计划 2021.05.29 | ||||||
|                                 "1".equals(sysOrder.getOrderMoneyType()) || sysOrder.getCounted() == 1) { |                                 "1".equals(sysOrder.getOrderMoneyType()) || sysOrder.getCounted() == 1) { | ||||||
|                             System.out.println("---------------------" + sysOrder.getOrderId() + "不生成食谱------------------------"); |                             System.out.println("---------------------" + sysOrder.getOrderId() + "不生成食谱------------------------"); | ||||||
|   | |||||||
| @@ -136,7 +136,7 @@ public class SysWxSaleAccountServiceImpl implements ISysWxSaleAccountService { | |||||||
|      * @param sysWxSaleAccount |      * @param sysWxSaleAccount | ||||||
|      * @return |      * @return | ||||||
|      */ |      */ | ||||||
|     public List<SysWxSaleAccount> getWxAccountAndSale(){ |     public List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount){ | ||||||
|         return sysWxSaleAccountMapper.getWxAccountAndSale(); |         return sysWxSaleAccountMapper.getWxAccountAndSale(sysWxSaleAccount); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -106,4 +106,13 @@ public class SysWxUserInfoServiceImpl implements ISysWxUserInfoService { | |||||||
|     public SysWxUserInfo getSysWxUserInfoByPhone(String phone){ |     public SysWxUserInfo getSysWxUserInfoByPhone(String phone){ | ||||||
|         return sysWxUserInfoMapper.getSysWxUserInfoByPhone(phone); |         return sysWxUserInfoMapper.getSysWxUserInfoByPhone(phone); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 根据openid移除对应绑定的cusId | ||||||
|  |      * @param openid | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public int removeCusIdByOpenId(String openid){ | ||||||
|  |         return sysWxUserInfoMapper.removeCusIdByOpenId(openid); | ||||||
|  |     } | ||||||
| } | } | ||||||
| @@ -4,9 +4,9 @@ import com.stdiet.custom.domain.SysOrder; | |||||||
|  |  | ||||||
| public class OrderUtils { | public class OrderUtils { | ||||||
|  |  | ||||||
|     private static final String[] orderTypeArray = {"普通单","比例拆分单","体验单"}; |     private static final String[] orderTypeArray = {"普通单","比例拆分单","体验单","售中单"}; | ||||||
|  |  | ||||||
|     private static final String[] orderCountTypeArray = {"一开单","二开单"}; |     private static final String[] orderCountTypeArray = {"一开单","二开单","一开单(拆分)","二开单(拆分)"}; | ||||||
|  |  | ||||||
|     private static final String[] orderMoneyTypeArray = {"全款单","定金单","尾款单"}; |     private static final String[] orderMoneyTypeArray = {"全款单","定金单","尾款单"}; | ||||||
|  |  | ||||||
| @@ -27,7 +27,7 @@ public class OrderUtils { | |||||||
|         orderTypeName += "/"+orderCountTypeArray[Integer.parseInt(sysOrder.getOrderCountType())]; |         orderTypeName += "/"+orderCountTypeArray[Integer.parseInt(sysOrder.getOrderCountType())]; | ||||||
|         orderTypeName += "/"+orderMoneyTypeArray[Integer.parseInt(sysOrder.getOrderMoneyType())]; |         orderTypeName += "/"+orderMoneyTypeArray[Integer.parseInt(sysOrder.getOrderMoneyType())]; | ||||||
|         //判断是不是二开提成单 |         //判断是不是二开提成单 | ||||||
|         if("1".equals(sysOrder.getOrderCountType()) && sysOrder.getAfterSaleCommissOrder().intValue() == 1){ |         if(sysOrder.getAfterSaleCommissOrder() != null && sysOrder.getAfterSaleCommissOrder().intValue() == 1){ | ||||||
|             orderTypeName += "/提成单"; |             orderTypeName += "/提成单"; | ||||||
|         } |         } | ||||||
|         return orderTypeName; |         return orderTypeName; | ||||||
|   | |||||||
| @@ -42,12 +42,17 @@ | |||||||
|         <if test="endTime != null and endTime != ''">AND date_format(order_time,'%y%m%d') <= |         <if test="endTime != null and endTime != ''">AND date_format(order_time,'%y%m%d') <= | ||||||
|             date_format(${endTime},'%y%m%d') |             date_format(${endTime},'%y%m%d') | ||||||
|         </if> |         </if> | ||||||
|  |         <!-- 因为体验单、售中单都存在售中,所以售中的提成金额只计算售中单的,不计算体验单 --> | ||||||
|  |         <if test="postCode != null and postCode == 'on_sale_id'"> | ||||||
|  |             and order_type = 3 | ||||||
|  |         </if> | ||||||
|         GROUP BY ${column} |         GROUP BY ${column} | ||||||
|     </sql> |     </sql> | ||||||
|  |  | ||||||
|     <select id="selectSysCommisionDetail" parameterType="SysCommision" resultMap="SysCommisionResult"> |     <select id="selectSysCommisionDetail" parameterType="SysCommision" resultMap="SysCommisionResult"> | ||||||
|         SELECT * FROM view_user_post pa |         SELECT * FROM view_user_post pa | ||||||
|         JOIN ( |         JOIN ( | ||||||
|  |         <if test="postId == null or postId == 0"> | ||||||
|         <include refid="groupAmountVo"> |         <include refid="groupAmountVo"> | ||||||
|             <property name="column" value="pre_sale_id"/> |             <property name="column" value="pre_sale_id"/> | ||||||
|             <property name="reviewStatus" value="#{reviewStatus}"/> |             <property name="reviewStatus" value="#{reviewStatus}"/> | ||||||
| @@ -56,6 +61,22 @@ | |||||||
|             <property name="postId" value="5"/> |             <property name="postId" value="5"/> | ||||||
|         </include> |         </include> | ||||||
|         UNION |         UNION | ||||||
|  |         <include refid="groupAmountVo"> | ||||||
|  |             <property name="column" value="push_pre_sale_id"/> | ||||||
|  |             <property name="reviewStatus" value="#{reviewStatus}"/> | ||||||
|  |             <property name="beginTime" value="#{beginTime}"/> | ||||||
|  |             <property name="endTime" value="#{endTime}"/> | ||||||
|  |             <property name="postId" value="18"/> | ||||||
|  |         </include> | ||||||
|  |         UNION | ||||||
|  |         <include refid="groupAmountVo"> | ||||||
|  |             <property name="column" value="on_sale_id"/> | ||||||
|  |             <property name="reviewStatus" value="#{reviewStatus}"/> | ||||||
|  |             <property name="beginTime" value="#{beginTime}"/> | ||||||
|  |             <property name="endTime" value="#{endTime}"/> | ||||||
|  |             <property name="postId" value="16"/> | ||||||
|  |         </include> | ||||||
|  |         UNION | ||||||
|         <include refid="groupAmountVo"> |         <include refid="groupAmountVo"> | ||||||
|             <property name="column" value="after_sale_id"/> |             <property name="column" value="after_sale_id"/> | ||||||
|             <property name="reviewStatus" value="#{reviewStatus}"/> |             <property name="reviewStatus" value="#{reviewStatus}"/> | ||||||
| @@ -111,9 +132,19 @@ | |||||||
|             <property name="endTime" value="#{endTime}"/> |             <property name="endTime" value="#{endTime}"/> | ||||||
|             <property name="postId" value="8"/> |             <property name="postId" value="8"/> | ||||||
|         </include> |         </include> | ||||||
|  |         </if> | ||||||
|  |         <if test="postId != null and postId > 0"> | ||||||
|  |             <include refid="groupAmountVo"> | ||||||
|  |                 <property name="column" value="${postCode}"/> | ||||||
|  |                 <property name="reviewStatus" value="#{reviewStatus}"/> | ||||||
|  |                 <property name="beginTime" value="#{beginTime}"/> | ||||||
|  |                 <property name="endTime" value="#{endTime}"/> | ||||||
|  |                 <property name="postId" value="${postId}"/> | ||||||
|  |             </include> | ||||||
|  |         </if> | ||||||
|         ) AS a USING(user_id, post_id) |         ) AS a USING(user_id, post_id) | ||||||
|         <where> |         <where> | ||||||
|             <if test="postId != null and postId != ''">and post_id = #{postId}</if> |             <!--<if test="postId != null and postId != ''">and post_id = #{postId}</if>--> | ||||||
|             <if test="userId != null and userId != ''">and user_id = #{userId}</if> |             <if test="userId != null and userId != ''">and user_id = #{userId}</if> | ||||||
|             <if test="userIds != null"> |             <if test="userIds != null"> | ||||||
|                 and user_id in |                 and user_id in | ||||||
| @@ -122,6 +153,7 @@ | |||||||
|                 </foreach> |                 </foreach> | ||||||
|             </if> |             </if> | ||||||
|         </where> |         </where> | ||||||
|  |         order by user_id asc | ||||||
|     </select> |     </select> | ||||||
|  |  | ||||||
|     <sql id="selectSysCommisionVo"> |     <sql id="selectSysCommisionVo"> | ||||||
|   | |||||||
| @@ -41,6 +41,7 @@ | |||||||
|         <result property="serverEndTime" column="server_end_time"/> |         <result property="serverEndTime" column="server_end_time"/> | ||||||
|         <result property="becomeFanTime" column="become_fan_time"/> |         <result property="becomeFanTime" column="become_fan_time"/> | ||||||
|  |  | ||||||
|  |         <result property="pushPreSaleId"    column="push_pre_sale_id"    /> | ||||||
|         <result property="onSaleId" column="on_sale_id"/> |         <result property="onSaleId" column="on_sale_id"/> | ||||||
|         <result property="orderType" column="order_type"/> |         <result property="orderType" column="order_type"/> | ||||||
|         <result property="orderCountType" column="order_count_type"/> |         <result property="orderCountType" column="order_count_type"/> | ||||||
| @@ -63,7 +64,7 @@ | |||||||
|         o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time, |         o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time, | ||||||
|         o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id, |         o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id, | ||||||
|         o.recommender, o.order_time,o.give_serve_day,o.conditioning_project_id,cp.dict_label as conditioning_project,o.server_end_time, |         o.recommender, o.order_time,o.give_serve_day,o.conditioning_project_id,cp.dict_label as conditioning_project,o.server_end_time, | ||||||
|         o.on_sale_id,o.order_type,o.order_count_type,o.order_money_type,o.main_order_id,o.after_sale_commiss_order,o.commiss_start_time, o.counted |         o.on_sale_id,o.order_type,o.order_count_type,o.order_money_type,o.main_order_id,o.after_sale_commiss_order,o.commiss_start_time, o.counted,o.push_pre_sale_id | ||||||
|         from sys_order o |         from sys_order o | ||||||
|         LEFT JOIN sys_customer sc ON sc.id = o.cus_id |         LEFT JOIN sys_customer sc ON sc.id = o.cus_id | ||||||
|         LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id |         LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id | ||||||
| @@ -227,6 +228,7 @@ | |||||||
|             <if test="operatorId != null">operator_id,</if> |             <if test="operatorId != null">operator_id,</if> | ||||||
|             <if test="serveTimeId != null">serve_time_id,</if> |             <if test="serveTimeId != null">serve_time_id,</if> | ||||||
|             <if test="recommender != null">recommender,</if> |             <if test="recommender != null">recommender,</if> | ||||||
|  |             <if test="pushPreSaleId != null">push_pre_sale_id,</if> | ||||||
|             <if test="amount != null">amount,</if> |             <if test="amount != null">amount,</if> | ||||||
|             <if test="orderTime != null">order_time,</if> |             <if test="orderTime != null">order_time,</if> | ||||||
|             <if test="createBy != null">create_by,</if> |             <if test="createBy != null">create_by,</if> | ||||||
| @@ -270,6 +272,7 @@ | |||||||
|             <if test="operatorId != null">#{operatorId},</if> |             <if test="operatorId != null">#{operatorId},</if> | ||||||
|             <if test="serveTimeId != null">#{serveTimeId},</if> |             <if test="serveTimeId != null">#{serveTimeId},</if> | ||||||
|             <if test="recommender != null">#{recommender},</if> |             <if test="recommender != null">#{recommender},</if> | ||||||
|  |             <if test="pushPreSaleId != null">#{pushPreSaleId},</if> | ||||||
|             <if test="amount != null">#{amount},</if> |             <if test="amount != null">#{amount},</if> | ||||||
|             <if test="orderTime != null">#{orderTime},</if> |             <if test="orderTime != null">#{orderTime},</if> | ||||||
|             <if test="createBy != null">#{createBy},</if> |             <if test="createBy != null">#{createBy},</if> | ||||||
| @@ -316,6 +319,7 @@ | |||||||
|             <if test="operatorId != null">operator_id = #{operatorId},</if> |             <if test="operatorId != null">operator_id = #{operatorId},</if> | ||||||
|             <if test="serveTimeId != null">serve_time_id = #{serveTimeId},</if> |             <if test="serveTimeId != null">serve_time_id = #{serveTimeId},</if> | ||||||
|             <if test="recommender != null">recommender = #{recommender},</if> |             <if test="recommender != null">recommender = #{recommender},</if> | ||||||
|  |             <if test="pushPreSaleId != null">push_pre_sale_id = #{pushPreSaleId},</if> | ||||||
|             <if test="amount != null">amount = #{amount},</if> |             <if test="amount != null">amount = #{amount},</if> | ||||||
|             <if test="orderTime != null">order_time = #{orderTime},</if> |             <if test="orderTime != null">order_time = #{orderTime},</if> | ||||||
|             <if test="createBy != null">create_by = #{createBy},</if> |             <if test="createBy != null">create_by = #{createBy},</if> | ||||||
| @@ -387,6 +391,7 @@ | |||||||
|         <result property="serverEndTime" column="server_end_time"/> |         <result property="serverEndTime" column="server_end_time"/> | ||||||
|         <result property="becomeFanTime" column="become_fan_time"/> |         <result property="becomeFanTime" column="become_fan_time"/> | ||||||
|  |  | ||||||
|  |         <result property="pushPreSaleId"    column="push_pre_sale_id"    /> | ||||||
|         <result property="onSaleId" column="on_sale_id"/> |         <result property="onSaleId" column="on_sale_id"/> | ||||||
|         <result property="orderType" column="order_type"/> |         <result property="orderType" column="order_type"/> | ||||||
|         <result property="orderCountType" column="order_count_type"/> |         <result property="orderCountType" column="order_count_type"/> | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ | |||||||
|       FROM sys_wx_distribution AS swd |       FROM sys_wx_distribution AS swd | ||||||
|       lEFT JOIN sys_wx_sale_account swsa ON swsa.id = swd.wechat_account and swsa.del_flag = 0 |       lEFT JOIN sys_wx_sale_account swsa ON swsa.id = swd.wechat_account and swsa.del_flag = 0 | ||||||
|       LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0 |       LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0 | ||||||
|       LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'fan_channel') AS acc ON acc.dict_value = swd.account_id |       LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = swd.account_id | ||||||
|       LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'sale_group') AS asg ON asg.dict_value = swd.sale_group_id |       LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'sale_group') AS asg ON asg.dict_value = swd.sale_group_id | ||||||
|       where swd.del_flag = 0 |       where swd.del_flag = 0 | ||||||
|     </sql> |     </sql> | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ | |||||||
|          left join sys_wx_sale_account swsa on swsa.id = swfs.wx_id and swsa.del_flag = 0 |          left join sys_wx_sale_account swsa on swsa.id = swfs.wx_id and swsa.del_flag = 0 | ||||||
|          left join sys_wx_distribution swd on swd.wechat_account = swfs.wx_id and swd.del_flag = 0 |          left join sys_wx_distribution swd on swd.wechat_account = swfs.wx_id and swd.del_flag = 0 | ||||||
|          left join sys_user su on su.user_id = swd.user_id and su.del_flag = 0 |          left join sys_user su on su.user_id = swd.user_id and su.del_flag = 0 | ||||||
|          LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'fan_channel') AS acc ON acc.dict_value = swd.account_id |          LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = swd.account_id | ||||||
|          LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'sale_group') AS asg ON asg.dict_value = swd.sale_group_id |          LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'sale_group') AS asg ON asg.dict_value = swd.sale_group_id | ||||||
|     </sql> |     </sql> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -145,6 +145,15 @@ | |||||||
|         left join sys_wx_distribution swd on wa.id = swd.wechat_account and swd.del_flag = 0 |         left join sys_wx_distribution swd on wa.id = swd.wechat_account and swd.del_flag = 0 | ||||||
|         LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0 |         LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0 | ||||||
|         where wa.del_flag = 0 and wa.status = 0 |         where wa.del_flag = 0 and wa.status = 0 | ||||||
|  |         <if test="saleId != null"> | ||||||
|  |            and swd.user_id = #{saleId} | ||||||
|  |         </if> | ||||||
|  |         <if test="wxAccount != null and wxAccount != ''"> | ||||||
|  |             and wa.wx_account like concat('%',#{wxAccount},'%') | ||||||
|  |         </if> | ||||||
|  |         <if test="channel != null"> | ||||||
|  |             and swd.account_id = #{channel} | ||||||
|  |         </if> | ||||||
|         order by su.user_id asc |         order by su.user_id asc | ||||||
|     </select> |     </select> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -135,4 +135,9 @@ | |||||||
|         where phone = #{phone} order by create_time desc limit 1 |         where phone = #{phone} order by create_time desc limit 1 | ||||||
|     </select> |     </select> | ||||||
|  |  | ||||||
|  |     <!-- 根据openid移除绑定的cusId --> | ||||||
|  |     <update id="removeCusIdByOpenId" parameterType="String"> | ||||||
|  |         update sys_wx_user_info set cus_id = null where openid = #{openid} | ||||||
|  |     </update> | ||||||
|  |  | ||||||
| </mapper> | </mapper> | ||||||
| @@ -1,15 +1,56 @@ | |||||||
| <template> | <template> | ||||||
|     <!--  --> |     <!--  --> | ||||||
|     <!-- 添加或修改导粉管理对话框 --> |     <!-- 添加或修改导粉管理对话框 --> | ||||||
|     <el-dialog :title="title" :visible.sync="open" width="1000px" :close-on-click-modal="false" append-to-body @closed="cancel"> |     <el-dialog :title="title" :visible.sync="open" width="1050px" :close-on-click-modal="false" append-to-body @closed="cancel"> | ||||||
|       <div style="margin-bottom: 20px;color:red">1、添加导粉记录时会根据进粉渠道、当前时间来自动确定所属直播间,当前时间段没有直播,则取上一次直播,若账号从未直播过,则为空</div> |       <!--<div style="margin-bottom: 20px;color:red">1、添加导粉记录时会根据进粉渠道、当前时间来自动确定所属直播间,当前时间段没有直播,则取上一次直播,若账号从未直播过,则为空</div>--> | ||||||
|  |         <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> | ||||||
|  |       <!--<el-form-item label="账号渠道" prop="channel"> | ||||||
|  |           <el-select | ||||||
|  |               v-model="queryParams.channel" | ||||||
|  |               placeholder="请选择账号渠道" | ||||||
|  |               clearable | ||||||
|  |               filterable | ||||||
|  |               size="small" | ||||||
|  |             > | ||||||
|  |               <el-option | ||||||
|  |                 v-for="dict in fanChanneloptions" | ||||||
|  |                 :key="dict.dictValue" | ||||||
|  |                 :label="dict.dictLabel" | ||||||
|  |                 :value="parseInt(dict.dictValue)" | ||||||
|  |               /> | ||||||
|  |             </el-select> | ||||||
|  |         </el-form-item>--> | ||||||
|  |         <el-form-item label="销售" prop="saleId" label-width="50px"> | ||||||
|  |           <el-select | ||||||
|  |               v-model="queryParams.saleId" | ||||||
|  |               placeholder="请选择销售" | ||||||
|  |               clearable | ||||||
|  |               filterable | ||||||
|  |               size="small" | ||||||
|  |             > | ||||||
|  |               <el-option | ||||||
|  |                 v-for="dict in preSaleIdOptions" | ||||||
|  |                 :key="dict.dictValue" | ||||||
|  |                 :label="dict.dictLabel" | ||||||
|  |                 :value="parseInt(dict.dictValue)" | ||||||
|  |               /> | ||||||
|  |             </el-select> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item label="微信账号" prop="wxAccount"> | ||||||
|  |             <el-input v-model.trim="queryParams.wxAccount" placeholder="请输入微信号" /> | ||||||
|  |         </el-form-item> | ||||||
|  |       <el-form-item> | ||||||
|  |         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | ||||||
|  |         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | ||||||
|  |       </el-form-item> | ||||||
|  |     </el-form> | ||||||
|         <div style="height: 500px; overflow: auto"> |         <div style="height: 500px; overflow: auto"> | ||||||
|             <el-table v-loading="loading" :data="wxAccountList"> |             <el-table v-loading="loading" :data="wxAccountList"> | ||||||
|                 <!--<el-table-column label="微信昵称" align="center" prop="wxNickName" />--> |                 <!--<el-table-column label="微信昵称" align="center" prop="wxNickName" />--> | ||||||
|                 <el-table-column label="微信号" align="center" prop="wxAccount" width="160"/> |                 <el-table-column label="微信号" align="center" prop="wxAccount" width="160"/> | ||||||
|                 <el-table-column label="销售" align="center" prop="saleName" width="120"/> |                 <el-table-column label="销售" align="center" prop="saleName" width="120"/> | ||||||
|                 <el-table-column label="已导粉数量" align="center" prop="importFanNum" width="120"/> |                 <!--<el-table-column label="已导粉数量" align="center" prop="importFanNum" width="120"/>--> | ||||||
|                 <el-table-column label="进粉渠道" align="center" prop="importFanChannel" > |                 <el-table-column label="账号渠道" align="center" prop="importFanChannel" width="180"> | ||||||
|                     <template slot-scope="scope"> |                     <template slot-scope="scope"> | ||||||
|                             <el-select |                             <el-select | ||||||
|                         v-model="scope.row.importFanChannel" |                         v-model="scope.row.importFanChannel" | ||||||
| @@ -46,7 +87,23 @@ | |||||||
|                         </el-select> |                         </el-select> | ||||||
|                     </template> |                     </template> | ||||||
|                 </el-table-column>--> |                 </el-table-column>--> | ||||||
|                 <el-table-column label="导粉数量" align="center" prop="fanNum" width="200"> |                  <el-table-column label="导粉时间" align="center" prop="fanTime" width="240"> | ||||||
|  |                    <template slot-scope="scope"> | ||||||
|  |                   <el-date-picker | ||||||
|  |                     v-model="scope.row.fanTime" | ||||||
|  |                     type="datetime" | ||||||
|  |                     placeholder="选择导粉时间" | ||||||
|  |                     format="yyyy-MM-dd HH:mm" | ||||||
|  |                     value-format="yyyy-MM-dd HH:mm" | ||||||
|  |                     :picker-options="fanPickerOptions" | ||||||
|  |                     @change="autoSelectLive(scope.row)" | ||||||
|  |                   > | ||||||
|  |                   </el-date-picker> | ||||||
|  |                    </template> | ||||||
|  |                 </el-table-column> | ||||||
|  |                  | ||||||
|  |  | ||||||
|  |                 <el-table-column label="导粉数量" align="center" prop="fanNum" width="180"> | ||||||
|                     <template slot-scope="scope"> |                     <template slot-scope="scope"> | ||||||
|                             <el-input-number v-model="scope.row.fanNum" :min="1" :max="10000" label="导粉数量" style="width:160px"></el-input-number> |                             <el-input-number v-model="scope.row.fanNum" :min="1" :max="10000" label="导粉数量" style="width:160px"></el-input-number> | ||||||
|                     </template> |                     </template> | ||||||
| @@ -76,6 +133,7 @@ | |||||||
| <script> | <script> | ||||||
| import { addImportFanRecord,getWxAccountAndSale } from "@/api/custom/importFanRecord"; | import { addImportFanRecord,getWxAccountAndSale } from "@/api/custom/importFanRecord"; | ||||||
| import { getAllLiveSchedulByDate,getLiveSchedulByTime } from "@/api/custom/liveSchedul"; | import { getAllLiveSchedulByDate,getLiveSchedulByTime } from "@/api/custom/liveSchedul"; | ||||||
|  | import { mapGetters } from "vuex"; | ||||||
| import dayjs from "dayjs"; | import dayjs from "dayjs"; | ||||||
| const nowTime = dayjs().format("YYYY-MM-DD HH:mm"); | const nowTime = dayjs().format("YYYY-MM-DD HH:mm"); | ||||||
| export default { | export default { | ||||||
| @@ -107,12 +165,28 @@ export default { | |||||||
|       //总导粉统计 |       //总导粉统计 | ||||||
|       fanNumList:[], |       fanNumList:[], | ||||||
|       //是否进行了导粉操作 |       //是否进行了导粉操作 | ||||||
|       importFanFlag: false |       importFanFlag: false, | ||||||
|  |       queryParams:{ | ||||||
|  |           channel: null, | ||||||
|  |           saleId: null, | ||||||
|  |           wxAccount: null | ||||||
|  |       }, | ||||||
|  |       fanPickerOptions: { | ||||||
|  |         disabledDate(time) { | ||||||
|  |           return time.getTime() > Date.now() || time.getTime() < Date.now(); | ||||||
|  |         }, | ||||||
|  |       }, | ||||||
|     }; |     }; | ||||||
|   }, |   }, | ||||||
|   created(){ |   created(){ | ||||||
|      |      | ||||||
|          |          | ||||||
|  |   }, | ||||||
|  |   computed: { | ||||||
|  |     ...mapGetters([ | ||||||
|  |       // 售前字典 | ||||||
|  |       "preSaleIdOptions" | ||||||
|  |     ]), | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     showDialog(data, callback, fanChanneloptions) { |     showDialog(data, callback, fanChanneloptions) { | ||||||
| @@ -149,18 +223,29 @@ export default { | |||||||
|     //获取所有可接粉的微信号 |     //获取所有可接粉的微信号 | ||||||
|     getListWxAccount() { |     getListWxAccount() { | ||||||
|         this.loading = true; |         this.loading = true; | ||||||
|         getWxAccountAndSale({'importFanDate': this.data.importFanDate}).then((response) => { |         getWxAccountAndSale(this.queryParams).then((response) => { | ||||||
|             response.data.wxSaleAccountList.forEach((item,index) => { |             response.data.wxSaleAccountList.forEach((item,index) => { | ||||||
|                 item.fanNum = 1; |                 item.fanNum = 1; | ||||||
|                 item.importFanNum =  this.getTotalFanNum(response.data.fanNumList, item.id); |                 //item.importFanNum =  this.getTotalFanNum(response.data.fanNumList, item.id); | ||||||
|                 item.importFanChannel = null; |                 item.importFanChannel = null; | ||||||
|                 item.importFanLive = null; |                 item.importFanLive = null; | ||||||
|  |                 item.fanTime = null; | ||||||
|             }); |             }); | ||||||
|             this.wxAccountList = response.data.wxSaleAccountList; |             this.wxAccountList = response.data.wxSaleAccountList; | ||||||
|             this.fanNumList = response.data.fanNumList; |             //this.fanNumList = response.data.fanNumList; | ||||||
|             this.loading = false; |             this.loading = false; | ||||||
|         }); |         }); | ||||||
|     }, |     }, | ||||||
|  |     handleQuery(){ | ||||||
|  |         this.getListWxAccount(); | ||||||
|  |     }, | ||||||
|  |     resetQuery(){ | ||||||
|  |         this.queryParams = { | ||||||
|  |           channel: null, | ||||||
|  |           saleId: null, | ||||||
|  |           wxAccount: null | ||||||
|  |         }; | ||||||
|  |     }, | ||||||
|     getAllLiveSchedulByDate(){ |     getAllLiveSchedulByDate(){ | ||||||
|       getAllLiveSchedulByDate({'liveSchedulDate':this.data.importFanDate}).then((response) => { |       getAllLiveSchedulByDate({'liveSchedulDate':this.data.importFanDate}).then((response) => { | ||||||
|           response.data.forEach((item,index) => { |           response.data.forEach((item,index) => { | ||||||
| @@ -186,7 +271,15 @@ export default { | |||||||
|         if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""){ |         if(row.importFanChannel == undefined || row.importFanChannel == null || row.importFanChannel == ""){ | ||||||
|           this.$message({ |           this.$message({ | ||||||
|                 type: 'warning', |                 type: 'warning', | ||||||
|                 message: '进粉渠道不能为空', |                 message: '账号渠道不能为空', | ||||||
|  |                 center: true | ||||||
|  |           }); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|  |         if(row.fanTime == undefined || row.fanTime == null || row.fanTime == ""){ | ||||||
|  |           this.$message({ | ||||||
|  |                 type: 'warning', | ||||||
|  |                 message: '导粉时间不能为空', | ||||||
|                 center: true |                 center: true | ||||||
|           }); |           }); | ||||||
|           return; |           return; | ||||||
| @@ -273,7 +366,7 @@ export default { | |||||||
|            row.importFanLive = null; |            row.importFanLive = null; | ||||||
|            return; |            return; | ||||||
|         } |         } | ||||||
|         getLiveSchedulByTime({'fanChannel':row.importFanChannel,'liveStartTimeString':encodeURIComponent(dayjs().format("YYYY-MM-DD HH:mm"))}).then((response) => { |         getLiveSchedulByTime({'fanChannel':row.importFanChannel,'liveStartTimeString':encodeURIComponent(row.fanTime)}).then((response) => { | ||||||
|               if (response.code === 200) { |               if (response.code === 200) { | ||||||
|                  let live = response.data; |                  let live = response.data; | ||||||
|                  if(live != undefined && live != null){ |                  if(live != undefined && live != null){ | ||||||
|   | |||||||
| @@ -111,8 +111,8 @@ | |||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8"> |         <el-col :span="8" v-show="preSaleShow"> | ||||||
|           <el-form-item label="售前" prop="preSaleId"> |           <el-form-item label="售前" prop="preSaleId" > | ||||||
|             <el-select v-model="form.preSaleId" placeholder="请选择" filterable |             <el-select v-model="form.preSaleId" placeholder="请选择" filterable | ||||||
|               clearable> |               clearable> | ||||||
|               <el-option |               <el-option | ||||||
| @@ -124,7 +124,20 @@ | |||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8" v-show="!afterNutiShow"> |         <el-col :span="8" v-show="pushPreSaleShow"> | ||||||
|  |           <el-form-item label="售前推送" prop="preSaleId" title="售前推送人就是该客户体验单的销售,只有售中一开单需要选择"> | ||||||
|  |             <el-select v-model="form.pushPreSaleId" placeholder="请选择" filterable | ||||||
|  |               clearable> | ||||||
|  |               <el-option | ||||||
|  |                 v-for="dict in pushPreSaleIdOptions" | ||||||
|  |                 :key="dict.dictValue" | ||||||
|  |                 :label="dict.dictLabel" | ||||||
|  |                 :value="parseInt(dict.dictValue)" | ||||||
|  |               /> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  |         <el-col :span="8" v-show="onSaleShow"> | ||||||
|           <el-form-item label="售中" prop="onSaleId"> |           <el-form-item label="售中" prop="onSaleId"> | ||||||
|             <el-select v-model="form.onSaleId" placeholder="请选择"> |             <el-select v-model="form.onSaleId" placeholder="请选择"> | ||||||
|               <el-option |               <el-option | ||||||
| @@ -243,11 +256,11 @@ | |||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8"> |         <!--<el-col :span="8"> | ||||||
|           <el-form-item label="推荐人" prop="recommender"> |           <el-form-item label="推荐人" prop="recommender"> | ||||||
|             <el-input v-model="form.recommender" placeholder="请输入推荐人" /> |             <el-input v-model="form.recommender" placeholder="请输入推荐人" /> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col>--> | ||||||
|         <el-col :span="10"> |         <el-col :span="10"> | ||||||
|           <el-form-item label="成交时间" prop="orderTime"> |           <el-form-item label="成交时间" prop="orderTime"> | ||||||
|             <el-date-picker |             <el-date-picker | ||||||
| @@ -263,7 +276,7 @@ | |||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="10"> |         <el-col :span="10"> | ||||||
|           <el-form-item label="服务开始时间" prop="startTime" label-width="120"> |           <el-form-item label="服务开始时间" prop="startTime" label-width="180"> | ||||||
|             <el-date-picker |             <el-date-picker | ||||||
|               style="width: 182.5px" |               style="width: 182.5px" | ||||||
|               v-model="form.startTime" |               v-model="form.startTime" | ||||||
| @@ -347,11 +360,15 @@ export default { | |||||||
|       visible: false, |       visible: false, | ||||||
|       // 表单校验 |       // 表单校验 | ||||||
|       rules: { |       rules: { | ||||||
|         customer: [ |         /*customer: [ | ||||||
|           { required: true, message: "客户姓名不能为空", trigger: "blur" }, |           { required: true, message: "客户姓名不能为空", trigger: "blur" }, | ||||||
|         ], |         ],*/ | ||||||
|         amount: [{ required: true, message: "金额不能为空", trigger: "blur" }], |         amount: [{ required: true, message: "金额不能为空", trigger: "blur" }], | ||||||
|         phone: [ |         /*payTypeId: [{ required: true, message: "收款方式不能为空", trigger: "blur" }], | ||||||
|  |         accountId: [{ required: true, message: "渠道不能为空", trigger: "blur" }], | ||||||
|  |         serveTime: [{ required: true, message: "服务时间不能为空", trigger: "blur" }], | ||||||
|  |         conditioningProjectId: [{ required: true, message: "服务项目不能为空", trigger: "blur" }],*/ | ||||||
|  |         /*phone: [ | ||||||
|           { required: true, message: "手机号不能为空", trigger: "blur" }, |           { required: true, message: "手机号不能为空", trigger: "blur" }, | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
| @@ -359,7 +376,7 @@ export default { | |||||||
|             pattern: /^[0-9]{5,11}$/, |             pattern: /^[0-9]{5,11}$/, | ||||||
|             message: "手机号格式不正确", |             message: "手机号格式不正确", | ||||||
|           }, |           }, | ||||||
|         ], |         ],*/ | ||||||
|         orderTime: [ |         orderTime: [ | ||||||
|           { required: true, message: "成交时间不能为空", trigger: "blur" }, |           { required: true, message: "成交时间不能为空", trigger: "blur" }, | ||||||
|           { required: true, trigger: "blur", validator: checkOrderTime }, |           { required: true, trigger: "blur", validator: checkOrderTime }, | ||||||
| @@ -425,6 +442,7 @@ export default { | |||||||
|           return time.getTime() < Date.now(); |           return time.getTime() < Date.now(); | ||||||
|         }, |         }, | ||||||
|       }, |       }, | ||||||
|  |       data: null, | ||||||
|       // 收款方式字典 |       // 收款方式字典 | ||||||
|       payTypeIdOptions: [], |       payTypeIdOptions: [], | ||||||
|       // 账号 |       // 账号 | ||||||
| @@ -444,7 +462,14 @@ export default { | |||||||
|       secondAfterSaleFlagShow: false, |       secondAfterSaleFlagShow: false, | ||||||
|       //分成比例 |       //分成比例 | ||||||
|       orderRateOptions: orderTypeData["orderRateArray"], |       orderRateOptions: orderTypeData["orderRateArray"], | ||||||
|  |       //比例是否显示 | ||||||
|       orderRateOptionsShow: false, |       orderRateOptionsShow: false, | ||||||
|  |       //售前是否显示 | ||||||
|  |       preSaleShow: true, | ||||||
|  |       //售中是否显示 | ||||||
|  |       onSaleShow: false, | ||||||
|  |       //售前推送人是否显示(售中一开单才存在) | ||||||
|  |       pushPreSaleShow: false, | ||||||
|       //售后、营养师、营养师助理是否显示 |       //售后、营养师、营养师助理是否显示 | ||||||
|       afterNutiShow: true, |       afterNutiShow: true, | ||||||
|     }; |     }; | ||||||
| @@ -511,6 +536,8 @@ export default { | |||||||
|       "operatorIdOptions", |       "operatorIdOptions", | ||||||
|       // 运营助理字典 |       // 运营助理字典 | ||||||
|       "operatorAssisIdOptions", |       "operatorAssisIdOptions", | ||||||
|  |       //售前推送 | ||||||
|  |       "pushPreSaleIdOptions" | ||||||
|     ]), |     ]), | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
| @@ -518,7 +545,7 @@ export default { | |||||||
|       // this.data = data; |       // this.data = data; | ||||||
|       this.callback = callback; |       this.callback = callback; | ||||||
|       this.reset(data); |       this.reset(data); | ||||||
|  |       this.data = data; | ||||||
|       this.title = `${data.orderId ? "修改" : "创建"}「${ |       this.title = `${data.orderId ? "修改" : "创建"}「${ | ||||||
|         data.customer |         data.customer | ||||||
|       }」客户订单`; |       }」客户订单`; | ||||||
| @@ -527,15 +554,15 @@ export default { | |||||||
|     /** 提交按钮 */ |     /** 提交按钮 */ | ||||||
|     submitForm() { |     submitForm() { | ||||||
|       this.$refs["form"].validate((valid) => { |       this.$refs["form"].validate((valid) => { | ||||||
|         if (valid) { |         if (valid && this.validateAddOrder()) { | ||||||
|           if (this.form.orderId != null) { |           if (this.form.orderId != null) { | ||||||
|             updateOrder(this.form).then((response) => { |             /*updateOrder(this.form).then((response) => { | ||||||
|               if (response.code === 200) { |               if (response.code === 200) { | ||||||
|                 this.msgSuccess("修改成功"); |                 this.msgSuccess("修改成功"); | ||||||
|                 this.visible = false; |                 this.visible = false; | ||||||
|                 this.callback && this.callback(); |                 this.callback && this.callback(); | ||||||
|               } |               } | ||||||
|             }); |             });*/ | ||||||
|           } else { |           } else { | ||||||
|             addOrder(this.form).then((response) => { |             addOrder(this.form).then((response) => { | ||||||
|               if (response.code === 200) { |               if (response.code === 200) { | ||||||
| @@ -548,6 +575,88 @@ export default { | |||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|  |     //验证订单参数 | ||||||
|  |     validateAddOrder(){ | ||||||
|  |       //普通单、拆分单 | ||||||
|  |       if(this.form.orderTypeList[0] == 0 || this.form.orderTypeList[0] == 1){ | ||||||
|  |            //售前、售后、营养师助理都不能为空 | ||||||
|  |            if(this.form.preSaleId == null || this.form.preSaleId <= 0 || this.form.afterSaleId == null || this.form.afterSaleId <= 0  | ||||||
|  |               || this.form.nutriAssisId == null ||  this.form.nutriAssisId <= 0){ | ||||||
|  |               this.$message({ | ||||||
|  |                 type: 'warning', | ||||||
|  |                 message: '售前、售后、营养师助理不能为空', | ||||||
|  |                 center: true | ||||||
|  |               }); | ||||||
|  |               return false; | ||||||
|  |            } | ||||||
|  |            //根据是否拆分判断营养师 | ||||||
|  |            if(this.form.orderTypeList[0] == 0){ | ||||||
|  |               if(this.form.nutritionistIdList == null || this.form.nutritionistIdList.length != 1 || this.form.nutritionistIdList[0] <= 0){ | ||||||
|  |                 this.$message({ | ||||||
|  |                   type: 'warning', | ||||||
|  |                   message: '营养师不能为空,普通单只能选择一个营养师', | ||||||
|  |                   center: true | ||||||
|  |                 }); | ||||||
|  |                 return false; | ||||||
|  |               } | ||||||
|  |            }else{ | ||||||
|  |               if(this.form.nutritionistIdList == null || this.form.nutritionistIdList.length != 2 || this.form.nutritionistIdList[0] <= 0 || this.form.nutritionistIdList[1] <= 0){ | ||||||
|  |                 this.$message({ | ||||||
|  |                   type: 'warning', | ||||||
|  |                   message: '营养师不能为空,拆分单需要选择两个营养师', | ||||||
|  |                   center: true | ||||||
|  |                 }); | ||||||
|  |                 return false; | ||||||
|  |               } | ||||||
|  |            } | ||||||
|  |       } | ||||||
|  |       //体验单 | ||||||
|  |       else if(this.form.orderTypeList[0] == 2){ | ||||||
|  |           //售前、售中不能为空 | ||||||
|  |           if(this.form.preSaleId == null || this.form.preSaleId <= 0 || this.form.onSaleId == null ||  this.form.onSaleId <= 0){ | ||||||
|  |               this.$message({ | ||||||
|  |                 type: 'warning', | ||||||
|  |                 message: '售前、售中不能为空', | ||||||
|  |                 center: true | ||||||
|  |               }); | ||||||
|  |               return false; | ||||||
|  |            } | ||||||
|  |       } | ||||||
|  |       //售中单 | ||||||
|  |       else if(this.form.orderTypeList[0] == 3){ | ||||||
|  |           //售中、售后、营养师助理不能为空 | ||||||
|  |           if(this.form.onSaleId == null || this.form.onSaleId <= 0 || this.form.afterSaleId == null || this.form.afterSaleId <= 0  | ||||||
|  |               || this.form.nutriAssisId == null ||  this.form.nutriAssisId <= 0){ | ||||||
|  |               this.$message({ | ||||||
|  |                 type: 'warning', | ||||||
|  |                 message: '售中、售后、营养师助理不能为空', | ||||||
|  |                 center: true | ||||||
|  |               }); | ||||||
|  |               return false; | ||||||
|  |            } | ||||||
|  |            //判断是否拆分单 | ||||||
|  |            if(this.form.orderTypeList[1] == 0 || this.form.orderTypeList[1] == 1){ | ||||||
|  |               if(this.form.nutritionistIdList == null || this.form.nutritionistIdList.length != 1 || this.form.nutritionistIdList[0] <= 0){ | ||||||
|  |                 this.$message({ | ||||||
|  |                   type: 'warning', | ||||||
|  |                   message: '营养师不能为空,普通单只能选择一个营养师', | ||||||
|  |                   center: true | ||||||
|  |                 }); | ||||||
|  |                 return false; | ||||||
|  |               } | ||||||
|  |            }else{ | ||||||
|  |               if(this.form.nutritionistIdList == null || this.form.nutritionistIdList.length != 2 || this.form.nutritionistIdList[0] <= 0 || this.form.nutritionistIdList[1] <= 0){ | ||||||
|  |                 this.$message({ | ||||||
|  |                   type: 'warning', | ||||||
|  |                   message: '营养师不能为空,拆分单需要选择两个营养师', | ||||||
|  |                   center: true | ||||||
|  |                 }); | ||||||
|  |                 return false; | ||||||
|  |               } | ||||||
|  |            } | ||||||
|  |       } | ||||||
|  |       return true; | ||||||
|  |     }, | ||||||
|     reset(obj = {}) { |     reset(obj = {}) { | ||||||
|       const defaultPayType = this.payTypeIdOptions.find( |       const defaultPayType = this.payTypeIdOptions.find( | ||||||
|         (opt) => opt.remark === "default" |         (opt) => opt.remark === "default" | ||||||
| @@ -614,6 +723,7 @@ export default { | |||||||
|         pauseTime: null, |         pauseTime: null, | ||||||
|         payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, |         payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, | ||||||
|         preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, |         preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, | ||||||
|  |         pushPreSaleId: null, | ||||||
|         createBy: null, |         createBy: null, | ||||||
|         createTime: null, |         createTime: null, | ||||||
|         onSaleId: null, |         onSaleId: null, | ||||||
| @@ -696,7 +806,7 @@ export default { | |||||||
|     // }, |     // }, | ||||||
|     "form.orderTypeList": function (newVal, oldVal) { |     "form.orderTypeList": function (newVal, oldVal) { | ||||||
|       //判断订单类型是否选择了二开 |       //判断订单类型是否选择了二开 | ||||||
|       if (newVal[1] == 1) { |       if (newVal[1] == 1 || newVal[1] == 3) { | ||||||
|         this.form.secondAfterSaleFlag = 1; |         this.form.secondAfterSaleFlag = 1; | ||||||
|         this.secondAfterSaleFlagShow = true; |         this.secondAfterSaleFlagShow = true; | ||||||
|       } else { |       } else { | ||||||
| @@ -704,7 +814,7 @@ export default { | |||||||
|         this.secondAfterSaleFlagShow = false; |         this.secondAfterSaleFlagShow = false; | ||||||
|       } |       } | ||||||
|       //判断是否选择了比例拆分单 |       //判断是否选择了比例拆分单 | ||||||
|       if (newVal[0] == 1) { |       if (newVal[0] == 1 || newVal[1] == 2 || newVal[1] == 3) { | ||||||
|         this.orderRateOptionsShow = true; |         this.orderRateOptionsShow = true; | ||||||
|         this.form.nutritionistRate = "2,8"; |         this.form.nutritionistRate = "2,8"; | ||||||
|       } else { |       } else { | ||||||
| @@ -713,15 +823,40 @@ export default { | |||||||
|       } |       } | ||||||
|       //判断是否选择了体验单 |       //判断是否选择了体验单 | ||||||
|       if (newVal[0] == 2) { |       if (newVal[0] == 2) { | ||||||
|         this.afterNutiShow = false; |  | ||||||
|         this.form.onSaleId = parseInt(this.onSaleIdOptions[1].dictValue); |  | ||||||
|         this.form.serveTimeId = 7; |         this.form.serveTimeId = 7; | ||||||
|         this.form.conditioningProjectId = 12; |         this.form.conditioningProjectId = 12; | ||||||
|  |         this.onSaleShow = true; | ||||||
|  |         this.afterNutiShow = false; | ||||||
|       } else { |       } else { | ||||||
|         this.form.onSaleId = null; |         this.form.onSaleId = null; | ||||||
|         this.form.serveTimeId = 90; |         this.form.serveTimeId = 90; | ||||||
|         this.afterNutiShow = true; |  | ||||||
|         this.form.conditioningProjectId = 0; |         this.form.conditioningProjectId = 0; | ||||||
|  |         this.onSaleShow = false; | ||||||
|  |         this.afterNutiShow = true; | ||||||
|  |       } | ||||||
|  |       //判断是否选择了售中单 | ||||||
|  |       if(newVal[0] == 3){ | ||||||
|  |         //不需要选择销售,需要选择售中 | ||||||
|  |         this.form.preSaleId = null; | ||||||
|  |         this.onSaleShow = true; | ||||||
|  |         this.preSaleShow = false; | ||||||
|  |         //一开单 | ||||||
|  |         if(newVal[1] == 0 || newVal[1] == 2){ | ||||||
|  |           this.form.pushPreSaleId = (this.data && this.data.preSaleId != null) ? this.data.preSaleId : null; | ||||||
|  |             this.pushPreSaleShow = true; | ||||||
|  |         }else{ | ||||||
|  |             this.pushPreSaleShow = false; | ||||||
|  |             this.form.pushPreSaleId = null; | ||||||
|  |         } | ||||||
|  |       }else{ | ||||||
|  |           this.form.pushPreSaleId = null; | ||||||
|  |           this.pushPreSaleShow = false; | ||||||
|  |           this.preSaleShow = true; | ||||||
|  |           //需要判断是否为体验单 | ||||||
|  |           if (newVal[0] != 2) { | ||||||
|  |             this.form.onSaleId = null; | ||||||
|  |             this.onSaleShow = false; | ||||||
|  |           } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -66,16 +66,18 @@ export default { | |||||||
|     return { |     return { | ||||||
|       orderDetailList: [], |       orderDetailList: [], | ||||||
|       visible: false, |       visible: false, | ||||||
|  |       preSaleTitle: "售前", | ||||||
|  |       preSaleValue: "preSale", | ||||||
|       //订单详情的标题,按竖显示 |       //订单详情的标题,按竖显示 | ||||||
|       orderTitleData: [ |       orderTitleData: [ | ||||||
|         ["订单类型","审核状态", "成交时间"], |         ["订单类型","审核状态", "成交时间"], | ||||||
|         ["调理项目","姓名", "手机号"], |         ["调理项目","姓名", "手机号"], | ||||||
|         ["金额","收款方式", "收款账号"], |         ["金额","收款方式", "收款账号"], | ||||||
|         ["服务时长","赠送时长", "售前"], |         ["服务时长","赠送时长", "售前"], | ||||||
|         ["售中","售后","营养师"], |         ["售前推送","售中","售后"], | ||||||
|         ["助理营养师","策划","策划助理"], |         ["营养师","助理营养师","策划"], | ||||||
|         ["运营","运营助理","开始时间"], |         ["策划助理","运营","运营助理"], | ||||||
|         ["结束时间","备注",""] |         ["开始时间","结束时间","备注"] | ||||||
|       ], |       ], | ||||||
|       //订单详情的属性名称,与标题对应,按竖显示 |       //订单详情的属性名称,与标题对应,按竖显示 | ||||||
|       orderValueData: [ |       orderValueData: [ | ||||||
| @@ -83,10 +85,10 @@ export default { | |||||||
|         ["conditioningProject","customer", "phone"], |         ["conditioningProject","customer", "phone"], | ||||||
|         ["amount","payType", "account"], |         ["amount","payType", "account"], | ||||||
|         ["serveTime","giveServeDay", "preSale"], |         ["serveTime","giveServeDay", "preSale"], | ||||||
|         ["onSale","afterSale","nutritionist"], |         ["pushPreSale","onSale","afterSale"], | ||||||
|         ["nutriAssis","planner","plannerAssis"], |         ["nutritionist","nutriAssis","planner"], | ||||||
|         ["operator","operatorAssis","startTime"], |         ["plannerAssis","operator","operatorAssis"], | ||||||
|         ["serverEndTime","remark",""] |         ["startTime","serverEndTime","remark"] | ||||||
|       ], |       ], | ||||||
|     }; |     }; | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -90,7 +90,7 @@ | |||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8"> |         <el-col :span="8" v-show="preSaleShow"> | ||||||
|           <el-form-item label="售前" prop="preSaleId"> |           <el-form-item label="售前" prop="preSaleId"> | ||||||
|             <el-select v-model="form.preSaleId" placeholder="请选择"> |             <el-select v-model="form.preSaleId" placeholder="请选择"> | ||||||
|               <el-option |               <el-option | ||||||
| @@ -102,6 +102,19 @@ | |||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|  |  | ||||||
|  |         <el-col :span="8" v-show="pushPreSaleShow"> | ||||||
|  |           <el-form-item label="售前推送" prop="preSaleId"> | ||||||
|  |             <el-select v-model="form.pushPreSaleId" placeholder="请选择"> | ||||||
|  |               <el-option | ||||||
|  |                 v-for="dict in pushPreSaleIdOptions" | ||||||
|  |                 :key="dict.dictValue" | ||||||
|  |                 :label="dict.dictLabel" | ||||||
|  |                 :value="parseInt(dict.dictValue)" | ||||||
|  |               /> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|         <el-col :span="8" v-show="onSaleShow"> |         <el-col :span="8" v-show="onSaleShow"> | ||||||
|           <el-form-item label="售中" prop="onSaleId"> |           <el-form-item label="售中" prop="onSaleId"> | ||||||
|             <el-select v-model="form.onSaleId" placeholder="请选择"> |             <el-select v-model="form.onSaleId" placeholder="请选择"> | ||||||
| @@ -198,11 +211,11 @@ | |||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8"> |         <!--<el-col :span="8"> | ||||||
|           <el-form-item label="推荐人" prop="recommender"> |           <el-form-item label="推荐人" prop="recommender"> | ||||||
|             <el-input v-model="form.recommender" placeholder="请输入推荐人" /> |             <el-input v-model="form.recommender" placeholder="请输入推荐人" /> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col>--> | ||||||
|         <el-col :span="10"> |         <el-col :span="10"> | ||||||
|           <el-form-item label="成交时间" prop="orderTime"> |           <el-form-item label="成交时间" prop="orderTime"> | ||||||
|             <el-date-picker |             <el-date-picker | ||||||
| @@ -218,7 +231,7 @@ | |||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="12"> |         <el-col :span="12"> | ||||||
|           <el-form-item label="服务开始时间" prop="startTime" label-width="120"> |           <el-form-item label="服务开始时间" prop="startTime" label-width="160"> | ||||||
|             <el-date-picker |             <el-date-picker | ||||||
|               style="width: 182.5px" |               style="width: 182.5px" | ||||||
|               v-model="form.startTime" |               v-model="form.startTime" | ||||||
| @@ -392,8 +405,12 @@ export default { | |||||||
|       reviewStatusOptions: [], |       reviewStatusOptions: [], | ||||||
|       //下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理) |       //下拉列表对应关系(用于选择收款账号自动选择策划、策划助理、运营、运营助理) | ||||||
|       orderDropdownCorrespondingOptions: [], |       orderDropdownCorrespondingOptions: [], | ||||||
|       //是否显示售中 |       //售前是否显示 | ||||||
|  |       preSaleShow: true, | ||||||
|  |       //售中是否显示 | ||||||
|       onSaleShow: false, |       onSaleShow: false, | ||||||
|  |       //售前推送人是否显示(售中一开单才存在) | ||||||
|  |       pushPreSaleShow: false, | ||||||
|       //是否显示售后、营养师、营养师助理 |       //是否显示售后、营养师、营养师助理 | ||||||
|       afterSaleNutriAssShow: true, |       afterSaleNutriAssShow: true, | ||||||
|       //是否显示策划、策划助理、运营、运营助理 |       //是否显示策划、策划助理、运营、运营助理 | ||||||
| @@ -448,6 +465,8 @@ export default { | |||||||
|       "operatorIdOptions", |       "operatorIdOptions", | ||||||
|       // 运营助理字典 |       // 运营助理字典 | ||||||
|       "operatorAssisIdOptions", |       "operatorAssisIdOptions", | ||||||
|  |       //售前推送 | ||||||
|  |       "pushPreSaleIdOptions" | ||||||
|     ]), |     ]), | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
| @@ -545,6 +564,7 @@ export default { | |||||||
|         pauseTime: null, |         pauseTime: null, | ||||||
|         payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, |         payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, | ||||||
|         preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, |         preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, | ||||||
|  |         pushPreSaleId: null, | ||||||
|         onSaleId: null, |         onSaleId: null, | ||||||
|         createBy: null, |         createBy: null, | ||||||
|         createTime: null, |         createTime: null, | ||||||
| @@ -575,13 +595,42 @@ export default { | |||||||
|         accountId, |         accountId, | ||||||
|         ...obj, |         ...obj, | ||||||
|       }; |       }; | ||||||
|       // console.log(this.form); |  | ||||||
|       this.resetForm("form"); |       this.resetForm("form"); | ||||||
|       // console.log("--"+obj.orderType); |  | ||||||
|       this.onSaleShow = this.form.orderType == "2"; |       //售前是否显示 | ||||||
|       this.afterSaleNutriAssShow = |       this.preSaleShow = true; | ||||||
|         this.form.orderType != "2" && this.form.afterSaleCommissOrder == 0; |       //售中是否显示 | ||||||
|       this.planOperatorShow = this.form.afterSaleCommissOrder == 0; |       this.onSaleShow = false; | ||||||
|  |       //售前推送人是否显示(售中一开单才存在) | ||||||
|  |       this.pushPreSaleShow= false; | ||||||
|  |       //是否显示售后、营养师、营养师助理 | ||||||
|  |       this.afterSaleNutriAssShow= true; | ||||||
|  |       //是否显示策划、策划助理、运营、运营助理 | ||||||
|  |       this.planOperatorShow = true; | ||||||
|  |        | ||||||
|  |       if(this.form.orderType == "3"){ | ||||||
|  |          //售中单的非提成单不显示售前 | ||||||
|  |          if(this.form.afterSaleCommissOrder == null || this.form.afterSaleCommissOrder == 0){ | ||||||
|  |             this.preSaleShow = false; | ||||||
|  |          } | ||||||
|  |          if(this.form.orderCountType == 0 || this.form.orderCountType == 2){ | ||||||
|  |            this.pushPreSaleShow = true; | ||||||
|  |          } | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       if(this.form.orderType == "2" || (this.form.orderType == "3" && (this.form.afterSaleCommissOrder == null || this.form.afterSaleCommissOrder == 0))){ | ||||||
|  |         this.onSaleShow = true; | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       if((this.form.afterSaleCommissOrder != null && this.form.afterSaleCommissOrder != 0) || this.form.orderType == "2"){ | ||||||
|  |         this.afterSaleNutriAssShow = false; | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       if(this.form.afterSaleCommissOrder != null && this.form.afterSaleCommissOrder != 0){ | ||||||
|  |         this.planOperatorShow = false; | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       //console.log(this.preSaleShow + " | " + this.pushPreSaleShow + " | " + this.onSaleShow + " | " + this.afterSaleNutriAssShow + "|" + this.planOperatorShow); | ||||||
|     }, |     }, | ||||||
|     handleOnClosed() { |     handleOnClosed() { | ||||||
|       this.reset(); |       this.reset(); | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ const getters = { | |||||||
|   plannerIdOptions: state => state.global.plannerIdOptions, |   plannerIdOptions: state => state.global.plannerIdOptions, | ||||||
|   plannerAssisIdOptions: state => state.global.plannerAssisIdOptions, |   plannerAssisIdOptions: state => state.global.plannerAssisIdOptions, | ||||||
|   operatorIdOptions: state => state.global.operatorIdOptions, |   operatorIdOptions: state => state.global.operatorIdOptions, | ||||||
|   operatorAssisIdOptions: state => state.global.operatorAssisIdOptions |   operatorAssisIdOptions: state => state.global.operatorAssisIdOptions, | ||||||
|  |   pushPreSaleIdOptions: state => state.global.pushPreSaleIdOptions | ||||||
| }; | }; | ||||||
| export default getters; | export default getters; | ||||||
|   | |||||||
| @@ -11,6 +11,7 @@ const oriState = { | |||||||
|   operatorIdOptions: [], |   operatorIdOptions: [], | ||||||
|   operatorAssisIdOptions: [], |   operatorAssisIdOptions: [], | ||||||
|   msgUnreadCount: 0, |   msgUnreadCount: 0, | ||||||
|  |   pushPreSaleIdOptions:[] | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const mutations = { | const mutations = { | ||||||
| @@ -48,7 +49,8 @@ const actions = { | |||||||
|       plannerIdOptions: options["planner"] || [], |       plannerIdOptions: options["planner"] || [], | ||||||
|       plannerAssisIdOptions: options["planner_assis"] || [], |       plannerAssisIdOptions: options["planner_assis"] || [], | ||||||
|       operatorIdOptions: options["operator"] || [], |       operatorIdOptions: options["operator"] || [], | ||||||
|       operatorAssisIdOptions: options["operator_assis"] || [] |       operatorAssisIdOptions: options["operator_assis"] || [], | ||||||
|  |       pushPreSaleIdOptions: options["push_pre_sale"] || [], | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -25,6 +25,29 @@ export const orderCountTypeArray = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
|  | //订单次数加拆分类型 | ||||||
|  | export const orderCountExtendedTypeArray = [ | ||||||
|  |   { | ||||||
|  |     value: 0, | ||||||
|  |     label: "一开单", | ||||||
|  |     children: orderMoneyTypeArray | ||||||
|  |   },{ | ||||||
|  |     value: 1, | ||||||
|  |     label: "二开单", | ||||||
|  |     children: orderMoneyTypeArray | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     value: 2, | ||||||
|  |     label: "一开单(拆分)", | ||||||
|  |     children: orderMoneyTypeArray | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     value: 3, | ||||||
|  |     label: "二开单(拆分)", | ||||||
|  |     children: orderMoneyTypeArray | ||||||
|  |   } | ||||||
|  | ] | ||||||
|  |  | ||||||
| //订单类型(订单新增) | //订单类型(订单新增) | ||||||
| export const orderTypeArray = [ | export const orderTypeArray = [ | ||||||
|   { |   { | ||||||
| @@ -47,6 +70,11 @@ export const orderTypeArray = [ | |||||||
|         label: "全款单" |         label: "全款单" | ||||||
|       }] |       }] | ||||||
|     }] |     }] | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     value: 3, | ||||||
|  |     label: "售中单", | ||||||
|  |     children: orderCountExtendedTypeArray | ||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ | |||||||
|         </el-select> |         </el-select> | ||||||
|       </el-form-item> --> |       </el-form-item> --> | ||||||
|       <el-form-item label="进粉渠道" prop="channelId"> |       <el-form-item label="进粉渠道" prop="channelId"> | ||||||
|         <el-select v-model="queryParams.channelId" placeholder="请选择"> |         <el-select v-model="queryParams.channelId" filterable clearable placeholder="请选择"> | ||||||
|           <el-option |           <el-option | ||||||
|             v-for="dict in accountIdOptions" |             v-for="dict in accountIdOptions" | ||||||
|             :key="dict.dictValue" |             :key="dict.dictValue" | ||||||
|   | |||||||
| @@ -356,7 +356,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   created() { |   created() { | ||||||
|     this.getList(); |     this.getList(); | ||||||
|     this.getDicts("fan_channel").then((response) => { |     this.getDicts("cus_account").then((response) => { | ||||||
|       this.accountIdOptions = response.data; |       this.accountIdOptions = response.data; | ||||||
|     }); |     }); | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -327,7 +327,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   created() { |   created() { | ||||||
|     this.getList(); |     this.getList(); | ||||||
|     this.getDicts("fan_channel").then((response) => { |     this.getDicts("cus_account").then((response) => { | ||||||
|       this.accountIdOptions = response.data; |       this.accountIdOptions = response.data; | ||||||
|     }); |     }); | ||||||
|     this.getDicts("sale_group").then((response) => { |     this.getDicts("sale_group").then((response) => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user