diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java index 66bf11ab6..a00702d95 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java @@ -101,6 +101,8 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setMainOrderId(0L); sysOrder.setAfterSaleCommissOrder(0); sysOrder.setOnSaleId(null); + sysOrder.setPushPreSaleId(null); + sysOrder.setBusinessAffairId(null); //二开单 if("1".equals(sysOrder.getOrderCountType())){ row = sysOrderMapper.insertSysOrder(sysOrder); @@ -116,6 +118,8 @@ public class SysOrderServiceImpl implements ISysOrderService { else if("1".equals(sysOrder.getOrderType())){ sysOrder.setAfterSaleCommissOrder(0); sysOrder.setOnSaleId(null); + sysOrder.setBusinessAffairId(null); + sysOrder.setPushPreSaleId(null); String rate = sysOrder.getNutritionistRate(); if(StringUtils.isEmpty(rate) || rate.indexOf(",") == -1 || "0,10".equals(rate) || sysOrder.getNutritionistIdList().length != 2){ return 0; @@ -151,7 +155,9 @@ public class SysOrderServiceImpl implements ISysOrderService { else if("2".equals(sysOrder.getOrderType())){ sysOrder.setMainOrderId(0L); sysOrder.setAfterSaleCommissOrder(0); + sysOrder.setPushPreSaleId(null); sysOrder.setAfterSaleId(null); + sysOrder.setBusinessAffairId(null); sysOrder.setNutritionistId(null); sysOrder.setNutriAssisId(null); row = sysOrderMapper.insertSysOrder(sysOrder); @@ -159,6 +165,7 @@ public class SysOrderServiceImpl implements ISysOrderService { //售中单 else if("3".equals(sysOrder.getOrderType())){ sysOrder.setPreSaleId(null); + sysOrder.setBusinessAffairId(null); //一开、二开 if("0".equals(sysOrder.getOrderCountType()) || "1".equals(sysOrder.getOrderCountType())){ sysOrder.setNutritionistId((sysOrder.getNutritionistIdList() != null && sysOrder.getNutritionistIdList().length > 0) ? sysOrder.getNutritionistIdList()[0] : null); @@ -227,6 +234,29 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setOperatorId(null); sysOrder.setOperatorAssisId(null); row = sysOrderMapper.insertSysOrder(sysOrder); + //二开单 + if(row > 0 && "1".equals(sysOrder.getOrderCountType()) && sysOrder.getSecondAfterSaleFlag() != null && sysOrder.getSecondAfterSaleFlag().intValue() == 1){ + //需要自动创建售后二开提成单 + row = autoCreateSecondAfterSaleOrder(sysOrder); + } + } + //基因订单 + else if("5".equals(sysOrder.getOrderType())){ + sysOrder.setServeTimeId(null); + sysOrder.setGiveServeDay(0); + sysOrder.setOnSaleId(null); + sysOrder.setPushPreSaleId(null); + sysOrder.setBusinessAffairId(null); + sysOrder.setAfterSaleId(null); + sysOrder.setNutritionistId(null); + sysOrder.setNutriAssisId(null); + sysOrder.setPlannerId(null); + sysOrder.setPlannerAssisId(null); + sysOrder.setOperatorId(null); + sysOrder.setOperatorAssisId(null); + sysOrder.setStartTime(sysOrder.getOrderTime()); + sysOrder.setServerEndTime(sysOrder.getOrderTime()); + row = sysOrderMapper.insertSysOrder(sysOrder); } return row; } @@ -251,6 +281,7 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setMainOrderId(0L); sysOrder.setAfterSaleCommissOrder(1); sysOrder.setOrderId(sysOrder.getOrderId()+1); + sysOrder.setBusinessAffairId(null); return sysOrderMapper.insertSysOrder(sysOrder); } return 0; @@ -273,6 +304,7 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setAfterSaleId(null); sysOrder.setNutritionistId(null); sysOrder.setNutriAssisId(null); + sysOrder.setBusinessAffairId(null); } //提成单 if(sysOrder.getAfterSaleCommissOrder().intValue() == 1){ @@ -283,11 +315,17 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setPlannerAssisId(null); sysOrder.setOperatorId(null); sysOrder.setOperatorAssisId(null); + sysOrder.setBusinessAffairId(null); + sysOrder.setOnSaleId(null); + sysOrder.setPushPreSaleId(null); } if("3".equals(sysOrder.getOrderType())){ sysOrder.setPreSaleId(null); + sysOrder.setBusinessAffairId(null); } if("4".equals(sysOrder.getOrderType())){ + sysOrder.setMainOrderId(0L); + sysOrder.setAfterSaleCommissOrder(0); sysOrder.setPreSaleId(null); sysOrder.setOnSaleId(null); sysOrder.setPushPreSaleId(null); @@ -296,6 +334,22 @@ public class SysOrderServiceImpl implements ISysOrderService { sysOrder.setOperatorId(null); sysOrder.setOperatorAssisId(null); } + if("5".equals(sysOrder.getOrderType())){ + sysOrder.setServeTimeId(null); + sysOrder.setGiveServeDay(0); + sysOrder.setOnSaleId(null); + sysOrder.setPushPreSaleId(null); + sysOrder.setBusinessAffairId(null); + sysOrder.setAfterSaleId(null); + sysOrder.setNutritionistId(null); + sysOrder.setNutriAssisId(null); + sysOrder.setPlannerId(null); + sysOrder.setPlannerAssisId(null); + sysOrder.setOperatorId(null); + sysOrder.setOperatorAssisId(null); + sysOrder.setStartTime(sysOrder.getOrderTime()); + sysOrder.setServerEndTime(sysOrder.getOrderTime()); + } if(oldSysOrder.getStartTime() == null){//确保提成计算时间不为空 sysOrder.setCommissStartTime(sysOrder.getOrderTime()); } @@ -407,7 +461,7 @@ public class SysOrderServiceImpl implements ISysOrderService { LocalDate newStartTime = null; //判断是否提成单,拆分单中的副单,体验单,定金单 if(sysOrder.getStartTime() == null || sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 || - "2".equals(sysOrder.getOrderType()) || !isNeedByOrderMoneyType(sysOrder)){ + "2".equals(sysOrder.getOrderType()) || !isNeedByOrderMoneyType(sysOrder) || "5".equals(sysOrder.getOrderType())){ //设置服务到期时间 setOrderServerEndDate(sysOrder); sysOrder.setUpdateTime(new Date()); diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesPlanServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesPlanServiceImpl.java index 99161a48c..5b4d6ab56 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesPlanServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysRecipesPlanServiceImpl.java @@ -176,7 +176,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService { //判断是否提成单,拆分单中的副单,体验单,定金单 if (sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 || // "2".equals(sysOrder.getOrderType()) || // 体验单也需要生成计划 2021.05.29 - !isNeedByOrderMoneyType(sysOrder) || sysOrder.getCounted() == 1) { + !isNeedByOrderMoneyType(sysOrder) || sysOrder.getCounted() == 1 || "5".equals(sysOrder.getOrderType())) { System.out.println("---------------------" + sysOrder.getOrderId() + "不生成食谱------------------------"); continue; } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java b/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java index 96c68be4c..0bfba0f33 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java @@ -4,7 +4,7 @@ import com.stdiet.custom.domain.SysOrder; public class OrderUtils { - private static final String[] orderTypeArray = {"普通单","比例拆分单","体验单","售中单","商务单"}; + private static final String[] orderTypeArray = {"普通单","比例拆分单","体验单","售中单","商务单","基因单"}; private static final String[] orderCountTypeArray = {"一开单","二开单","一开单(拆分)","二开单(拆分)"}; diff --git a/stdiet-ui/src/components/OrderAdd/index.vue b/stdiet-ui/src/components/OrderAdd/index.vue index da543fdea..a34839e6f 100644 --- a/stdiet-ui/src/components/OrderAdd/index.vue +++ b/stdiet-ui/src/components/OrderAdd/index.vue @@ -9,7 +9,7 @@ > - + - + - - + + - + - + - + - - + + - + - + @@ -124,7 +124,7 @@ - + - + @@ -149,7 +149,7 @@ - + - + @@ -174,7 +174,7 @@ - + - + - + @@ -216,7 +216,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -273,7 +273,7 @@ --> - + --> - + - + - + { @@ -850,61 +842,10 @@ export default { // this.initPlanningAndOperation(); // }, "form.orderTypeList": function (newVal, oldVal) { - //判断订单类型是否选择了二开 - if ((newVal[1] == 1 || newVal[1] == 3) && newVal[0] != 4) { - this.form.secondAfterSaleFlag = 1; - this.secondAfterSaleFlagShow = true; - } else { - this.form.secondAfterSaleFlag = 0; - this.secondAfterSaleFlagShow = false; - } - //判断是否选择了比例拆分单 - if (newVal[0] == 1 || newVal[1] == 2 || newVal[1] == 3) { - this.orderRateOptionsShow = true; - this.form.nutritionistRate = "2,8"; - } else { - this.orderRateOptionsShow = false; - this.form.nutritionistRate = "0,10"; - } - //判断是否选择了体验单 - if (newVal[0] == 2) { - this.form.serveTimeId = 7; - this.form.conditioningProjectId = 12; - this.onSaleShow = true; - this.afterNutiShow = false; - } else { - this.form.onSaleId = null; - this.form.serveTimeId = 90; - 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; - } - } - //是否选择了商务单 - this.businessAffairShow = newVal[0] == 4; + let resultArray = orderTypeData.dealOrderModuleshowByOrderType(newVal, this.orderModuleshow, this.form); + this.orderModuleshow = resultArray[0]; + this.form = resultArray[1]; + }, }, }; diff --git a/stdiet-ui/src/components/OrderDetail/index.vue b/stdiet-ui/src/components/OrderDetail/index.vue index a8f2a422a..b08182be4 100644 --- a/stdiet-ui/src/components/OrderDetail/index.vue +++ b/stdiet-ui/src/components/OrderDetail/index.vue @@ -113,7 +113,7 @@ export default { response.data.weight = response.data.weight != null ? response.data.weight + "斤" : ""; response.data.giveServeDay = response.data.giveServeDay != null ? response.data.giveServeDay + "天" : ""; if(response.data.orderType == 4){ - response.data.preSale = response.data.businessAffair; + response.data.preSale = response.data.preSale != null ? response.data.preSale : response.data.businessAffair; } for (let i = 0; i < this.orderTitleData.length; i++) { this.orderDetailList.push({ diff --git a/stdiet-ui/src/components/OrderDrawer/index.vue b/stdiet-ui/src/components/OrderDrawer/index.vue index 1358ed683..803415f6c 100644 --- a/stdiet-ui/src/components/OrderDrawer/index.vue +++ b/stdiet-ui/src/components/OrderDrawer/index.vue @@ -110,6 +110,7 @@ >删除 - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + --> - + - + - + - +
-
+ +
+
@@ -21,118 +25,101 @@
- -
-

