Commit bdf46615 authored by 吴春's avatar 吴春

1

parent a0f193e1
......@@ -86,6 +86,7 @@
/>
</template>
<q-input
v-if="false"
filled
stack-label
:dense="false"
......@@ -94,9 +95,46 @@
class="col-6 q-py-sm"
label="优惠金额"
/>
<template v-if="item.Unit_PriceType==2">
<q-input
filled
stack-label
:dense="false"
type="number"
:min="1"
@input="totalCourseFee()"
v-model="item.TotalClassHours"
class="col-6 q-py-sm"
label="总课时数"
/>
</template>
<q-input
filled
stack-label
:dense="false"
type="number"
:min="0"
@input="totalCourseFee()"
v-model="item.TextbookFee"
class="col-6 q-py-sm"
label="课件费"
/>
<q-input
filled
stack-label
:dense="false"
type="number"
:min="0"
@input="totalCourseFee()"
v-model="item.CoursewareFee"
class="col-6 q-py-sm"
label="教材费"
/>
<template v-if="modityOrderType == 3">
<q-input
filled
min
stack-label
:dense="false"
v-model="item.Unit_Price"
......@@ -139,7 +177,7 @@
class="col-6 q-py-sm"
label="客人来源"
/>
<q-select
<q-select v-if="false"
:disable="
modityOrderType == 2 ||
item.JoinType == 3 ||
......@@ -377,6 +415,7 @@
/>
</template>
<q-input
v-if="false"
filled
stack-label
:dense="false"
......@@ -385,6 +424,41 @@
class="col-6 q-py-sm"
label="优惠金额"
/>
<template v-if="OrderMsg.Unit_PriceType==2">
<q-input
filled
stack-label
:dense="false"
type="number"
:min="1"
@input="oneTotalCourseFee()"
v-model="OrderMsg.TotalClassHours"
class="col-6 q-py-sm"
label="总课时数"
/>
</template>
<q-input
filled
stack-label
:dense="false"
type="number"
:min="0"
@input="oneTotalCourseFee()"
v-model="OrderMsg.TextbookFee"
class="col-6 q-py-sm"
label="课件费"
/>
<q-input
filled
stack-label
:dense="false"
type="number"
:min="0"
@input="oneTotalCourseFee()"
v-model="OrderMsg.CoursewareFee"
class="col-6 q-py-sm"
label="教材费"
/>
<!-- <q-input filled stack-label :dense="false" v-model="OrderMsg.PerDiscountMoney" :disable="true"
class="col-6 q-py-sm" label="优惠金额(每人)" :hint="'总优惠金额:'+(OrderMsg.PerDiscountMoney*OrderMsg.GuestNum)" /> -->
<template v-if="modityOrderType == 3">
......@@ -459,7 +533,7 @@
</q-item>
</template>
</q-select> -->
<q-select
<q-select v-if="false"
:disable="
modityOrderType == 2 ||
OrderMsg.JoinType == 3 ||
......@@ -648,6 +722,10 @@ export default {
OrderSource: 0,
SaleRemark: "",
Class_Price: 0, //单价
Unit_PriceType:1,//价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
TotalClassHours:0,//总课时数 2024-08-26 add by:W
CoursewareFee:0,//教材费
TextbookFee:0,//课件费
OrderId: 0,
OrderType: 0, //订单类型(1-班级课程订单,2-留学就业订单)
SourceId: 0, //来源编号
......@@ -729,6 +807,7 @@ export default {
this.OrderMsg.HelpEnterId = this.stuData.StuList[0].STTeacherId;
this.AssistName = this.stuData.StuList[0].STTeacherName
}
console.log("selectedCourseList",this.selectedCourseList);
if(this.selectedCourseList.length>1){
this.selectedCourseList.forEach(item => {
let dataObj = {
......@@ -742,6 +821,10 @@ export default {
OrderSource: 0,
SaleRemark: "",
Class_Price: 0, //单价
Unit_PriceType:1,//价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
TotalClassHours:0,//总课时数 2024-08-26 add by:W
CoursewareFee:0,//教材费
TextbookFee:0,//课件费
OrderId: 0,
OrderType: 0, //订单类型(1-班级课程订单,2-留学就业订单)
SourceId: 0, //来源编号
......@@ -781,6 +864,13 @@ export default {
dataObj.Unit_Price = item.SellPrice;
dataObj.Class_Price = item.SellPrice;
}
if (item.SellPriceType) {
dataObj.Unit_PriceType = item.SellPriceType;
}
if (item.ClassHours) {
dataObj.TotalClassHours = item.ClassHours;
}
if (item.SourceId) {
dataObj.SourceId = item.SourceId;
}
......@@ -811,6 +901,14 @@ export default {
}
},
methods: {
//单个课程计算
oneTotalCourseFee(){
if(this.OrderMsg.Unit_PriceType==2){
this.OrderMsg.PreferPrice = this.OrderMsg.GuestNum*this.OrderMsg.Unit_Price*this.OrderMsg.TotalClassHours+Number(this.OrderMsg.TextbookFee)+Number(this.OrderMsg.CoursewareFee)
}
},
// 多个课程计算
totalCourseFee(){
this.courseInformationList.forEach((item)=>{
......@@ -822,13 +920,28 @@ export default {
item.B2CReNewRatio / 100
)
);
item.PreferPrice = item.GuestNum*item.Unit_Price
if(item.Unit_PriceType==1){
item.PreferPrice = item.GuestNum*item.Unit_Price+Number(item.TextbookFee)+Number(item.CoursewareFee)
}
else if(item.Unit_PriceType==2){
item.TextbookFee=Number((item.TotalClassHours*item.Unit_Price*item.GuestNum)*(20/100)).toFixed(2);
item.PreferPrice = (item.GuestNum*item.Unit_Price*item.TotalClassHours)+Number(item.TextbookFee)+Number(item.CoursewareFee)
}
}else{
item.DiscountMoney = this.accAdd(
item.DiscountMoney,
this.accMul(item.Class_Price, item.B2CRatio / 100)
);
item.PreferPrice = item.GuestNum*item.Unit_Price
if(item.Unit_PriceType==1){
item.PreferPrice = item.GuestNum*item.Unit_Price+Number(item.TextbookFee)+Number(item.CoursewareFee)
}
else if(item.Unit_PriceType==2){
item.TextbookFee=Number((item.TotalClassHours*item.Unit_Price*item.GuestNum)*(20/100)).toFixed(2);
item.PreferPrice = item.GuestNum*item.Unit_Price*item.TotalClassHours+Number(item.TextbookFee)+Number(item.CoursewareFee)
}
//item.PreferPrice = item.GuestNum*item.Unit_Price
}
})
},
......@@ -889,11 +1002,15 @@ export default {
if (this.OrderMsg.GuestNum && this.OrderMsg.GuestNum > 0) {
guestNum = Number(this.OrderMsg.GuestNum);
}
if(this.saveObj.SellPriceType==2){
this.OrderMsg.TextbookFee=((Number(this.OrderMsg.TotalClassHours) * Number(this.OrderMsg.Unit_Price) * Number(this.OrderMsg.GuestNum)) * (20/100)).toFixed(2);
}
let temp = this.CourseList.find(
x => x.CourseId == this.OrderMsg.CourseId
);
console.log("我是计算价格",temp);
if (temp) {
console.log("我是计算价格111",temp);
this.courseObj = temp;
var tempDiscountMoney = 0; //优惠金额
// var tempSaleRemark = `直客首次报名优惠比例${temp.B2CRatio ?? 0}%`; //备注
......@@ -949,6 +1066,7 @@ export default {
// }
// this.OrderMsg.SaleRemark = tempSaleRemark;
} else {
console.log("我是计算价格2222",temp);
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
}
......@@ -982,13 +1100,26 @@ export default {
this.courseObj.CourseId &&
this.courseObj.CourseId > 0
) {
newPreferPrice = chaBanPrice * guestNum;
if(this.OrderMsg.Unit_PriceType==1){
newPreferPrice= chaBanPrice * guestNum
}
else if(this.OrderMsg.Unit_PriceType==2){
newPreferPrice = chaBanPrice * guestNum*this.OrderMsg.TotalClassHours
}
}
console.log("我进来了...",this.OrderMsg);
this.OrderMsg.PreferPrice =
Number(newPreferPrice).toFixed(2) - this.OrderMsg.LessPrice;
} else {
this.OrderMsg.PreferPrice =
if(this.OrderMsg.Unit_PriceType==1){
this.OrderMsg.PreferPrice =
Number(guestNum * unit_price).toFixed(2) - this.OrderMsg.LessPrice;
}
else if(this.OrderMsg.Unit_PriceType==2){
this.OrderMsg.PreferPrice =
Number((guestNum * unit_price*this.OrderMsg.TotalClassHours)+Number(this.OrderMsg.TextbookFee)).toFixed(2) - this.OrderMsg.LessPrice;
}
}
//留学就业订单
if (this.OrderMsg.OrderType == 2) {
......@@ -1037,6 +1168,8 @@ export default {
this.OrderMsg.B2CReNewRatio = 0;
this.OrderMsg.CustomerId = 0;
this.OrderMsg.CourseConsultantId = 0;
this.OrderMsg.TotalClassHours = 0;
this.OrderMsg.Unit_PriceType = 1;
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OrderNature = 1;
}
......@@ -1052,7 +1185,16 @@ export default {
if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId;
}
if (this.saveObj.SellPriceType) {
this.OrderMsg.Unit_PriceType = this.saveObj.SellPriceType;
}
if (this.saveObj.ClassHours) {
this.OrderMsg.TotalClassHours = this.saveObj.ClassHours;
}
console.log("this.OrderMsg.TotalClassHours",this.OrderMsg.TotalClassHours);
console.log("this.OrderMsg.Unit_Price",this.OrderMsg.Unit_Price);
console.log("this.OrderMsg.GuestNum",this.OrderMsg.GuestNum);
if (this.saveObj.CourseId) {
this.OrderMsg.CourseId = this.saveObj.CourseId;
} else {
......
......@@ -17,13 +17,13 @@
<q-icon name="check" class="check-icon" />
</div>
</div>
<div class="box-businessModel" style="margin-right:0;" :class="{ 'checked-border': type == 3 }" @click="chooseChange(3)">
<!-- <div class="box-businessModel" style="margin-right:0;" :class="{ 'checked-border': type == 3 }" @click="chooseChange(3)">
<i class="iconfont icon-vipkecheng" style="font-size:38px"></i>
<div>VIP课程</div>
<div class="right" v-if="type == 3">
<q-icon name="check" class="check-icon" />
</div>
</div>
</div> -->
</div>
</template>
<script>
......
......@@ -58,6 +58,21 @@
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-SellPriceType="props">
<q-td :props="props">
<q-badge :color="props.value == 1 ? 'negative' : 'primary'" :label="props.value == 1? '课程总价' : '课时单价'" />
</q-td>
</template>
<template v-slot:body-cell-TextbookFee="props">
<q-td :props="props">
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-CoursewareFee="props">
<q-td :props="props">
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-B2CRatio="props" v-if="false">
<q-td :props="props">
<span>{{ props.row.B2CRatio }}%</span>
......@@ -370,6 +385,28 @@
align: "left",
field: row => row.SellPrice.toFixed(2)
},
,
{
name: "SellPriceType",
required: true,
label: "价格类型",
align: "left",
field: row => row.SellPriceType
},
{
name: "TextbookFee",
required: true,
label: "教材费",
align: "left",
field: row => row.TextbookFee.toFixed(2)
},
{
name: "CoursewareFee",
required: true,
label: "课件费",
align: "left",
field: row => row.CoursewareFee.toFixed(2)
},
// {
// name: "B2CRatio",
// required: true,
......
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