Commit 94ea820b authored by zhengke's avatar zhengke

no message

parent 26907e33
......@@ -696,17 +696,18 @@ export default {
};
},
computed: {
CourseCalculation(){
return this.courseInformationList.forEach(item=>{return item})
}
// CourseCalculation(){
// return this.courseInformationList.forEach(item=>{return item})
// }
},
watch: {
CourseCalculation:{
handler(val, oldVal) {
this.totalCourseFee()
},
deep: true,
},
// CourseCalculation:{
// handler(val, oldVal) {
// console.log(val,'====')
// this.totalCourseFee()
// },
// deep: true,
// },
},
created() {
if (this.saveObj && this.saveObj.CourseId) {
......@@ -741,7 +742,7 @@ export default {
let dataObj = {
CourseName: "",//课程名称
ClassId: 0, //班级编号
GuestNum: 0, //人数
GuestNum: 1, //人数
B2CRatio: 0,
B2CReNewRatio: 0,
Unit_Price: 0,
......@@ -778,17 +779,15 @@ export default {
ScrollSchoolId: -1,
// UnitPrice:0
}
if(item.CourseName){
dataObj.CourseName = item.CourseName
}
if (item.ClassId) {
dataObj.ClassId = item.ClassId;
}
if (item.Unit_Price) {
dataObj.Unit_Price = item.Unit_Price;
dataObj.Class_Price = item.Unit_Price;
dataObj.UnitPrice = item.Unit_Price;
if (item.SellPrice) {
dataObj.Unit_Price = item.SellPrice;
dataObj.Class_Price = item.SellPrice;
}
if (item.SourceId) {
dataObj.SourceId = item.SourceId;
......@@ -812,6 +811,7 @@ export default {
0}%`;
}
this.courseInformationList.push(dataObj)
});
this.totalCourseFee()
......@@ -821,137 +821,26 @@ export default {
methods: {
// 多个课程计算
totalCourseFee(){
this.courseInformationList.forEach(item=>{
var guestNum = 0;
if (item.GuestNum && item.GuestNum > 0) {
guestNum = Number(item.GuestNum);
}
let temp = this.CourseList.find(
x => x.CourseId == item.CourseId
);
if (temp) {
this.courseObj = temp;
var tempDiscountMoney = 0; //优惠金额
// var tempSaleRemark = `直客首次报名优惠比例${temp.B2CRatio ?? 0}%`; //备注
//插班课时单价
var classHourPrice = temp.SellPrice / this.courseObj.ClassHours;
var chaBanPrice = Number(
classHourPrice *
(this.courseObj.ClassHours - item.StartClassHours)
).toFixed(2);
if (guestNum == 1) {
if (temp.CoursePriceList && temp.CoursePriceList.length > 0) {
if (temp.CoursePriceList[0].PriceType == 0) {
if (item.IsChaBan == 1) {
tempDiscountMoney =
(chaBanPrice * temp.CoursePriceList[0].PriceMoney) / 100;
} else {
tempDiscountMoney =
(temp.SellPrice * temp.CoursePriceList[0].PriceMoney) / 100;
}
// tempSaleRemark = "单人报名优惠" + temp.CoursePriceList[0].PriceMoney + "%";
} else {
tempDiscountMoney = item.CoursePriceList[0].PriceMoney;
// tempSaleRemark = "单人报名优惠" + temp.CoursePriceList[0].PriceMoney;
}
}
}
if (guestNum > 1) {
if (temp.CoursePriceList && temp.CoursePriceList.length > 0) {
if (temp.CoursePriceList[1].PriceType == 0) {
// tempSaleRemark = "双人报名优惠" + temp.CoursePriceList[1].PriceMoney + "%";
if (this.OrderMsg.IsChaBan == 1) {
tempDiscountMoney =
(chaBanPrice * temp.CoursePriceList[1].PriceMoney) / 100;
} else {
tempDiscountMoney =
(temp.SellPrice * temp.CoursePriceList[1].PriceMoney) / 100;
}
} else {
tempDiscountMoney = item.CoursePriceList[1].PriceMoney;
// tempSaleRemark = "双人报名优惠" + temp.CoursePriceList[1].PriceMoney;
}
}
}
var perDiscountMoney = Number(tempDiscountMoney).toFixed(2);
item.PerDiscountMoney = perDiscountMoney;
//计算每人优惠和总优惠
// if (item.IsChaBan == 1) {
// item.Unit_Price = chaBanPrice;
// this.UnitPrice = chaBanPrice;
// } else {
// item.Unit_Price = temp.SellPrice;
// this.UnitPrice = temp.SellPrice;
// }
// item.SaleRemark = tempSaleRemark;
} else {
if (this.saveObj.ClassId) {
item.ClassId = this.saveObj.ClassId;
}
if (this.saveObj.Unit_Price) {
item.Unit_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
}
if (this.saveObj.SourceId) {
item.SourceId = this.saveObj.SourceId;
}
this.courseObj = {};
}
/**计算少价---开始*/
var tempPerLessMoney = 0;
if (item.PerLessMoney && item.PerLessMoney > 0) {
tempPerLessMoney = item.PerLessMoney;
}
item.LessPrice = tempPerLessMoney * guestNum;
/**计算少价----结束*/
var unit_price = 0;
if (item.Unit_Price && item.Unit_Price > 0) {
unit_price = Number(item.Unit_Price);
}
var str = "";
//计算应收价格
if (item.IsChaBan == 1) {
var newPreferPrice = 0;
if (
this.courseObj &&
this.courseObj.CourseId &&
this.courseObj.CourseId > 0
) {
newPreferPrice = chaBanPrice * guestNum;
}
item.PreferPrice =
Number(newPreferPrice).toFixed(2) - item.LessPrice;
} else {
item.PreferPrice =
Number(guestNum * unit_price).toFixed(2) - item.LessPrice;
}
//留学就业订单
if (item.OrderType == 2) {
item.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
this.courseInformationList.forEach((item)=>{
item.Unit_Price = item.GuestNum*item.Unit_Price
if(this.stuData.StuList[0].IsRenewGuest==1){
item.DiscountMoney = this.accAdd(
item.DiscountMoney,
this.accMul(
item.Class_Price,
item.B2CReNewRatio / 100
)
);
item.PreferPrice = item.GuestNum*item.Unit_Price-item.DiscountMoney
}else{
item.DiscountMoney = this.accAdd(
item.DiscountMoney,
this.accMul(item.Class_Price, item.B2CRatio / 100)
);
item.PreferPrice = item.GuestNum*item.Unit_Price-item.DiscountMoney
}
item.GuestNum = this.stuData.StuList.length;
item.DiscountMoney = 0;
this.stuData.StuList.map(e => {
if (e.IsRenewGuest == 0) {
item.DiscountMoney = this.accAdd(
item.DiscountMoney,
this.accMul(item.Class_Price, item.B2CRatio / 100)
);
} else {
item.DiscountMoney = this.accAdd(
item.DiscountMoney,
this.accMul(
item.Class_Price,
item.B2CReNewRatio / 100
)
);
}
});
})
},
//获取协助人员
......
......@@ -41,7 +41,7 @@
</div>
<div class="col-4">
<p class="yueke-title">已选:</p>
<p class="yueke-CourseName" v-for="(item,index) in selection">
<p class="yueke-CourseName" v-for="(item,index) in selected">
<span>{{index+1}}</span>
{{item.CourseName}}
</p>
......@@ -53,8 +53,7 @@
-->
<q-table
:pagination="msg"
selection="multiple"
:selected.sync="selection"
no-data-label="暂无相关数据"
flat
class="sticky-tow-column-table sticky-two-header-table"
......@@ -64,9 +63,11 @@
row-key="ClassId"
@update:selected="emitSel"
:selected-rows-label="getSelectedString"
selection="multiple"
:selected.sync="selected"
table-class="table"
>
<template v-slot:body-cell-CourseName="props">
<!-- <template v-slot:body-cell-CourseName="props">
<q-td :props="props">
{{ props.row.CourseName }}
</q-td>
......@@ -80,7 +81,7 @@
:input="true"
@input="changePage"
/>
</template>
</template> -->
</q-table>
</div>
</template>
......@@ -109,34 +110,34 @@ export default {
},
data() {
return {
selection: [],
selected: [],
columns: [
{
name: "CourseName",
required: true,
label: "课程",
field: "CourseName",
align: "left"
align: "left",
field: row => row.CourseName,
format: val => `${val}`,
sortable: true
},
{
name: "CourseSubjectName",
required: true,
label: "所属科目",
align: "left",
field: row => row.CourseSubjectName
field: row => row.CourseSubjectName,
format: val => `${val}`,
sortable: true
},
// {
// name: "CateName",
// required: true,
// label: "系列",
// align: "left",
// field: row => row.CateName
// },
{
name: "SellPrice",
required: true,
label: "直客价",
align: "left",
field: row => row.SellPrice.toFixed(2)
field: row => row.SellPrice.toFixed(2),
format: val => `${val}`,
sortable: true
}
],
// msg: {
......@@ -179,7 +180,7 @@ export default {
};
},
mounted() {
this.selection = this.select;
this.selected = this.select;
this.getCourseList();
this.queryCourseSubject();
// this.getCategorytree();
......@@ -187,7 +188,9 @@ export default {
methods: {
// 多选
getSelectedString () {
return this.selection.length === 0 ? '' : `${this.selection.length} record${this.selection.length > 1 ? 's' : ''} selected of ${this.dataList.length}`
return this.selected.length === 0 ? '' : `${this.selected.length}
record${this.selected.length > 1 ? 's' : ''}
selected of ${this.dataList.length}`
},
emitSel(val) {
this.$emit("select", val);
......
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