一、基础信息

二、食物以及对比照信息

-
+ -
-

体型对比照

-
- - +
+
+

早餐照片

+
+ + +
+
+
+

午餐照片

+
+ + +
+
+
+

晚餐照片

+
+ + +
+
+
+

加餐照片

+
+ + +
+
+
+

体型对比照

+
+ + +
+
-
- - - - - - - - - - - - - - - +
@@ -181,7 +168,8 @@ export default { }, commentRules:{}, scoreArray:[0.5,1,1.5,2,2.5,3,3.5,4,4.5,5], - commentFlag: false, //是否更新了点评 + commentFlag: false, //是否更新了点评, + dialogWidth: "1000px" }; }, methods: { @@ -245,10 +233,14 @@ export default { }, onClosed() { this.data = null; - this.callback = null; + //this.callback = null; this.punchLog = null; this.imageUrl = []; this.punchLogDetail = []; + if(this.commentFlag){ + console.log("cbhdsjcsnjcsdc"); + this.callback && this.callback(); + } }, clickComment(){ @@ -258,12 +250,13 @@ export default { comment: this.punchLog.comment, executionScore: this.punchLog.executionScore == null ? 0 : this.punchLog.executionScore, } - this.commentTitle = "点评「"+this.punchLog.customerName+" "+ this.punchLog.logTime +"」打卡"; + this.commentTitle = "点评「"+ this.punchLog.logTime +"」打卡"; this.commentVisible = true; - + this.dialogWidth = "1200px"; }, commentClosed(){ this.commentVisible = false; + this.dialogWidth = "1000px"; }, commentSubmit(){ /*if(this.commentForm.executionScore == null || this.commentForm.executionScore == 0){ @@ -273,10 +266,9 @@ export default { commentPunchContent(this.commentForm).then((res) => { if(res.code == 200){ this.msgSuccess("点评成功"); - this.commentVisible = false; + this.commentClosed(); this.getPunchLogById(); this.commentFlag = true; - this.callback && this.callback(); }else{ this.msgSuccess("点评失败"); } @@ -289,13 +281,13 @@ export default { diff --git a/stdiet-ui/src/utils/healthyData.js b/stdiet-ui/src/utils/healthyData.js index e8ac89b1b..16f74c6d5 100644 --- a/stdiet-ui/src/utils/healthyData.js +++ b/stdiet-ui/src/utils/healthyData.js @@ -823,12 +823,12 @@ export function dealHealthy(customerHealthy) { return customerHealthy; } -export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂","10":"消化系统管理"}; -export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂","10":"消化系统管理"}; +export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂","10":"消化系统管理","14":"增重"}; +export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂","10":"消化系统管理","14":"增重"}; //需要填写慢病调查问卷的项目 export const extendHealthyIndex = [5, 6, 1, 2, 13,4,7]; //跳过减脂经历问卷的项目 -export const notExperienceIndex = [3,1,2,13,4,7,10]; +export const notExperienceIndex = [3,1,2,13,4,7,10,14]; export function getTitleKey(projectId){ return extendHealthyTitle[projectId+""] != null ? extendHealthyTitle[projectId+""] : extendHealthyTitle["0"]; diff --git a/stdiet-ui/src/utils/orderType.js b/stdiet-ui/src/utils/orderType.js index 55bec0f4b..203321814 100644 --- a/stdiet-ui/src/utils/orderType.js +++ b/stdiet-ui/src/utils/orderType.js @@ -80,6 +80,18 @@ export const orderTypeArray = [ value: 4, label: "商务单", children: orderCountTypeArray + }, + { + value: 5, + label: "基因单", + children:[{ + value: 0, + label: "一开单", + children: [{ + value: 0, + label: "全款单" + }] + }] } ] @@ -115,3 +127,186 @@ export const orderRateArray = [ remark: "" } ] + +//订单模块控制标识,默认为普通单、一开单、全款单 +export const orderModuleshow = { + orderTypeShow: true, + secondAfterSaleFlagShow: false, + amountShow: true, + payTypeShow: true, + accountShow: true, + serveTimeShow: true, + giveServeDayShow: true, + conditioningProjectShow: true, + preSaleShow: true, + businessAffairShow: false, + pushPreSaleShow: false, + onSaleShow: false, + afterSaleShow: true, + nutritionistShow: true, + nutritionistRateShow: false, + nutriAssisShow: true, + plannerShow: true, + plannerAssisShow: true, + operatorShow: true, + operatorAssisShow: true, + orderTimeShow: true, + startTimeShow: true, + reviewStatusShow: true, + remarkShow: true +} + +/** + * 根据订单类型处理订单模块的显示与隐藏 + * + * @param {*} orderType 订单类型 + * @param {*} moduleshow 订单模块控制标识对象 + * @param {*} form 订单模块控制标识对象 + */ +export function dealOrderModuleshowByOrderType(orderType, moduleshow, form){ + + let addFlag = form.orderId == undefined || form.orderId == null; + + if(addFlag){ + //还原 + moduleshow = { + ...orderModuleshow + }; + + form.serveTimeId = 90; + form.conditioningProjectId = 0; + form.nutritionistRate = "0,10"; + form.pushPreSaleId = null; + form.onSaleId = null; + form.businessAffairId = null; + form.secondAfterSaleFlag = 0; + + form.payTypeId = 3; + } + + switch(orderType[0]){ + //普通单 + case 0: + break; + //拆分单 + case 1: + moduleshow.nutritionistRateShow = true; + if(addFlag){ + form.nutritionistRate = "2,8"; + } + break; + //体验单 + case 2: + if(addFlag){ + form.serveTimeId = 7; + form.conditioningProjectId = 12; + } + moduleshow.onSaleShow = true; + moduleshow.afterSaleShow = false; + moduleshow.nutritionistShow = false; + moduleshow.nutriAssisShow = false; + break; + //售中单 + case 3: + if(addFlag){ + form.preSaleId = null; + } + moduleshow.onSaleShow = true; + moduleshow.preSaleShow = false; + if(orderType[1] == 2 || orderType[1] == 3){ + moduleshow.nutritionistRateShow = true; + if(addFlag){ + form.nutritionistRate = "2,8"; + } + } + //一开单 + if(orderType[1] == 0 || orderType[1] == 2){ + moduleshow.pushPreSaleShow = true; + } + break; + //商务单 + case 4: + if(addFlag){ + form.preSaleId = null; + form.plannerId = null; + form.plannerAssisId = null; + form.operatorId = null; + form.operatorAssisId = null; + } + + moduleshow.preSaleShow = false; + moduleshow.plannerShow = false; + moduleshow.plannerAssisShow = false; + moduleshow.operatorShow = false; + moduleshow.operatorAssisShow = false; + moduleshow.businessAffairShow = true; + break; + //基因单 + case 5: + if(addFlag){ + form.payTypeId = 9; + form.conditioningProjectId = 15; + } + moduleshow.serveTimeShow = false; + //moduleshow.accountShow = false; + moduleshow.giveServeDayShow = false; + moduleshow.afterSaleShow = false; + moduleshow.nutritionistShow = false; + moduleshow.nutriAssisShow = false; + moduleshow.plannerShow = false; + moduleshow.plannerAssisShow = false; + moduleshow.operatorShow = false; + moduleshow.operatorAssisShow = false; + moduleshow.startTimeShow = false; + break; + default: + break; + } + + if(addFlag){ + if(orderType[1] == 1 || orderType[1] == 3){ + form.secondAfterSaleFlag = 1; + moduleshow.secondAfterSaleFlagShow = true; + } + } + + if(!addFlag){ + if(form.afterSaleCommissOrder != null && form.afterSaleCommissOrder != 0){ + let afterSaleCommissShow = { + orderTypeShow: true, + secondAfterSaleFlagShow: false, + amountShow: true, + payTypeShow: true, + accountShow: true, + serveTimeShow: true, + giveServeDayShow: true, + conditioningProjectShow: true, + preSaleShow: true, + businessAffairShow: false, + pushPreSaleShow: false, + onSaleShow: false, + afterSaleShow: false, + nutritionistShow: false, + nutritionistRateShow: false, + nutriAssisShow: false, + plannerShow: false, + plannerAssisShow: false, + operatorShow: false, + operatorAssisShow: false, + orderTimeShow: true, + startTimeShow: true, + reviewStatusShow: true, + remarkShow: true + } + moduleshow = { + ...afterSaleCommissShow + }; + } + } + + + return [moduleshow, form]; + //console.log(moduleshow); + + //console.log(orderModuleshow); +}