Commit 17fc05c2 authored by 罗超's avatar 罗超
parents 827549d4 077ab81b
......@@ -235,3 +235,39 @@ export function queryCourseJobPageList(data) {
data
})
}
/**
* 获取课程优惠类型列表
*/
export function queryCoursePreferentialType()
{
return request({
url: "/Course/GetCoursePreferentialType",
method: 'post',
})
}
/**
* 获取课程优惠列表
*/
export function queryCoursePreferentialList(data)
{
return request({
url: "/Course/GetCoursePreferentialList",
method: 'post',
data
})
}
/**
* 新增修改课程优惠
*/
export function saveCoursePreferential(data)
{
return request({
url: "/Course/SetBeatchCoursePreferential",
method: 'post',
data
})
}
\ No newline at end of file
......@@ -26,12 +26,12 @@
<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">
<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"
:true-value="1" v-model="objOption.IsOpenStepPrice" />
</div>
<div class="row wrap">
<div class="row wrap" v-if="isShowPrice==1">
<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="原价"
......@@ -43,13 +43,13 @@
:rules="[val => !!val || '请填写卖价']" />
</div>
</div>
<div class="row wrap" style="margin:20px 0;">
<div class="row wrap" style="margin:20px 0;" v-if="isShowPrice==1">
<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">
<template v-if="objOption.IsOpenStepPrice==1 && isShowPrice==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"
......@@ -65,11 +65,11 @@
</div>
</div>
</template>
<div class="text-caption q-mb-lg q-px-md text-grey-6">可续费课程
<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"
:true-value="1" v-model="objOption.IsRenew" />
</div>
<div class="row wrap" v-if="objOption.IsRenew==1">
<div class="row wrap" v-if="objOption.IsRenew==1&&isShowPrice==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')"
......@@ -163,6 +163,7 @@
SaleplatList: [], //销售端口
choosePlat: [], //选择的平台
chooseTeacher: [], //选择老师
isShowPrice: 0, //是否显示价格【hk2021-03-05新增】
}
},
created() {
......
<template>
<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-section>
<div class="text-h6">设置课程价格</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="row wrap">
<div class="col-6">
<q-input filled 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 class="col-6">
<q-input filled 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>
</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>
<table class="col-12">
<thead>
<tr style="height:60px;">
<td colspan="5" style="text-align:right;">
<q-btn color="accent" size="sm" icon="add" label="新增优惠" @click="addPrice()" />
</td>
</tr>
<tr>
<td style="width:280px">
优惠类型
</td>
<td style="width:180px">
优惠条件
</td>
<td style="width:120px">
同行返佣
</td>
<td style="width:120px">
销售返佣
</td>
<td style="width:100px">
操作
</td>
</tr>
</thead>
<tbody v-for="(item,index) in priceObj.priceList">
<tr>
<td>
<q-select filled stack-label option-value="Id" option-label="Name" v-model="item.PriceDiscountType"
ref="PriceDiscountType_Id" :options="priceTypeList" label="优惠类型" :dense="false"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options />
</td>
<td>
<!--买送-->
<template v-if="item.PriceDiscountType==1">
<q-input filled stack-label maxlength="3" :dense="false" v-model="item.BuyNum" ref="BuyNum"
class="col-6 q-pr-lg q-pb-lg" label="买" @keyup.native="checkPrice(item,'BuyNum')"
style="width:80px;display:inline-block;" suffix="" />
<q-input filled stack-label maxlength="3" :dense="false" v-model="item.SendNum" ref="SendNum"
class="col-6 q-pr-lg q-pb-lg" label="送" @keyup.native="checkPrice(item,'SendNum')"
style="width:80px;display:inline-block;" suffix="">
</q-input>
</template>
<!--刷卡分期-->
<template v-else-if="item.PriceDiscountType==5">
</template>
<template v-else>
<q-input filled stack-label maxlength="4" :dense="false" v-model="item.PriceMoney" ref="PriceMoney"
class="q-pr-lg q-pb-lg" label="优惠" @keyup.native="checkPrice(item,'PriceMoney')" style="width:100px"
suffix="%" />
</template>
</td>
<td>
<q-input filled stack-label maxlength="4" :dense="false" v-model="item.B2BCommissionMoney"
ref="B2BCommissionMoney" class="q-pr-lg q-pb-lg" label="同行返佣"
@keyup.native="checkPrice(item,'B2BCommissionMoney')" style="width:100px" suffix="%" />
</td>
<td>
<q-input filled stack-label maxlength="4" :dense="false" v-model="item.SaleCommissionMoney"
ref="SaleCommissionMoney" class="q-pr-lg q-pb-lg" label="销售返佣"
@keyup.native="checkPrice(item,'SaleCommissionMoney')" style="width:100px" suffix="%" />
</td>
<td>
<q-btn flat size="xs" icon="iconfont icon-shanchu" title="删除" color="negative" style="font-weight:400"
class="q-mr-xs" label="" @click="delPrice(index)" />
</td>
</tr>
</tbody>
</table>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" 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>
</q-dialog>
</template>
<script>
import {
saveCoursePreferential,
queryCoursePreferentialList,
queryCourseInfo,
queryCoursePreferentialType,
} from '../../api/course/index'
export default {
components: {},
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
optionTitle: "",
saveCourseLoading: false,
//价格对象
priceObj: {
courseObj: {
CourseId: 0, //课程编号
OriginalPrice: 0, //原价
SellPrice: 0, //售价
},
priceList: [], //价格列表
},
priceTypeList: [], //优惠类型列表
}
},
created() {
this.getTypeList();
},
mounted() {
this.initObj()
},
methods: {
//获取优惠类型列表
getTypeList() {
queryCoursePreferentialType().then(res => {
this.priceTypeList = res.Data;
})
},
//新增价格
addPrice() {
var currentObj = {
Id: 0, //主键编号
CourseId: 0, //课程编号
PreferentialTerms: "", //优惠条件
SaleCommissionType: 0, //销售返佣类型(0-百分比,1-固定金额)
SaleCommissionMoney: 0, //销售返佣
B2BCommissionType: 0, //同行返佣类型(0-百分比,1-固定金额)
B2BCommissionMoney: 0, //同行返佣
PriceDiscountType: 0, //课程价格优惠类型(见枚举)
BuyNum: 0, //购买人数
SendNum: 0, //赠送人数
PriceType: 0, //优惠价格类型(0-百分比,1-固定金额)
PriceMoney: 0, //优惠金额
};
this.priceObj.priceList.push(currentObj);
},
//删除价格
delPrice(index) {
this.priceObj.priceList.splice(index, 1);
},
//初始化表单
initObj() {
if (this.saveObj && this.saveObj.CourseId > 0) {
queryCourseInfo({
CourseId: this.saveObj.CourseId
}).then(res => {
this.priceObj.courseObj.CourseId = res.Data.CourseId;
this.priceObj.courseObj.OriginalPrice = res.Data.OriginalPrice;
this.priceObj.courseObj.SellPrice = res.Data.SellPrice;
})
queryCoursePreferentialList({
CourseId: this.saveObj.CourseId
}).then(res => {
if (res.Code == 1 && res.Data) {
this.priceObj.priceList = res.Data;
}
})
this.optionTitle = "修改课程优惠信息"
} else {
this.optionTitle = "新增课程优惠信息"
this.priceObj.courseObj.CourseId = 0;
this.priceObj.courseObj.OriginalPrice = 0;
this.priceObj.courseObj.SellPrice = 0;
}
},
//关闭弹窗
closeCourseForm() {
this.$emit('close')
this.persistent = false
},
//保存菜单
saveCourse() {
this.saveCourseLoading = true;
if (this.priceObj.priceList && this.priceObj.priceList.length > 0) {
this.priceObj.priceList.forEach(item => {
if (item.BuyNum == '') {
item.BuyNum = 0;
}
if (item.SendNum == '') {
item.SendNum = 0;
}
if (item.PriceMoney == '') {
item.PriceMoney = 0;
}
if (item.B2BCommissionMoney == '') {
item.B2BCommissionMoney = 0;
}
if (item.SaleCommissionMoney == '') {
item.SaleCommissionMoney = 0;
}
})
}
saveCoursePreferential(this.priceObj).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
});
}
},
}
</script>
......@@ -23,7 +23,7 @@
<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="EditCourse(null)" />
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增课程" @click="EditCourse(null,1)" />
</div>
</template>
<template v-slot:body-cell-CoverImg="props">
......@@ -35,7 +35,7 @@
</template>
<template v-slot:body-cell-CourseIntro="props">
<q-td :props="props">
<span v-html="props.value" ></span>
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-Status="props">
......@@ -50,7 +50,9 @@
<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="EditCourse(props.row)" />
@click="EditCourse(props.row,1)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="价格设置"
@click="EditCourse(props.row,2)" v-if="isShowPriceEditBtn==1" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;display:none;" label="详情"
@click="goMycourse(props.row)" />
</q-td>
......@@ -59,6 +61,9 @@
<course-form v-if="isShowCourseForm" :save-obj="courseObjOption" @close="closeMenuSaveForm"
@success="refreshPage">
</course-form>
<courseprice-form v-if="isShowCoursePriceForm" :save-obj="courseObjOption" @close="closeMenuSaveForm"
@success="refreshPage">
</courseprice-form>
</div>
</div>
</template>
......@@ -68,6 +73,7 @@
queryCourseCategoryTree,
} from '../../api/course/index'
import courseForm from '../../components/course/course-form'
import coursepriceForm from '../../components/course/courseprice-form'
import selectTree from '../../components/common/select-tree'
export default {
meta: {
......@@ -75,7 +81,8 @@
},
components: {
courseForm,
selectTree
selectTree,
coursepriceForm
},
data() {
return {
......@@ -93,19 +100,13 @@
align: 'left',
field: row => row.CourseName
},
// {
// name: 'CateName',
// label: '所属分类',
// field: 'CateName',
// align: 'left'
// },
{
name: 'CoverImg',
label: '课程封面',
field: 'CoverImg',
align: 'left'
},
{
name: 'CreateByName',
label: '创建人',
......@@ -157,8 +158,10 @@
TreeCategoryList: [],
returnString: [], //默认值
pageCount: 0,
isShowCourseForm: false,
courseObjOption: null,
isShowCourseForm: false, //是否显示课程表单
isShowCoursePriceForm: false, //是否显示课程价格表单
courseObjOption: null, //课程对象
isShowPriceEditBtn: 1, //是否显示价格设置
}
},
mounted() {
......@@ -214,20 +217,26 @@
//刷新页面
refreshPage() {
this.isShowCourseForm = false;
this.isShowCoursePriceForm=false;
this.getcourselist();
},
//新增修改菜单
EditCourse(obj) {
//新增修改课程及价格
EditCourse(obj, type) {
if (obj) {
this.courseObjOption = obj
} else {
this.courseObjOption = null
}
this.isShowCourseForm = true
if (type == 1) {
this.isShowCourseForm = true;
} else {
this.isShowCoursePriceForm = true;
}
},
//关闭弹窗
closeMenuSaveForm() {
this.isShowCourseForm = false
this.isShowCourseForm = false;
this.isShowCoursePriceForm = false;
},
//跳转至我的课程
goMycourse(obj) {
......
<style>
li {
list-style-type: none;
}
.courseList ul {
padding: 0px
}
.courseList li {
background: rgba(221, 222, 224, 0.2);
border-radius: 4px;
margin-top: 15px
}
.courseList li .dline {
display: table;
width: 100%;
display: flex;
flex-direction: row
}
.courseList li .d1,
.courseList li .d2,
.courseList li .d3,
.courseList li .d4,
.courseList li .d5 {
width: 18%;
padding: 20px 20px 10px;
}
.courseList li .d7 {
flex: 1;
width: 1px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center
}
.courseList li .d1 .di-title {
font-size: 16px;
color: #111111;
}
.courseList li .d1 .di-c {
font-size: 14px;
display: flex;
line-height: 28px;
color: #111111
}
.courseList li .d6 {
padding: 10px 20px;
width: 100%;
height: inherit;
position: relative;
border-top: 1px solid #DDDEE0
}
.courseList li .d6 .progress {
width: 100%;
height: 5px;
position: absolute;
left: 0;
bottom: 0
}
.courseList li .d2 div {
margin: 2px 0;
font-size: 14px;
color: #111111;
}
.courseList li .d2-n {
font-size: 12px;
color: #999999;
margin-right: 20px
}
.courseList li .d3 .d3-s {
color: var(--q-color-negative);
font-weight: bold
}
.courseList li .d3 div {
margin: 2px 0;
font-size: 14px;
}
.courseList li .d4 div {
font-size: 14px;
color: #111111;
margin: 2px 0;
}
.courseList li .d5 div {
font-size: 14px;
color: #111111;
margin: 2px 0;
}
.courseList .myCourseNName {
width: 25px;
height: 25px;
border-radius: 50%;
color: #fff !important;
text-align: center;
line-height: 25px;
background-color: #004d40;
}
</style>
<template>
<div class="page-body courseList">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.CourseName" label="课程名称"
@clear="resetSearch" maxlength="20" />
</div>
</div>
</div>
<div class="page-content">
<ul v-if="data.length!=0">
<li v-for="(item,index) in data" :key="index">
<div class="dline">
<div class="d1" style="width:25%">
<div class="di-title">课程名称</div>
<div class="di-c" style="margin-top: 25px;">
<div>
<img :src="item.CoverImg" v-if="item.CoverImg" style="width:60px;height:60px;margin-right:10px;" />
<img style="width:60px;height:60px;margin-right:10px;" v-else src="../../assets/images/default.png"/>
</div>
<div>{{item.CourseName}}</div>
</div>
</div>
<div class="d2">
<div class="di-title">讲师</div>
<div class="di-c" style="margin-top: 25px;">
<div style="display:flex;align-items:center;" v-for="(subItem,sIndex) in item.TeacherList"
:key="sIndex">
<div>
<img v-if="subItem.TeacherIcon" style="width:25px;height:25px;border-radius:50%;"
:src="subItem.TeacherIcon" />
<div v-else class="myCourseNName">{{subItem.TeacherName.substring(0,1)}}</div>
</div>
<div style="margin-left:5px;">{{subItem.TeacherName}}</div>
</div>
</div>
</div>
<div class="d3">
<div class="di-title">销售平台</div>
<div class="di-c" style="margin-top: 25px;">
<span style="margin-right:5px;" v-for="(pItem,pIndex) in item.SalePlatArr">{{pItem}}</span>
</div>
</div>
<div class="d4" style="width:20%">
<div class="di-title">基础价格</div>
<div class="di-c" style="margin-top: 25px;">
<span
style="color: var(--q-color-negative); font-weight: bold;">{{item.OriginalPrice.toFixed(2)}}</span>
</div>
</div>
<div class="d5" style="width:19%">
<div class="di-title">优惠价格</div>
<div class="di-c" style="margin-top: 25px;">
<template v-if="item.PreferentialList&&item.PreferentialList.length>0">
<table>
<tbody v-for="(pitem,pindex) in item.PreferentialList" v-if="pindex==0">
<tr>
<td>
<template v-if="pitem.PriceDiscountType==1">
<span style="color: var(--q-color-negative); font-weight: bold;">{{pitem.BuyNum}}</span>
<span style="color: var(--q-color-negative); font-weight: bold;">{{pitem.SendNum}}</span>
</template>
<template v-else-if="pitem.PriceDiscountType==5">
刷卡分期
</template>
<template v-else>
{{pitem.PriceDiscountTypeStr}} <span
style="color: var(--q-color-negative); font-weight: bold;"> {{pitem.PriceMoney}} %</span>
</template>
</td>
</tr>
<tr>
<td>
同行返佣<span
style="color: var(--q-color-negative); font-weight: bold;"> {{pitem.B2BCommissionMoney}}
%</span>
</td>
</tr>
<tr>
<td>
销售返佣<span
style="color: var(--q-color-negative); font-weight: bold;"> {{pitem.SaleCommissionMoney}}
%</span>
<span class="iconfont icon-xiangxia" style="color: #2961FE;font-size: 10px"
v-if="item.PreferentialList.length>1">
<q-popup-proxy>
<q-banner>
<table style="width:400px;" border="0" cellspacing="0" cellpadding="0">
<thead style="background-color:rgba(221, 222, 224, 0.2);">
<tr>
<td style="width:45%;height:30px;">
优惠条件
</td>
<td style="width:25%;height:30px;">
同行返佣
</td>
<td style="width:25%;height:30px;">
销售返佣
</td>
</tr>
</thead>
<tbody>
<tr v-for="(pitem,pindex) in item.PreferentialList">
<td style="height:30px;">
<template v-if="pitem.PriceDiscountType==1">
{{pitem.BuyNum}}{{pitem.SendNum}}
</template>
<template v-else-if="pitem.PriceDiscountType==5">
刷卡分期
</template>
<template v-else>
{{pitem.PriceDiscountTypeStr}} {{pitem.PriceMoney}} %
</template>
</td>
<td style="height:30px;">
{{pitem.B2BCommissionMoney}} %
</td>
<td style="height:30px;">
{{pitem.SaleCommissionMoney}} %
</td>
</tr>
</tbody>
</table>
</q-banner>
</q-popup-proxy>
</span>
</td>
</tr>
</tbody>
</table>
</template>
</div>
</div>
</div>
<div class="d6 row">
<p style="color:var(--q-color-negative);font-weight: bold"><span
style="color:#2D2D2D;">课程特色:</span>{{item.CourseFeature}}</p>
</div>
</li>
<li style="border: none;display: flex;justify-content: flex-end;background: white;padding: 5px 20px">
<q-pagination v-model="msg.pageIndex" :max="pageCount" @input="changePage" class="full-width justify-end"
color="primary" :input="true">
</q-pagination>
</li>
</ul>
<div v-else style="width: 100%;color: #999999;text-align: center;font-size: 15px">暂无数据</div>
</div>
</div>
</template>
<script>
import {
queryCoursePage,
} from '../../api/course/index'
export default {
meta: {
title: "课程预览"
},
components: {
},
data() {
return {
currentUrl: "",
data: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
CourseName: "",
QCateIds: "",
Status: "0",
IsQPrice: 1, //是否查询优惠价格设置
IsQTeacher: 1, //是否查询课程讲师
},
pageCount: 0,
}
},
mounted() {
this.currentUrl = this.$route.path
this.getcourselist();
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getcourselist();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getcourselist()
},
//获取菜单分页列表
getcourselist() {
this.loading = true;
queryCoursePage(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount;
console.log(this.data, 'data');
}).catch(() => {
this.loading = false
})
},
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -146,7 +146,7 @@ const routes = [{
{
path: "/course/lessonPreparation", //教师备课
component: () =>
import("pages/course/lessonPreparation.vue")
import("pages/course/lessonPreparation.vue")
},
{
path: "/course/prepareclassDetails", //教师备课 备课详情
......@@ -421,6 +421,11 @@ const routes = [{
component: () =>
import("pages/sale/japaneseTrain.vue")
},
{
path: "/sale/courseList", //销售 课程预览
component: () =>
import("pages/sale/courseList.vue")
},
{
path: "/sale/myOrder", //销售 我的订单
component: () =>
......
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