Commit 450fc143 authored by 罗超's avatar 罗超

1

parent ec93274c
......@@ -267,8 +267,11 @@
if (this.OrderMsg && this.OrderMsg.CourseId) {
this.courseObj = this.CourseList.find(x => x.CourseId == this.OrderMsg.CourseId);
}
if (!this.saveObj.OrderId){
this.calcPrice();
}
}
});
},
//计算课程单价和应收金额
......@@ -319,7 +322,8 @@
var perDiscountMoney = Number(tempDiscountMoney).toFixed(2);
this.OrderMsg.PerDiscountMoney = perDiscountMoney;
// this.OrderMsg.DiscountMoney = perDiscountMoney * guestNum;
this.OrderMsg.DiscountMoney=this.OrderMsg.Class_Price*this.OrderMsg.GuestNum*this.OrderMsg.B2CRatio
//计算每人优惠和总优惠
if (this.OrderMsg.IsChaBan == 1) {
this.OrderMsg.Unit_Price = chaBanPrice;
......@@ -404,8 +408,8 @@
this.OrderMsg.UpOrderId = tempData.UpOrderId;
this.OrderMsg.DiscountMoney = tempData.DiscountMoney;
this.OrderMsg.PerDiscountMoney = tempData.PerDiscountMoney;
this.OrderMsg.B2CRatio = tempData.B2CRatio>1?(tempData.B2CRatio/100):tempData.B2CRatio;
this.OrderMsg.B2CReNewRatio = tempData.B2CReNewRatio>1?(tempData.B2CReNewRatio/100):tempData.B2CReNewRatio;
this.OrderMsg.B2CRatio = tempData.B2CRatio;
this.OrderMsg.B2CReNewRatio = tempData.B2CReNewRatio;
this.OrderMsg.CustomerId=tempData.CustomerId
this.OrderMsg.CourseConsultantId=tempData.CourseConsultantId
this.UnitPrice = this.OrderMsg.Unit_Price;
......@@ -459,13 +463,14 @@
}
if(this.saveObj.B2CRatio){
this.OrderMsg.B2CRatio = this.saveObj.B2CRatio>1?this.saveObj.B2CRatio/100:this.saveObj.B2CRatio;
this.OrderMsg.B2CRatio = this.saveObj.B2CRatio
}
if(this.saveObj.B2CReNewRatio){
this.OrderMsg.B2CReNewRatio = this.saveObj.B2CReNewRatio>1?this.saveObj.B2CReNewRatio/100:this.saveObj.B2CReNewRatio;
this.OrderMsg.B2CReNewRatio = this.saveObj.B2CReNewRatio
}
this.OrderMsg.SaleRemark = `直客首次报名优惠比例${this.saveObj.B2CRatio }%`; //备注
}
this.OrderMsg.DiscountMoney=this.OrderMsg.Class_Price*this.OrderMsg.GuestNum*(this.OrderMsg.B2CRatio>1?this.OrderMsg.B2CRatio/100:this.OrderMsg.B2CRatio)
this.IsShowEditOrder = true;
this.calcPrice();
}
......
......@@ -472,6 +472,7 @@ export default {
},
//计算课程单价和应收金额
calcPrice() {
console.log("this.OrderMsg",this.OrderMsg)
var guestNum = 0;
if (this.OrderMsg.GuestNum && this.OrderMsg.GuestNum > 0) {
guestNum = Number(this.OrderMsg.GuestNum);
......@@ -482,7 +483,7 @@ export default {
if (temp) {
this.courseObj = temp;
var tempDiscountMoney = 0; //优惠金额
var tempSaleRemark = `直客首次报名优惠比例${temp.B2CRatio ?? 0}%`; //备注
// var tempSaleRemark = `直客首次报名优惠比例${temp.B2CRatio ?? 0}%`; //备注
//插班课时单价
var classHourPrice = temp.SellPrice / this.courseObj.ClassHours;
var chaBanPrice = Number(
......@@ -525,21 +526,15 @@ export default {
}
var perDiscountMoney = Number(tempDiscountMoney).toFixed(2);
this.OrderMsg.PerDiscountMoney = perDiscountMoney;
// this.OrderMsg.DiscountMoney = perDiscountMoney * guestNum;
// this.OrderMsg.DiscountMoney =
// this.OrderMsg.Class_Price *
// this.OrderMsg.GuestNum *
// this.OrderMsg.B2CRatio;
//计算每人优惠和总优惠
if (this.OrderMsg.IsChaBan == 1) {
this.OrderMsg.Unit_Price = chaBanPrice;
this.UnitPrice = chaBanPrice;
} else {
this.OrderMsg.Unit_Price = temp.SellPrice;
this.UnitPrice = temp.SellPrice;
}
this.OrderMsg.SaleRemark = tempSaleRemark;
// if (this.OrderMsg.IsChaBan == 1) {
// this.OrderMsg.Unit_Price = chaBanPrice;
// this.UnitPrice = chaBanPrice;
// } else {
// this.OrderMsg.Unit_Price = temp.SellPrice;
// this.UnitPrice = temp.SellPrice;
// }
// this.OrderMsg.SaleRemark = tempSaleRemark;
} else {
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
......@@ -589,6 +584,7 @@ export default {
this.OrderMsg.GuestNum = this.stuData.StuList.length;
this.OrderMsg.DiscountMoney = 0;
this.stuData.StuList.map(e => {
if (e.IsRenewGuest == 0) {
this.OrderMsg.DiscountMoney +=
......@@ -609,8 +605,7 @@ export default {
this.OrderMsg.OrderNature = 0;
this.OrderMsg.OldPreferPrice = 0;
this.OrderMsg.StartClassHours = 0;
this.OrderMsg.IsChaBan = 0
;
this.OrderMsg.IsChaBan = 0;
this.OrderMsg.EffectTime = "";
this.OrderMsg.UpOrderId = 0;
this.OrderMsg.JoinType = 1;
......@@ -751,38 +746,38 @@ export default {
}
//插班报名计算应收
if (this.OrderMsg.IsChaBan == 1) {
if (this.modityOrderType == 1 || this.modityOrderType == 2) {
if (
!this.courseObj ||
(this.courseObj && !this.courseObj.ClassHours)
) {
if (this.OrderMsg && this.OrderMsg.CourseId) {
this.courseObj = this.CourseList.find(
x => x.CourseId == this.OrderMsg.CourseId
);
}
}
//插班课时单价
var classHourPrice =
this.courseObj.SellPrice / this.courseObj.ClassHours;
var chaBanPrice = Number(
classHourPrice *
(this.courseObj.ClassHours - this.OrderMsg.StartClassHours)
).toFixed(2);
var newPreferPrice =
chaBanPrice * this.OrderMsg.GuestNum - this.OrderMsg.LessPrice;
this.OrderMsg.PreferPrice = Number(newPreferPrice).toFixed(2);
}
}
// if (this.OrderMsg.IsChaBan == 1) {
// if (this.modityOrderType == 1 || this.modityOrderType == 2) {
// if (
// !this.courseObj ||
// (this.courseObj && !this.courseObj.ClassHours)
// ) {
// if (this.OrderMsg && this.OrderMsg.CourseId) {
// this.courseObj = this.CourseList.find(
// x => x.CourseId == this.OrderMsg.CourseId
// );
// }
// }
// //插班课时单价
// var classHourPrice =
// this.courseObj.SellPrice / this.courseObj.ClassHours;
// var chaBanPrice = Number(
// classHourPrice *
// (this.courseObj.ClassHours - this.OrderMsg.StartClassHours)
// ).toFixed(2);
// var newPreferPrice =
// chaBanPrice * this.OrderMsg.GuestNum - this.OrderMsg.LessPrice;
// this.OrderMsg.PreferPrice = Number(newPreferPrice).toFixed(2);
// }
// }
//正常报名计算应收
if (this.OrderMsg.IsChaBan == 0) {
if (this.modityOrderType == 1 || this.modityOrderType == 2) {
this.OrderMsg.PreferPrice =
this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price -
this.OrderMsg.LessPrice;
}
}
// if (this.OrderMsg.IsChaBan == 0) {
// if (this.modityOrderType == 1 || this.modityOrderType == 2) {
// this.OrderMsg.PreferPrice =
// this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price -
// this.OrderMsg.LessPrice;
// }
// }
this.OrderMsg.StuIds = this.stuData.StuList.map(e => e.StuId).toString();
this.OrderMsg.CustomerId = this.stuData.CustomerId;
setClassOrder(this.OrderMsg).then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment