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

修改课程相关信息

parent 722e86f8
This diff is collapsed.
This diff is collapsed.
...@@ -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>
</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>
</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> <div v-if="x.PriceDiscountType == 0">
<div class="remark-font">暂无佣金信息</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