Commit 94ea820b authored by zhengke's avatar zhengke

no message

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