Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
254acaaa
Commit
254acaaa
authored
Mar 09, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改课程相关信息
parent
722e86f8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
974 additions
and
520 deletions
+974
-520
course-form.vue
src/components/course/course-form.vue
+458
-276
courseprice-form.vue
src/components/course/courseprice-form.vue
+342
-212
catagory.vue
src/pages/course/catagory.vue
+68
-10
course.vue
src/pages/course/course.vue
+38
-7
courseList.vue
src/pages/sale/courseList.vue
+68
-15
No files found.
src/components/course/course-form.vue
View file @
254acaaa
<
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
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>
</div>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课程介绍
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课程介绍
</div>
</div>
<ext-editor
<ext-editor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></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'
components
:
{
import
selectTree
from
'../common/select-tree'
selectTree
,
import
extEditor
from
'../common/ext-editor'
extEditor
export
default
{
},
components
:
{
props
:
{
selectTree
,
saveObj
:
{
extEditor
,
type
:
Object
,
},
default
:
null
props
:
{
}
saveObj
:
{
},
type
:
Object
,
data
()
{
default
:
null
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
},
optionTitle
:
""
,
defaultArray
:
[],
ladderPriceList
:
[],
//阶梯定价数组
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
TeacherList
:
[],
//关联教师下拉数据
SaleplatList
:
[],
//销售端口
choosePlat
:
[],
//选择的平台
chooseTeacher
:
[],
//选择老师
chosenCateId
:
null
,
isShowPrice
:
0
//是否显示价格【hk2021-03-05新增】
};
},
created
()
{
this
.
GetTeacherList
();
this
.
getSaleplat
();
},
mounted
()
{
this
.
getCategorytree
();
this
.
initObj
();
},
methods
:
{
//获取教师下拉
GetTeacherList
()
{
getTeacherDropDownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
TeacherList
=
res
.
Data
;
}
});
},
},
data
()
{
//获取销售端口列表
return
{
getSaleplat
()
{
persistent
:
true
,
querySaleplatList
().
then
(
res
=>
{
objOption
:
{
this
.
SaleplatList
=
res
.
Data
;
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
},
optionTitle
:
""
,
defaultArray
:
[],
ladderPriceList
:
[],
//阶梯定价数组
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
TeacherList
:
[],
//关联教师下拉数据
SaleplatList
:
[],
//销售端口
choosePlat
:
[],
//选择的平台
chooseTeacher
:
[],
//选择老师
isShowPrice
:
0
,
//是否显示价格【hk2021-03-05新增】
}
},
},
created
()
{
//获取编辑器值
this
.
GetTeacherList
();
getEditValue
(
obj
)
{
this
.
getSaleplat
()
;
this
.
objOption
.
CourseIntro
=
obj
;
},
},
mounted
()
{
getChild
(
obj
)
{
this
.
getCategorytree
();
if
(
obj
==
""
)
{
this
.
initObj
()
this
.
objOption
.
CateId
=
0
;
}
else
{
this
.
objOption
.
CateId
=
obj
;
}
},
},
methods
:
{
uploadFile
(
files
)
{
//获取教师下拉
UploadSelfFile
(
"course"
,
files
[
0
],
res
=>
{
GetTeacherList
()
{
if
(
res
.
Code
==
1
)
{
getTeacherDropDownList
({}).
then
(
res
=>
{
this
.
objOption
.
CoverImg
=
res
.
FileUrl
;
if
(
res
.
Code
==
1
)
{
this
.
TeacherList
=
res
.
Data
;
}
})
},
//获取销售端口列表
getSaleplat
()
{
querySaleplatList
().
then
(
res
=>
{
this
.
SaleplatList
=
res
.
Data
;
})
},
//获取编辑器值
getEditValue
(
obj
)
{
this
.
objOption
.
CourseIntro
=
obj
;
},
getChild
(
obj
)
{
if
(
obj
==
""
)
{
this
.
objOption
.
CateId
=
0
;
}
else
{
this
.
objOption
.
CateId
=
obj
;
}
}
},
});
uploadFile
(
files
)
{
},
UploadSelfFile
(
'course'
,
files
[
0
],
res
=>
{
getCategorytree
()
{
if
(
res
.
Code
==
1
)
{
this
.
TreeCategoryList
=
[];
this
.
objOption
.
CoverImg
=
res
.
FileUrl
;
var
qMsg
=
{};
}
queryCourseCategoryTree
(
qMsg
).
then
(
res
=>
{
})
this
.
TreeCategoryList
=
res
.
Data
;
},
if
(
this
.
objOption
.
CateId
!=
0
){
getCategorytree
()
{
this
.
TreeCategoryList
.
forEach
(
x
=>
{
this
.
TreeCategoryList
=
[];
if
(
x
.
CateId
==
this
.
objOption
.
CateId
){
var
qMsg
=
{}
this
.
chosenCateId
=
x
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
;
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
=
"修改课程信息"
}
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
;
}
}
},
});
//关闭弹窗
},
closeCourseForm
()
{
//新增阶梯定价
this
.
$emit
(
'close'
)
addStepPrice
()
{
this
.
persistent
=
false
var
obj
=
{
},
ClassStepPriceId
:
0
,
//保存菜单
PersionNum
:
2
,
saveCourse
()
{
PersionPrice
:
0
this
.
$refs
.
CourseName
.
validate
();
};
this
.
$refs
.
ClassHours
.
validate
();
if
(
this
.
ladderPriceList
&&
this
.
ladderPriceList
.
length
>
0
)
{
if
(
!
this
.
$refs
.
CourseName
.
hasError
&&!
this
.
$refs
.
ClassHours
.
hasError
)
{
var
_index
=
this
.
ladderPriceList
.
length
-
1
;
this
.
saveCourseLoading
=
true
;
obj
.
PersionNum
=
parseInt
(
this
.
ladderPriceList
[
_index
].
PersionNum
)
+
1
;
var
Teacher_Ids
=
""
;
}
if
(
this
.
chooseTeacher
&&
this
.
chooseTeacher
.
length
>
0
)
{
this
.
ladderPriceList
.
push
(
obj
);
this
.
chooseTeacher
.
forEach
(
item
=>
{
},
Teacher_Ids
+=
","
+
item
;
//删除阶梯定价
})
delStepPrice
(
index
)
{
}
this
.
ladderPriceList
.
splice
(
index
,
1
);
if
(
Teacher_Ids
!=
''
)
{
},
Teacher_Ids
=
Teacher_Ids
.
substring
(
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
;
if
(
res
.
Data
.
StepPriceList
&&
res
.
Data
.
StepPriceList
.
length
>
0
)
{
this
.
ladderPriceList
=
res
.
Data
.
StepPriceList
;
}
}
var
salePlat
=
""
;
if
(
res
.
Data
.
TeacherIdList
&&
res
.
Data
.
TeacherIdList
.
length
>
0
)
{
if
(
this
.
choosePlat
&&
this
.
choosePlat
.
length
>
0
)
{
this
.
chooseTeacher
=
res
.
Data
.
TeacherIdList
;
this
.
choosePlat
.
forEach
(
item
=>
{
salePlat
+=
","
+
item
;
});
}
}
if
(
salePlat
!=
''
)
{
if
(
res
.
Data
.
SalePlatList
&&
res
.
Data
.
SalePlatList
.
length
>
0
)
{
salePlat
=
salePlat
.
substring
(
1
)
;
this
.
choosePlat
=
res
.
Data
.
SalePlatList
;
}
}
this
.
objOption
.
StepPriceList
=
this
.
ladderPriceList
;
this
.
defaultArray
.
push
(
res
.
Data
.
CateId
);
this
.
objOption
.
Teacher_Ids
=
Teacher_Ids
;
});
this
.
objOption
.
Saleplat
=
salePlat
;
this
.
optionTitle
=
"修改课程信息"
;
saveCourseInfo
(
this
.
objOption
).
then
(
res
=>
{
}
else
{
this
.
saveCourseLoading
=
false
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
;
}
},
//关闭弹窗
closeCourseForm
()
{
this
.
$emit
(
"close"
);
this
.
persistent
=
false
;
},
//保存菜单
saveCourse
()
{
this
.
$refs
.
CourseName
.
validate
();
this
.
$refs
.
ClassHours
.
validate
();
this
.
$refs
.
CateId
.
validate
();
if
(
!
this
.
$refs
.
CourseName
.
hasError
&&
!
this
.
$refs
.
ClassHours
.
hasError
&&
!
this
.
$refs
.
CateId
.
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
;
console
.
log
(
this
.
chosenCateId
)
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
>
src/components/course/courseprice-form.vue
View file @
254acaaa
<
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>
<thead>
<table
class=
"col-12"
>
<tr
style=
"height:60px;"
>
<thead>
<td
colspan=
"5"
style=
"text-align:right;"
>
<tr
style=
"height:60px;"
>
<q-btn
<td
colspan=
"5"
style=
"text-align:right;"
>
color=
"accent"
<q-btn
color=
"accent"
size=
"sm"
icon=
"add"
label=
"新增优惠"
@
click=
"addPrice()"
/>
size=
"sm"
</td>
icon=
"add"
</tr>
label=
"新增优惠"
<tr>
@
click=
"addPrice()"
<td
style=
"width:280px"
>
/>
优惠类型
</td>
</td>
</tr>
<td
style=
"width:180px"
>
<tr>
优惠条件
<td
style=
"width:200px"
>
</td>
优惠类型
<td
style=
"width:120px"
>
</td>
同行返佣
<td
style=
"width:200px"
>
</td>
优惠条件
<td
style=
"width:120px"
>
</td>
销售返佣
<td
style=
"width:140px"
>
</td>
同行返佣
<td
style=
"width:100px"
>
</td>
操作
<td
style=
"width:140px"
>
</td>
销售返佣
</tr>
</td>
</thead>
<td>
<tbody
v-for=
"(item,index) in priceObj.priceList"
>
操作
<tr>
</td>
<td>
</tr>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"item.PriceDiscountType"
</thead>
ref=
"PriceDiscountType_Id"
:options=
"priceTypeList"
label=
"优惠类型"
:dense=
"false"
<tbody
v-for=
"(item, index) in priceObj.priceList"
>
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<tr>
</td>
<td
style=
"height:50px"
>
<td>
<q-select
<!--买送-->
filled
<template
v-if=
"item.PriceDiscountType==1"
>
stack-label
<q-input
filled
stack-label
maxlength=
"3"
:dense=
"false"
v-model=
"item.BuyNum"
ref=
"BuyNum"
option-value=
"Id"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"买"
@
keyup
.
native=
"checkPrice(item,'BuyNum')"
option-label=
"Name"
style=
"width:80px;display:inline-block;"
suffix=
""
/>
v-model=
"item.PriceDiscountType"
<q-input
filled
stack-label
maxlength=
"3"
:dense=
"false"
v-model=
"item.SendNum"
ref=
"SendNum"
ref=
"PriceDiscountType_Id"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"送"
@
keyup
.
native=
"checkPrice(item,'SendNum')"
:options=
"priceTypeList"
style=
"width:80px;display:inline-block;"
suffix=
""
>
label=
"优惠类型"
style=
"width:160px"
dense
emit-value
map-options
/>
</td>
<td>
<!--买送-->
<template
v-if=
"item.PriceDiscountType == 1"
>
<q-input
filled
stack-label
dense
v-model=
"item.BuyNum"
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>
</
template
>
<!--刷卡分期-->
<
template
v-else-if=
"item.PriceDiscountType == 5"
>
</
template
>
<
template
v-else
>
<q-input
filled
stack-label
dense
v-model=
"item.PriceMoney"
ref=
"PriceMoney"
label=
"优惠"
@
keyup
.
native=
"checkPrice(item, 'PriceMoney')"
style=
"width:165px"
suffix=
"%"
/>
</
template
>
</td>
<td>
<q-input
filled
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>
</q-input>
</
template
>
</td>
<!--刷卡分期-->
<td>
<
template
v-else-if=
"item.PriceDiscountType==5"
>
<q-input
filled
</
template
>
stack-label
<
template
v-else
>
dense
<q-input
filled
stack-label
maxlength=
"4"
:dense=
"false"
v-model=
"item.PriceMoney"
ref=
"PriceMoney"
v-model=
"item.SaleCommissionMoney"
class=
"q-pr-lg q-pb-lg"
label=
"优惠"
@
keyup
.
native=
"checkPrice(item,'PriceMoney')"
style=
"width:100px"
ref=
"SaleCommissionMoney"
suffix=
"%"
/>
label=
"销售返佣"
</
template
>
@
keyup
.
native=
"checkPrice(item, 'SaleCommissionMoney')"
</td>
class=
"q-pr-none"
<td>
style=
"width:100px"
<q-input
filled
stack-label
maxlength=
"4"
:dense=
"false"
v-model=
"item.B2BCommissionMoney"
>
ref=
"B2BCommissionMoney"
class=
"q-pr-lg q-pb-lg"
label=
"同行返佣"
<
template
v-slot:append
>
@
keyup
.
native=
"checkPrice(item,'B2BCommissionMoney')"
style=
"width:100px"
suffix=
"%"
/>
<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;"
>
</td>
<span>
{{
item
.
SaleCommissionType
==
0
?
'%'
:
'¥'
}}
</span>
<td>
<q-menu
auto-close
>
<q-input
filled
stack-label
maxlength=
"4"
:dense=
"false"
v-model=
"item.SaleCommissionMoney"
<q-list>
ref=
"SaleCommissionMoney"
class=
"q-pr-lg q-pb-lg"
label=
"销售返佣"
<q-item
clickable
v-close-popup
@
click=
"item.SaleCommissionType=0"
>
@
keyup
.
native=
"checkPrice(item,'SaleCommissionMoney')"
style=
"width:100px"
suffix=
"%"
/>
<q-item-section>
按百分比(%)
</q-item-section>
</td>
</q-item>
<td>
<q-item
clickable
v-close-popup
@
click=
"item.SaleCommissionType=1"
>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shanchu"
title=
"删除"
color=
"negative"
style=
"font-weight:400"
<q-item-section>
按固定额度(¥)
</q-item-section>
class=
"q-mr-xs"
label=
""
@
click=
"delPrice(index)"
/>
</q-item>
</td>
</q-list>
</tr>
</q-menu>
</tbody>
</div>
</table>
</
template
>
</q-input>
</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>
</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
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
}
}
},
},
data
()
{
data
()
{
return
{
return
{
persistent
:
true
,
persistent
:
true
,
optionTitle
:
""
,
optionTitle
:
""
,
saveCourseLoading
:
false
,
saveCourseLoading
:
false
,
//价格对象
//价格对象
priceObj
:
{
priceObj
:
{
courseObj
:
{
courseObj
:
{
CourseId
:
0
,
//课程编号
CourseId
:
0
,
//课程编号
OriginalPrice
:
0
,
//原价
OriginalPrice
:
0
,
//原价
SellPrice
:
0
,
//售价
SellPrice
:
0
//售价
},
priceList
:
[],
//价格列表
},
},
priceTypeList
:
[],
//优惠类型列表
priceList
:
[]
//价格列表
}
},
priceTypeList
:
[]
//优惠类型列表
};
},
created
()
{
this
.
getTypeList
();
},
mounted
()
{
this
.
initObj
();
},
methods
:
{
//获取优惠类型列表
getTypeList
()
{
queryCoursePreferentialType
().
then
(
res
=>
{
this
.
priceTypeList
=
res
.
Data
;
});
},
},
created
()
{
//新增价格
this
.
getTypeList
();
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
);
},
},
mounted
()
{
//删除价格
this
.
initObj
()
delPrice
(
index
)
{
this
.
priceObj
.
priceList
.
splice
(
index
,
1
);
},
},
methods
:
{
//初始化表单
//获取优惠类型列表
initObj
()
{
getTypeList
()
{
if
(
this
.
saveObj
&&
this
.
saveObj
.
CourseId
>
0
)
{
queryCoursePreferentialType
().
then
(
res
=>
{
queryCourseInfo
({
this
.
priceTypeList
=
res
.
Data
;
CourseId
:
this
.
saveObj
.
CourseId
})
}).
then
(
res
=>
{
},
this
.
priceObj
.
courseObj
.
CourseId
=
res
.
Data
.
CourseId
;
//新增价格
this
.
priceObj
.
courseObj
.
OriginalPrice
=
res
.
Data
.
OriginalPrice
;
addPrice
()
{
this
.
priceObj
.
courseObj
.
SellPrice
=
res
.
Data
.
SellPrice
;
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
});
});
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
>
</
script
>
src/pages/course/catagory.vue
View file @
254acaaa
...
@@ -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
{
queryCourseCategory
Tre
e
queryCourseCategory
Pag
e
}
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
;
})
})
},
},
//新增修改角色
//新增修改角色
...
...
src/pages/course/course.vue
View file @
254acaaa
...
@@ -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
:
'
Cre
ateTimeStr'
,
name
:
'
Upd
ateTimeStr'
,
label
:
'
创建
时间'
,
label
:
'
更新
时间'
,
field
:
'
Cre
ateTimeStr'
,
field
:
'
Upd
ateTimeStr'
,
align
:
'left'
align
:
'left'
},
},
{
{
...
...
src/pages/sale/courseList.vue
View file @
254acaaa
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment