Commit 4d71e35e authored by 黄奎's avatar 黄奎

页面修改

parent 63969c27
......@@ -17,9 +17,8 @@
</div>
<div class="row wrap">
<div class="col-6 q-pb-lg q-pr-lg">
<q-uploader :style="{ backgroundImage: 'url(' + objOption.CoverImg + ')' }"
style="width: auto; height: 139px" flat hide-upload-btn max-files="1" label="课程封面" accept=".jpg, image/*"
:factory="uploadFile" auto-upload>
<q-uploader :style="{ backgroundImage: 'url(' + objOption.CoverImg + ')' }" style="width: auto; height: 139px"
flat hide-upload-btn max-files="1" label="课程封面" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div>
<div class="col-6 q-pr-lg q-pb-lg">
......@@ -133,23 +132,23 @@
</div>
</div>
<div class="row" v-if="objOption.IsScrollClass==1">
<div class="row" v-if="objOption.IsScrollClass == 1">
<q-input filled stack-label v-model="objOption.ScrollMinNum" ref="ScrollMinNum" class="col-6 q-pr-lg q-pb-lg"
label="最小上课人数" :rules="[val => !!val || '请填写最小上课人数']" />
<q-input filled stack-label v-model="objOption.ScrollMaxNum" ref="ScrollMaxNum" class="col-6 q-pr-lg q-pb-lg"
label="最大上课人数" :rules="[val => !!val || '请填写最大上课人数']" />
</div>
<div class="row">
<q-input filled stack-label v-model="objOption.FreeCoffeeNum" ref="FreeCoffeeNum"
class="col-6 q-pr-lg q-pb-lg" label="赠送咖啡杯数" :rules="[val => val >=0 || '请填写赠送咖啡杯数']" />
<q-input filled stack-label v-model="objOption.AddHoursMoney" ref="AddHoursMoney"
class="col-6 q-pr-lg q-pb-lg" label="课程增加课时费" :rules="[val => val >=0 || '请填写课程增加课时费']" />
<q-input filled stack-label v-model="objOption.FreeCoffeeNum" ref="FreeCoffeeNum" class="col-6 q-pr-lg q-pb-lg"
label="赠送咖啡杯数" :rules="[val => val >= 0 || '请填写赠送咖啡杯数']" />
<q-input filled stack-label v-model="objOption.AddHoursMoney" ref="AddHoursMoney" class="col-6 q-pr-lg q-pb-lg"
label="课程增加课时费" :rules="[val => val >= 0 || '请填写课程增加课时费']" />
</div>
<div class="row wrap">
<div class="col-6">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="CourseEmphasis" multiple
use-chips ref="CourseEmphasis" :options="keynoteList" label="课程重点" class="col-6 q-pr-lg q-pb-lg"
emit-value map-options />
<q-select filled stack-label option-value="Id" option-label="Name" v-model="CourseEmphasis" multiple use-chips
ref="CourseEmphasis" :options="keynoteList" label="课程重点" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options />
</div>
<div class="col-6 q-pb-lg q-pr-lg">
<q-uploader :style="{ backgroundImage: 'url(' + objOption.B2BIcon + ')' }" style="width: auto; " flat
......@@ -188,6 +187,18 @@
:true-value="1" v-model="objOption.IsKCourse" />
</div>
</div>
<div class="row wrap">
<div class="col-9">
<q-field stack-label class="col-3 q-pr-lg" prefix="是否显示:" borderless>
<template v-slot:control>
<q-radio v-model="objOption.SaleState" :val="1" label="显示" />
<q-radio v-model="objOption.SaleState" :val="2" label="隐藏" />
</template>
</q-field>
</div>
<div class="col-3">
</div>
</div>
<div class="row col-12" v-if="choosePlat.find(e => e == 4)">
<span class="q-mb-sm">选择分类:</span>
<q-card class="full-width">
......@@ -208,523 +219,525 @@
</template>
<script>
import ColorThief from "colorthief";
import {
queryCourseCategoryTree,
saveCourseInfo,
queryCourseInfo,
querySaleplatList,
getCourseRate,
getCourseSubject,
getCourseEmphasisEnumList
} from "../../api/course/index";
import {
getTeacherDropDownList,
GetBankTypeList
} from "../../api/school/index";
import {
UploadSelfFile
} from "../../api/common/common";
import {
getScrollCourseTimeList
} from "../../api/course/roll";
import extEditor from "../common/ext-editor";
import {
mapState
} from "vuex";
export default {
components: {
extEditor
},
props: {
saveObj: {
type: Object,
default: null
import ColorThief from "colorthief";
import {
queryCourseCategoryTree,
saveCourseInfo,
queryCourseInfo,
querySaleplatList,
getCourseRate,
getCourseSubject,
getCourseEmphasisEnumList
} from "../../api/course/index";
import {
getTeacherDropDownList,
GetBankTypeList
} from "../../api/school/index";
import {
UploadSelfFile
} from "../../api/common/common";
import {
getScrollCourseTimeList
} from "../../api/course/roll";
import extEditor from "../common/ext-editor";
import {
mapState
} from "vuex";
export default {
components: {
extEditor
},
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
CourseId: 0, //课程编号
CoverImg: "", //课程封面图
CourseName: "", //课程名称
CourseIntro: "", //课程介绍
CateId: 0, //课程编号
School_Id: 0, //校区编号
Teacher_Ids: "", //教学团队
CourseFeature: "", //课程特色
OriginalPrice: 0, //原价
SellPrice: 0, //售价
IsOpenStepPrice: 0, //是否开启阶梯定价(1-开启)
IsRenew: 0, //是否可续费课程(1-是)
RenewOgPrice: 0, //续费原价
RenewSlPrice: 0, //续费售价
Saleplat: "", //销售平台
IsKCourse: 0, //是否是K12课程(1-是)
ClassHours: 0,
CategoryList: [],
CourseRate: "", //课程等级
CourseSubject: "", //课程科目
B2BIcon: "", //图标
B2BBackground: "", //背景
CourseEmphasis: [], //课程重点 多选 英文逗号分隔
ContractInfo: "", //合同补充协议
IsScrollClass: 0, // 是否开启滚动开班 1是 0否(默认)
ScrollMinNum: 0, // 最小上课人数
ScrollMaxNum: 0, // 最大上课人数
FreeCoffeeNum: 0, // 赠送咖啡
AddHoursMoney: 0, // 课程增加课时费
CourseTimeId: 0, // 关联上课时段
ContractInfo: "", //合同补充协议
OpenBankLevelList: [], //开放题库
ChineseHours: "", //中教课时
ForeignHours: "", //外教课时
SaleState: 1,//上架状态(1-上架,2-下架)
},
CourseTimeList: [], //上课时段列表
CourseEmphasis: [], //数据临时存放
optionTitle: "",
defaultArray: [],
ladderPriceList: [], //阶梯定价数组
saveCourseLoading: false,
TreeCategoryList: [], //课程分类树形列表
TeacherList: [], //关联教师下拉数据
SaleplatList: [], //销售端口
choosePlat: [], //选择的平台
chooseTeacher: [], //选择老师
isShowPrice: 0, //是否显示价格【hk2021-03-05新增】
goodClassify: [], //商品分类列表
chooseGoodsClassify: [], //选中的商品分类
modifyClassifyList: [], //修改时返回的分类列表
courseLevelList: [], //课程等级列表
courseSubjectList: [], //课程科目列表
keynoteList: [], //重点枚举列表
LevelData: []
};
},
created() {
this.getCategorytree();
this.GetTeacherList();
this.getSaleplat();
//获取电商商品分类
this.getGoodsClassify();
this.getCourseRateList();
this.getCourseEmphasisList(); //获取课程重点枚举列表
this.initObj();
this.getLevel();
},
computed: mapState({
//是否有编辑课时权限
isHaveCourseHoursEdit(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Edit_CourseClassHours") {
return x;
}
});
if (action) {
return true;
}
}
return false;
}
}),
mounted() {
this.getCourseTimeList();
},
methods: {
//获取关联考试等级
getLevel() {
GetBankTypeList({}).then(res => {
if (res.Code == 1) {
this.LevelData = res.Data;
}
})
},
data() {
return {
persistent: true,
objOption: {
CourseId: 0, //课程编号
CoverImg: "", //课程封面图
CourseName: "", //课程名称
CourseIntro: "", //课程介绍
CateId: 0, //课程编号
School_Id: 0, //校区编号
Teacher_Ids: "", //教学团队
CourseFeature: "", //课程特色
OriginalPrice: 0, //原价
SellPrice: 0, //售价
IsOpenStepPrice: 0, //是否开启阶梯定价(1-开启)
IsRenew: 0, //是否可续费课程(1-是)
RenewOgPrice: 0, //续费原价
RenewSlPrice: 0, //续费售价
Saleplat: "", //销售平台
IsKCourse: 0, //是否是K12课程(1-是)
ClassHours: 0,
CategoryList: [],
CourseRate: "", //课程等级
CourseSubject: "", //课程科目
B2BIcon: "", //图标
B2BBackground: "", //背景
CourseEmphasis: [], //课程重点 多选 英文逗号分隔
ContractInfo: "", //合同补充协议
IsScrollClass: 0, // 是否开启滚动开班 1是 0否(默认)
ScrollMinNum: 0, // 最小上课人数
ScrollMaxNum: 0, // 最大上课人数
FreeCoffeeNum: 0, // 赠送咖啡
AddHoursMoney: 0, // 课程增加课时费
CourseTimeId: 0, // 关联上课时段
ContractInfo: "", //合同补充协议
OpenBankLevelList: [], //开放题库
ChineseHours: "", //中教课时
ForeignHours: "", //外教课时
},
CourseTimeList: [], //上课时段列表
CourseEmphasis: [], //数据临时存放
optionTitle: "",
defaultArray: [],
ladderPriceList: [], //阶梯定价数组
saveCourseLoading: false,
TreeCategoryList: [], //课程分类树形列表
TeacherList: [], //关联教师下拉数据
SaleplatList: [], //销售端口
choosePlat: [], //选择的平台
chooseTeacher: [], //选择老师
isShowPrice: 0, //是否显示价格【hk2021-03-05新增】
goodClassify: [], //商品分类列表
chooseGoodsClassify: [], //选中的商品分类
modifyClassifyList: [], //修改时返回的分类列表
courseLevelList: [], //课程等级列表
courseSubjectList: [], //课程科目列表
keynoteList: [], //重点枚举列表
LevelData: []
};
//根据系列改变获取所属科目
changeCourseSubject(Id) {
if (Id > 0) {
let val = this.TreeCategoryList.find(x => x.CateId == Id);
this.objOption.CourseSubject = val.CourseSubject;
}
},
created() {
this.getCategorytree();
this.GetTeacherList();
this.getSaleplat();
//获取电商商品分类
this.getGoodsClassify();
this.getCourseRateList();
this.getCourseEmphasisList(); //获取课程重点枚举列表
this.initObj();
this.getLevel();
//获取课程等级列表
getCourseRateList() {
getCourseRate({}).then(res => {
if (res.Code == 1) {
var tempData = res.Data;
if (tempData && tempData.length > 0) {
tempData.forEach(item => {
this.courseLevelList.push({
Id: item.Id,
Name: item.Name.replace(/课程/g, "")
});
});
}
}
});
getCourseSubject({}).then(res => {
if (res.Code == 1) {
this.courseSubjectList = res.Data;
}
});
},
computed: mapState({
//是否有编辑课时权限
isHaveCourseHoursEdit(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Edit_CourseClassHours") {
return x;
}
getCourseEmphasisList() {
getCourseEmphasisEnumList({}).then(res => {
if (res.Code == 1) {
this.keynoteList = res.Data;
this.keynoteList.map(x => {
this.CourseEmphasis.push(x.Id);
});
if (action) {
return true;
}
}
return false;
}
}),
mounted() {
this.getCourseTimeList();
});
},
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.TeacherList = res.Data;
}
});
},
//获取销售端口列表
getSaleplat() {
querySaleplatList().then(res => {
this.SaleplatList = res.Data;
});
},
//获取编辑器值
getEditValue(obj) {
this.objOption.CourseIntro = obj;
},
methods: {
//获取关联考试等级
getLevel() {
GetBankTypeList({}).then(res => {
if (res.Code == 1) {
this.LevelData = res.Data;
uploadFile(files) {
UploadSelfFile("course", files[0], res => {
if (res.Code == 1) {
this.objOption.CoverImg = res.FileUrl;
}
});
},
uploadFile2(files) {
UploadSelfFile("course", files[0], res => {
if (res.Code == 1) {
this.objOption.B2BIcon = res.FileUrl;
this.ImgColor();
}
});
},
ImgColor() {
//获取图标上传的主色
let domImg = document.querySelector("#background");
let colorthief = new ColorThief();
domImg.addEventListener("load", () => {
let color = colorthief.getColor(domImg, 2);
this.objOption.B2BBackground = this.rgb2Hex(
`RGB(${color[0]}, ${color[1]}, ${color[2]})`
);
});
},
rgb2Hex(string) {
//rgb转化为16进制
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(string)) {
var aColor = string.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex = Number(aColor[i]).toString(16);
if (hex === "0") {
hex += hex;
}
})
},
//根据系列改变获取所属科目
changeCourseSubject(Id) {
if (Id > 0) {
let val = this.TreeCategoryList.find(x => x.CateId == Id);
this.objOption.CourseSubject = val.CourseSubject;
strHex += hex;
}
},
//获取课程等级列表
getCourseRateList() {
getCourseRate({}).then(res => {
if (res.Code == 1) {
var tempData = res.Data;
if (tempData && tempData.length > 0) {
tempData.forEach(item => {
this.courseLevelList.push({
Id: item.Id,
Name: item.Name.replace(/课程/g, "")
});
if (strHex.length !== 7) {
strHex = string;
}
return strHex;
} else if (reg.test(string)) {
var aNum = string.replace(/#/, "").split("");
if (aNum.length === 6) {
return string;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += aNum[i] + aNum[i];
}
return numHex;
}
} else {
return string;
}
},
//获取课程系列
getCategorytree() {
this.TreeCategoryList = [];
var qMsg = {};
queryCourseCategoryTree(qMsg).then(res => {
this.TreeCategoryList = res.Data;
});
},
//新增阶梯定价
addStepPrice() {
var obj = {
ClassStepPriceId: 0,
PersionNum: 2,
PersionPrice: 0
};
if (this.ladderPriceList && this.ladderPriceList.length > 0) {
var _index = this.ladderPriceList.length - 1;
obj.PersionNum = parseInt(this.ladderPriceList[_index].PersionNum) + 1;
}
this.ladderPriceList.push(obj);
},
//删除阶梯定价
delStepPrice(index) {
this.ladderPriceList.splice(index, 1);
},
//初始化表单
initObj() {
this.defaultArray = [];
if (this.saveObj && this.saveObj.CourseId > 0) {
queryCourseInfo({
CourseId: this.saveObj.CourseId
}).then(res => {
this.objOption.CourseId = res.Data.CourseId;
this.objOption.CoverImg = res.Data.CoverImg;
this.objOption.CourseName = res.Data.CourseName;
this.objOption.CourseIntro = res.Data.CourseIntro;
this.objOption.CateId = res.Data.CateId;
this.objOption.School_Id = res.Data.School_Id;
this.objOption.Teacher_Ids = res.Data.Teacher_Ids;
this.objOption.CourseFeature = res.Data.CourseFeature;
this.objOption.OriginalPrice = res.Data.OriginalPrice;
this.objOption.SellPrice = res.Data.SellPrice;
this.objOption.ClassHours = res.Data.ClassHours;
this.objOption.IsOpenStepPrice = res.Data.IsOpenStepPrice;
this.objOption.IsRenew = res.Data.IsRenew;
this.objOption.RenewOgPrice = res.Data.RenewOgPrice;
this.objOption.RenewSlPrice = res.Data.RenewSlPrice;
this.objOption.Saleplat = res.Data.Saleplat;
this.objOption.IsKCourse = res.Data.IsKCourse;
this.objOption.CourseRate = res.Data.CourseRate;
this.objOption.CourseSubject = res.Data.CourseSubject;
this.objOption.B2BIcon = res.Data.B2BIcon;
this.objOption.B2BBackground = res.Data.B2BBackground;
this.objOption.ContractInfo = res.Data.ContractInfo;
this.objOption.IsScrollClass = res.Data.IsScrollClass;
this.objOption.ScrollMinNum = res.Data.ScrollMinNum;
this.objOption.ScrollMaxNum = res.Data.ScrollMaxNum;
this.objOption.FreeCoffeeNum = res.Data.FreeCoffeeNum;
this.objOption.AddHoursMoney = res.Data.AddHoursMoney;
this.objOption.CourseTimeId = res.Data.CourseTimeId;
this.objOption.OpenBankLevelList = res.Data.OpenBankLevelList;
this.objOption.ChineseHours = res.Data.ChineseHours;
this.objOption.ForeignHours = res.Data.ForeignHours;
this.objOption.SaleState = res.Data.SaleState;
this.CourseEmphasis = [];
setTimeout(() => {
//Todo 暂时不知道什么原因 偶尔会出现2个 所以加了一个延迟
if (res.Data.CourseEmphasis && res.Data.CourseEmphasis != "") {
this.CourseEmphasis = res.Data.CourseEmphasis.split(",").map(
Number
);
} else {
this.keynoteList.map(x => {
this.CourseEmphasis.push(x.Id);
});
}
}, 100);
if (res.Data.StepPriceList && res.Data.StepPriceList.length > 0) {
this.ladderPriceList = res.Data.StepPriceList;
}
});
getCourseSubject({}).then(res => {
if (res.Code == 1) {
this.courseSubjectList = res.Data;
if (res.Data.TeacherIdList && res.Data.TeacherIdList.length > 0) {
this.chooseTeacher = res.Data.TeacherIdList;
}
});
},
getCourseEmphasisList() {
getCourseEmphasisEnumList({}).then(res => {
if (res.Code == 1) {
this.keynoteList = res.Data;
this.keynoteList.map(x => {
this.CourseEmphasis.push(x.Id);
});
if (res.Data.SalePlatList && res.Data.SalePlatList.length > 0) {
this.choosePlat = res.Data.SalePlatList;
}
});
},
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.TeacherList = res.Data;
}
});
},
//获取销售端口列表
getSaleplat() {
querySaleplatList().then(res => {
this.SaleplatList = res.Data;
});
},
//获取编辑器值
getEditValue(obj) {
this.objOption.CourseIntro = obj;
},
uploadFile(files) {
UploadSelfFile("course", files[0], res => {
if (res.Code == 1) {
this.objOption.CoverImg = res.FileUrl;
}
});
},
uploadFile2(files) {
UploadSelfFile("course", files[0], res => {
if (res.Code == 1) {
this.objOption.B2BIcon = res.FileUrl;
this.ImgColor();
if (res.Data.CategoryList && res.Data.CategoryList.length > 0) {
this.modifyClassifyList = res.Data.CategoryList;
this.chooseGoodsClassify = res.Data.CategoryList.map(e => {
return e.CategoryId;
});
}
this.defaultArray.push(res.Data.CateId);
this.handleCheckChange();
});
},
ImgColor() {
//获取图标上传的主色
let domImg = document.querySelector("#background");
let colorthief = new ColorThief();
domImg.addEventListener("load", () => {
let color = colorthief.getColor(domImg, 2);
this.objOption.B2BBackground = this.rgb2Hex(
`RGB(${color[0]}, ${color[1]}, ${color[2]})`
);
});
},
rgb2Hex(string) {
//rgb转化为16进制
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(string)) {
var aColor = string.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex = Number(aColor[i]).toString(16);
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = string;
}
return strHex;
} else if (reg.test(string)) {
var aNum = string.replace(/#/, "").split("");
if (aNum.length === 6) {
return string;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += aNum[i] + aNum[i];
}
return numHex;
}
} else {
return string;
this.optionTitle = "修改课程信息";
} else {
this.optionTitle = "新增课程";
this.objOption.CourseId = 0;
this.objOption.CoverImg = "";
this.objOption.CourseName = "";
this.objOption.CourseIntro = "";
this.objOption.CateId = 0;
this.objOption.School_Id = 0;
this.objOption.Teacher_Ids = "";
this.objOption.CourseFeature = "";
this.objOption.OriginalPrice = 0;
this.objOption.SellPrice = 0;
this.objOption.ClassHours = 0;
this.objOption.IsOpenStepPrice = 0;
this.objOption.IsRenew = 0;
this.objOption.RenewOgPrice = 0;
this.objOption.RenewSlPrice = 0;
this.objOption.Saleplat = "";
this.objOption.IsKCourse = 0;
this.objOption.CourseRate = "";
this.objOption.ContractInfo = "";
this.objOption.IsScrollClass = 0;
this.objOption.ScrollMinNum = 0;
this.objOption.ScrollMaxNum = 0;
this.objOption.FreeCoffeeNum = 0;
this.objOption.AddHoursMoney = 0;
this.objOption.CourseTimeId = 0;
this.objOption.OpenBankLevelList = [];
this.objOption.ChineseHours = "";
this.objOption.ForeignHours = "";
}
},
//关闭弹窗
closeCourseForm() {
this.$emit("close");
this.persistent = false;
},
//保存菜单
saveCourse() {
this.$refs.CourseName.validate();
//this.$refs.ClassHours.validate();
this.$refs.CateId.validate();
this.$refs.FreeCoffeeNum.validate();
this.$refs.AddHoursMoney.validate();
//!this.$refs.ClassHours.hasError &&
if (
!this.$refs.CourseName.hasError &&
!this.$refs.CateId.hasError &&
!this.$refs.FreeCoffeeNum.hasError &&
!this.$refs.AddHoursMoney.hasError
) {
this.saveCourseLoading = true;
var Teacher_Ids = "";
if (this.chooseTeacher && this.chooseTeacher.length > 0) {
this.chooseTeacher.forEach(item => {
Teacher_Ids += "," + item;
});
}
},
//获取课程系列
getCategorytree() {
this.TreeCategoryList = [];
var qMsg = {};
queryCourseCategoryTree(qMsg).then(res => {
this.TreeCategoryList = res.Data;
});
},
//新增阶梯定价
addStepPrice() {
var obj = {
ClassStepPriceId: 0,
PersionNum: 2,
PersionPrice: 0
};
if (this.ladderPriceList && this.ladderPriceList.length > 0) {
var _index = this.ladderPriceList.length - 1;
obj.PersionNum = parseInt(this.ladderPriceList[_index].PersionNum) + 1;
if (Teacher_Ids != "") {
Teacher_Ids = Teacher_Ids.substring(1);
}
this.ladderPriceList.push(obj);
},
//删除阶梯定价
delStepPrice(index) {
this.ladderPriceList.splice(index, 1);
},
//初始化表单
initObj() {
this.defaultArray = [];
if (this.saveObj && this.saveObj.CourseId > 0) {
queryCourseInfo({
CourseId: this.saveObj.CourseId
}).then(res => {
this.objOption.CourseId = res.Data.CourseId;
this.objOption.CoverImg = res.Data.CoverImg;
this.objOption.CourseName = res.Data.CourseName;
this.objOption.CourseIntro = res.Data.CourseIntro;
this.objOption.CateId = res.Data.CateId;
this.objOption.School_Id = res.Data.School_Id;
this.objOption.Teacher_Ids = res.Data.Teacher_Ids;
this.objOption.CourseFeature = res.Data.CourseFeature;
this.objOption.OriginalPrice = res.Data.OriginalPrice;
this.objOption.SellPrice = res.Data.SellPrice;
this.objOption.ClassHours = res.Data.ClassHours;
this.objOption.IsOpenStepPrice = res.Data.IsOpenStepPrice;
this.objOption.IsRenew = res.Data.IsRenew;
this.objOption.RenewOgPrice = res.Data.RenewOgPrice;
this.objOption.RenewSlPrice = res.Data.RenewSlPrice;
this.objOption.Saleplat = res.Data.Saleplat;
this.objOption.IsKCourse = res.Data.IsKCourse;
this.objOption.CourseRate = res.Data.CourseRate;
this.objOption.CourseSubject = res.Data.CourseSubject;
this.objOption.B2BIcon = res.Data.B2BIcon;
this.objOption.B2BBackground = res.Data.B2BBackground;
this.objOption.ContractInfo = res.Data.ContractInfo;
this.objOption.IsScrollClass = res.Data.IsScrollClass;
this.objOption.ScrollMinNum = res.Data.ScrollMinNum;
this.objOption.ScrollMaxNum = res.Data.ScrollMaxNum;
this.objOption.FreeCoffeeNum = res.Data.FreeCoffeeNum;
this.objOption.AddHoursMoney = res.Data.AddHoursMoney;
this.objOption.CourseTimeId = res.Data.CourseTimeId;
this.objOption.OpenBankLevelList = res.Data.OpenBankLevelList;
this.objOption.ChineseHours = res.Data.ChineseHours;
this.objOption.ForeignHours = res.Data.ForeignHours;
this.CourseEmphasis = [];
setTimeout(() => {
//Todo 暂时不知道什么原因 偶尔会出现2个 所以加了一个延迟
if (res.Data.CourseEmphasis && res.Data.CourseEmphasis != "") {
this.CourseEmphasis = res.Data.CourseEmphasis.split(",").map(
Number
);
} else {
this.keynoteList.map(x => {
this.CourseEmphasis.push(x.Id);
});
}
}, 100);
if (res.Data.StepPriceList && res.Data.StepPriceList.length > 0) {
this.ladderPriceList = res.Data.StepPriceList;
}
if (res.Data.TeacherIdList && res.Data.TeacherIdList.length > 0) {
this.chooseTeacher = res.Data.TeacherIdList;
}
if (res.Data.SalePlatList && res.Data.SalePlatList.length > 0) {
this.choosePlat = res.Data.SalePlatList;
}
if (res.Data.CategoryList && res.Data.CategoryList.length > 0) {
this.modifyClassifyList = res.Data.CategoryList;
this.chooseGoodsClassify = res.Data.CategoryList.map(e => {
return e.CategoryId;
});
}
this.defaultArray.push(res.Data.CateId);
this.handleCheckChange();
var salePlat = "";
if (this.choosePlat && this.choosePlat.length > 0) {
this.choosePlat.forEach(item => {
salePlat += "," + item;
});
this.optionTitle = "修改课程信息";
}
if (salePlat != "") {
salePlat = salePlat.substring(1);
}
this.objOption.StepPriceList = this.ladderPriceList;
this.objOption.Teacher_Ids = Teacher_Ids;
this.objOption.Saleplat = salePlat;
if (this.CourseEmphasis.length > 0) {
this.objOption.CourseEmphasis = this.CourseEmphasis.join(",");
} else {
this.optionTitle = "新增课程";
this.objOption.CourseId = 0;
this.objOption.CoverImg = "";
this.objOption.CourseName = "";
this.objOption.CourseIntro = "";
this.objOption.CateId = 0;
this.objOption.School_Id = 0;
this.objOption.Teacher_Ids = "";
this.objOption.CourseFeature = "";
this.objOption.OriginalPrice = 0;
this.objOption.SellPrice = 0;
this.objOption.ClassHours = 0;
this.objOption.IsOpenStepPrice = 0;
this.objOption.IsRenew = 0;
this.objOption.RenewOgPrice = 0;
this.objOption.RenewSlPrice = 0;
this.objOption.Saleplat = "";
this.objOption.IsKCourse = 0;
this.objOption.CourseRate = "";
this.objOption.ContractInfo = "";
this.objOption.IsScrollClass = 0;
this.objOption.ScrollMinNum = 0;
this.objOption.ScrollMaxNum = 0;
this.objOption.FreeCoffeeNum = 0;
this.objOption.AddHoursMoney = 0;
this.objOption.CourseTimeId = 0;
this.objOption.OpenBankLevelList = [];
this.objOption.ChineseHours = "";
this.objOption.ForeignHours = "";
this.objOption.CourseEmphasis = "";
}
},
//关闭弹窗
closeCourseForm() {
this.$emit("close");
this.persistent = false;
},
//保存菜单
saveCourse() {
this.$refs.CourseName.validate();
//this.$refs.ClassHours.validate();
this.$refs.CateId.validate();
this.$refs.FreeCoffeeNum.validate();
this.$refs.AddHoursMoney.validate();
//!this.$refs.ClassHours.hasError &&
if (
!this.$refs.CourseName.hasError &&
!this.$refs.CateId.hasError &&
!this.$refs.FreeCoffeeNum.hasError &&
!this.$refs.AddHoursMoney.hasError
) {
this.saveCourseLoading = true;
var Teacher_Ids = "";
if (this.chooseTeacher && this.chooseTeacher.length > 0) {
this.chooseTeacher.forEach(item => {
Teacher_Ids += "," + item;
});
}
if (Teacher_Ids != "") {
Teacher_Ids = Teacher_Ids.substring(1);
}
var salePlat = "";
if (this.choosePlat && this.choosePlat.length > 0) {
this.choosePlat.forEach(item => {
salePlat += "," + item;
});
}
if (salePlat != "") {
salePlat = salePlat.substring(1);
}
this.objOption.StepPriceList = this.ladderPriceList;
this.objOption.Teacher_Ids = Teacher_Ids;
this.objOption.Saleplat = salePlat;
if (this.CourseEmphasis.length > 0) {
this.objOption.CourseEmphasis = this.CourseEmphasis.join(",");
} else {
this.objOption.CourseEmphasis = "";
}
saveCourseInfo(this.objOption)
.then(res => {
this.saveCourseLoading = false;
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top"
});
this.$emit("success");
this.closeSaveForm();
})
.catch(() => {
this.saveCourseLoading = false;
saveCourseInfo(this.objOption)
.then(res => {
this.saveCourseLoading = false;
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top"
});
this.$emit("success");
this.closeSaveForm();
})
.catch(() => {
this.saveCourseLoading = false;
});
}
},
//获取商品分类
getGoodsClassify() {
let msg1 = {
Id: 0,
Name: "",
Tier: 0,
ParentId: 0,
Enabled: 1,
IsShow: 1,
CategoryPageType: 0
};
this.apipostDS("/api/product/GetProductCategoryTreeList", msg1, res => {
if (res.data.resultCode === 1) {
this.goodClassify = res.data.data;
}
},
//获取商品分类
getGoodsClassify() {
let msg1 = {
Id: 0,
Name: "",
Tier: 0,
ParentId: 0,
Enabled: 1,
IsShow: 1,
CategoryPageType: 0
};
this.apipostDS("/api/product/GetProductCategoryTreeList", msg1, res => {
if (res.data.resultCode === 1) {
this.goodClassify = res.data.data;
});
},
//处理选中后的商品分类参数
handleCheckChange() {
this.objOption.CategoryList = [];
this.chooseGoodsClassify.forEach(list => {
this.goodClassify.forEach(item => {
if (list == item.Id) {
let newItem = JSON.parse(JSON.stringify(item));
newItem.CategoryId = item.Id;
newItem.Id = 0;
//查找已提交的分类的id,否则为0
let findId = this.modifyClassifyList.find(
e => e.CategoryId === newItem.CategoryId
);
if (findId) {
newItem.Id = findId.Id;
}
this.objOption.CategoryList.push(newItem);
}
});
},
//处理选中后的商品分类参数
handleCheckChange() {
this.objOption.CategoryList = [];
this.chooseGoodsClassify.forEach(list => {
this.goodClassify.forEach(item => {
if (list == item.Id) {
let newItem = JSON.parse(JSON.stringify(item));
newItem.CategoryId = item.Id;
newItem.Id = 0;
//查找已提交的分类的id,否则为0
let findId = this.modifyClassifyList.find(
e => e.CategoryId === newItem.CategoryId
item.ChildList.forEach(item2 => {
if (list == item2.Id) {
let newItem2 = JSON.parse(JSON.stringify(item2));
newItem2.CategoryId = item2.Id;
newItem2.Id = 0;
let findId2 = this.modifyClassifyList.find(
e => e.CategoryId === newItem2.CategoryId
);
if (findId) {
newItem.Id = findId.Id;
if (findId2) {
newItem2.Id = findId2.Id;
}
this.objOption.CategoryList.push(newItem);
this.objOption.CategoryList.push(newItem2);
}
item.ChildList.forEach(item2 => {
if (list == item2.Id) {
let newItem2 = JSON.parse(JSON.stringify(item2));
newItem2.CategoryId = item2.Id;
newItem2.Id = 0;
let findId2 = this.modifyClassifyList.find(
e => e.CategoryId === newItem2.CategoryId
item2.ChildList.forEach(item3 => {
if (list == item3.Id) {
let newItem3 = JSON.parse(JSON.stringify(item3));
newItem3.CategoryId = item2.Id;
newItem3.Id = 0;
let findId3 = this.modifyClassifyList.find(
e => e.CategoryId === newItem3.CategoryId
);
if (findId2) {
newItem2.Id = findId2.Id;
if (findId3) {
newItem3.Id = findId3.Id;
}
this.objOption.CategoryList.push(newItem2);
this.objOption.CategoryList.push(newItem3);
}
item2.ChildList.forEach(item3 => {
if (list == item3.Id) {
let newItem3 = JSON.parse(JSON.stringify(item3));
newItem3.CategoryId = item2.Id;
newItem3.Id = 0;
let findId3 = this.modifyClassifyList.find(
e => e.CategoryId === newItem3.CategoryId
);
if (findId3) {
newItem3.Id = findId3.Id;
}
this.objOption.CategoryList.push(newItem3);
}
});
});
});
});
},
//关联上课时间段
getCourseTimeList() {
getScrollCourseTimeList({}).then(res => {
if (res.Code == 1) {
this.CourseTimeList = res.Data;
}
});
}
});
},
//关联上课时间段
getCourseTimeList() {
getScrollCourseTimeList({}).then(res => {
if (res.Code == 1) {
this.CourseTimeList = res.Data;
}
});
}
};
}
};
</script>
\ No newline at end of file
......@@ -73,20 +73,21 @@
</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>
:modityOrderType="1" :selectedCourseList="selectedCourseList" @success="$emit('close')"
@cancelloading="cancelloading"></orderForm>
</q-step>
</q-stepper>
</q-card-section>
<q-card-actions align="right" class="bg-white q-mx-md ">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" v-close-popup />
<q-btn @click="$refs.stepper.previous()" color="primary" label="上一步" v-if="step > 1" />
<template v-if="mode==3&&step == 2">
<q-btn label="保存" color="primary" @click="saveCourseForm"/>
</template>
<template v-else>
<q-btn @click="next" color="primary" label="下一步" v-if="step < 3" />
<q-btn label="保存" color="primary" :loading="loading1" @click="saveOrderForm" v-if="step == 3" />
</template>
<q-btn @click="$refs.stepper.previous()" color="primary" label="上一步" v-if="step > 1" />
<template v-if="mode == 3 && step == 2">
<q-btn label="保存" color="primary" @click="saveCourseForm" />
</template>
<template v-else>
<q-btn @click="next" color="primary" label="下一步" v-if="step < 3" />
<q-btn label="保存" color="primary" :loading="loading1" @click="saveOrderForm" v-if="step == 3" />
</template>
</q-card-actions>
</q-card>
</q-dialog>
......@@ -94,318 +95,318 @@
</template>
<script>
import {
getClassPruductList, //获取日语培训列表
setClassOrder, //新增 修改订单
getOrderGuestRenewState
} from "../../../api/sale/sale";
import {
getSchoolDropdown, //获取校区列表
getTeacherDropDownList
} from "../../../api/school/index";
import {
queryCourseDropdownList,
getCourseSubject
} from "../../../api/course/index";
import Mode from "./transfer-order/tickMode";
import Course from "./transfer-order/courselist";
import orderForm from "./transfer-order/order-form";
import yueke from "./transfer-order/yueke";
import vipcourse from "./transfer-order/vipcourse";
export default {
props: {
select: {
type: Array,
default: () => []
}
},
components: {
Course,
Mode,
orderForm,
yueke,
vipcourse
import {
getClassPruductList, //获取日语培训列表
setClassOrder, //新增 修改订单
getOrderGuestRenewState
} from "../../../api/sale/sale";
import {
getSchoolDropdown, //获取校区列表
getTeacherDropDownList
} from "../../../api/school/index";
import {
queryCourseDropdownList,
getCourseSubject
} from "../../../api/course/index";
import Mode from "./transfer-order/tickMode";
import Course from "./transfer-order/courselist";
import orderForm from "./transfer-order/order-form";
import yueke from "./transfer-order/yueke";
import vipcourse from "./transfer-order/vipcourse";
export default {
props: {
select: {
type: Array,
default: () => []
}
},
components: {
Course,
Mode,
orderForm,
yueke,
vipcourse
},
data() {
return {
persistent: true,
step: 1,
stuData: {}, //学生是否续费
OrderMsg: {
ClassId: 0, //班级编号
GuestNum: 0, //人数
B2CRatio: 0,
B2CReNewRatio: 0,
CustomerId: 0, //市场专员
Unit_Price: 0,
PreferPrice: 0,
OrderSource: 0,
SaleRemark: "",
Class_Price: 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 //每人优惠金额
},
courseMsg: {
pageIndex: 1,
pageSize: 8,
ClassName: "", //班级名称
StartTime: "", //开始时间
EndTime: "", //结束时间
School_Id: "", //关联校区
CouseId: 0, //课程id
Teacher_Id: 0, //教师id
Q_CanApply: "0", //是否可以报名 1是
JoinStartTime: "", //报名截止日期开始
JoinEndTime: "", //报名截止日期结束
ClassNo: "", //班号
CourseSubject: "", //所属科目
IsQuerySalePlat: 1
},
courseData: [], //课程列表
coursePageCount: 0, //课程页数
saveObj: {}, //所选课程
defaultCourse: [], //默认课程
//关联校区列表
schoolList: [],
ClassList: [], //关联课程下拉数据
myClassList: [],
allClassList: [],
loading1: false, //防止多次点击
mode: 1,
selectedCourseList: [],//多选课程
};
},
mounted() {
let nowDay = new Date();
var year = nowDay.getFullYear(); //年
var month = nowDay.getMonth() + 1; //月
var day = nowDay.getDate(); //日
var currentDay = year + "-" + month + "-" + day;
this.courseMsg.StartTime = currentDay;
this.getOrderGuestRenewState();
this.getCourseList();
this.getSchool();
this.CourseList();
},
methods: {
getOrderGuestRenewState() {
const ids = this.select.map(e => e.StuId).toString();
getOrderGuestRenewState({
StuIds: ids
}).then(res => {
this.stuData = res.Data;
});
},
data() {
return {
persistent: true,
step: 1,
stuData: {}, //学生是否续费
OrderMsg: {
ClassId: 0, //班级编号
GuestNum: 0, //人数
B2CRatio: 0,
B2CReNewRatio: 0,
CustomerId: 0, //市场专员
Unit_Price: 0,
PreferPrice: 0,
OrderSource: 0,
SaleRemark: "",
Class_Price: 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 //每人优惠金额
},
courseMsg: {
pageIndex: 1,
pageSize: 8,
ClassName: "", //班级名称
StartTime: "", //开始时间
EndTime: "", //结束时间
School_Id: "", //关联校区
CouseId: 0, //课程id
Teacher_Id: 0, //教师id
Q_CanApply: "0", //是否可以报名 1是
JoinStartTime: "", //报名截止日期开始
JoinEndTime: "", //报名截止日期结束
ClassNo: "", //班号
CourseSubject: "", //所属科目
IsQuerySalePlat:1
},
courseData: [], //课程列表
coursePageCount: 0, //课程页数
saveObj: {}, //所选课程
defaultCourse: [], //默认课程
//关联校区列表
schoolList: [],
ClassList: [], //关联课程下拉数据
myClassList: [],
allClassList: [],
loading1: false, //防止多次点击
mode: 1,
selectedCourseList:[],//多选课程
};
//获取课程分页列表
getCourseList() {
getClassPruductList(this.courseMsg).then(res => {
this.courseData = res.Data.PageData;
this.coursePageCount = res.Data.PageCount;
this.courseData.forEach(x => {
if (x.ClassStyle == 1) {
let weekList = [
//定义一个数组
{
id: 7,
select: false
},
{
id: 1,
select: false
},
{
id: 2,
select: false
},
{
id: 3,
select: false
},
{
id: 4,
select: false
},
{
id: 5,
select: false
},
{
id: 6,
select: false
}
];
weekList.forEach(j => {
x.ClassPlanList.forEach(z => {
if (j.id == z.WeekDay) {
j.select = true;
}
});
});
x.weeks = weekList;
} else if (x.ClassStyle == 2) {
let data = [];
for (let i = 0; i < 31; i++) {
let obj = {
name: i + 1,
select: false
};
x.ClassPlanList.forEach(j => {
if (j.WeekDay == i + 1) {
obj.select = true;
}
});
data.push(obj);
}
x.month = data;
}
});
});
},
mounted() {
let nowDay = new Date();
var year = nowDay.getFullYear(); //年
var month = nowDay.getMonth() + 1; //月
var day = nowDay.getDate(); //日
var currentDay = year + "-" + month + "-" + day;
this.courseMsg.StartTime = currentDay;
this.getOrderGuestRenewState();
// 课程翻页
changePage(val) {
this.courseMsg.pageIndex = val;
this.getCourseList();
this.getSchool();
this.CourseList();
},
methods: {
getOrderGuestRenewState() {
const ids = this.select.map(e => e.StuId).toString();
getOrderGuestRenewState({
StuIds: ids
}).then(res => {
this.stuData = res.Data;
// 选择班级
selectClass(val) {
this.selectedCourseList = []
if (val.length > 0) {
this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.defaultCourse = val;
} else {
this.saveObj = {};
this.saveObj.Unit_Price = 0;
this.defaultCourse = [];
}
},
// 选择课程
selectCourse(val) {
this.selectedCourseList = []
if (val.length > 0) {
this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.selectedCourseList = val;
} else {
this.saveObj = {};
this.saveObj.Unit_Price = 0;
this.selectedCourseList = [];
}
},
next() {
if (this.step == 1 && this.mode <= 0) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择上课模式`
});
},
//获取课程分页列表
getCourseList() {
getClassPruductList(this.courseMsg).then(res => {
this.courseData = res.Data.PageData;
this.coursePageCount = res.Data.PageCount;
this.courseData.forEach(x => {
if (x.ClassStyle == 1) {
let weekList = [
//定义一个数组
{
id: 7,
select: false
},
{
id: 1,
select: false
},
{
id: 2,
select: false
},
{
id: 3,
select: false
},
{
id: 4,
select: false
},
{
id: 5,
select: false
},
{
id: 6,
select: false
}
];
weekList.forEach(j => {
x.ClassPlanList.forEach(z => {
if (j.id == z.WeekDay) {
j.select = true;
}
});
});
x.weeks = weekList;
} else if (x.ClassStyle == 2) {
let data = [];
for (let i = 0; i < 31; i++) {
let obj = {
name: i + 1,
select: false
};
x.ClassPlanList.forEach(j => {
if (j.WeekDay == i + 1) {
obj.select = true;
}
});
data.push(obj);
}
x.month = data;
}
return;
}
if (this.step == 2) {
if (
this.mode == 1 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择班级`
});
});
},
// 课程翻页
changePage(val) {
this.courseMsg.pageIndex = val;
this.getCourseList();
},
// 选择班级
selectClass(val) {
this.selectedCourseList = []
if (val.length > 0) {
this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.defaultCourse = val;
} else {
this.saveObj = {};
this.saveObj.Unit_Price = 0;
this.defaultCourse = [];
}
},
// 选择课程
selectCourse(val) {
this.selectedCourseList = []
if (val.length > 0) {
this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.selectedCourseList = val;
} else {
this.saveObj = {};
this.saveObj.Unit_Price = 0;
this.selectedCourseList = [];
return;
}
},
next() {
if (this.step == 1 && this.mode <= 0) {
if (
this.mode == 2 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择上课模式`
message: `请选择课程`
});
return;
}
if (this.step == 2) {
if (
this.mode == 1 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择班级`
});
return;
}
if (
this.mode == 2 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择课程`
});
return;
}
}
this.$refs.stepper.next();
},
//获取校区列表
getSchool() {
getSchoolDropdown({}).then(res => {
if (res.Code == 1) {
this.schoolList = res.Data;
}
});
},
//获取课程
CourseList() {
queryCourseDropdownList({
IsQuerySalePlat: 1
}).then(res => {
if (res.Code == 1) {
this.ClassList = res.Data;
this.ClassList.unshift({
CourseId: 0,
CourseName: "不限"
});
this.myClassList = this.ClassList;
this.allClassList = res.Data;
}
});
},
//课程筛选
filterCourseFn(val, update, abort) {
update(() => {
if (val === "") {
this.myClassList = JSON.parse(JSON.stringify(this.allClassList));
} else {
const needle = val.toLowerCase();
this.myClassList = this.allClassList.filter(
v => v.CourseName.toLowerCase().indexOf(needle) > -1
);
}
});
},
resetSearch() {
this.courseMsg.pageIndex = 1;
this.getCourseList();
},
saveOrderForm() {
this.loading1 = true;
this.$refs.orderForm.saveOrderInfo();
},
//保存课程
saveCourseForm(){
this.$refs.vipCourse.saveVipCourse();
},
cancelloading() {
this.loading1 = false;
}
this.$refs.stepper.next();
},
//获取校区列表
getSchool() {
getSchoolDropdown({}).then(res => {
if (res.Code == 1) {
this.schoolList = res.Data;
}
});
},
//获取课程
CourseList() {
queryCourseDropdownList({
IsQuerySalePlat: 1
}).then(res => {
if (res.Code == 1) {
this.ClassList = res.Data;
this.ClassList.unshift({
CourseId: 0,
CourseName: "不限"
});
this.myClassList = this.ClassList;
this.allClassList = res.Data;
}
});
},
//课程筛选
filterCourseFn(val, update, abort) {
update(() => {
if (val === "") {
this.myClassList = JSON.parse(JSON.stringify(this.allClassList));
} else {
const needle = val.toLowerCase();
this.myClassList = this.allClassList.filter(
v => v.CourseName.toLowerCase().indexOf(needle) > -1
);
}
});
},
resetSearch() {
this.courseMsg.pageIndex = 1;
this.getCourseList();
},
saveOrderForm() {
this.loading1 = true;
this.$refs.orderForm.saveOrderInfo();
},
//保存课程
saveCourseForm() {
this.$refs.vipCourse.saveVipCourse();
},
cancelloading() {
this.loading1 = false;
}
};
}
};
</script>
<style scoped>
/deep/.el-input__inner {
background-color: transparent;
border: none;
}
/deep/.el-input__inner {
background-color: transparent;
border: none;
}
/deep/.q-stepper__step-inner {
padding: 0 24px;
}
/deep/.q-stepper__step-inner {
padding: 0 24px;
}
</style>
\ No newline at end of file
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