Commit 6afeeca4 authored by 黄奎's avatar 黄奎

页面修改

parent 43b147b2
......@@ -202,3 +202,14 @@ export function queryChapterTree(data) {
data
})
}
/**
* 获取课程销售端口
*/
export function querySaleplatList() {
return request({
url: "/Course/GetSaleplatList",
method: 'post',
data: {}
})
}
......@@ -5,24 +5,97 @@
<div class="text-h6">{{objOption.CourseId==0?'新增课程信息':'修改课程信息'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">课程信息</div>
<div class="text-caption q-mb-lg q-px-md text-grey-6">基本设置</div>
<div class="row wrap">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CourseName" ref="CourseName"
class="col-6 q-pr-lg q-pb-lg" label="课程名称" :rules="[val => !!val || '请填写课程名称']" />
<div class="col-6 q-pr-lg q-pb-lg">
<selectTree v-if="TreeCategoryList&&TreeCategoryList.length>0" :treeData='TreeCategoryList'
:defaultArray="defaultArray" nodeKey="CateId" :multiple="false" labelKey="CateName"
childrenKey="ChildList" tipText="课程分类" @getChild="getChild"></selectTree>
</div>
<div class="col-6 q-pb-lg upload-assiatant-box">
<selectTree v-if="TreeCategoryList&&TreeCategoryList.length>0" :treeData='TreeCategoryList'
:defaultArray="defaultArray" nodeKey="CateId" :multiple="false" labelKey="CateName" childrenKey="ChildList"
tipText="课程分类" @getChild="getChild" style="display:none"></selectTree>
<q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="chooseTeacher"
ref="Teacher_Id" :options="TeacherList" label="教师团队" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options multiple />
</div>
<div class="row wrap">
<div class="col-6 q-pb-lg">
<q-uploader :style="{backgroundImage:'url(' + objOption.CoverImg + ')'}" flat hide-upload-btn max-files="1"
label="课程封面" :max-file-size="512*1024" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div>
<div class="col-6 q-pr-lg q-pb-lg">
<q-input v-model="objOption.CourseFeature" filled type="textarea" placeholder="课程特色" />
</div>
</div>
<div class="text-caption q-mb-lg q-px-md text-grey-6">
价格设置
<q-toggle style="float:right;" size="md" left-label label="阶梯定价" color="primary" :false-value="0"
:true-value="1" v-model="objOption.IsOpenStepPrice" />
</div>
<div class="row wrap">
<div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.OriginalPrice"
ref="OriginalPrice" class="col-6 q-pr-lg q-pb-lg" label="原价"
@keyup.native="checkPrice(objOption,'OriginalPrice')" :rules="[val => !!val || '请填写原价']" />
</div>
<div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.SellPrice" ref="SellPrice"
class="col-6 q-pr-lg q-pb-lg" label="卖价" @keyup.native="checkPrice(objOption,'SellPrice')"
:rules="[val => !!val || '请填写卖价']" />
</div>
</div>
<div class="row wrap" style="margin:20px 0;">
<div class="col-6">
<q-btn v-if="objOption.IsOpenStepPrice==1" size="10px" @click="addStepPrice()" round color="primary"
icon="iconfont icon-img_haha" />
</div>
</div>
<template v-if="objOption.IsOpenStepPrice==1">
<div class="row wrap" v-for="(item,index) in ladderPriceList" :key="index">
<div class="col-6">
<q-input filled stack-label maxlength="3" v-model="item.PersionNum"
@keyup.native="checkInteger(item,'PersionNum')" :dense="false" class="col-6 q-pr-lg q-pb-lg"
label="人" />
</div>
<div class="col-6" style="position:relative;">
<q-input filled stack-label maxlength="8" v-model="item.PersionPrice"
@keyup.native="checkPrice(item,'PersionPrice')" :dense="false" class="col-6 q-pr-lg q-pb-lg"
label="价格" />
<q-btn style="position:absolute;right:-5px;top:20px;" size="6px" @click="delStepPrice(index)" round
color="red" icon="iconfont icon-guanbi1" />
</div>
</div>
</template>
<div class="text-caption q-mb-lg q-px-md text-grey-6">可续费课程
<q-toggle style="float:right;" size="md" left-label label="可续费课程" color="primary" :false-value="0"
:true-value="1" v-model="objOption.IsRenew" />
</div>
<div class="row wrap" v-if="objOption.IsRenew==1">
<div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.RenewOgPrice" ref="RenewOgPrice"
class="col-6 q-pr-lg q-pb-lg" label="续费原价" @keyup.native="checkPrice(objOption,'RenewOgPrice')"
:rules="[val => !!val || '请填写续费原价']" />
</div>
<div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.RenewSlPrice" ref="RenewSlPrice"
class="col-6 q-pr-lg q-pb-lg" label="续费售价" @keyup.native="checkPrice(objOption,'RenewSlPrice')"
:rules="[val => !!val || '请填写续费售价']" />
</div>
</div>
<div class="text-caption q-my-md q-px-xs text-grey-6">课程介绍
</div>
<ext-editor :defaultMsg="objOption.CourseIntro" classStr="col-12" @getEditValue="getEditValue"></ext-editor>
<div class="row wrap">
<div class="col-6">
<span>上架端口</span>
<template v-for="(item,index) in SaleplatList">
<q-checkbox v-model="choosePlat" :label="item.Name" :val="item.Id" />
</template>
</div>
<div class="col-6">
<q-toggle style="float:right;" size="md" left-label label="K12课程" color="primary" :false-value="0"
:true-value="1" v-model="objOption.IsKCourse" />
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
......@@ -39,7 +112,11 @@
queryCourseCategoryTree,
saveCourseInfo,
queryCourseInfo,
querySaleplatList,
} from '../../api/course/index'
import {
getTeacherDropDownList,
} from '../../api/school/index'
import {
UploadSelfFile
} from '../../api/common/common'
......@@ -65,18 +142,57 @@
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-是)
},
optionTitle: "",
defaultArray: [],
ladderPriceList: [], //阶梯定价数组
saveCourseLoading: false,
TreeCategoryList: [], //课程分类树形列表
TeacherList: [], //关联教师下拉数据
SaleplatList: [], //销售端口
choosePlat: [], //选择的平台
chooseTeacher: [], //选择老师
}
},
created() {
this.GetTeacherList();
this.getSaleplat();
},
mounted() {
this.getCategorytree();
this.initObj()
},
methods: {
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.TeacherList = res.Data;
var obj = {
TeacherName: '请选择',
TId: 0
}
this.TeacherList.unshift(obj);
}
})
},
//获取销售端口列表
getSaleplat() {
querySaleplatList().then(res => {
this.SaleplatList = res.Data;
})
},
//获取编辑器值
getEditValue(obj) {
this.objOption.CourseIntro = obj;
......@@ -102,6 +218,23 @@
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 = [];
......@@ -114,6 +247,26 @@
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.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;
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;
}
this.defaultArray.push(res.Data.CateId);
})
this.optionTitle = "修改课程信息"
......@@ -124,6 +277,17 @@
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.IsOpenStepPrice = 0;
this.objOption.IsRenew = 0;
this.objOption.RenewOgPrice = 0;
this.objOption.RenewSlPrice = 0;
this.objOption.Saleplat = "";
this.objOption.IsKCourse = 0;
}
},
//关闭弹窗
......@@ -133,7 +297,28 @@
},
//保存菜单
saveCourse() {
this.saveCourseLoading = true
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;
saveCourseInfo(this.objOption).then(res => {
this.saveCourseLoading = false
this.$q.notify({
......
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