Commit 254acaaa authored by 罗超's avatar 罗超

修改课程相关信息

parent 722e86f8
<template> <template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale"> <q-dialog
v-model="persistent"
persistent
content-class="bg-grey-1"
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;">
<q-card-section> <q-card-section>
<div class="text-h6">{{objOption.CourseId==0?'新增课程信息':'修改课程信息'}}</div> <div class="text-h6">
{{ objOption.CourseId == 0 ? "新增课程信息" : "修改课程信息" }}
</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <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"> <div class="row wrap">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CourseName" ref="CourseName" <q-input
class="col-6 q-pr-lg q-pb-lg" label="课程名称" :rules="[val => !!val || '请填写课程名称']" /> filled
<selectTree v-if="TreeCategoryList&&TreeCategoryList.length>0" :treeData='TreeCategoryList' stack-label
:defaultArray="defaultArray" nodeKey="CateId" :multiple="false" labelKey="CateName" childrenKey="ChildList" :dense="false"
tipText="课程分类" @getChild="getChild" style="display:none"></selectTree> v-model="objOption.CourseName"
<q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="chooseTeacher" ref="CourseName"
ref="Teacher_Id" :options="TeacherList" label="教师团队" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value class="col-6 q-pr-lg q-pb-lg"
map-options multiple /> label="课程名称"
:rules="[val => !!val || '请填写课程名称']"
/>
<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>
<div class="row wrap"> <div class="row wrap">
<div class="col-6 q-pb-lg q-pr-lg"> <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" <q-uploader
label="课程封面" accept=".jpg, image/*" :factory="uploadFile" auto-upload> :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> </q-uploader>
</div> </div>
<div class="col-6 q-pr-lg q-pb-lg"> <div class="col-6 q-pr-lg q-pb-lg">
<q-input v-model="objOption.CourseFeature" filled type="textarea" placeholder="课程特色" /> <q-input
v-model="objOption.CourseFeature"
filled
type="textarea"
placeholder="课程特色"
/>
</div> </div>
</div> </div>
<div class="text-caption q-mb-lg q-px-md text-grey-6" v-if="isShowPrice==1"> <div
class="text-caption q-mb-lg q-px-md text-grey-6"
v-if="isShowPrice == 1"
>
价格设置 价格设置
<q-toggle style="float:right;" size="md" left-label label="阶梯定价" color="primary" :false-value="0" <q-toggle
:true-value="1" v-model="objOption.IsOpenStepPrice" /> style="float:right;"
size="md"
left-label
label="阶梯定价"
color="primary"
:false-value="0"
:true-value="1"
v-model="objOption.IsOpenStepPrice"
/>
</div> </div>
<div class="row wrap" v-if="isShowPrice==1"> <div class="row wrap" v-if="isShowPrice == 1">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.OriginalPrice" <q-input
ref="OriginalPrice" class="col-6 q-pr-lg q-pb-lg" label="原价" filled
@keyup.native="checkPrice(objOption,'OriginalPrice')" :rules="[val => !!val || '请填写原价']" /> stack-label
: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>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.SellPrice" ref="SellPrice" <q-input
class="col-6 q-pr-lg q-pb-lg" label="卖价" @keyup.native="checkPrice(objOption,'SellPrice')" filled
:rules="[val => !!val || '请填写卖价']" /> stack-label
: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> </div>
<div class="row wrap" style="margin:20px 0;" v-if="isShowPrice==1"> <div class="row wrap" style="margin:20px 0;" v-if="isShowPrice == 1">
<div class="col-6"> <div class="col-6">
<q-btn v-if="objOption.IsOpenStepPrice==1" size="10px" @click="addStepPrice()" round color="primary" <q-btn
icon="iconfont icon-img_haha" /> v-if="objOption.IsOpenStepPrice == 1"
size="10px"
@click="addStepPrice()"
round
color="primary"
icon="iconfont icon-img_haha"
/>
</div> </div>
</div> </div>
<template v-if="objOption.IsOpenStepPrice==1 && isShowPrice==1"> <template v-if="objOption.IsOpenStepPrice == 1 && isShowPrice == 1">
<div class="row wrap" v-for="(item,index) in ladderPriceList" :key="index"> <div
class="row wrap"
v-for="(item, index) in ladderPriceList"
:key="index"
>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="3" v-model="item.PersionNum" <q-input
@keyup.native="checkInteger(item,'PersionNum')" :dense="false" class="col-6 q-pr-lg q-pb-lg" filled
label="人" /> stack-label
v-model="item.PersionNum"
@keyup.native="checkInteger(item, 'PersionNum')"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
label="人"
/>
</div> </div>
<div class="col-6" style="position:relative;"> <div class="col-6" style="position:relative;">
<q-input filled stack-label maxlength="8" v-model="item.PersionPrice" <q-input
@keyup.native="checkPrice(item,'PersionPrice')" :dense="false" class="col-6 q-pr-lg q-pb-lg" filled
label="价格" /> stack-label
<q-btn style="position:absolute;right:-5px;top:20px;" size="6px" @click="delStepPrice(index)" round v-model="item.PersionPrice"
color="red" icon="iconfont icon-guanbi1" /> @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>
</div> </div>
</template> </template>
<div class="text-caption q-mb-lg q-px-md text-grey-6" v-if="isShowPrice==1">可续费课程 <div
<q-toggle style="float:right;" size="md" left-label label="可续费课程" color="primary" :false-value="0" class="text-caption q-mb-lg q-px-md text-grey-6"
:true-value="1" v-model="objOption.IsRenew" /> v-if="isShowPrice == 1"
>
可续费课程
<q-toggle
style="float:right;"
size="md"
left-label
label="可续费课程"
color="primary"
:false-value="0"
:true-value="1"
v-model="objOption.IsRenew"
/>
</div> </div>
<div class="row wrap" v-if="objOption.IsRenew==1&&isShowPrice==1"> <div class="row wrap" v-if="objOption.IsRenew == 1 && isShowPrice == 1">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.RenewOgPrice" ref="RenewOgPrice" <q-input
class="col-6 q-pr-lg q-pb-lg" label="续费原价" @keyup.native="checkPrice(objOption,'RenewOgPrice')" filled
:rules="[val => !!val || '请填写续费原价']" /> stack-label
: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>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.RenewSlPrice" ref="RenewSlPrice" <q-input
class="col-6 q-pr-lg q-pb-lg" label="续费售价" @keyup.native="checkPrice(objOption,'RenewSlPrice')" filled
:rules="[val => !!val || '请填写续费售价']" /> stack-label
: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> </div>
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" mask="#" fill-mask="0" <q-input
reverse-fill-mask v-model="objOption.ClassHours" ref="ClassHours" filled
class="col-6 q-pr-lg q-pb-lg" label="课时数量" stack-label
:rules="[val => !!val || '请填写课时信息']" /> :dense="false"
mask="#"
fill-mask="0"
reverse-fill-mask
v-model="objOption.ClassHours"
ref="ClassHours"
class="col-6 q-pr-lg q-pb-lg"
label="课时数量"
:rules="[val => !!val || '请填写课时信息']"
/>
</div> </div>
<div class="col-6">
<q-select
filled
stack-label
option-value="CateId"
option-label="CateName"
v-model="chosenCateId"
ref="CateId"
:options="TreeCategoryList"
label="所属系列"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
:rules="[val => !!val || '请选择课程所属系列']"
/>
</div> </div>
<div class="text-caption q-my-md q-px-xs text-grey-6">课程介绍
</div> </div>
<ext-editor :defaultMsg="objOption.CourseIntro" classStr="col-12" @getEditValue="getEditValue"></ext-editor> <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="row wrap">
<div class="col-6"> <div class="col-6">
<span>上架端口:</span> <span>上架端口:</span>
<template v-for="(item,index) in SaleplatList"> <template v-for="(item, index) in SaleplatList">
<q-checkbox v-model="choosePlat" :label="item.Name" :val="item.Id" /> <q-checkbox
v-model="choosePlat"
:label="item.Name"
:val="item.Id"
/>
</template> </template>
</div> </div>
<div class="col-6"> <div class="col-6">
<q-toggle style="float:right;" size="md" left-label label="K12课程" color="primary" :false-value="0" <q-toggle
:true-value="1" v-model="objOption.IsKCourse" /> style="float:right;"
size="md"
left-label
label="K12课程"
color="primary"
:false-value="0"
:true-value="1"
v-model="objOption.IsKCourse"
/>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" /> <q-btn
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading" label="取消"
@click="saveCourse" /> flat
color="grey-10"
style="font-weight:400 !important"
@click="closeCourseForm"
/>
<q-btn
label="立即提交"
color="accent q-px-md"
style="font-weight:400 !important"
:loading="saveCourseLoading"
@click="saveCourse"
/>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<script> <script>
import { import {
queryCourseCategoryTree, queryCourseCategoryTree,
saveCourseInfo, saveCourseInfo,
queryCourseInfo, queryCourseInfo,
querySaleplatList, querySaleplatList
} from '../../api/course/index' } from "../../api/course/index";
import { import { getTeacherDropDownList } from "../../api/school/index";
getTeacherDropDownList, import { UploadSelfFile } from "../../api/common/common";
} from '../../api/school/index' import selectTree from "../common/select-tree";
import { import extEditor from "../common/ext-editor";
UploadSelfFile export default {
} from '../../api/common/common'
import selectTree from '../common/select-tree'
import extEditor from '../common/ext-editor'
export default {
components: { components: {
selectTree, selectTree,
extEditor, extEditor
}, },
props: { props: {
saveObj: { saveObj: {
...@@ -161,7 +331,7 @@ ...@@ -161,7 +331,7 @@
RenewSlPrice: 0, //续费售价 RenewSlPrice: 0, //续费售价
Saleplat: "", //销售平台 Saleplat: "", //销售平台
IsKCourse: 0, //是否是K12课程(1-是) IsKCourse: 0, //是否是K12课程(1-是)
ClassHours:0 ClassHours: 0
}, },
optionTitle: "", optionTitle: "",
defaultArray: [], defaultArray: [],
...@@ -172,8 +342,9 @@ ...@@ -172,8 +342,9 @@
SaleplatList: [], //销售端口 SaleplatList: [], //销售端口
choosePlat: [], //选择的平台 choosePlat: [], //选择的平台
chooseTeacher: [], //选择老师 chooseTeacher: [], //选择老师
isShowPrice: 0, //是否显示价格【hk2021-03-05新增】 chosenCateId: null,
} isShowPrice: 0 //是否显示价格【hk2021-03-05新增】
};
}, },
created() { created() {
this.GetTeacherList(); this.GetTeacherList();
...@@ -181,7 +352,7 @@ ...@@ -181,7 +352,7 @@
}, },
mounted() { mounted() {
this.getCategorytree(); this.getCategorytree();
this.initObj() this.initObj();
}, },
methods: { methods: {
//获取教师下拉 //获取教师下拉
...@@ -190,13 +361,13 @@ ...@@ -190,13 +361,13 @@
if (res.Code == 1) { if (res.Code == 1) {
this.TeacherList = res.Data; this.TeacherList = res.Data;
} }
}) });
}, },
//获取销售端口列表 //获取销售端口列表
getSaleplat() { getSaleplat() {
querySaleplatList().then(res => { querySaleplatList().then(res => {
this.SaleplatList = res.Data; this.SaleplatList = res.Data;
}) });
}, },
//获取编辑器值 //获取编辑器值
getEditValue(obj) { getEditValue(obj) {
...@@ -210,18 +381,25 @@ ...@@ -210,18 +381,25 @@
} }
}, },
uploadFile(files) { uploadFile(files) {
UploadSelfFile('course', files[0], res => { UploadSelfFile("course", files[0], res => {
if (res.Code == 1) { if (res.Code == 1) {
this.objOption.CoverImg = res.FileUrl; this.objOption.CoverImg = res.FileUrl;
} }
}) });
}, },
getCategorytree() { getCategorytree() {
this.TreeCategoryList = []; this.TreeCategoryList = [];
var qMsg = {} var qMsg = {};
queryCourseCategoryTree(qMsg).then(res => { queryCourseCategoryTree(qMsg).then(res => {
this.TreeCategoryList = res.Data; this.TreeCategoryList = res.Data;
if(this.objOption.CateId!=0){
this.TreeCategoryList.forEach(x=>{
if(x.CateId==this.objOption.CateId){
this.chosenCateId=x
}
}) })
}
});
}, },
//新增阶梯定价 //新增阶梯定价
addStepPrice() { addStepPrice() {
...@@ -229,7 +407,7 @@ ...@@ -229,7 +407,7 @@
ClassStepPriceId: 0, ClassStepPriceId: 0,
PersionNum: 2, PersionNum: 2,
PersionPrice: 0 PersionPrice: 0
} };
if (this.ladderPriceList && this.ladderPriceList.length > 0) { if (this.ladderPriceList && this.ladderPriceList.length > 0) {
var _index = this.ladderPriceList.length - 1; var _index = this.ladderPriceList.length - 1;
obj.PersionNum = parseInt(this.ladderPriceList[_index].PersionNum) + 1; obj.PersionNum = parseInt(this.ladderPriceList[_index].PersionNum) + 1;
...@@ -257,7 +435,7 @@ ...@@ -257,7 +435,7 @@
this.objOption.CourseFeature = res.Data.CourseFeature; this.objOption.CourseFeature = res.Data.CourseFeature;
this.objOption.OriginalPrice = res.Data.OriginalPrice; this.objOption.OriginalPrice = res.Data.OriginalPrice;
this.objOption.SellPrice = res.Data.SellPrice; this.objOption.SellPrice = res.Data.SellPrice;
this.objOption.ClassHours=res.Data.ClassHours; this.objOption.ClassHours = res.Data.ClassHours;
this.objOption.IsOpenStepPrice = res.Data.IsOpenStepPrice; this.objOption.IsOpenStepPrice = res.Data.IsOpenStepPrice;
this.objOption.IsRenew = res.Data.IsRenew; this.objOption.IsRenew = res.Data.IsRenew;
this.objOption.RenewOgPrice = res.Data.RenewOgPrice; this.objOption.RenewOgPrice = res.Data.RenewOgPrice;
...@@ -274,10 +452,10 @@ ...@@ -274,10 +452,10 @@
this.choosePlat = res.Data.SalePlatList; this.choosePlat = res.Data.SalePlatList;
} }
this.defaultArray.push(res.Data.CateId); this.defaultArray.push(res.Data.CateId);
}) });
this.optionTitle = "修改课程信息" this.optionTitle = "修改课程信息";
} else { } else {
this.optionTitle = "新增课程" this.optionTitle = "新增课程";
this.objOption.CourseId = 0; this.objOption.CourseId = 0;
this.objOption.CoverImg = ""; this.objOption.CoverImg = "";
this.objOption.CourseName = ""; this.objOption.CourseName = "";
...@@ -288,7 +466,7 @@ ...@@ -288,7 +466,7 @@
this.objOption.CourseFeature = ""; this.objOption.CourseFeature = "";
this.objOption.OriginalPrice = 0; this.objOption.OriginalPrice = 0;
this.objOption.SellPrice = 0; this.objOption.SellPrice = 0;
this.objOption.ClassHours=0 this.objOption.ClassHours = 0;
this.objOption.IsOpenStepPrice = 0; this.objOption.IsOpenStepPrice = 0;
this.objOption.IsRenew = 0; this.objOption.IsRenew = 0;
this.objOption.RenewOgPrice = 0; this.objOption.RenewOgPrice = 0;
...@@ -299,22 +477,23 @@ ...@@ -299,22 +477,23 @@
}, },
//关闭弹窗 //关闭弹窗
closeCourseForm() { closeCourseForm() {
this.$emit('close') this.$emit("close");
this.persistent = false this.persistent = false;
}, },
//保存菜单 //保存菜单
saveCourse() { saveCourse() {
this.$refs.CourseName.validate(); this.$refs.CourseName.validate();
this.$refs.ClassHours.validate(); this.$refs.ClassHours.validate();
if (!this.$refs.CourseName.hasError&&!this.$refs.ClassHours.hasError) { this.$refs.CateId.validate();
if (!this.$refs.CourseName.hasError && !this.$refs.ClassHours.hasError && !this.$refs.CateId.hasError) {
this.saveCourseLoading = true; this.saveCourseLoading = true;
var Teacher_Ids = ""; var Teacher_Ids = "";
if (this.chooseTeacher && this.chooseTeacher.length > 0) { if (this.chooseTeacher && this.chooseTeacher.length > 0) {
this.chooseTeacher.forEach(item => { this.chooseTeacher.forEach(item => {
Teacher_Ids += "," + item; Teacher_Ids += "," + item;
}) });
} }
if (Teacher_Ids != '') { if (Teacher_Ids != "") {
Teacher_Ids = Teacher_Ids.substring(1); Teacher_Ids = Teacher_Ids.substring(1);
} }
var salePlat = ""; var salePlat = "";
...@@ -323,29 +502,32 @@ ...@@ -323,29 +502,32 @@
salePlat += "," + item; salePlat += "," + item;
}); });
} }
if (salePlat != '') { if (salePlat != "") {
salePlat = salePlat.substring(1); salePlat = salePlat.substring(1);
} }
this.objOption.StepPriceList = this.ladderPriceList; this.objOption.StepPriceList = this.ladderPriceList;
this.objOption.Teacher_Ids = Teacher_Ids; this.objOption.Teacher_Ids = Teacher_Ids;
this.objOption.Saleplat = salePlat; this.objOption.Saleplat = salePlat;
saveCourseInfo(this.objOption).then(res => { console.log(this.chosenCateId)
this.saveCourseLoading = false this.objOption.CateId=this.chosenCateId
saveCourseInfo(this.objOption)
.then(res => {
this.saveCourseLoading = false;
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: "iconfont icon-chenggong",
color: 'accent', color: "accent",
timeout: 2000, timeout: 2000,
message: '数据保存成功!', message: "数据保存成功!",
position: 'top' position: "top"
}) });
this.$emit("success") this.$emit("success");
this.closeSaveForm() this.closeSaveForm();
}).catch(() => {
this.saveCourseLoading = false
}) })
.catch(() => {
this.saveCourseLoading = false;
});
} }
} }
},
} }
};
</script> </script>
<template> <template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale"> <q-dialog
v-model="persistent"
persistent
content-class="bg-grey-1"
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;">
<q-card-section> <q-card-section>
<div class="text-h6">设置课程价格</div> <div class="text-h6">设置课程价格</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <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 text-grey-6">基础价格设置</div>
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="priceObj.courseObj.OriginalPrice" <q-input
ref="OriginalPrice" class="col-6 q-pr-lg q-pb-lg" label="基础收费" filled
@keyup.native="checkPrice(priceObj.courseObj,'OriginalPrice')" :rules="[val => !!val || '请填写基础收费']" /> stack-label
maxlength="8"
:dense="false"
v-model="priceObj.courseObj.OriginalPrice"
ref="OriginalPrice"
class="col-6 q-pr-lg q-pb-lg"
label="基础收费"
@keyup.native="checkPrice(priceObj.courseObj, 'OriginalPrice')"
:rules="[val => !!val || '请填写基础收费']"
/>
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="priceObj.courseObj.SellPrice" <q-input
ref="SellPrice" class="col-6 q-pr-lg q-pb-lg" label="卖价" filled
@keyup.native="checkPrice(priceObj.courseObj,'SellPrice')" :rules="[val => !!val || '请填写卖价']" /> stack-label
maxlength="8"
:dense="false"
v-model="priceObj.courseObj.SellPrice"
ref="SellPrice"
class="col-6 q-pr-lg q-pb-lg"
label="卖价"
@keyup.native="checkPrice(priceObj.courseObj, 'SellPrice')"
:rules="[val => !!val || '请填写卖价']"
/>
</div> </div>
</div> </div>
</q-card-section> <div class="q-pt-none scroll" style="max-height:60hv">
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <table>
<div class="text-caption q-mb-lg q-px-md text-grey-6">优惠设置</div>
<table class="col-12">
<thead> <thead>
<tr style="height:60px;"> <tr style="height:60px;">
<td colspan="5" style="text-align:right;"> <td colspan="5" style="text-align:right;">
<q-btn color="accent" size="sm" icon="add" label="新增优惠" @click="addPrice()" /> <q-btn
color="accent"
size="sm"
icon="add"
label="新增优惠"
@click="addPrice()"
/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width:280px"> <td style="width:200px">
优惠类型 优惠类型
</td> </td>
<td style="width:180px"> <td style="width:200px">
优惠条件 优惠条件
</td> </td>
<td style="width:120px"> <td style="width:140px">
同行返佣 同行返佣
</td> </td>
<td style="width:120px"> <td style="width:140px">
销售返佣 销售返佣
</td> </td>
<td style="width:100px"> <td>
操作 操作
</td> </td>
</tr> </tr>
</thead> </thead>
<tbody v-for="(item,index) in priceObj.priceList"> <tbody v-for="(item, index) in priceObj.priceList">
<tr> <tr>
<td> <td style="height:50px">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="item.PriceDiscountType" <q-select
ref="PriceDiscountType_Id" :options="priceTypeList" label="优惠类型" :dense="false" filled
class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> stack-label
option-value="Id"
option-label="Name"
v-model="item.PriceDiscountType"
ref="PriceDiscountType_Id"
:options="priceTypeList"
label="优惠类型"
style="width:160px"
dense
emit-value
map-options
/>
</td> </td>
<td> <td>
<!--买送--> <!--买送-->
<template v-if="item.PriceDiscountType==1"> <template v-if="item.PriceDiscountType == 1">
<q-input filled stack-label maxlength="3" :dense="false" v-model="item.BuyNum" ref="BuyNum" <q-input
class="col-6 q-pr-lg q-pb-lg" label="买" @keyup.native="checkPrice(item,'BuyNum')" filled
style="width:80px;display:inline-block;" suffix="" /> stack-label
<q-input filled stack-label maxlength="3" :dense="false" v-model="item.SendNum" ref="SendNum" dense
class="col-6 q-pr-lg q-pb-lg" label="送" @keyup.native="checkPrice(item,'SendNum')" v-model="item.BuyNum"
style="width:80px;display:inline-block;" suffix=""> ref="BuyNum"
label="买"
@keyup.native="checkPrice(item, 'BuyNum')"
style="width:80px;display:inline-block;"
suffix=""
/>
<q-input
filled
stack-label
class="q-ml-xs"
v-model="item.SendNum"
ref="SendNum"
dense
label="送"
@keyup.native="checkPrice(item, 'SendNum')"
style="width:80px;display:inline-block;"
suffix=""
>
</q-input> </q-input>
</template> </template>
<!--刷卡分期--> <!--刷卡分期-->
<template v-else-if="item.PriceDiscountType==5"> <template v-else-if="item.PriceDiscountType == 5"> </template>
</template>
<template v-else> <template v-else>
<q-input filled stack-label maxlength="4" :dense="false" v-model="item.PriceMoney" ref="PriceMoney" <q-input
class="q-pr-lg q-pb-lg" label="优惠" @keyup.native="checkPrice(item,'PriceMoney')" style="width:100px" filled
suffix="%" /> stack-label
dense
v-model="item.PriceMoney"
ref="PriceMoney"
label="优惠"
@keyup.native="checkPrice(item, 'PriceMoney')"
style="width:165px"
suffix="%"
/>
</template> </template>
</td> </td>
<td> <td>
<q-input filled stack-label maxlength="4" :dense="false" v-model="item.B2BCommissionMoney" <q-input
ref="B2BCommissionMoney" class="q-pr-lg q-pb-lg" label="同行返佣" filled
@keyup.native="checkPrice(item,'B2BCommissionMoney')" style="width:100px" suffix="%" /> stack-label
dense
v-model="item.B2BCommissionMoney"
ref="B2BCommissionMoney"
label="同行返佣"
@keyup.native="checkPrice(item, 'B2BCommissionMoney')"
style="width:100px"
>
<template v-slot:append>
<div class="text-dark text-center text-dark cursor-pointer" style="width:30px;margin-right:-12px;height:100%;font-size:14px;border-left:1px solid #ddd;padding-top:15px;" >
<span>{{item.B2BCommissionType==0?'%':'¥'}}</span>
<q-menu auto-close>
<q-list>
<q-item clickable v-close-popup @click="item.B2BCommissionType=0">
<q-item-section>按百分比(%)</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="item.B2BCommissionType=1">
<q-item-section>按固定额度(¥)</q-item-section>
</q-item>
</q-list>
</q-menu>
</div>
</template>
</q-input>
</td> </td>
<td> <td>
<q-input filled stack-label maxlength="4" :dense="false" v-model="item.SaleCommissionMoney" <q-input
ref="SaleCommissionMoney" class="q-pr-lg q-pb-lg" label="销售返佣" filled
@keyup.native="checkPrice(item,'SaleCommissionMoney')" style="width:100px" suffix="%" /> stack-label
dense
v-model="item.SaleCommissionMoney"
ref="SaleCommissionMoney"
label="销售返佣"
@keyup.native="checkPrice(item, 'SaleCommissionMoney')"
class="q-pr-none"
style="width:100px"
>
<template v-slot:append>
<div class="text-dark text-center text-dark cursor-pointer" style="width:30px;margin-right:-12px;height:100%;font-size:14px;border-left:1px solid #ddd;padding-top:15px;" >
<span>{{item.SaleCommissionType==0?'%':'¥'}}</span>
<q-menu auto-close>
<q-list>
<q-item clickable v-close-popup @click="item.SaleCommissionType=0">
<q-item-section>按百分比(%)</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="item.SaleCommissionType=1">
<q-item-section>按固定额度(¥)</q-item-section>
</q-item>
</q-list>
</q-menu>
</div>
</template>
</q-input>
</td> </td>
<td> <td>
<q-btn flat size="xs" icon="iconfont icon-shanchu" title="删除" color="negative" style="font-weight:400" <q-btn
class="q-mr-xs" label="" @click="delPrice(index)" /> flat
size="xs"
icon="iconfont icon-shanchu"
title="删除"
color="negative"
style="font-weight:400"
class="q-mr-xs"
label=""
@click="delPrice(index)"
/>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" /> <q-btn
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading" label="取消"
@click="saveCourse" /> flat
color="grey-10"
style="font-weight:400 !important"
@click="closeCourseForm"
/>
<q-btn
label="立即提交"
color="accent q-px-md"
style="font-weight:400 !important"
:loading="saveCourseLoading"
@click="saveCourse"
/>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<script> <script>
import { import {
saveCoursePreferential, saveCoursePreferential,
queryCoursePreferentialList, queryCoursePreferentialList,
queryCourseInfo, queryCourseInfo,
queryCoursePreferentialType, queryCoursePreferentialType
} from '../../api/course/index' } from "../../api/course/index";
export default { export default {
components: {}, components: {},
props: { props: {
saveObj: { saveObj: {
...@@ -127,25 +257,25 @@ ...@@ -127,25 +257,25 @@
courseObj: { courseObj: {
CourseId: 0, //课程编号 CourseId: 0, //课程编号
OriginalPrice: 0, //原价 OriginalPrice: 0, //原价
SellPrice: 0, //售价 SellPrice: 0 //售价
}, },
priceList: [], //价格列表 priceList: [] //价格列表
}, },
priceTypeList: [], //优惠类型列表 priceTypeList: [] //优惠类型列表
} };
}, },
created() { created() {
this.getTypeList(); this.getTypeList();
}, },
mounted() { mounted() {
this.initObj() this.initObj();
}, },
methods: { methods: {
//获取优惠类型列表 //获取优惠类型列表
getTypeList() { getTypeList() {
queryCoursePreferentialType().then(res => { queryCoursePreferentialType().then(res => {
this.priceTypeList = res.Data; this.priceTypeList = res.Data;
}) });
}, },
//新增价格 //新增价格
addPrice() { addPrice() {
...@@ -161,7 +291,7 @@ ...@@ -161,7 +291,7 @@
BuyNum: 0, //购买人数 BuyNum: 0, //购买人数
SendNum: 0, //赠送人数 SendNum: 0, //赠送人数
PriceType: 0, //优惠价格类型(0-百分比,1-固定金额) PriceType: 0, //优惠价格类型(0-百分比,1-固定金额)
PriceMoney: 0, //优惠金额 PriceMoney: 0 //优惠金额
}; };
this.priceObj.priceList.push(currentObj); this.priceObj.priceList.push(currentObj);
}, },
...@@ -178,17 +308,17 @@ ...@@ -178,17 +308,17 @@
this.priceObj.courseObj.CourseId = res.Data.CourseId; this.priceObj.courseObj.CourseId = res.Data.CourseId;
this.priceObj.courseObj.OriginalPrice = res.Data.OriginalPrice; this.priceObj.courseObj.OriginalPrice = res.Data.OriginalPrice;
this.priceObj.courseObj.SellPrice = res.Data.SellPrice; this.priceObj.courseObj.SellPrice = res.Data.SellPrice;
}) });
queryCoursePreferentialList({ queryCoursePreferentialList({
CourseId: this.saveObj.CourseId CourseId: this.saveObj.CourseId
}).then(res => { }).then(res => {
if (res.Code == 1 && res.Data) { if (res.Code == 1 && res.Data) {
this.priceObj.priceList = res.Data; this.priceObj.priceList = res.Data;
} }
}) });
this.optionTitle = "修改课程优惠信息" this.optionTitle = "修改课程优惠信息";
} else { } else {
this.optionTitle = "新增课程优惠信息" this.optionTitle = "新增课程优惠信息";
this.priceObj.courseObj.CourseId = 0; this.priceObj.courseObj.CourseId = 0;
this.priceObj.courseObj.OriginalPrice = 0; this.priceObj.courseObj.OriginalPrice = 0;
this.priceObj.courseObj.SellPrice = 0; this.priceObj.courseObj.SellPrice = 0;
...@@ -196,48 +326,48 @@ ...@@ -196,48 +326,48 @@
}, },
//关闭弹窗 //关闭弹窗
closeCourseForm() { closeCourseForm() {
this.$emit('close') this.$emit("close");
this.persistent = false this.persistent = false;
}, },
//保存菜单 //保存菜单
saveCourse() { saveCourse() {
this.saveCourseLoading = true; this.saveCourseLoading = true;
if (this.priceObj.priceList && this.priceObj.priceList.length > 0) { if (this.priceObj.priceList && this.priceObj.priceList.length > 0) {
this.priceObj.priceList.forEach(item => { this.priceObj.priceList.forEach(item => {
if (item.BuyNum == '') { if (item.BuyNum == "") {
item.BuyNum = 0; item.BuyNum = 0;
} }
if (item.SendNum == '') { if (item.SendNum == "") {
item.SendNum = 0; item.SendNum = 0;
} }
if (item.PriceMoney == '') { if (item.PriceMoney == "") {
item.PriceMoney = 0; item.PriceMoney = 0;
} }
if (item.B2BCommissionMoney == '') { if (item.B2BCommissionMoney == "") {
item.B2BCommissionMoney = 0; item.B2BCommissionMoney = 0;
} }
if (item.SaleCommissionMoney == '') { if (item.SaleCommissionMoney == "") {
item.SaleCommissionMoney = 0; item.SaleCommissionMoney = 0;
} }
}) });
} }
saveCoursePreferential(this.priceObj).then(res => { saveCoursePreferential(this.priceObj)
this.saveCourseLoading = false .then(res => {
this.saveCourseLoading = false;
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: "iconfont icon-chenggong",
color: 'accent', color: "accent",
timeout: 2000, timeout: 2000,
message: '数据保存成功!', message: "数据保存成功!",
position: 'top' position: "top"
});
this.$emit("success");
this.closeSaveForm();
}) })
this.$emit("success") .catch(() => {
this.closeSaveForm() this.saveCourseLoading = false;
}).catch(() => {
this.saveCourseLoading = false
}); });
} }
},
} }
};
</script> </script>
...@@ -3,19 +3,16 @@ ...@@ -3,19 +3,16 @@
<div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-input ref="filter" filled v-model="keyWords" label="分类名称"> <q-input ref="filter" filled v-model="keyWords" label="系列名称">
<template v-slot:append> <template v-slot:append>
<q-icon v-if="keyWords !== ''" name="clear" class="cursor-pointer" @click="resetFilter" /> <q-icon v-if="keyWords !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
</template> </template>
</q-input> </q-input>
</div> </div>
</div> </div>
<div class="page-option">
<q-btn color="accent" class="q-mr-md" icon="add" label="新增分类" @click="EditCategory(null)" />
</div>
</div> </div>
<div class="page-content"> <div class="page-content">
<div class="q-pa-md q-gutter-sm"> <!--<div class="q-pa-md q-gutter-sm">
<q-tree v-if="isShow" :nodes="data" node-key="CateId" label-key="CateName" children-key="ChildList" <q-tree v-if="isShow" :nodes="data" node-key="CateId" label-key="CateName" children-key="ChildList"
:filter="keyWords" :filter-method="myFilterMethod" default-expand-all no-results-label="暂无相关数据"> :filter="keyWords" :filter-method="myFilterMethod" default-expand-all no-results-label="暂无相关数据">
<template v-slot:default-header="prop"> <template v-slot:default-header="prop">
...@@ -30,7 +27,31 @@ ...@@ -30,7 +27,31 @@
</div> </div>
</template> </template>
</q-tree> </q-tree>
</div>-->
<q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">系列信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增系列" @click="EditCategory(null)" />
</div> </div>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==0?'正常':'禁用'" />
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCategory(props.row)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;display:none;" label="详情"
@click="deleteCategory(props.row.CateId)" />
</q-td>
</template>
</q-table>
<category-form v-if="isShowCategory" :save-obj="categoryObj" @close="closeCagegoryForm" @success="refreshPage"> <category-form v-if="isShowCategory" :save-obj="categoryObj" @close="closeCagegoryForm" @success="refreshPage">
</category-form> </category-form>
</div> </div>
...@@ -39,12 +60,12 @@ ...@@ -39,12 +60,12 @@
<script> <script>
import { import {
queryCourseCategoryTree queryCourseCategoryPage
} from '../../api/course/index' } from '../../api/course/index'
import categoryForm from '../../components/course/category-form' import categoryForm from '../../components/course/category-form'
export default { export default {
meta: { meta: {
title: "课程类" title: "课程类"
}, },
components: { components: {
categoryForm, categoryForm,
...@@ -57,6 +78,39 @@ ...@@ -57,6 +78,39 @@
isShowCategory: false, isShowCategory: false,
isShow: false, isShow: false,
categoryObj: {}, categoryObj: {},
loading:true,
columns: [
{
name: 'CateName',
label: '系列名称',
field: 'CateName',
align: 'left'
},
{
name: 'CourseCount',
label: '关联课程',
align: 'left',
field: row => row.CourseCount
},
{
name: 'Status',
label: '状态',
align: 'left',
field: row => row.Status
},
{
name: 'UpdateByName',
label: '修改人',
align: 'left',
field: row => row.UpdateByName
},
{
name: 'UpdateTimeStr',
label: '修改时间',
align: 'left',
field: row => row.UpdateTimeStr
}
],
} }
}, },
mounted() { mounted() {
...@@ -80,9 +134,13 @@ ...@@ -80,9 +134,13 @@
//获取课程分类树形结构 //获取课程分类树形结构
getcoursecategorytree() { getcoursecategorytree() {
this.isShow = false; this.isShow = false;
queryCourseCategoryTree({}).then(res => { queryCourseCategoryPage({
PageSize:50,
pageIndex:1
}).then(res => {
this.isShow = true; this.isShow = true;
this.data = res.Data; this.loading=false;
this.data = res.Data.PageData;
}) })
}, },
//新增修改角色 //新增修改角色
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="col-3"> <div class="col-3">
<select-tree :treeData='TreeCategoryList' :defaultArray="returnString" nodeKey="CateId" :multiple="true" <select-tree :treeData='TreeCategoryList' :defaultArray="returnString" nodeKey="CateId" :multiple="true"
labelKey="CateName" childrenKey="ChildList" tipText="课程分类" @getChild="getChild"></select-tree> labelKey="CateName" childrenKey="ChildList" tipText="课程系列" @getChild="getChild"></select-tree>
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" v-model="msg.Status" :options="ShowOpts" <q-select @input="resetSearch" standout="bg-primary text-white" v-model="msg.Status" :options="ShowOpts"
...@@ -44,25 +44,41 @@ ...@@ -44,25 +44,41 @@
</template> </template>
<template v-slot:body-cell-PreferentialList="props"> <template v-slot:body-cell-PreferentialList="props">
<q-td :props="props" style="padding-right:0px"> <q-td :props="props" style="padding-right:0px">
<div v-for="x in props.value"> <div v-for="x in props.value" >
<div class="border-bottom" v-if="x.PriceDiscountType==1">{{x.BuyNum}}{{x.SendNum}}</div> <div class="border-bottom" v-if="x.PriceDiscountType==1">{{x.BuyNum}}{{x.SendNum}}</div>
<div class="border-bottom" v-if="x.PriceDiscountType==2">单人报名享{{100-x.PriceMoney}}折优惠</div> <div class="border-bottom" v-if="x.PriceDiscountType==2">单人报名享{{100-x.PriceMoney}}折优惠</div>
<div class="border-bottom" v-if="x.PriceDiscountType==3">双人报名享{{100-x.PriceMoney}}折优惠</div> <div class="border-bottom" v-if="x.PriceDiscountType==3">双人报名享{{100-x.PriceMoney}}折优惠</div>
<div class="border-bottom" v-if="x.PriceDiscountType==4">续费享{{100-x.PriceMoney}}折优惠</div> <div class="border-bottom" v-if="x.PriceDiscountType==4">续费享{{100-x.PriceMoney}}折优惠</div>
<div class="remark-font" v-if="x.PriceDiscountType==0">暂无优惠政策</div>
</div>
<div v-if="!props.value || props.value.length==0">
<div class="remark-font">暂无优惠政策</div>
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-PreferentialListSellCommission="props"> <template v-slot:body-cell-PreferentialListSellCommission="props">
<q-td :props="props" style="padding-right:0px;padding-left:0px"> <q-td :props="props" style="padding-right:0px;padding-left:0px">
<div v-for="x in props.value"> <div v-for="x in props.value">
<div class="border-bottom" style="padding-left: 16px;padding-right: 16px">{{x.SaleCommissionMoney}}%</div> <div class="border-bottom" style="padding-left: 16px;padding-right: 16px" :class="{'text-red':x.SaleCommissionType==1}" v-if="x.PriceDiscountType!=0">{{x.SaleCommissionType==1?'¥':''}}{{x.SaleCommissionMoney}}{{x.SaleCommissionType==0?'%':''}}</div>
<div v-if="x.PriceDiscountType==0">
<div class="remark-font">暂无佣金信息</div>
</div>
</div>
<div v-if="!props.value || props.value.length==0">
<div class="remark-font">暂无佣金信息</div>
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-PreferentialListB2BCommission="props"> <template v-slot:body-cell-PreferentialListB2BCommission="props">
<q-td :props="props" style="padding-left:0px"> <q-td :props="props" style="padding-left:0px">
<div v-for="x in props.value"> <div v-for="x in props.value">
<div class="border-bottom" style="padding-left: 16px">{{x.B2BCommissionMoney}}%</div> <div class="border-bottom" style="padding-left: 16px" :class="{'text-red':x.B2BCommissionType==1}" v-if="x.PriceDiscountType!=0">{{x.B2BCommissionType==1?'¥':''}}{{x.B2BCommissionMoney}}{{x.B2BCommissionType==0?'%':''}}</div>
<div v-if="x.PriceDiscountType==0">
<div class="remark-font">暂无佣金信息</div>
</div>
</div>
<div v-if="!props.value || props.value.length==0">
<div class="remark-font">暂无佣金信息</div>
</div> </div>
</q-td> </q-td>
</template> </template>
...@@ -135,6 +151,13 @@ ...@@ -135,6 +151,13 @@
align: 'left', align: 'left',
field: row => row.CourseName field: row => row.CourseName
}, },
{
name: 'CateName',
required: true,
label: '系列',
align: 'left',
field: row => row.CateName
},
{ {
name: 'OriginalPrice', name: 'OriginalPrice',
required: true, required: true,
...@@ -170,6 +193,14 @@ ...@@ -170,6 +193,14 @@
align: 'left', align: 'left',
field: row => row.PreferentialList field: row => row.PreferentialList
}, },
{
name: "ClassHours",
label: "课时长度",
field: "ClassHours",
align: "left",
format: (val, row) => `${val}课时`
},
{ {
name: 'CreateByName', name: 'CreateByName',
label: '创建人', label: '创建人',
...@@ -177,9 +208,9 @@ ...@@ -177,9 +208,9 @@
align: 'left' align: 'left'
}, },
{ {
name: 'CreateTimeStr', name: 'UpdateTimeStr',
label: '创建时间', label: '更新时间',
field: 'CreateTimeStr', field: 'UpdateTimeStr',
align: 'left' align: 'left'
}, },
{ {
......
...@@ -174,9 +174,6 @@ li { ...@@ -174,9 +174,6 @@ li {
> >
</q-img> </q-img>
</q-td> </q-td>
<q-td v-else-if="col.name == 'CourseIntro'">
<span v-html="col.value"></span>
</q-td>
<q-td <q-td
v-else-if="col.name == 'PreferentialList'" v-else-if="col.name == 'PreferentialList'"
style="padding-right:0px" style="padding-right:0px"
...@@ -194,6 +191,12 @@ li { ...@@ -194,6 +191,12 @@ li {
<div class="border-bottom" v-if="x.PriceDiscountType == 4"> <div class="border-bottom" v-if="x.PriceDiscountType == 4">
续费享{{ 100 - x.PriceMoney }}折优惠 续费享{{ 100 - x.PriceMoney }}折优惠
</div> </div>
<div class="remark-font" v-if="x.PriceDiscountType == 0">
暂无优惠政策
</div>
</div>
<div v-if="!col.value || col.value.length == 0">
<div class="remark-font">暂无优惠政策</div>
</div> </div>
</q-td> </q-td>
<q-td <q-td
...@@ -201,12 +204,13 @@ li { ...@@ -201,12 +204,13 @@ li {
style="padding-right:0px;padding-left:0px" style="padding-right:0px;padding-left:0px"
> >
<div v-for="x in col.value"> <div v-for="x in col.value">
<div <div class="border-bottom" style="padding-left: 16px;padding-right: 16px" :class="{'text-red':x.SaleCommissionType==1}" v-if="x.PriceDiscountType!=0">{{x.SaleCommissionType==1?'¥':''}}{{x.SaleCommissionMoney}}{{x.SaleCommissionType==0?'%':''}}</div>
class="border-bottom" <div v-if="x.PriceDiscountType == 0">
style="padding-left: 16px;padding-right: 16px" <div class="remark-font">暂无佣金信息</div>
> </div>
{{ x.SaleCommissionMoney }}%
</div> </div>
<div v-if="!col.value || col.value.length==0">
<div class="remark-font">暂无佣金信息</div>
</div> </div>
</q-td> </q-td>
<q-td <q-td
...@@ -214,9 +218,14 @@ li { ...@@ -214,9 +218,14 @@ li {
style="padding-left:0px" style="padding-left:0px"
> >
<div v-for="x in col.value"> <div v-for="x in col.value">
<div class="border-bottom" style="padding-left: 16px"> <div class="border-bottom" style="padding-left: 16px" :class="{'text-red':x.B2BCommissionType==1}" v-if="x.PriceDiscountType!=0">{{x.B2BCommissionType==1?'¥':''}}{{x.B2BCommissionMoney}}{{x.B2BCommissionType==0?'%':''}}</div>
{{ x.B2BCommissionMoney }}%
<div v-if="x.PriceDiscountType == 0">
<div class="remark-font">暂无佣金信息</div>
</div>
</div> </div>
<div v-if="!col.value || col.value.length==0">
<div class="remark-font">暂无佣金信息</div>
</div> </div>
</q-td> </q-td>
<q-td v-else-if="col.name == 'TeacherList'"> <q-td v-else-if="col.name == 'TeacherList'">
...@@ -230,6 +239,9 @@ li { ...@@ -230,6 +239,9 @@ li {
</q-chip> </q-chip>
</div> </div>
</q-td> </q-td>
<q-td v-else-if="col.name=='CourseIntro'">
<q-btn flat color="primary" label="查看详情" @click="showContentDialog(col.value)" />
</q-td>
<q-td <q-td
v-else-if="col.name != 'CourseFeature'" v-else-if="col.name != 'CourseFeature'"
:key="col.name" :key="col.name"
...@@ -245,7 +257,10 @@ li { ...@@ -245,7 +257,10 @@ li {
<q-badge color="negative" class="q-mr-md"> <q-badge color="negative" class="q-mr-md">
课程特色 课程特色
</q-badge> </q-badge>
<div v-html="props.row.CourseFeature" class="text-left col text-negative"></div> <div
v-html="props.row.CourseFeature"
class="text-left col text-negative"
></div>
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>
...@@ -262,6 +277,16 @@ li { ...@@ -262,6 +277,16 @@ li {
</template> </template>
</q-table> </q-table>
</div> </div>
<q-dialog v-model="carousel">
<q-card style="width: 600px;max-height:70vh;" class="q-px-sm q-pb-md scroll">
<q-card-section>
<div class="text-h6">课程详情</div>
</q-card-section>
<q-card-section>
<div v-html="showContent"></div>
</q-card-section>
</q-card>
</q-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -276,6 +301,8 @@ export default { ...@@ -276,6 +301,8 @@ export default {
currentUrl: "", currentUrl: "",
data: [], data: [],
loading: true, loading: true,
carousel:false,
showContent:'',
columns: [ columns: [
{ {
name: "CourseFeature", name: "CourseFeature",
...@@ -302,6 +329,13 @@ export default { ...@@ -302,6 +329,13 @@ export default {
align: "left", align: "left",
field: row => row.CourseName field: row => row.CourseName
}, },
{
name: "CateName",
required: true,
label: "系列",
align: "left",
field: row => row.CateName
},
{ {
name: "OriginalPrice", name: "OriginalPrice",
required: true, required: true,
...@@ -349,6 +383,18 @@ export default { ...@@ -349,6 +383,18 @@ export default {
field: "ClassHours", field: "ClassHours",
align: "left", align: "left",
format: (val, row) => `${val}课时` format: (val, row) => `${val}课时`
},
{
name: "CourseIntro",
label: "课程详情",
field: "CourseIntro",
align: "left"
},
{
name: "UpdateTimeStr",
label: "更新时间",
field: "UpdateTimeStr",
align: "left"
} }
], ],
msg: { msg: {
...@@ -369,6 +415,10 @@ export default { ...@@ -369,6 +415,10 @@ export default {
this.getcourselist(); this.getcourselist();
}, },
methods: { methods: {
showContentDialog(content){
this.showContent=content;
this.carousel=true
},
//重新查询 //重新查询
resetSearch() { resetSearch() {
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
...@@ -387,8 +437,11 @@ export default { ...@@ -387,8 +437,11 @@ export default {
this.loading = false; this.loading = false;
res.Data.PageData.forEach(x => { res.Data.PageData.forEach(x => {
x.expand = false; x.expand = false;
x.CourseFeature=x.CourseFeature.replace(new RegExp('\n',"gm"),'<br/>') x.CourseFeature = x.CourseFeature.replace(
console.log(x.CourseFeature) new RegExp("\n", "gm"),
"<br/>"
);
console.log(x.CourseFeature);
}); });
this.data = res.Data.PageData; this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount; this.pageCount = res.Data.PageCount;
......
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