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

新增修改订单调整

parent 7862e151
......@@ -21,74 +21,40 @@
</div>
<div style="padding:20px 15px;">
<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 || '请填写人数']"
: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;" />
v-model="OrderMsg.GuestNum" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']" />
<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-12" 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-12" label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</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">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @input="calcPrice()" class="col-12"
label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</template>
<template v-if="OrderMsg.Unit_PriceType==2">
<q-input filled stack-label :dense="false" v-model="OrderMsg.TotalClassHours" @input="calcPrice()" class="col-12"
label="总课时数" type="number" :min="0" :rules="[val => !!val || '请填总课时数']" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.TotalClassHours" @input="calcPrice()"
class="col-12" label="总课时数" type="number" :min="0" :rules="[val => !!val || '请填总课时数']" />
</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"
label="教材费" type="number" :min="0" :rules="[val => !!val || '请填教材费']" />
<q-input v-if="OrderMsg.ClassList[0].ClassScrollType==2" filled stack-label :dense="false" v-model="OrderMsg.CoursewareFee" @input="calcPrice()" class="col-12"
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.TextbookFee" class="col-12" 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>
......@@ -98,8 +64,8 @@
<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"
label="客人来源" style="display:none;" />
v-model="OrderMsg.OrderSource" :options="SourceEnumList" emit-value map-options class="q-pb-lg" label="客人来源"
style="display:none;" />
<q-select :disable="(modityOrderType==2)||(OrderMsg.JoinType==3)" v-model="OrderMsg.HelpEnterId"
: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">
......@@ -111,20 +77,11 @@
</q-item>
</template>
</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"
ref="EmployeeName" class="col-6 q-pb-lg" emit-value map-options @filter="filterFn">
<template v-slot:no-option>
<q-item>
<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">
<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>
<q-item>
<q-item-section class="text-grey">
......@@ -133,12 +90,8 @@
</q-item>
</template>
</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()"
@keyup.native="checkPrice(OrderMsg,'PerLessMoney')" maxlength="10" filled stack-label :dense="false"
v-model="OrderMsg.PerLessMoney" class="col-12" label="少价金额(每人)"
......@@ -164,7 +117,7 @@
setClassOrder, //修改订单
queryChaClassInfo,
GetSelectClassOrderList, //获取前置下拉
getMyCustomerList//同行下拉
getMyCustomerList //同行下拉
} from '../../api/sale/sale'
import {
queryEmployee
......@@ -201,11 +154,11 @@
OrderMsg: {
ClassId: 0, //班级编号
GuestNum: 0, //人数
B2CRatio:0,
B2CReNewRatio:0,
CustomerId:0,//市场专员
B2CRatio: 0,
B2CReNewRatio: 0,
CustomerId: 0, //市场专员
Unit_Price: 0,
PreferPrice: 0,//应收
PreferPrice: 0, //应收
OrderSource: 0,
SaleRemark: "",
Class_Price: 0, //单价
......@@ -228,14 +181,14 @@
JoinType: 1, //订单报入类型
DiscountMoney: 0, //优惠金额
PerDiscountMoney: 0, //每人优惠金额
CourseConsultantId:0,//课程顾问
CustomerId:0,//同行
OrderIdentify:1,//标识参数, 1产品下单 2客户转订单
Unit_PriceType:1,//价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
TotalClassHours:0,//总课时数 2024-08-26 add by:W
CoursewareFee:0,//教材费
TextbookFee:0,//课件费
ClassList:[],
CourseConsultantId: 0, //课程顾问
CustomerId: 0, //同行
OrderIdentify: 1, //标识参数, 1产品下单 2客户转订单
Unit_PriceType: 1, //价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
TotalClassHours: 0, //总课时数 2024-08-26 add by:W
CoursewareFee: 0, //教材费
TextbookFee: 0, //课件费
OrderCourseList: [],
},
Unit_PriceRemark: "", //单价规则
IsShowUpPrice: false, //是否显示高于定价
......@@ -246,8 +199,8 @@
CourseList: [], //课程列表
courseObj: {}, //选择的课程
beforeOrderList: [], //前置订单数据
myCustomerList:[],//同行列表
allCustomerList:[],//所有同行列表
myCustomerList: [], //同行列表
allCustomerList: [], //所有同行列表
}
},
created() {
......@@ -279,7 +232,6 @@
}
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;
......@@ -287,10 +239,9 @@
if (this.OrderMsg && this.OrderMsg.CourseId) {
this.courseObj = this.CourseList.find(x => x.CourseId == this.OrderMsg.CourseId);
}
if (!this.saveObj.OrderId){
if (!this.saveObj.OrderId) {
this.calcPrice();
}
}
});
},
......@@ -300,107 +251,21 @@
if (this.OrderMsg.GuestNum && this.OrderMsg.GuestNum > 0) {
guestNum = Number(this.OrderMsg.GuestNum);
}
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;
var preferPrice = 0; //应收
if (this.OrderMsg.OrderCourseList && this.OrderMsg.OrderCourseList.length > 0) {
this.OrderMsg.OrderCourseList.forEach(item => {
if (this.OrderMsg.Unit_PriceType == 1) {
preferPrice += this.OrderMsg.Unit_Price * guestNum;
} 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;
// 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;
preferPrice += this.OrderMsg.Unit_Price * this.OrderMsg.TotalClassHours * guestNum;
}
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) {
/**计算少价---开始*/
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);
this.OrderMsg.TextbookFee = (preferPrice * (20 / 100)).toFixed(2);
}
},
initData() {
......@@ -438,15 +303,15 @@
this.OrderMsg.PerDiscountMoney = tempData.PerDiscountMoney;
this.OrderMsg.B2CRatio = tempData.B2CRatio;
this.OrderMsg.B2CReNewRatio = tempData.B2CReNewRatio;
this.OrderMsg.CustomerId=tempData.CustomerId
this.OrderMsg.CourseConsultantId=tempData.CourseConsultantId
this.OrderMsg.CustomerId = tempData.CustomerId
this.OrderMsg.CourseConsultantId = tempData.CourseConsultantId
this.UnitPrice = this.OrderMsg.Unit_Price;
this.OrderMsg.OrderIdentify = tempData.OrderIdentify;
this.OrderMsg.Unit_PriceType = tempData.Unit_PriceType;
this.OrderMsg.TotalClassHours = tempData.TotalClassHours;
this.OrderMsg.CoursewareFee = tempData.CoursewareFee;
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;
}
})
......@@ -470,9 +335,9 @@
this.OrderMsg.OrderType = this.orderType;
this.OrderMsg.B2CRatio = 0;
this.OrderMsg.B2CReNewRatio = 0;
this.OrderMsg.CustomerId=0;
this.OrderMsg.CourseConsultantId=0;
this.OrderMsg.OrderIdentify =1;
this.OrderMsg.CustomerId = 0;
this.OrderMsg.CourseConsultantId = 0;
this.OrderMsg.OrderIdentify = 1;
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OrderNature = 1;
}
......@@ -494,18 +359,18 @@
} else {
this.OrderMsg.CourseId = '';
}
if(this.saveObj.B2CRatio){
if (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.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.OrderMsg.ClassList=[];
this.OrderMsg.OrderCourseList = [];
this.calcPrice();
}
},
......@@ -527,7 +392,8 @@
this.myCustomerList = JSON.parse(JSON.stringify(this.allCustomerList))
} else {
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 @@
}
}
//插班报名计算应收
// 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 => {
if (res.Code == 1) {
this.$q.notify({
......@@ -654,13 +498,13 @@
}
return str
},
getCustomerList(){
getMyCustomerList({}).then(res=>{
this.myCustomerList=res.Data
this.allCustomerList=res.Data
getCustomerList() {
getMyCustomerList({}).then(res => {
this.myCustomerList = res.Data
this.allCustomerList = res.Data
this.myCustomerList.unshift({
CustomerId:0,
CustomerName:"不限"
CustomerId: 0,
CustomerName: "不限"
})
})
}
......
......@@ -991,8 +991,7 @@
</div>
</td>
<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-list>
<q-item clickable v-close-popup>
......@@ -1917,10 +1916,7 @@
this.IsRefund = 0
var newUrlPath = "/financial/financalDocument/ChoiceAddFinancialDocuments";
this.OpenNewUrl(newUrlPath, query);
// this.$router.push({
// path: newUrlPath,
// query
// });
},
chanceType_lx(obj) {
//留学的时 成本制单
......
......@@ -23,12 +23,14 @@
</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"
:input="true" @input="changePage" />
</q-step>
<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-stepper>
</q-card-section>
......@@ -44,14 +46,9 @@
</template>
<script>
import {
queryCourseDropdownList,
getCourseSubject
} from "../../../api/course/index";
import {
queryStudyAbroadPage
} from '../../../api/studyabroad/index'
import abroadlist from "./transfer-order/abroadlist";
import studyForm from "./transfer-order/study-form";
export default {
......@@ -84,7 +81,7 @@
dataList: [],
defaultCourse: [],
saveObj: {}, //所选数据
loading:false,
loading: false,
studyList: [{
Id: 1,
Name: '留学'
......@@ -93,11 +90,11 @@
Name: '就业'
}],
PageCount: 0,
selectedArr:[]
selectedArr: []
};
},
mounted() {
if(this.select){
if (this.select) {
this.selectedArr = this.select;
}
this.getList();
......@@ -121,13 +118,13 @@
},
// 选择课程
selectCourse(val) {
if(val&&val.length>0){
if (val && val.length > 0) {
this.saveObj = val[0];
this.defaultCourse = val;
this.saveObj.OrderCourseList =[];
this.saveObj.OrderCourseList = [];
this.saveObj.OrderCourseList.push(JSON.parse(JSON.stringify(this.saveObj)));
this.saveObj.TextbookFee=0;
this.saveObj.CoursewareFee=0;
this.saveObj.TextbookFee = 0;
this.saveObj.CoursewareFee = 0;
}
},
next() {
......@@ -146,11 +143,11 @@
this.getList();
},
saveOrderForm() {
this.loading1 = true
this.loading1 = true;
this.$refs.orderForm.saveOrderInfo();
},
cancelloading() {
this.loading1 = false
this.loading1 = false;
},
}
};
......
......@@ -22,7 +22,6 @@
v-model="courseMsg.School_Id" :options="schoolList" emit-value map-options label="关联校区"
clearable />
</div>
<div class="col-3">
<q-input @change="resetSearch" clearable filled v-model="courseMsg.ClassNo" label="班号"
@clear="resetSearch" maxlength="20" />
......@@ -74,8 +73,7 @@
</q-step>
<q-step :name="3" title="确认" icon="settings" :done="step > 3">
<orderForm ref="orderForm" :mode="mode" :schoolList="schoolList" :save-obj="saveObj" :stuData="stuData"
:modityOrderType="1" :selectedCourseList="selectedCourseList" @success="$emit('close')"
@cancelloading="cancelloading"></orderForm>
@success="$emit('close')" @cancelloading="cancelloading"></orderForm>
</q-step>
</q-stepper>
</q-card-section>
......@@ -100,11 +98,9 @@
} from "../../../api/sale/sale";
import {
getSchoolDropdown, //获取校区列表
} from "../../../api/school/index";
import {
queryCourseDropdownList,
} from "../../../api/course/index";
import Mode from "./transfer-order/tickMode";
import Course from "./transfer-order/courselist";
......@@ -188,7 +184,7 @@
myClassList: [],
allClassList: [],
loading1: false, //防止多次点击
mode: 1,
mode: 1, //1-班课,2-常规约课,3-vip 1对1
selectedCourseList: [], //多选课程
};
},
......
......@@ -4,10 +4,6 @@
<div class="q-mb-sm text-accent">
<span class="text-primary" v-if="mode === 1">班级:</span>
<span v-if="mode === 1">{{ saveObj.ClassName }}</span>
<!-- <span>
<span class="q-ml-md text-primary">课程:</span>
{{ saveObj.CourseName }}
</span> -->
</div>
<div class="row q-mb-md">
<div class="col-10 flex">
......@@ -17,18 +13,17 @@
</q-chip>
</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>
<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="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>
<tr>
<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>
......@@ -39,15 +34,15 @@
</tr>
</thead>
<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 v-if="mode==1" > {{item.TeacherName}} </td>
<td v-if="mode==1" > {{item.OpenTime}} </td>
<td v-if="mode!=1" >{{item.CourseSubjectName}}</td>
<td v-if="mode!=1" >{{item.SellPrice}}</td>
<td v-if="mode!=1" >{{item.SellPriceType==1?"课程总价":"课时单价"}}</td>
<td v-if="mode==2" >{{item.TextbookFee}}</td>
<td v-if="mode==2" >{{item.CoursewareFee}}</td>
<td v-if="mode==1"> {{item.TeacherName}} </td>
<td v-if="mode==1"> {{item.OpenTime}} </td>
<td v-if="mode!=1">{{item.CourseSubjectName}}</td>
<td v-if="mode!=1">{{item.SellPrice}}</td>
<td v-if="mode!=1">{{item.SellPriceType==1?"课程总价":"课时单价"}}</td>
<td v-if="mode==2">{{item.TextbookFee}}</td>
<td v-if="mode==2">{{item.CoursewareFee}}</td>
</tr>
</table>
</div>
......@@ -57,103 +52,31 @@
<div class="column items-center">
<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')"
v-model="OrderMsg.GuestNum" @input="calcPrice()" label="人数" :rules="[val => !!val || '请填写人数']" disable
class="col-6 q-py-sm" />
<template v-if="OrderMsg.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="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()"
v-model="OrderMsg.GuestNum" @input="calcPrice()" label="人数" :rules="[val => !!val || '请填写人数']"
:disable="true" class="col-6 q-py-sm" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" :disable="true" @blur="calcPrice()"
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">
<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="总课时数" />
</template>
<q-input v-if="mode!=1" filled stack-label :dense="false" type="number" :min="0" @input="oneTotalCourseFee(0)"
v-model="OrderMsg.TextbookFee" 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.TextbookFee"
class="col-6 q-py-sm" label="教材费" />
<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="课件费" />
<template v-if="modityOrderType == 3">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @input="calcPrice()"
class="col-6 q-py-sm" label="成交单价" :rules="[val => !!val || '请填成交单价']" />
</template>
<q-input filled stack-label :disable="modityOrderType != 3" :dense="false" maxlength="10"
<q-input filled stack-label :disable="true" :dense="false" maxlength="10"
@keyup.native="checkPrice(OrderMsg, 'PreferPrice')" v-model="OrderMsg.PreferPrice" class="col-6 q-py-sm"
label="应收" />
<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
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"
label="市场人员" />
......@@ -195,15 +118,9 @@
</template>
<script>
import {
getOrderSourceEnumList, //获取订单来源 枚举
setClassOrder, //修改订单
SetClassOrderBatch, //多个约课订单
queryChaClassInfo,
GetSelectClassOrderList //获取前置下拉
} from "../../../../api/sale/sale";
import {
GetStudentAssistList,
GetVisitorReserveTeacherList
} from "../../../../api/sale/sale"; //获取协助人员
import {
......@@ -238,17 +155,10 @@
type: Array,
default: () => []
},
// 已选的多选课程
selectedCourseList: {
type: Array,
default: () => []
}
},
data() {
return {
courseInformationList: [], //存储多个课程
AssistName: "", //协助老师名称
IsShowEditOrder: true,
OrderMsg: {
ClassId: 0, //班级编号
GuestNum: 0, //人数
......@@ -256,7 +166,7 @@
B2CReNewRatio: 0,
Unit_Price: 0,
PreferPrice: 0, //应收
OrderSource: 0,
OrderSource: 1, //客人来源
SaleRemark: "",
Class_Price: 0, //单价
Unit_PriceType: 1, //价格类型:1-总课时费,2-课时单价 2024-08-26 add by:W
......@@ -285,33 +195,17 @@
CourseConsultantId: 0, //课程顾问
CustomerId: 0, //同行
OrderIdentify: 2, //标识参数, 1产品下单 2客户转订单
StuIds: "",
StuIds: "", //学员
EnterId: 0, //市场人员
// NormalCommission:'',//正常返佣金额
// RenewCommission:"",// 预计返佣金额
ScrollSchoolId: -1,
ScrollSchoolId: -1, //校区编号
OrderCourseList: [], //选择的课程信息
},
newSchoolList: [],
EnterName: "", //市场人员
Unit_PriceRemark: "", //单价规则
IsShowUpPrice: false, //是否显示高于定价
UnitPrice: 0,
SourceEnumList: [], //订单来源
EmployeeList: [], //教师列表
AllemployeeList: [], //所有教师列表
EmployeeList2: [], //课程顾问列表
AllemployeeList2: [], //所有课程顾问列表
AssistList: [], //协助人员列表
AllAssistList: [], //所有协助人员列表
CourseList: [], //课程列表
courseObj: {}, //选择的课程
beforeOrderList: [], //前置订单数据
HelpEnterDisable: false, //是否可选择协助教师
CourseConsultantDisable: false, //是否可选择课程顾问
inception: false,
inceptionData: null,
OrderCourseList: [], //选择的课程信息
};
},
computed: {
......@@ -321,14 +215,8 @@
},
created() {
if (this.saveObj && this.saveObj.CourseId) {
// this.OrderMsg.CourseId = this.saveObj.CourseId;
}
this.getOrderSEList();
this.getEmployee(0);
this.getEmployee(2);
this.initConfig();
this.getSelectClass();
this.initData();
this.getVisitorReserveTeacherList();
},
mounted() {
this.newSchoolList = [];
......@@ -337,179 +225,22 @@
SName: "不限",
SId: -1
});
this.initData();
this.getVisitorReserveTeacherList();
this.OrderMsg.EnterId = this.stuData.EnterId;
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: {
//单个课程计算
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() {
this.AssistList=[];
this.AllAssistList=[];
this.AssistList = [];
this.AllAssistList = [];
const ids = this.stuData.StuList.map(e => e.StuId).toString();
GetVisitorReserveTeacherList({
StuId: ids
}).then(res => {
if (res.Code == 1) {
res.Data.map(e => {
this.AssistList .push({
this.AssistList.push({
Id: e.TeacherId,
EmployeeName: e.TeacherName
});
......@@ -518,83 +249,23 @@
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.getQueryEmployee();
}
else{
} else {
this.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
})
}
}
});
}
});
//获取协助老师
getQueryEmployee() {
if (this.AssistList.length == 0) {
var qMsg = {
IsLeave: 1,
UserRole: 0,
AccountType:2,
AccountType: 2,
};
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
......@@ -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() {
this.OrderMsg.GuestNum = this.stuData.StuList.length;
var guestNum = 0;
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
);
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 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
) {
var preferPrice = 0; //应收
var coursewareFee = 0; //课件费
var textbookFee = 0; //教材费
if (this.OrderMsg.OrderCourseList && this.OrderMsg.OrderCourseList.length > 0) {
this.OrderMsg.OrderCourseList.forEach(item => {
if (this.OrderMsg.Unit_PriceType == 1) {
newPreferPrice = chaBanPrice * guestNum
} else if (this.OrderMsg.Unit_PriceType == 2) {
newPreferPrice = chaBanPrice * guestNum * this.OrderMsg.TotalClassHours
}
}
this.OrderMsg.PreferPrice =
Number(newPreferPrice).toFixed(2) - this.OrderMsg.LessPrice;
preferPrice += this.OrderMsg.Unit_Price * guestNum;
coursewareFee += item.CoursewareFee * guestNum;
textbookFee += item.TextbookFee * guestNum;
} else {
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;
}
preferPrice += this.OrderMsg.Unit_Price * this.OrderMsg.TotalClassHours * guestNum;
}
//留学就业订单
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
})
}
this.OrderMsg.DiscountMoney = 0;
this.stuData.StuList.map(e => {
if (e.IsRenewGuest == 0) {
this.OrderMsg.DiscountMoney = this.accAdd(
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.PreferPrice = preferPrice;
//课时计价
if (this.saveObj.SellPriceType == 2) {
textbookFee = (preferPrice * (20 / 100)).toFixed(2);
}
});
this.OrderMsg.TextbookFee = textbookFee;
this.OrderMsg.CoursewareFee = coursewareFee;
},
// 初始化
initData() {
......@@ -804,9 +337,10 @@
this.OrderMsg.TotalClassHours = 0;
this.OrderMsg.Unit_PriceType = 1;
this.OrderMsg.OrderCourseList = [];
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OrderNature = 1;
if (this.stuData && this.stuData.StuList && this.stuData.StuList.length > 0) {
this.OrderMsg.GuestNum = this.stuData.StuList.length;
}
if (this.saveObj) {
if (this.saveObj.ClassId) {
this.OrderMsg.ClassId = this.saveObj.ClassId;
......@@ -814,7 +348,7 @@
if (this.saveObj.Unit_Price) {
this.OrderMsg.Unit_Price = this.saveObj.Unit_Price;
this.OrderMsg.Class_Price = this.saveObj.Unit_Price;
this.UnitPrice = this.saveObj.Unit_Price;
}
if (this.saveObj.SourceId) {
this.OrderMsg.SourceId = this.saveObj.SourceId;
......@@ -846,35 +380,10 @@
if (this.saveObj.OrderCourseList && this.saveObj.OrderCourseList.length > 0) {
this.OrderMsg.OrderCourseList = JSON.parse(JSON.stringify(this.saveObj.OrderCourseList));
}
if (this.selectedCourseList.length > 1) {
return
}
}
this.IsShowEditOrder = true;
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) {
update(() => {
......@@ -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() {
this.IsShowEditOrder = false;
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() {
// if(this.selectedCourseList.length>1){
// this.multipleAppointmentsFun()
// }else{
// 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() {
//插班验证课程和生效时间
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.CustomerId = this.stuData.CustomerId;
setClassOrder(this.OrderMsg)
......@@ -1042,7 +423,7 @@
});
//调用父页面成功方法
this.$emit("success");
this.IsShowEditOrder = false;
} else {
this.$q.notify({
type: "negative",
......@@ -1065,30 +446,6 @@
});
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 @@
</div>
</div>
</div>
<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"
:data="dataList" :columns="columns" row-key="ClassId" @update:selected="emitSel"
......@@ -50,15 +49,14 @@
} from "../../../../api/sale/sale";
export default {
components: {
},
components: {},
props: {
select: {
type: Array,
default: () => []
},
mode: {
type: Number, //1:约课,2:班课,3-Vip
type: Number, //1-班课,2-常规约课,3-Vip 1对1课程
default: 1
},
},
......@@ -173,7 +171,6 @@
}
}
};
</script>
<style>
.table {
......@@ -220,5 +217,4 @@
.yueke-CourseName span {
color: #2961fe;
}
</style>
\ No newline at end of file
......@@ -131,7 +131,6 @@
queryCourseDropdownList,
getCourseSubject
} from '../../api/course/index'
import myOrderForm from '../../components/sale/myOrder-form'
import classinfoForm from '../../components/course/classinfo-form';
import orderlist from '../../components/sale/orderlist'
export default {
......@@ -139,7 +138,6 @@
title: "我的语培订单"
},
components: {
myOrderForm,
classinfoForm,
orderlist
},
......
......@@ -246,7 +246,7 @@
</q-calendar>
</div>
<SubscribeForm v-model="showForm" :editType="editType" :dateObj="dateObj" :saveObj="saveObj" :auth="auth"
:teacherList="TeacherList2" @success="successHandle" />
:teacherList="TeacherList" @success="successHandle" />
</div>
</template>
......@@ -386,7 +386,6 @@
"brown",
],
legendList: [],
TeacherList2: [],
events: [],
dateObj: {},
saveObj: {},
......@@ -499,7 +498,6 @@
getTeacherList() {
getTeacherDropDownList({
LeaveStatus: 1,
}).then(res => {
if (res.Code == 1) {
this.TeacherList = JSON.parse(JSON.stringify(res.Data));
......@@ -508,11 +506,6 @@
TId: 0
};
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.forEach((item, 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