Commit 03da7023 authored by 黄奎's avatar 黄奎

新增修改订单调整

parent 7862e151
...@@ -21,74 +21,40 @@ ...@@ -21,74 +21,40 @@
</div> </div>
<div style="padding:20px 15px;"> <div style="padding:20px 15px;">
<q-input filled stack-label maxlength="3" :dense="false" @keyup.native="checkInteger(OrderMsg,'GuestNum')" <q-input filled stack-label maxlength="3" :dense="false" @keyup.native="checkInteger(OrderMsg,'GuestNum')"
v-model="OrderMsg.GuestNum" @input="calcPrice()" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']" v-model="OrderMsg.GuestNum" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']" />
:disable="modityOrderType==2||OrderMsg.OrderIdentify==2" />
<template v-if="isChaBan==1">
<q-select filled option-value="CourseId" :disable="modityOrderType==2" option-label="CourseName"
ref="CourseId" v-model="OrderMsg.CourseId" :options="CourseList" emit-value map-options class="q-pb-lg"
:rules="[val => !!val || '请选择课程']" label="选择课程" @input="calcPrice()" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.StartClassHours" :disable="modityOrderType==2"
@keyup.native="checkInteger(OrderMsg,'StartClassHours')" ref="StartClassHours" @input="calcPrice()"
class="col-12 q-pb-lg" label="起始课时" />
<q-input filled v-model="OrderMsg.EffectTime" ref="EffectTime" :rules="[val => !!val || '请填生效时间']"
class="col-6 q-pb-lg" :disable="modityOrderType==2" mask="date" label="生效时间">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy1" transition-show="scale" transition-hide="scale">
<q-date v-model="OrderMsg.EffectTime" @input="() => $refs.qDateProxy1.hide()" />
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-select filled option-value="OrderId" option-label="CourseName" class="q-pb-lg"
:disable="modityOrderType==2" v-model="OrderMsg.UpOrderId" :options="beforeOrderList" emit-value map-options
label="前置订单">
<template v-slot:option="{ itemProps, itemEvents, opt, selected, toggleOption }">
<q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section>
<q-item-label><span style="color:blue">{{opt.OrderId}}</span> {{opt.CourseName}} {{opt.ClassName}}
{{getStudent(opt.GuestList)}}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
</template>
<q-input filled stack-label :dense="false" v-model="OrderMsg.Class_Price" :disable="true" class="col-12 q-pb-lg"
label="单价(课程售价)" style="display:none;" />
<template v-if="modityOrderType==1"> <template v-if="modityOrderType==1">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" <q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price"
:disable="IsShowUpPrice==true?false:true" @blur="calcPrice()" class="col-12" label="成交单价" :disable="IsShowUpPrice==true?false:true" @blur="calcPrice()" class="col-12" label="成交单价"
:rules="[val => !!val || '请填成交单价']" /> :rules="[val => !!val || '请填成交单价']" />
<q-toggle v-model="IsShowUpPrice" label="高于定价收生" class="q-mb-md" style="display:none;" />
</template> </template>
<template v-if="modityOrderType==2"> <template v-if="modityOrderType==2">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" :disable="true" @input="calcPrice()" <q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" :disable="true" @input="calcPrice()"
class="col-12" label="成交单价" :rules="[val => !!val || '请填成交单价']" /> class="col-12" label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</template> </template>
<!-- <q-input filled stack-label :dense="false" v-model="OrderMsg.PerDiscountMoney" :disable="true"
class="col-12 q-pb-lg" label="优惠金额(每人)" :hint="'总优惠金额:'+(OrderMsg.PerDiscountMoney*OrderMsg.GuestNum)" /> -->
<q-input filled stack-label :dense="false" v-model="OrderMsg.DiscountMoney" @keyup.native="checkPrice(OrderMsg,'DiscountMoney')"
class="col-12 q-pb-lg" label="优惠金额" /> <q-input filled stack-label :dense="false" v-model="OrderMsg.DiscountMoney"
@keyup.native="checkPrice(OrderMsg,'DiscountMoney')" class="col-12 q-pb-lg" label="优惠金额" />
<template v-if="modityOrderType==3"> <template v-if="modityOrderType==3">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @input="calcPrice()" class="col-12" <q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @input="calcPrice()" class="col-12"
label="成交单价" :rules="[val => !!val || '请填成交单价']" /> label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</template> </template>
<template v-if="OrderMsg.Unit_PriceType==2"> <template v-if="OrderMsg.Unit_PriceType==2">
<q-input filled stack-label :dense="false" v-model="OrderMsg.TotalClassHours" @input="calcPrice()" class="col-12" <q-input filled stack-label :dense="false" v-model="OrderMsg.TotalClassHours" @input="calcPrice()"
label="总课时数" type="number" :min="0" :rules="[val => !!val || '请填总课时数']" /> class="col-12" label="总课时数" type="number" :min="0" :rules="[val => !!val || '请填总课时数']" />
</template> </template>
<template v-if="OrderMsg.ClassList&&OrderMsg.ClassList.length>0"> <template v-if="OrderMsg.OrderCourseList&&OrderMsg.OrderCourseList.length>0">
<q-input v-if="OrderMsg.ClassList[0].ClassScrollType==2" filled stack-label :dense="false" v-model="OrderMsg.TextbookFee" @input="calcPrice()" class="col-12" <q-input v-if="OrderMsg.OrderCourseList[0].ClassScrollType==2" filled stack-label :dense="false"
label="教材费" type="number" :min="0" :rules="[val => !!val || '请填教材费']" /> v-model="OrderMsg.TextbookFee" class="col-12" label="教材费" type="number" :min="0"
<q-input v-if="OrderMsg.ClassList[0].ClassScrollType==2" filled stack-label :dense="false" v-model="OrderMsg.CoursewareFee" @input="calcPrice()" class="col-12" :rules="[val => !!val || '请填教材费']" />
label="课件费" type="number" :min="0" :rules="[val => !!val || '请填课件费']" /> <q-input v-if="OrderMsg.OrderCourseList[0].ClassScrollType==2" filled stack-label :dense="false"
v-model="OrderMsg.CoursewareFee" class="col-12" label="课件费" type="number" :min="0"
:rules="[val => !!val || '请填课件费']" />
</template> </template>
...@@ -98,8 +64,8 @@ ...@@ -98,8 +64,8 @@
<q-select :disable="modityOrderType==2" filled option-value="Id" option-label="Name" <q-select :disable="modityOrderType==2" filled option-value="Id" option-label="Name"
v-model="OrderMsg.OrderSource" :options="SourceEnumList" emit-value map-options class="q-pb-lg" v-model="OrderMsg.OrderSource" :options="SourceEnumList" emit-value map-options class="q-pb-lg" label="客人来源"
label="客人来源" style="display:none;" /> style="display:none;" />
<q-select :disable="(modityOrderType==2)||(OrderMsg.JoinType==3)" v-model="OrderMsg.HelpEnterId" <q-select :disable="(modityOrderType==2)||(OrderMsg.JoinType==3)" v-model="OrderMsg.HelpEnterId"
:options="EmployeeList" filled use-input label="协助老师" option-label="EmployeeName" option-value="Id" :options="EmployeeList" filled use-input label="协助老师" option-label="EmployeeName" option-value="Id"
ref="EmployeeName" class="col-6 q-pb-lg" emit-value map-options @filter="filterFn"> ref="EmployeeName" class="col-6 q-pb-lg" emit-value map-options @filter="filterFn">
...@@ -111,20 +77,11 @@ ...@@ -111,20 +77,11 @@
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<!-- <q-select :disable="(modityOrderType==2)||(OrderMsg.JoinType==3)" v-model="OrderMsg.CourseConsultantId"
:options="EmployeeList" filled use-input label="课程顾问" option-label="EmployeeName" option-value="Id" <q-select style="display:none;" :disable="(modityOrderType==2)||(OrderMsg.JoinType==3)"
ref="EmployeeName" class="col-6 q-pb-lg" emit-value map-options @filter="filterFn"> v-model="OrderMsg.CustomerId" :options="myCustomerList" filled use-input label="同行"
<template v-slot:no-option> option-label="CustomerName" option-value="CustomerId" ref="CustomerName" class="col-6 q-pb-lg" emit-value
<q-item> map-options @filter="cusfilterFn">
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select> -->
<q-select style="display:none;" :disable="(modityOrderType==2)||(OrderMsg.JoinType==3)" v-model="OrderMsg.CustomerId"
:options="myCustomerList" filled use-input label="同行" option-label="CustomerName" option-value="CustomerId"
ref="CustomerName" class="col-6 q-pb-lg" emit-value map-options @filter="cusfilterFn">
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey"> <q-item-section class="text-grey">
...@@ -133,12 +90,8 @@ ...@@ -133,12 +90,8 @@
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<q-input style="display:none;" :disable="(modityOrderType==2)" v-if="OrderMsg.OrderSource==3" filled stack-label :dense="false"
maxlength="50" v-model="OrderMsg.GeneralOccupation" class="col-12 q-pb-lg" label="一般同行" />
<q-input style="display:none;" :disable="(modityOrderType==2)" v-if="OrderMsg.OrderSource==7" filled stack-label :dense="false"
maxlength="50" v-model="OrderMsg.EduOccupation" class="col-12 q-pb-lg" label="教育同行" />
<!-- <q-toggle :disable="(modityOrderType==2)" v-model="OrderMsg.IsLessPrice" :false-value="0" :true-value="1"
label="是否少价" class="q-mb-md" /> -->
<q-input :disable="(modityOrderType==2)" v-if="OrderMsg.IsLessPrice==1" @input="calcPrice()" <q-input :disable="(modityOrderType==2)" v-if="OrderMsg.IsLessPrice==1" @input="calcPrice()"
@keyup.native="checkPrice(OrderMsg,'PerLessMoney')" maxlength="10" filled stack-label :dense="false" @keyup.native="checkPrice(OrderMsg,'PerLessMoney')" maxlength="10" filled stack-label :dense="false"
v-model="OrderMsg.PerLessMoney" class="col-12" label="少价金额(每人)" v-model="OrderMsg.PerLessMoney" class="col-12" label="少价金额(每人)"
...@@ -164,7 +117,7 @@ ...@@ -164,7 +117,7 @@
setClassOrder, //修改订单 setClassOrder, //修改订单
queryChaClassInfo, queryChaClassInfo,
GetSelectClassOrderList, //获取前置下拉 GetSelectClassOrderList, //获取前置下拉
getMyCustomerList//同行下拉 getMyCustomerList //同行下拉
} from '../../api/sale/sale' } from '../../api/sale/sale'
import { import {
queryEmployee queryEmployee
...@@ -201,11 +154,11 @@ ...@@ -201,11 +154,11 @@
OrderMsg: { OrderMsg: {
ClassId: 0, //班级编号 ClassId: 0, //班级编号
GuestNum: 0, //人数 GuestNum: 0, //人数
B2CRatio:0, B2CRatio: 0,
B2CReNewRatio:0, B2CReNewRatio: 0,
CustomerId:0,//市场专员 CustomerId: 0, //市场专员
Unit_Price: 0, Unit_Price: 0,
PreferPrice: 0,//应收 PreferPrice: 0, //应收
OrderSource: 0, OrderSource: 0,
SaleRemark: "", SaleRemark: "",
Class_Price: 0, //单价 Class_Price: 0, //单价
...@@ -228,14 +181,14 @@ ...@@ -228,14 +181,14 @@
JoinType: 1, //订单报入类型 JoinType: 1, //订单报入类型
DiscountMoney: 0, //优惠金额 DiscountMoney: 0, //优惠金额
PerDiscountMoney: 0, //每人优惠金额 PerDiscountMoney: 0, //每人优惠金额
CourseConsultantId:0,//课程顾问 CourseConsultantId: 0, //课程顾问
CustomerId:0,//同行 CustomerId: 0, //同行
OrderIdentify:1,//标识参数, 1产品下单 2客户转订单 OrderIdentify: 1, //标识参数, 1产品下单 2客户转订单
Unit_PriceType:1,//价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W Unit_PriceType: 1, //价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
TotalClassHours:0,//总课时数 2024-08-26 add by:W TotalClassHours: 0, //总课时数 2024-08-26 add by:W
CoursewareFee:0,//教材费 CoursewareFee: 0, //教材费
TextbookFee:0,//课件费 TextbookFee: 0, //课件费
ClassList:[], OrderCourseList: [],
}, },
Unit_PriceRemark: "", //单价规则 Unit_PriceRemark: "", //单价规则
IsShowUpPrice: false, //是否显示高于定价 IsShowUpPrice: false, //是否显示高于定价
...@@ -246,8 +199,8 @@ ...@@ -246,8 +199,8 @@
CourseList: [], //课程列表 CourseList: [], //课程列表
courseObj: {}, //选择的课程 courseObj: {}, //选择的课程
beforeOrderList: [], //前置订单数据 beforeOrderList: [], //前置订单数据
myCustomerList:[],//同行列表 myCustomerList: [], //同行列表
allCustomerList:[],//所有同行列表 allCustomerList: [], //所有同行列表
} }
}, },
created() { created() {
...@@ -279,7 +232,6 @@ ...@@ -279,7 +232,6 @@
} }
queryChaClassInfo(qMsg).then(res => { queryChaClassInfo(qMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.CourseList = res.Data.otherCourse; this.CourseList = res.Data.otherCourse;
if (this.saveObj && this.saveObj.OrderId > 0) {} else { if (this.saveObj && this.saveObj.OrderId > 0) {} else {
this.OrderMsg.StartClassHours = res.Data.finishHours; this.OrderMsg.StartClassHours = res.Data.finishHours;
...@@ -287,10 +239,9 @@ ...@@ -287,10 +239,9 @@
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);
} }
if (!this.saveObj.OrderId){ if (!this.saveObj.OrderId) {
this.calcPrice(); this.calcPrice();
} }
} }
}); });
}, },
...@@ -300,107 +251,21 @@ ...@@ -300,107 +251,21 @@
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);
} }
let temp = this.CourseList.find(x => x.CourseId == this.OrderMsg.CourseId); var preferPrice = 0; //应收
//插班 if (this.OrderMsg.OrderCourseList && this.OrderMsg.OrderCourseList.length > 0) {
if (temp) { this.OrderMsg.OrderCourseList.forEach(item => {
this.courseObj = temp; if (this.OrderMsg.Unit_PriceType == 1) {
var tempDiscountMoney = 0; //优惠金额 preferPrice += this.OrderMsg.Unit_Price * guestNum;
// var tempSaleRemark = `直客首次报名优惠比例${ temp.B2CRatio??0 }%`; //备注
//插班课时单价
var classHourPrice = temp.SellPrice / this.courseObj.ClassHours;
var chaBanPrice = Number(classHourPrice * (this.courseObj.ClassHours - this.OrderMsg.StartClassHours))
.toFixed(2);
if (guestNum == 1) {
if (temp.CoursePriceList && temp.CoursePriceList.length > 0) {
if (temp.CoursePriceList[0].PriceType == 0) {
if (this.OrderMsg.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 { } else {
tempDiscountMoney = (temp.SellPrice * temp.CoursePriceList[1].PriceMoney) / 100; preferPrice += this.OrderMsg.Unit_Price * this.OrderMsg.TotalClassHours * guestNum;
}
} else {
tempDiscountMoney = item.CoursePriceList[1].PriceMoney;
// tempSaleRemark = "双人报名优惠" + temp.CoursePriceList[1].PriceMoney;
}
}
}
var perDiscountMoney = Number(tempDiscountMoney).toFixed(2);
this.OrderMsg.PerDiscountMoney = perDiscountMoney;
// this.OrderMsg.DiscountMoney = perDiscountMoney * guestNum;
//计算每人优惠和总优惠
if (this.OrderMsg.IsChaBan == 1) {
this.OrderMsg.Unit_Price = chaBanPrice;
this.UnitPrice = chaBanPrice;
} else {
this.OrderMsg.Unit_Price = temp.SellPrice;
this.UnitPrice = temp.SellPrice;
}
// this.OrderMsg.SaleRemark = tempSaleRemark;
} else {
//未插班
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
} }
if (this.saveObj.Unit_Price) { })
this.OrderMsg.Unit_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
}
if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId;
}
this.courseObj = {};
} }
this.OrderMsg.PreferPrice = preferPrice;
//课时计价
if (this.saveObj.SellPriceType == 2) {
/**计算少价---开始*/ this.OrderMsg.TextbookFee = (preferPrice * (20 / 100)).toFixed(2);
var tempPerLessMoney = 0;
if (this.OrderMsg.PerLessMoney && this.OrderMsg.PerLessMoney > 0) {
tempPerLessMoney = this.OrderMsg.PerLessMoney;
}
this.OrderMsg.LessPrice = tempPerLessMoney * guestNum;
/**计算少价----结束*/
var unit_price = 0;
if (this.OrderMsg.Unit_Price && this.OrderMsg.Unit_Price > 0) {
unit_price = Number(this.OrderMsg.Unit_Price);
}
var str = ""
//计算应收价格
if (this.OrderMsg.IsChaBan == 1) {
var newPreferPrice = 0;
if (this.courseObj && this.courseObj.CourseId && this.courseObj.CourseId > 0) {
if(this.OrderMsg.Unit_PriceType==2){
newPreferPrice = chaBanPrice * guestNum * Number( this.OrderMsg.TotalClassHours)+Number(this.OrderMsg.CoursewareFee)+Number(this.OrderMsg.TextbookFee);
} else{
newPreferPrice = chaBanPrice * guestNum;
}
}
this.OrderMsg.PreferPrice = Number(newPreferPrice).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.CoursewareFee)+Number(this.OrderMsg.TextbookFee)).toFixed(2)- this.OrderMsg.LessPrice;
} else{
this.OrderMsg.PreferPrice = Number(guestNum * unit_price).toFixed(2) - this.OrderMsg.LessPrice;
}
}
//留学就业订单
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
} }
}, },
initData() { initData() {
...@@ -438,15 +303,15 @@ ...@@ -438,15 +303,15 @@
this.OrderMsg.PerDiscountMoney = tempData.PerDiscountMoney; this.OrderMsg.PerDiscountMoney = tempData.PerDiscountMoney;
this.OrderMsg.B2CRatio = tempData.B2CRatio; this.OrderMsg.B2CRatio = tempData.B2CRatio;
this.OrderMsg.B2CReNewRatio = 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;
this.OrderMsg.OrderIdentify = tempData.OrderIdentify; this.OrderMsg.OrderIdentify = tempData.OrderIdentify;
this.OrderMsg.Unit_PriceType = tempData.Unit_PriceType; this.OrderMsg.Unit_PriceType = tempData.Unit_PriceType;
this.OrderMsg.TotalClassHours = tempData.TotalClassHours; this.OrderMsg.TotalClassHours = tempData.TotalClassHours;
this.OrderMsg.CoursewareFee = tempData.CoursewareFee; this.OrderMsg.CoursewareFee = tempData.CoursewareFee;
this.OrderMsg.TextbookFee = tempData.TextbookFee; this.OrderMsg.TextbookFee = tempData.TextbookFee;
this.OrderMsg.ClassList= JSON.parse(JSON.stringify(tempData.ClassList)); this.OrderMsg.OrderCourseList = JSON.parse(JSON.stringify(tempData.ClassList));
this.IsShowEditOrder = true; this.IsShowEditOrder = true;
} }
}) })
...@@ -470,9 +335,9 @@ ...@@ -470,9 +335,9 @@
this.OrderMsg.OrderType = this.orderType; this.OrderMsg.OrderType = this.orderType;
this.OrderMsg.B2CRatio = 0; this.OrderMsg.B2CRatio = 0;
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.OrderIdentify =1; this.OrderMsg.OrderIdentify = 1;
if (this.OrderMsg.OrderType == 2) { if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OrderNature = 1; this.OrderMsg.OrderNature = 1;
} }
...@@ -494,18 +359,18 @@ ...@@ -494,18 +359,18 @@
} else { } else {
this.OrderMsg.CourseId = ''; this.OrderMsg.CourseId = '';
} }
if(this.saveObj.B2CRatio){ if (this.saveObj.B2CRatio) {
this.OrderMsg.B2CRatio = this.saveObj.B2CRatio this.OrderMsg.B2CRatio = this.saveObj.B2CRatio
} }
if(this.saveObj.B2CReNewRatio){ if (this.saveObj.B2CReNewRatio) {
this.OrderMsg.B2CReNewRatio = this.saveObj.B2CReNewRatio this.OrderMsg.B2CReNewRatio = this.saveObj.B2CReNewRatio
} }
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.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.OrderMsg.ClassList=[]; this.OrderMsg.OrderCourseList = [];
this.calcPrice(); this.calcPrice();
} }
}, },
...@@ -527,7 +392,8 @@ ...@@ -527,7 +392,8 @@
this.myCustomerList = JSON.parse(JSON.stringify(this.allCustomerList)) this.myCustomerList = JSON.parse(JSON.stringify(this.allCustomerList))
} else { } else {
const needle = val.toLowerCase(); const needle = val.toLowerCase();
this.myCustomerList = this.allCustomerList.filter(v => v.CustomerName.toLowerCase().indexOf(needle) > -1); this.myCustomerList = this.allCustomerList.filter(v => v.CustomerName.toLowerCase().indexOf(needle) > -
1);
} }
}) })
}, },
...@@ -587,28 +453,6 @@ ...@@ -587,28 +453,6 @@
} }
} }
//插班报名计算应收
// if (this.OrderMsg.IsChaBan == 1) {
// if (this.modityOrderType == 1 || this.modityOrderType == 2) {
// if (!this.courseObj || (this.courseObj && !this.courseObj.ClassHours)) {
// if (this.OrderMsg && this.OrderMsg.CourseId) {
// this.courseObj = this.CourseList.find(x => x.CourseId == this.OrderMsg.CourseId);
// }
// }
// //插班课时单价
// var classHourPrice = this.courseObj.SellPrice / this.courseObj.ClassHours;
// var chaBanPrice = Number(classHourPrice * (this.courseObj.ClassHours - this.OrderMsg.StartClassHours))
// .toFixed(2);
// var newPreferPrice = chaBanPrice * this.OrderMsg.GuestNum - this.OrderMsg.LessPrice;
// this.OrderMsg.PreferPrice = Number(newPreferPrice).toFixed(2);
// }
// }
//正常报名计算应收
// if (this.OrderMsg.IsChaBan == 0) {
// if (this.modityOrderType == 1 || this.modityOrderType == 2) {
// this.OrderMsg.PreferPrice = (this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price) - this.OrderMsg.LessPrice;
// }
// }
setClassOrder(this.OrderMsg).then(res => { setClassOrder(this.OrderMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
...@@ -654,13 +498,13 @@ ...@@ -654,13 +498,13 @@
} }
return str return str
}, },
getCustomerList(){ getCustomerList() {
getMyCustomerList({}).then(res=>{ getMyCustomerList({}).then(res => {
this.myCustomerList=res.Data this.myCustomerList = res.Data
this.allCustomerList=res.Data this.allCustomerList = res.Data
this.myCustomerList.unshift({ this.myCustomerList.unshift({
CustomerId:0, CustomerId: 0,
CustomerName:"不限" CustomerName: "不限"
}) })
}) })
} }
......
...@@ -991,8 +991,7 @@ ...@@ -991,8 +991,7 @@
</div> </div>
</td> </td>
<td style="border:none;" v-if="AuthorityObj.isShowEdit && viewType == 0"> <td style="border:none;" v-if="AuthorityObj.isShowEdit && viewType == 0">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;display:none;" label="编辑"
@click="editOrder(item)" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left:10px;display:none;"> <q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left:10px;display:none;">
<q-list> <q-list>
<q-item clickable v-close-popup> <q-item clickable v-close-popup>
...@@ -1917,10 +1916,7 @@ ...@@ -1917,10 +1916,7 @@
this.IsRefund = 0 this.IsRefund = 0
var newUrlPath = "/financial/financalDocument/ChoiceAddFinancialDocuments"; var newUrlPath = "/financial/financalDocument/ChoiceAddFinancialDocuments";
this.OpenNewUrl(newUrlPath, query); this.OpenNewUrl(newUrlPath, query);
// this.$router.push({
// path: newUrlPath,
// query
// });
}, },
chanceType_lx(obj) { chanceType_lx(obj) {
//留学的时 成本制单 //留学的时 成本制单
......
...@@ -23,12 +23,14 @@ ...@@ -23,12 +23,14 @@
</div> </div>
</div> </div>
</div> </div>
<abroadlist :dataList="dataList" :loading="loading" @select="selectCourse" :select="defaultCourse"></abroadlist> <abroadlist :dataList="dataList" :loading="loading" @select="selectCourse" :select="defaultCourse">
</abroadlist>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="PageCount" <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="PageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" />
</q-step> </q-step>
<q-step :name="2" title="确认" icon="settings" :done="step > 2"> <q-step :name="2" title="确认" icon="settings" :done="step > 2">
<studyForm ref="orderForm" :save-obj="saveObj" :select="selectedArr" @success="$emit('close')" @cancelloading='cancelloading'></studyForm> <studyForm ref="orderForm" :save-obj="saveObj" :select="selectedArr" @success="$emit('close')"
@cancelloading='cancelloading'></studyForm>
</q-step> </q-step>
</q-stepper> </q-stepper>
</q-card-section> </q-card-section>
...@@ -44,14 +46,9 @@ ...@@ -44,14 +46,9 @@
</template> </template>
<script> <script>
import {
queryCourseDropdownList,
getCourseSubject
} from "../../../api/course/index";
import { import {
queryStudyAbroadPage queryStudyAbroadPage
} from '../../../api/studyabroad/index' } from '../../../api/studyabroad/index'
import abroadlist from "./transfer-order/abroadlist"; import abroadlist from "./transfer-order/abroadlist";
import studyForm from "./transfer-order/study-form"; import studyForm from "./transfer-order/study-form";
export default { export default {
...@@ -84,7 +81,7 @@ ...@@ -84,7 +81,7 @@
dataList: [], dataList: [],
defaultCourse: [], defaultCourse: [],
saveObj: {}, //所选数据 saveObj: {}, //所选数据
loading:false, loading: false,
studyList: [{ studyList: [{
Id: 1, Id: 1,
Name: '留学' Name: '留学'
...@@ -93,11 +90,11 @@ ...@@ -93,11 +90,11 @@
Name: '就业' Name: '就业'
}], }],
PageCount: 0, PageCount: 0,
selectedArr:[] selectedArr: []
}; };
}, },
mounted() { mounted() {
if(this.select){ if (this.select) {
this.selectedArr = this.select; this.selectedArr = this.select;
} }
this.getList(); this.getList();
...@@ -121,13 +118,13 @@ ...@@ -121,13 +118,13 @@
}, },
// 选择课程 // 选择课程
selectCourse(val) { selectCourse(val) {
if(val&&val.length>0){ if (val && val.length > 0) {
this.saveObj = val[0]; this.saveObj = val[0];
this.defaultCourse = val; this.defaultCourse = val;
this.saveObj.OrderCourseList =[]; this.saveObj.OrderCourseList = [];
this.saveObj.OrderCourseList.push(JSON.parse(JSON.stringify(this.saveObj))); this.saveObj.OrderCourseList.push(JSON.parse(JSON.stringify(this.saveObj)));
this.saveObj.TextbookFee=0; this.saveObj.TextbookFee = 0;
this.saveObj.CoursewareFee=0; this.saveObj.CoursewareFee = 0;
} }
}, },
next() { next() {
...@@ -146,11 +143,11 @@ ...@@ -146,11 +143,11 @@
this.getList(); this.getList();
}, },
saveOrderForm() { saveOrderForm() {
this.loading1 = true this.loading1 = true;
this.$refs.orderForm.saveOrderInfo(); this.$refs.orderForm.saveOrderInfo();
}, },
cancelloading() { cancelloading() {
this.loading1 = false this.loading1 = false;
}, },
} }
}; };
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
v-model="courseMsg.School_Id" :options="schoolList" emit-value map-options label="关联校区" v-model="courseMsg.School_Id" :options="schoolList" emit-value map-options label="关联校区"
clearable /> clearable />
</div> </div>
<div class="col-3"> <div class="col-3">
<q-input @change="resetSearch" clearable filled v-model="courseMsg.ClassNo" label="班号" <q-input @change="resetSearch" clearable filled v-model="courseMsg.ClassNo" label="班号"
@clear="resetSearch" maxlength="20" /> @clear="resetSearch" maxlength="20" />
...@@ -74,8 +73,7 @@ ...@@ -74,8 +73,7 @@
</q-step> </q-step>
<q-step :name="3" title="确认" icon="settings" :done="step > 3"> <q-step :name="3" title="确认" icon="settings" :done="step > 3">
<orderForm ref="orderForm" :mode="mode" :schoolList="schoolList" :save-obj="saveObj" :stuData="stuData" <orderForm ref="orderForm" :mode="mode" :schoolList="schoolList" :save-obj="saveObj" :stuData="stuData"
:modityOrderType="1" :selectedCourseList="selectedCourseList" @success="$emit('close')" @success="$emit('close')" @cancelloading="cancelloading"></orderForm>
@cancelloading="cancelloading"></orderForm>
</q-step> </q-step>
</q-stepper> </q-stepper>
</q-card-section> </q-card-section>
...@@ -100,11 +98,9 @@ ...@@ -100,11 +98,9 @@
} from "../../../api/sale/sale"; } from "../../../api/sale/sale";
import { import {
getSchoolDropdown, //获取校区列表 getSchoolDropdown, //获取校区列表
} from "../../../api/school/index"; } from "../../../api/school/index";
import { import {
queryCourseDropdownList, queryCourseDropdownList,
} from "../../../api/course/index"; } from "../../../api/course/index";
import Mode from "./transfer-order/tickMode"; import Mode from "./transfer-order/tickMode";
import Course from "./transfer-order/courselist"; import Course from "./transfer-order/courselist";
...@@ -188,7 +184,7 @@ ...@@ -188,7 +184,7 @@
myClassList: [], myClassList: [],
allClassList: [], allClassList: [],
loading1: false, //防止多次点击 loading1: false, //防止多次点击
mode: 1, mode: 1, //1-班课,2-常规约课,3-vip 1对1
selectedCourseList: [], //多选课程 selectedCourseList: [], //多选课程
}; };
}, },
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
<div class="q-mb-sm text-accent"> <div class="q-mb-sm text-accent">
<span class="text-primary" v-if="mode === 1">班级:</span> <span class="text-primary" v-if="mode === 1">班级:</span>
<span v-if="mode === 1">{{ saveObj.ClassName }}</span> <span v-if="mode === 1">{{ saveObj.ClassName }}</span>
<!-- <span>
<span class="q-ml-md text-primary">课程:</span>
{{ saveObj.CourseName }}
</span> -->
</div> </div>
<div class="row q-mb-md"> <div class="row q-mb-md">
<div class="col-10 flex"> <div class="col-10 flex">
...@@ -17,18 +13,17 @@ ...@@ -17,18 +13,17 @@
</q-chip> </q-chip>
</div> </div>
</div> </div>
<div class="col-2" v-if="mode == 1">
<q-toggle v-model="OrderMsg.IsChaBan" :true-value="1" :false-value="0" label="插班报入" />
</div>
</div> </div>
<template v-if="OrderMsg.OrderCourseList&&OrderMsg.OrderCourseList.length>0"> <template v-if="OrderMsg.OrderCourseList&&OrderMsg.OrderCourseList.length>0">
<div class="q-mb-sm text-accent q-mr-lg" style="margin-bottom:24px;"> <div class="q-mb-sm text-accent q-mr-lg" style="margin-bottom:24px;">
<div class="column items-center " style="width:100%;text-align:center;border:1px solid #f5f6f7;"> <div class="column items-center " style="width:100%;text-align:center;border:1px solid #f5f6f7;">
<table class="sticky-tow-column-table sticky-two-header-table" ref="PlanTable" style="border-collapse:collapse;margin-top:0;width:100%;border: 1 solid #000000;"> <table class="sticky-tow-column-table sticky-two-header-table" ref="PlanTable"
style="border-collapse:collapse;margin-top:0;width:100%;border: 1 solid #000000;">
<thead> <thead>
<tr> <tr>
<th v-if="mode==1">班级</th> <th v-if="mode==1">班级</th>
<th >课程</th> <th>课程</th>
<th v-if="mode==1">老师</th> <th v-if="mode==1">老师</th>
<th v-if="mode==1">上课时间</th> <th v-if="mode==1">上课时间</th>
<th v-if="mode!=1">所属科目</th> <th v-if="mode!=1">所属科目</th>
...@@ -39,15 +34,15 @@ ...@@ -39,15 +34,15 @@
</tr> </tr>
</thead> </thead>
<tr v-for="(item, index) in OrderMsg.OrderCourseList" :key="index" style="height:40px;"> <tr v-for="(item, index) in OrderMsg.OrderCourseList" :key="index" style="height:40px;">
<td v-if="mode==1" > {{item.ClassName}} </td> <td v-if="mode==1"> {{item.ClassName}} </td>
<td> {{item.CourseName}} </td> <td> {{item.CourseName}} </td>
<td v-if="mode==1" > {{item.TeacherName}} </td> <td v-if="mode==1"> {{item.TeacherName}} </td>
<td v-if="mode==1" > {{item.OpenTime}} </td> <td v-if="mode==1"> {{item.OpenTime}} </td>
<td v-if="mode!=1" >{{item.CourseSubjectName}}</td> <td v-if="mode!=1">{{item.CourseSubjectName}}</td>
<td v-if="mode!=1" >{{item.SellPrice}}</td> <td v-if="mode!=1">{{item.SellPrice}}</td>
<td v-if="mode!=1" >{{item.SellPriceType==1?"课程总价":"课时单价"}}</td> <td v-if="mode!=1">{{item.SellPriceType==1?"课程总价":"课时单价"}}</td>
<td v-if="mode==2" >{{item.TextbookFee}}</td> <td v-if="mode==2">{{item.TextbookFee}}</td>
<td v-if="mode==2" >{{item.CoursewareFee}}</td> <td v-if="mode==2">{{item.CoursewareFee}}</td>
</tr> </tr>
</table> </table>
</div> </div>
...@@ -57,103 +52,31 @@ ...@@ -57,103 +52,31 @@
<div class="column items-center"> <div class="column items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<q-input filled stack-label maxlength="3" :dense="false" @keyup.native="checkInteger(OrderMsg, 'GuestNum')" <q-input filled stack-label maxlength="3" :dense="false" @keyup.native="checkInteger(OrderMsg, 'GuestNum')"
v-model="OrderMsg.GuestNum" @input="calcPrice()" label="人数" :rules="[val => !!val || '请填写人数']" disable v-model="OrderMsg.GuestNum" @input="calcPrice()" label="人数" :rules="[val => !!val || '请填写人数']"
class="col-6 q-py-sm" /> :disable="true" class="col-6 q-py-sm" />
<template v-if="OrderMsg.IsChaBan == 1">
<q-select filled option-value="CourseId" :disable="modityOrderType == 2" option-label="CourseName" <q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" :disable="true" @blur="calcPrice()"
ref="CourseId" v-model="OrderMsg.CourseId" :options="CourseList" emit-value map-options
class="col-6 q-py-sm" :rules="[val => !!val || '请选择课程']" label="选择课程" @input="calcPrice()" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.StartClassHours" :disable="modityOrderType == 2"
@keyup.native="checkInteger(OrderMsg, 'StartClassHours')" ref="StartClassHours" @input="calcPrice()"
class="col-6 q-py-sm" label="起始课时" />
<q-input filled v-model="OrderMsg.EffectTime" ref="EffectTime" :rules="[val => !!val || '请填生效时间']"
class="col-6 q-py-sm" :disable="modityOrderType == 2" mask="date" label="生效时间">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy1" transition-show="scale" transition-hide="scale">
<q-date v-model="OrderMsg.EffectTime" @input="() => $refs.qDateProxy1.hide()" />
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-select filled option-value="OrderId" option-label="CourseName" class="col-6 q-py-sm"
:disable="modityOrderType == 2" v-model="OrderMsg.UpOrderId" :options="beforeOrderList" emit-value
map-options label="前置订单">
<template v-slot:option="{
itemProps,
itemEvents,
opt,
selected,
toggleOption
}">
<q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section>
<q-item-label><span style="color:blue">{{ opt.OrderId }}</span>
{{ opt.CourseName }} {{ opt.ClassName }}
{{ getStudent(opt.GuestList) }}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
</template>
<q-input filled stack-label :dense="false" v-model="OrderMsg.Class_Price" :disable="true" class="col-6 q-py-sm"
label="单价(课程售价)" style="display:none;" />
<template v-if="modityOrderType == 1">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price"
:disable="IsShowUpPrice == true ? false : true" @blur="calcPrice()" class="col-6 q-py-sm" label="成交单价"
:rules="[val => !!val || '请填成交单价']" />
<q-toggle v-model="IsShowUpPrice" label="高于定价收生" class="q-mb-md" style="display:none;" />
</template>
<template v-if="modityOrderType == 2">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" :disable="true" @input="calcPrice()"
class="col-6 q-py-sm" label="成交单价" :rules="[val => !!val || '请填成交单价']" /> class="col-6 q-py-sm" label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</template>
<q-input v-if="false" filled stack-label :dense="false" v-model="OrderMsg.DiscountMoney" :disable="true"
class="col-6 q-py-sm" label="优惠金额" />
<template v-if="OrderMsg.Unit_PriceType==2"> <template v-if="OrderMsg.Unit_PriceType==2">
<q-input filled stack-label :dense="false" type="number" :min="1" @input="oneTotalCourseFee(1)" <q-input filled stack-label :dense="false" type="number" :min="1" @input="calcPrice()"
v-model="OrderMsg.TotalClassHours" class="col-6 q-py-sm" label="总课时数" /> v-model="OrderMsg.TotalClassHours" class="col-6 q-py-sm" label="总课时数" />
</template> </template>
<q-input v-if="mode!=1" filled stack-label :dense="false" type="number" :min="0" @input="oneTotalCourseFee(0)" <q-input v-if="mode!=1" filled stack-label :dense="false" type="number" :min="0" v-model="OrderMsg.TextbookFee"
v-model="OrderMsg.TextbookFee" class="col-6 q-py-sm" label="教材费" /> class="col-6 q-py-sm" label="教材费" />
<q-input v-if="mode!=1" filled stack-label :dense="false" type="number" :min="0" @input="oneTotalCourseFee(0)" <q-input v-if="mode!=1" filled stack-label :dense="false" type="number" :min="0"
v-model="OrderMsg.CoursewareFee" class="col-6 q-py-sm" label="课件费" /> v-model="OrderMsg.CoursewareFee" class="col-6 q-py-sm" label="课件费" />
<template v-if="modityOrderType == 3">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @input="calcPrice()" <q-input filled stack-label :disable="true" :dense="false" maxlength="10"
class="col-6 q-py-sm" label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</template>
<q-input filled stack-label :disable="modityOrderType != 3" :dense="false" maxlength="10"
@keyup.native="checkPrice(OrderMsg, 'PreferPrice')" v-model="OrderMsg.PreferPrice" class="col-6 q-py-sm" @keyup.native="checkPrice(OrderMsg, 'PreferPrice')" v-model="OrderMsg.PreferPrice" class="col-6 q-py-sm"
label="应收" /> label="应收" />
<q-select v-show="false" v-if="mode == 2" standout="bg-primary text-white" option-value="SId" <q-select v-show="false" v-if="mode == 2" standout="bg-primary text-white" option-value="SId"
option-label="SName" v-model="OrderMsg.ScrollSchoolId" :options="newSchoolList" emit-value map-options option-label="SName" v-model="OrderMsg.ScrollSchoolId" :options="newSchoolList" emit-value map-options
class="col-6 q-py-sm" label="校区" /> class="col-6 q-py-sm" label="校区" />
<q-select style="display:none;" :disable="modityOrderType == 2" standout="bg-primary text-white"
option-value="Id" option-label="Name" v-model="OrderMsg.OrderSource" :options="SourceEnumList" emit-value
map-options class="col-6 q-py-sm" label="客人来源" />
<q-select v-if="false" :disable="
modityOrderType == 2 ||
OrderMsg.JoinType == 3 ||
CourseConsultantDisable
" v-model="OrderMsg.CourseConsultantId" :options="EmployeeList2" filled use-input label="课程顾问"
option-label="EmployeeName" option-value="Id" ref="EmployeeName2" class="col-6 q-py-sm" emit-value map-options
@filter="filterFn2">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<q-input :disable="modityOrderType == 2" v-if="OrderMsg.OrderSource == 3" filled stack-label :dense="false"
maxlength="50" v-model="OrderMsg.GeneralOccupation" class="col-6 q-py-sm" label="一般同行" />
<q-input :disable="modityOrderType == 2" v-if="OrderMsg.OrderSource == 7" filled stack-label :dense="false"
maxlength="50" v-model="OrderMsg.EduOccupation" class="col-6 q-py-sm" label="教育同行" />
<q-input :disable="modityOrderType == 2" v-if="OrderMsg.IsLessPrice == 1" @input="calcPrice()"
@keyup.native="checkPrice(OrderMsg, 'PerLessMoney')" maxlength="10" filled stack-label :dense="false"
v-model="OrderMsg.PerLessMoney" class="col-6 q-py-sm" label="少价金额(每人)"
:hint="'总少价金额:' + OrderMsg.PerLessMoney * OrderMsg.GuestNum" />
<q-input disable v-if="OrderMsg.EnterId > 0" filled stack-label v-model="EnterName" class="col-6 q-py-sm" <q-input disable v-if="OrderMsg.EnterId > 0" filled stack-label v-model="EnterName" class="col-6 q-py-sm"
label="市场人员" /> label="市场人员" />
...@@ -195,15 +118,9 @@ ...@@ -195,15 +118,9 @@
</template> </template>
<script> <script>
import { import {
getOrderSourceEnumList, //获取订单来源 枚举
setClassOrder, //修改订单 setClassOrder, //修改订单
SetClassOrderBatch, //多个约课订单
queryChaClassInfo,
GetSelectClassOrderList //获取前置下拉
} from "../../../../api/sale/sale"; } from "../../../../api/sale/sale";
import { import {
GetStudentAssistList,
GetVisitorReserveTeacherList GetVisitorReserveTeacherList
} from "../../../../api/sale/sale"; //获取协助人员 } from "../../../../api/sale/sale"; //获取协助人员
import { import {
...@@ -238,17 +155,10 @@ ...@@ -238,17 +155,10 @@
type: Array, type: Array,
default: () => [] default: () => []
}, },
// 已选的多选课程
selectedCourseList: {
type: Array,
default: () => []
}
}, },
data() { data() {
return { return {
courseInformationList: [], //存储多个课程
AssistName: "", //协助老师名称
IsShowEditOrder: true,
OrderMsg: { OrderMsg: {
ClassId: 0, //班级编号 ClassId: 0, //班级编号
GuestNum: 0, //人数 GuestNum: 0, //人数
...@@ -256,7 +166,7 @@ ...@@ -256,7 +166,7 @@
B2CReNewRatio: 0, B2CReNewRatio: 0,
Unit_Price: 0, Unit_Price: 0,
PreferPrice: 0, //应收 PreferPrice: 0, //应收
OrderSource: 0, OrderSource: 1, //客人来源
SaleRemark: "", SaleRemark: "",
Class_Price: 0, //单价 Class_Price: 0, //单价
Unit_PriceType: 1, //价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W Unit_PriceType: 1, //价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
...@@ -285,33 +195,17 @@ ...@@ -285,33 +195,17 @@
CourseConsultantId: 0, //课程顾问 CourseConsultantId: 0, //课程顾问
CustomerId: 0, //同行 CustomerId: 0, //同行
OrderIdentify: 2, //标识参数, 1产品下单 2客户转订单 OrderIdentify: 2, //标识参数, 1产品下单 2客户转订单
StuIds: "", StuIds: "", //学员
EnterId: 0, //市场人员 EnterId: 0, //市场人员
// NormalCommission:'',//正常返佣金额 ScrollSchoolId: -1, //校区编号
// RenewCommission:"",// 预计返佣金额 OrderCourseList: [], //选择的课程信息
ScrollSchoolId: -1,
}, },
newSchoolList: [], newSchoolList: [],
EnterName: "", //市场人员 EnterName: "", //市场人员
Unit_PriceRemark: "", //单价规则
IsShowUpPrice: false, //是否显示高于定价
UnitPrice: 0,
SourceEnumList: [], //订单来源
EmployeeList: [], //教师列表
AllemployeeList: [], //所有教师列表
EmployeeList2: [], //课程顾问列表
AllemployeeList2: [], //所有课程顾问列表
AssistList: [], //协助人员列表 AssistList: [], //协助人员列表
AllAssistList: [], //所有协助人员列表 AllAssistList: [], //所有协助人员列表
CourseList: [], //课程列表
courseObj: {}, //选择的课程
beforeOrderList: [], //前置订单数据
HelpEnterDisable: false, //是否可选择协助教师
CourseConsultantDisable: false, //是否可选择课程顾问
inception: false, inception: false,
inceptionData: null, inceptionData: null,
OrderCourseList: [], //选择的课程信息
}; };
}, },
computed: { computed: {
...@@ -321,14 +215,8 @@ ...@@ -321,14 +215,8 @@
}, },
created() { created() {
if (this.saveObj && this.saveObj.CourseId) { this.initData();
// this.OrderMsg.CourseId = this.saveObj.CourseId; this.getVisitorReserveTeacherList();
}
this.getOrderSEList();
this.getEmployee(0);
this.getEmployee(2);
this.initConfig();
this.getSelectClass();
}, },
mounted() { mounted() {
this.newSchoolList = []; this.newSchoolList = [];
...@@ -337,179 +225,22 @@ ...@@ -337,179 +225,22 @@
SName: "不限", SName: "不限",
SId: -1 SId: -1
}); });
this.initData();
this.getVisitorReserveTeacherList();
this.OrderMsg.EnterId = this.stuData.EnterId; this.OrderMsg.EnterId = this.stuData.EnterId;
this.EnterName = this.stuData.EnterName; this.EnterName = this.stuData.EnterName;
// 判断是否续费协助老师赋值
if (this.stuData.StuList[0].IsRenewGuest != 1) {
this.OrderMsg.HelpEnterId = 0;//this.stuData.StuList[0].STTeacherId;
this.AssistName = this.stuData.StuList[0].STTeacherName
}
if (this.selectedCourseList.length > 1) {
this.selectedCourseList.forEach(item => {
let dataObj = {
CourseName: "", //课程名称
ClassId: 0, //班级编号
GuestNum: 1, //人数
B2CRatio: 0,
B2CReNewRatio: 0,
Unit_Price: 0,
PreferPrice: 0, //应收
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, //来源编号
HelpEnterId: 0, //协助老师编号
GeneralOccupation: "", //一般同行
EduOccupation: "", //教育同行
IsLessPrice: 0, //是否少价 0 不少 1 少
LessPrice: 0, //少价金额
PerLessMoney: 0, //每人少价金额
OrderNature: 1, //订单性质
OldPreferPrice: 0, //原实际应收
IsChaBan: 0, //是否插班报入(1-是)
CourseId: "", //课程编号
StartClassHours: 0, //已上课时
EffectTime: "", //生效时间
UpOrderId: 0, //前置订单编号
JoinType: 1, //订单报入类型
DiscountMoney: 0, //优惠金额
PerDiscountMoney: 0, //每人优惠金额
CourseConsultantId: 0, //课程顾问
CustomerId: 0, //同行
OrderIdentify: 2, //标识参数, 1产品下单 2客户转订单
StuIds: "",
EnterId: 0, //市场人员
// NormalCommission:'',//正常返佣金额
// RenewCommission:"",// 预计返佣金额
ScrollSchoolId: -1,
OrderType: 1
}
if (item.CourseName) {
dataObj.CourseName = item.CourseName
}
if (item.ClassId) {
dataObj.ClassId = item.ClassId;
}
if (item.SellPrice) {
dataObj.Unit_Price = item.SellPrice;
dataObj.Class_Price = item.SellPrice;
}
if (item.SellPriceType) {
dataObj.Unit_PriceType = item.SellPriceType;
}
if (item.TotalClassHours) {
dataObj.TotalClassHours = item.TotalClassHours;
}
if (item.CoursewareFee) {
dataObj.CoursewareFee = item.CoursewareFee;
}
if (item.TextbookFee) {
dataObj.TextbookFee = item.TextbookFee;
}
if (item.SourceId) {
dataObj.SourceId = item.SourceId;
}
if (item.CourseId) {
dataObj.CourseId = item.CourseId;
} else {
dataObj.CourseId = "";
}
if (item.B2CRatio) {
dataObj.B2CRatio = item.B2CRatio;
}
if (item.B2CReNewRatio) {
dataObj.B2CReNewRatio = item.B2CReNewRatio;
}
if (this.stuData.RenewNum > 0) {
dataObj.SaleRemark = `首次报名优惠比例${item.B2CRatio ??
0}%;续费优惠比例${item.B2CReNewRatio ?? 0}%`;
} else {
dataObj.SaleRemark = `首次报名优惠比例${item.B2CRatio ??
0}%`;
}
this.courseInformationList.push(dataObj)
});
this.totalCourseFee(1)
}
}, },
methods: { methods: {
//单个课程计算
oneTotalCourseFee(type) {
if (this.OrderMsg.Unit_PriceType == 2) {
if (type == 1) {
this.OrderMsg.TextbookFee = Number((this.OrderMsg.TotalClassHours * this.OrderMsg.Unit_Price * this.OrderMsg
.GuestNum) * (20 / 100)).toFixed(2);
}
this.OrderMsg.PreferPrice = this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price * this.OrderMsg
.TotalClassHours + Number(this.OrderMsg.TextbookFee) + Number(this.OrderMsg.CoursewareFee)
}
},
// 多个课程计算
totalCourseFee(type) {
this.courseInformationList.forEach((item) => {
if (this.stuData.StuList[0].IsRenewGuest == 1) {
item.DiscountMoney = this.accAdd(
item.DiscountMoney,
this.accMul(
item.Class_Price,
item.B2CReNewRatio / 100
)
);
if (item.Unit_PriceType == 1) {
item.PreferPrice = item.GuestNum * item.Unit_Price
} else if (item.Unit_PriceType == 2) {
if (type == 1) {
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)
);
if (item.Unit_PriceType == 1) {
item.PreferPrice = item.GuestNum * item.Unit_Price
} 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
}
})
},
//获取协助人员 //获取协助人员
getVisitorReserveTeacherList() { getVisitorReserveTeacherList() {
this.AssistList=[]; this.AssistList = [];
this.AllAssistList=[]; this.AllAssistList = [];
const ids = this.stuData.StuList.map(e => e.StuId).toString(); const ids = this.stuData.StuList.map(e => e.StuId).toString();
GetVisitorReserveTeacherList({ GetVisitorReserveTeacherList({
StuId: ids StuId: ids
}).then(res => { }).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
res.Data.map(e => { res.Data.map(e => {
this.AssistList .push({ this.AssistList.push({
Id: e.TeacherId, Id: e.TeacherId,
EmployeeName: e.TeacherName EmployeeName: e.TeacherName
}); });
...@@ -518,83 +249,23 @@ ...@@ -518,83 +249,23 @@
EmployeeName: e.TeacherName EmployeeName: e.TeacherName
}); });
this.HelpEnterDisable = true;
}); });
if (this.stuData.StuList[0].IsRenewGuest == 1&&res.Data&&res.Data.length>0) { if (this.stuData.StuList[0].IsRenewGuest == 1 && res.Data && res.Data.length > 0) {
this.OrderMsg.HelpEnterId = res.Data[0].TeacherId; this.OrderMsg.HelpEnterId = res.Data[0].TeacherId;
} }
this.getQueryEmployee(); this.getQueryEmployee();
} } else {
else{
this.getQueryEmployee(); this.getQueryEmployee();
} }
}); });
}, },
//获取协助老师
getQueryEmployee(){ getQueryEmployee() {
if (this.AssistList.length == 0) {
var qMsg = {
IsLeave: 1,
UserRole: 0,
AccountType:2,
};
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
res.Data.map(e => {
this.AssistList.push({
Id: e.Id,
EmployeeName: e.EmployeeName
});
this.AllAssistList.push({
Id: e.Id,
EmployeeName: e.EmployeeName
});
});
}
});
}
},
//获取协助人员
getAssistList() {
const ids = this.stuData.StuList.map(e => e.StuId).toString();
GetStudentAssistList({
StuId: ids
}).then(res => {
if (res.Code == 1) {
res.Data.map(e => {
if (e.AssistType == 4) {
this.AssistList.push({
Id: e.AssistId,
EmployeeName: e.AssistName
});
this.AllAssistList.push({
Id: e.AssistId,
EmployeeName: e.AssistName
});
if (this.stuData.StuList[0].IsRenewGuest == 1) {
this.OrderMsg.HelpEnterId = e.AssistId;
this.AssistName = e.AssistName
}
this.HelpEnterDisable = true;
}
if (e.AssistType == 2) {
this.OrderMsg.CourseConsultantId = e.AssistId;
this.CourseConsultantDisable = true;
if (this.selectedCourseList.length > 1) {
this.courseInformationList.forEach(item => {
return item.CourseConsultantId = e.AssistId
})
}
}
});
}
});
if (this.AssistList.length == 0) { if (this.AssistList.length == 0) {
var qMsg = { var qMsg = {
IsLeave: 1, IsLeave: 1,
UserRole: 0, UserRole: 0,
AccountType:2, AccountType: 2,
}; };
queryEmployee(qMsg).then(res => { queryEmployee(qMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
...@@ -612,172 +283,34 @@ ...@@ -612,172 +283,34 @@
}); });
} }
}, },
//获取班级课程信息
initConfig() {
var qMsg = {
ClassId: 0
};
if (this.saveObj.ClassId) {
qMsg.ClassId = this.saveObj.ClassId;
}
queryChaClassInfo(qMsg).then(res => {
if (res.Code == 1) {
this.CourseList = res.Data.otherCourse;
if (this.saveObj && this.saveObj.OrderId > 0) {} else {
this.OrderMsg.StartClassHours = res.Data.finishHours;
}
if (this.OrderMsg && this.OrderMsg.CourseId) {
this.courseObj = this.CourseList.find(
x => x.CourseId == this.OrderMsg.CourseId
);
}
this.calcPrice();
}
});
},
//计算课程单价和应收金额 //计算课程单价和应收金额
calcPrice() { calcPrice() {
this.OrderMsg.GuestNum = this.stuData.StuList.length;
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);
} }
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
);
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 - this.OrderMsg.StartClassHours)
).toFixed(2);
if (guestNum == 1) {
if (temp.CoursePriceList && temp.CoursePriceList.length > 0) {
if (temp.CoursePriceList[0].PriceType == 0) {
if (this.OrderMsg.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);
this.OrderMsg.PerDiscountMoney = perDiscountMoney;
//计算每人优惠和总优惠
// if (this.OrderMsg.IsChaBan == 1) {
// this.OrderMsg.Unit_Price = chaBanPrice;
// this.UnitPrice = chaBanPrice;
// } else {
// this.OrderMsg.Unit_Price = temp.SellPrice;
// this.UnitPrice = temp.SellPrice;
// }
// this.OrderMsg.SaleRemark = tempSaleRemark;
} else {
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
}
if (this.saveObj.Unit_Price) {
this.OrderMsg.Unit_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
}
if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId;
}
this.courseObj = {};
}
/**计算少价---开始*/ var preferPrice = 0; //应收
var tempPerLessMoney = 0; var coursewareFee = 0; //课件费
if (this.OrderMsg.PerLessMoney && this.OrderMsg.PerLessMoney > 0) { var textbookFee = 0; //教材费
tempPerLessMoney = this.OrderMsg.PerLessMoney; if (this.OrderMsg.OrderCourseList && this.OrderMsg.OrderCourseList.length > 0) {
} this.OrderMsg.OrderCourseList.forEach(item => {
this.OrderMsg.LessPrice = tempPerLessMoney * guestNum;
/**计算少价----结束*/
var unit_price = 0;
if (this.OrderMsg.Unit_Price && this.OrderMsg.Unit_Price > 0) {
unit_price = Number(this.OrderMsg.Unit_Price);
}
var str = "";
//计算应收价格
if (this.OrderMsg.IsChaBan == 1) {
var newPreferPrice = 0;
if (
this.courseObj &&
this.courseObj.CourseId &&
this.courseObj.CourseId > 0
) {
if (this.OrderMsg.Unit_PriceType == 1) { if (this.OrderMsg.Unit_PriceType == 1) {
newPreferPrice = chaBanPrice * guestNum preferPrice += this.OrderMsg.Unit_Price * guestNum;
} else if (this.OrderMsg.Unit_PriceType == 2) { coursewareFee += item.CoursewareFee * guestNum;
newPreferPrice = chaBanPrice * guestNum * this.OrderMsg.TotalClassHours textbookFee += item.TextbookFee * guestNum;
}
}
this.OrderMsg.PreferPrice =
Number(newPreferPrice).toFixed(2) - this.OrderMsg.LessPrice;
} else { } else {
preferPrice += this.OrderMsg.Unit_Price * this.OrderMsg.TotalClassHours * guestNum;
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) +
Number(this.OrderMsg.CoursewareFee)).toFixed(2) - this.OrderMsg.LessPrice;
}
} }
//留学就业订单 })
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
} }
this.OrderMsg.DiscountMoney = 0; this.OrderMsg.PreferPrice = preferPrice;
this.stuData.StuList.map(e => { //课时计价
if (e.IsRenewGuest == 0) { if (this.saveObj.SellPriceType == 2) {
this.OrderMsg.DiscountMoney = this.accAdd( textbookFee = (preferPrice * (20 / 100)).toFixed(2);
this.OrderMsg.DiscountMoney,
this.accMul(this.OrderMsg.Class_Price, this.OrderMsg.B2CRatio / 100)
);
} else {
this.OrderMsg.DiscountMoney = this.accAdd(
this.OrderMsg.DiscountMoney,
this.accMul(
this.OrderMsg.Class_Price,
this.OrderMsg.B2CReNewRatio / 100
)
);
} }
}); this.OrderMsg.TextbookFee = textbookFee;
this.OrderMsg.CoursewareFee = coursewareFee;
}, },
// 初始化 // 初始化
initData() { initData() {
...@@ -804,9 +337,10 @@ ...@@ -804,9 +337,10 @@
this.OrderMsg.TotalClassHours = 0; this.OrderMsg.TotalClassHours = 0;
this.OrderMsg.Unit_PriceType = 1; this.OrderMsg.Unit_PriceType = 1;
this.OrderMsg.OrderCourseList = []; this.OrderMsg.OrderCourseList = [];
if (this.OrderMsg.OrderType == 2) { if (this.stuData && this.stuData.StuList && this.stuData.StuList.length > 0) {
this.OrderMsg.OrderNature = 1; this.OrderMsg.GuestNum = this.stuData.StuList.length;
} }
if (this.saveObj) { if (this.saveObj) {
if (this.saveObj.ClassId) { if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId; this.OrderMsg.ClassId = this.saveObj.ClassId;
...@@ -814,7 +348,7 @@ ...@@ -814,7 +348,7 @@
if (this.saveObj.Unit_Price) { if (this.saveObj.Unit_Price) {
this.OrderMsg.Unit_Price = this.saveObj.Unit_Price; this.OrderMsg.Unit_Price = this.saveObj.Unit_Price;
this.OrderMsg.Class_Price = this.saveObj.Unit_Price; this.OrderMsg.Class_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
} }
if (this.saveObj.SourceId) { if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId; this.OrderMsg.SourceId = this.saveObj.SourceId;
...@@ -846,35 +380,10 @@ ...@@ -846,35 +380,10 @@
if (this.saveObj.OrderCourseList && this.saveObj.OrderCourseList.length > 0) { if (this.saveObj.OrderCourseList && this.saveObj.OrderCourseList.length > 0) {
this.OrderMsg.OrderCourseList = JSON.parse(JSON.stringify(this.saveObj.OrderCourseList)); this.OrderMsg.OrderCourseList = JSON.parse(JSON.stringify(this.saveObj.OrderCourseList));
} }
if (this.selectedCourseList.length > 1) {
return
}
} }
this.IsShowEditOrder = true;
this.calcPrice(); this.calcPrice();
if (this.stuData.RenewNum > 0) {
this.OrderMsg.SaleRemark = `首次报名优惠比例${this.saveObj.B2CRatio ??
0}%;续费优惠比例${this.saveObj.B2CReNewRatio ?? 0}%`; //备注
} else {
this.OrderMsg.SaleRemark = `首次报名优惠比例${this.saveObj.B2CRatio ??
0}%`; //备注})
}
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === "") {
this.EmployeeList = JSON.parse(JSON.stringify(this.AllemployeeList));
} else {
const needle = val.toLowerCase();
this.EmployeeList = this.AllemployeeList.filter(
v => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
}, },
//筛选协助老师 //筛选协助老师
filterAssisFn(val, update) { filterAssisFn(val, update) {
update(() => { update(() => {
...@@ -888,145 +397,17 @@ ...@@ -888,145 +397,17 @@
} }
}); });
}, },
//筛选课程顾问
filterFn2(val, update) {
update(() => {
if (val === "") {
this.EmployeeList2 = JSON.parse(
JSON.stringify(this.AllemployeeList2)
);
} else {
const needle = val.toLowerCase();
this.EmployeeList2 = this.AllemployeeList2.filter(
v => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//获取业务员
getEmployee(n) {
var qMsg = {
IsLeave: 1,
UserRole: n
};
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
if (n == 0) {
//教师
this.EmployeeList = res.Data;
this.AllemployeeList = res.Data;
let obj = {
Id: 0,
EmployeeName: "不限"
};
this.EmployeeList.unshift(obj);
}
if (n == 2) {
//课程顾问
this.EmployeeList2 = res.Data;
this.AllemployeeList2 = res.Data;
let obj = {
Id: 0,
EmployeeName: "不限"
};
this.EmployeeList2.unshift(obj);
}
}
});
},
//关闭弹窗 //关闭弹窗
closeEditOrder() { closeEditOrder() {
this.IsShowEditOrder = false;
this.$emit("close"); this.$emit("close");
}, },
//获取订单来源 //父组件保存订单
getOrderSEList() {
getOrderSourceEnumList({}).then(res => {
if (res.Code == 1) {
var tempArray = res.Data;
this.SourceEnumList = tempArray;
this.OrderMsg.OrderSource = tempArray[0].Id;
if (this.selectedCourseList.length > 0) {
this.courseInformationList.forEach(item => {
return item.OrderSource = this.OrderMsg.OrderSource
})
}
}
});
},
//修改订单
saveOrderInfo() { saveOrderInfo() {
// if(this.selectedCourseList.length>1){
// this.multipleAppointmentsFun()
// }else{
// this.singleAppointmentsFun()
// }
this.singleAppointmentsFun() this.singleAppointmentsFun()
}, },
// 多个约课
multipleAppointmentsFun() {
//插班验证课程和生效时间
this.courseInformationList.forEach(item => {
item.StuIds = this.stuData.StuList.map(e => e.StuId).toString();
item.HelpEnterId = this.OrderMsg.HelpEnterId
item.CustomerId = this.stuData.CustomerId;
})
let Msg = {
OrderList: this.courseInformationList
}
SetClassOrderBatch(Msg)
.then(res => {
this.$emit("cancelloading"); //取消按钮的加载
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "操作成功!",
position: "top"
});
//调用父页面成功方法
this.$emit("success");
this.IsShowEditOrder = false;
} else {
this.$q.notify({
type: "negative",
position: "top",
message: res.Message
});
}
})
.catch(err => {
this.$emit("cancelloading"); //取消按钮的加载
if (err.Code == 2) {
this.inceptionData = err;
this.inception = true;
}
});
},
// 单个班课、约课 // 单个班课、约课
singleAppointmentsFun() { singleAppointmentsFun() {
//插班验证课程和生效时间
if (this.OrderMsg.IsChaBan == 1) {
this.$refs.CourseId.validate();
this.$refs.EffectTime.validate();
if (this.$refs.CourseId.hasError) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择课程!`
});
return;
}
if (this.$refs.EffectTime.hasError) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择生效时间!`
});
return;
}
}
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) setClassOrder(this.OrderMsg)
...@@ -1042,7 +423,7 @@ ...@@ -1042,7 +423,7 @@
}); });
//调用父页面成功方法 //调用父页面成功方法
this.$emit("success"); this.$emit("success");
this.IsShowEditOrder = false;
} else { } else {
this.$q.notify({ this.$q.notify({
type: "negative", type: "negative",
...@@ -1065,30 +446,6 @@ ...@@ -1065,30 +446,6 @@
}); });
this.inception = false; this.inception = false;
}, },
//获取前置下拉数据
getSelectClass() {
var qMsg = {
ClassId: 0
};
if (this.saveObj.ClassId) {
qMsg.ClassId = this.saveObj.ClassId;
}
GetSelectClassOrderList(qMsg).then(res => {
if (res.Code == 1) {
this.beforeOrderList = res.Data;
}
});
},
getStudent(item) {
let str = "";
if (item && item.length > 1) {
str = item[0].GuestName + "等" + item.length + "人";
}
if (item.length == 1) {
str = item[0].GuestName;
}
return str;
}
} }
}; };
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
</div> </div>
</div> </div>
</div> </div>
<q-table :pagination="msg" :selection="mode==2?'multiple':'single'" :selected.sync="selection" <q-table :pagination="msg" :selection="mode==2?'multiple':'single'" :selected.sync="selection"
no-data-label="暂无相关数据" flat class="sticky-tow-column-table sticky-two-header-table" separator="none" no-data-label="暂无相关数据" flat class="sticky-tow-column-table sticky-two-header-table" separator="none"
:data="dataList" :columns="columns" row-key="ClassId" @update:selected="emitSel" :data="dataList" :columns="columns" row-key="ClassId" @update:selected="emitSel"
...@@ -50,15 +49,14 @@ ...@@ -50,15 +49,14 @@
} from "../../../../api/sale/sale"; } from "../../../../api/sale/sale";
export default { export default {
components: { components: {},
},
props: { props: {
select: { select: {
type: Array, type: Array,
default: () => [] default: () => []
}, },
mode: { mode: {
type: Number, //1:约课,2:班课,3-Vip type: Number, //1-班课,2-常规约课,3-Vip 1对1课程
default: 1 default: 1
}, },
}, },
...@@ -173,7 +171,6 @@ ...@@ -173,7 +171,6 @@
} }
} }
}; };
</script> </script>
<style> <style>
.table { .table {
...@@ -220,5 +217,4 @@ ...@@ -220,5 +217,4 @@
.yueke-CourseName span { .yueke-CourseName span {
color: #2961fe; color: #2961fe;
} }
</style> </style>
\ No newline at end of file
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
queryCourseDropdownList, queryCourseDropdownList,
getCourseSubject getCourseSubject
} from '../../api/course/index' } from '../../api/course/index'
import myOrderForm from '../../components/sale/myOrder-form'
import classinfoForm from '../../components/course/classinfo-form'; import classinfoForm from '../../components/course/classinfo-form';
import orderlist from '../../components/sale/orderlist' import orderlist from '../../components/sale/orderlist'
export default { export default {
...@@ -139,7 +138,6 @@ ...@@ -139,7 +138,6 @@
title: "我的语培订单" title: "我的语培订单"
}, },
components: { components: {
myOrderForm,
classinfoForm, classinfoForm,
orderlist orderlist
}, },
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</q-calendar> </q-calendar>
</div> </div>
<SubscribeForm v-model="showForm" :editType="editType" :dateObj="dateObj" :saveObj="saveObj" :auth="auth" <SubscribeForm v-model="showForm" :editType="editType" :dateObj="dateObj" :saveObj="saveObj" :auth="auth"
:teacherList="TeacherList2" @success="successHandle" /> :teacherList="TeacherList" @success="successHandle" />
</div> </div>
</template> </template>
...@@ -386,7 +386,6 @@ ...@@ -386,7 +386,6 @@
"brown", "brown",
], ],
legendList: [], legendList: [],
TeacherList2: [],
events: [], events: [],
dateObj: {}, dateObj: {},
saveObj: {}, saveObj: {},
...@@ -499,7 +498,6 @@ ...@@ -499,7 +498,6 @@
getTeacherList() { getTeacherList() {
getTeacherDropDownList({ getTeacherDropDownList({
LeaveStatus: 1, LeaveStatus: 1,
}).then(res => { }).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.TeacherList = JSON.parse(JSON.stringify(res.Data)); this.TeacherList = JSON.parse(JSON.stringify(res.Data));
...@@ -508,11 +506,6 @@ ...@@ -508,11 +506,6 @@
TId: 0 TId: 0
}; };
this.TeacherList.unshift(obj); this.TeacherList.unshift(obj);
this.TeacherList2 = JSON.parse(JSON.stringify(res.Data));
this.TeacherList2.unshift({
TeacherName: "请选择",
TId: 0
});
this.legendList = JSON.parse(JSON.stringify(res.Data)); this.legendList = JSON.parse(JSON.stringify(res.Data));
this.legendList.forEach((item, index) => { this.legendList.forEach((item, index) => {
item.bg = this.colorList[index]; item.bg = this.colorList[index];
......
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