Commit bdf46615 authored by 吴春's avatar 吴春

1

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