Commit b2d07b8e authored by 黄奎's avatar 黄奎

页面修改

parent b83d53d6
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" option-value="SId" option-label="SName" <q-select @input="resetSearch" standout="bg-primary text-white" option-value="SId" option-label="SName"
v-model="msg.School_Id" :options="schoolList" emit-value map-options label="关联校区" /> v-model="msg.School_Id" :options="schoolList" emit-value map-options label="关联校区" clearable />
</div> </div>
<div class="col-3"> <div class="col-3">
<q-input @change="resetSearch" clearable standout="bg-primary text-white" v-model="msg.ClassName" label="班级名称" <q-input @change="resetSearch" clearable standout="bg-primary text-white" v-model="msg.ClassName" label="班级名称"
@clear="resetSearch" maxlength="20" /> @clear="resetSearch" maxlength="20" clearable />
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" option-value="TId" option-label="TeacherName" <q-select @input="resetSearch" standout="bg-primary text-white" option-value="TId" option-label="TeacherName"
v-model="msg.Teacher_Id" :options="TeacherList" emit-value map-options label="带班老师" /> v-model="msg.Teacher_Id" :options="TeacherList" emit-value map-options label="带班老师" clearable />
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" option-value="CourseId" <q-select @input="resetSearch" standout="bg-primary text-white" option-value="CourseId"
option-label="CourseName" v-model="msg.CouseId" :options="ClassList" emit-value map-options label="学习课程" /> option-label="CourseName" v-model="msg.CouseId" :options="ClassList" emit-value map-options label="学习课程" clearable />
</div> </div>
<div class="col-3"> <div class="col-3">
<div class="col-3 Sysuser_Date"> <div class="col-3 Sysuser_Date">
...@@ -222,7 +222,8 @@ ...@@ -222,7 +222,8 @@
</ul> </ul>
<div v-else style="width: 100%;color: #999999;text-align: center;font-size: 15px">暂无数据</div> <div v-else style="width: 100%;color: #999999;text-align: center;font-size: 15px">暂无数据</div>
</div> </div>
<editorder-form v-if="isShowEditOrderForm" :save-obj="orderObj" :orderType="1" @close="closeOrderSaveForm" @success="refreshOrder"> <editorder-form v-if="isShowEditOrderForm" :save-obj="orderObj" :orderType="1" @close="closeOrderSaveForm"
@success="refreshOrder">
</editorder-form> </editorder-form>
</div> </div>
</div> </div>
...@@ -231,7 +232,6 @@ ...@@ -231,7 +232,6 @@
<script> <script>
import { import {
getClassPruductList, //获取日语培训列表 getClassPruductList, //获取日语培训列表
getOrderSourceEnumList, //获取订单来源 枚举
setClassOrder, //新增 修改订单 setClassOrder, //新增 修改订单
} from '../../api/sale/sale'; } from '../../api/sale/sale';
import { import {
...@@ -241,10 +241,6 @@ ...@@ -241,10 +241,6 @@
import { import {
queryCourseDropdownList, queryCourseDropdownList,
} from '../../api/course/index' } from '../../api/course/index'
import {
queryEmployee
} from '../../api/users/user'; //获取员工
import editorderForm from '../../components/sale/editorder-form' //修改订单 import editorderForm from '../../components/sale/editorder-form' //修改订单
export default { export default {
...@@ -273,91 +269,43 @@ ...@@ -273,91 +269,43 @@
JoinStartTime: '', //报名截止日期开始 JoinStartTime: '', //报名截止日期开始
JoinEndTime: "", //报名截止日期结束 JoinEndTime: "", //报名截止日期结束
}, },
//学员报名
enrollMsg: {
ClassId: 0,
GuestNum: 1,
Unit_Price: 0, //成交单价
PreferPrice: 0, //应收总额
OrderSource: 0, //客人来源 枚举
SaleRemark: '', //备注
OrderType: 1, //订单类型(1-班级课程订单,2-留学就业订单)
SourceId: 0, //来源编号
HelpEnterId: 0, //协助人员编号
GeneralOccupation: "", //一般同行
EduOccupation: "", //教育同行
IsLessPrice: 0, //是否少价 0 不少 1 少
LessPrice: 0, //少价金额
},
//关联校区列表 //关联校区列表
schoolList: [], schoolList: [],
pageCount: 0, pageCount: 0,
selectitem: {},
IsUpPrice: false, //是否高于定价
UnitPrice: 0, //用于可以输入单价的验证
SourceEnumList: [],
ClassList: [], //关联课程下拉数据 ClassList: [], //关联课程下拉数据
TeacherList: [], //关联教师下拉数据 TeacherList: [], //关联教师下拉数据
elvalue: new Date(), elvalue: new Date(),
EmployeeList: [], //员工列表 isShowEditOrderForm: false,//是否显示订单弹窗
AllemployeeList: [], //所有员工列表 orderObj: {
isShowEditOrderForm:false, ClassId: 0,
orderObj:{} Unit_Price: 0,
}
} }
}, },
created() { created() {
this.getSchool(); this.getSchool();
this.getOrderSEList()
this.CourseList(); this.CourseList();
this.GetTeacherList(); this.GetTeacherList();
},
mounted() {
let nowDay = new Date(); let nowDay = new Date();
var year = nowDay.getFullYear(); //年 var year = nowDay.getFullYear(); //年
var month = nowDay.getMonth() + 1; //月 var month = nowDay.getMonth() + 1; //月
var day = nowDay.getDate(); //日 var day = nowDay.getDate(); //日
var currentDay = year + '-' + month + '-' + day; var currentDay = year + '-' + month + '-' + day;
this.msg.StartTime = currentDay this.msg.StartTime = currentDay
},
mounted() {
this.getList(); this.getList();
this.getEmployee();
}, },
methods: { methods: {
//关闭订单修改 //关闭订单修改
closeOrderSaveForm() { closeOrderSaveForm() {
this.isShowEditOrderForm = false; this.isShowEditOrderForm = false;
}, },
refreshOrder(){ refreshOrder() {
this.getList();
},
//筛选员工
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);
}
})
},
//获取业务员
getEmployee() {
var qMsg = {
Dept_Id: 0
}
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeList = res.Data;
this.AllemployeeList = res.Data;
let obj = {
Id:0,
EmployeeName:'不限'
}
this.EmployeeList.unshift(obj);
this.AllemployeeList.unshift(obj);
}
}).catch(() => {})
}, },
//跳转到班级订单 //跳转到班级订单
goclassorder(item) { goclassorder(item) {
...@@ -382,16 +330,8 @@ ...@@ -382,16 +330,8 @@
} }
}) })
}, },
getOrderSEList() { //判断是否过期
getOrderSourceEnumList({}).then(res => { getEXPDate(time) {
if (res.Code == 1) {
var tempArray = res.Data;
this.SourceEnumList = tempArray;
this.enrollMsg.OrderSource = tempArray[0].Id;
}
})
},
getEXPDate(time) { //判断是否过期
var str = time.replace(/年/g, "/").replace(/月/g, "/").replace(/日/g, ""); var str = time.replace(/年/g, "/").replace(/月/g, "/").replace(/日/g, "");
var date = new Date(str).getTime(); var date = new Date(str).getTime();
var now = new Date().getTime() + 86400; var now = new Date().getTime() + 86400;
...@@ -502,112 +442,11 @@ ...@@ -502,112 +442,11 @@
this.loading = false this.loading = false
}) })
}, },
getSortFun(order, sortBy) {
var ordAlpah = (order == 'asc') ? '>' : '<';
var sortFun = new Function('a', 'b', 'return a.' + sortBy + ordAlpah + 'b.' + sortBy + '?1:-1');
return sortFun;
},
countPrice(num) {
let array = [];
if (this.selectitem.ClassStepPriceList && this.selectitem.ClassStepPriceList.length) {
this.selectitem.ClassStepPriceList.forEach(x => {
let obj = {
PersionNum: x.PersionNum,
PersionPrice: x.PersionPrice,
}
array.push(obj)
})
let fz = false
let a = 0;
array.forEach(x => {
if (x.PersionNum == num) {
fz = true;
a = x.PersionPrice
}
})
if (fz == false) {
array.push({
PersionNum: num
})
array.sort(this.getSortFun('asc', 'PersionNum')); //升序排序
var idx;
for (var i = 0; i < array.length; i++) {
if (array[i].PersionNum == num) {
idx = i;
}
}
idx = Math.max(0, idx - 1);
if (array[idx].PersionPrice) {
return array[idx].PersionPrice
} else {
return this.selectitem.SellPrice
}
} else {
return a
}
} else {
return this.selectitem.SellPrice
}
},
placeAnorder(item) { placeAnorder(item) {
this.selectitem = item;
// this.dialog = true;
this.enrollMsg.ClassId = item.ClassId;
this.enrollMsg.SaleRemark = ''; //清空备注
this.enrollMsg.Unit_Price = this.countPrice(this.enrollMsg.GuestNum);
this.UnitPrice = this.enrollMsg.Unit_Price;
this.enrollMsg.HelpEnterId=0;
this.enrollMsg.GeneralOccupation='';
this.enrollMsg.EduOccupation='';
this.enrollMsg.IsLessPrice=0;
this.enrollMsg.LessPrice=0;
this.orderObj.ClassId = item.ClassId; this.orderObj.ClassId = item.ClassId;
this.orderObj.Unit_Price = this.countPrice(this.enrollMsg.GuestNum); this.orderObj.Unit_Price = item.SellPrice;
this.isShowEditOrderForm = true; this.isShowEditOrderForm = true;
console.log(item);
// this.orderObj.Id = item.
}, },
peopleNumber(val) {
if (val > this.selectitem.SurplusNum) {
this.enrollMsg.GuestNum = this.selectitem.SurplusNum
}
if (val == '') {
this.enrollMsg.GuestNum = 1
}
this.enrollMsg.Unit_Price = this.countPrice(this.enrollMsg.GuestNum)
this.UnitPrice = this.enrollMsg.Unit_Price
},
priceNumber(val) { //大于的时候赋值
if (this.enrollMsg.Unit_Price < this.UnitPrice) {
this.enrollMsg.Unit_Price = this.UnitPrice
}
},
saveSatMsg() { //立即报名
this.enrollMsg.PreferPrice = (this.enrollMsg.GuestNum * this.enrollMsg.Unit_Price)-this.enrollMsg.LessPrice;
setClassOrder(this.enrollMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '报名成功!',
position: 'top'
})
this.getList()
this.dialog = false;
this.enrollMsg = { //清空数据
ClassId: 0,
GuestNum: 1,
Unit_Price: 0, //成交单价
PreferPrice: 0, //应收总额
OrderSource: 0, //客人来源 枚举
SaleRemark: '', //备注
}
}
}).catch(() => {})
}
} }
} }
......
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