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

1

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