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
44168af2
Commit
44168af2
authored
Aug 26, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
8dafcade
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
386 additions
and
536 deletions
+386
-536
course-form.vue
src/components/course/course-form.vue
+386
-536
No files found.
src/components/course/course-form.vue
View file @
44168af2
<
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-section>
<div
class=
"text-h6"
>
...
...
@@ -15,307 +9,149 @@
<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"
>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"objOption.CourseName"
ref=
"CourseName"
class=
"col-6 q-pr-lg q-pb-lg"
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
/>
<q-input
filled
stack-label
:dense=
"false"
v-model=
"objOption.CourseName"
ref=
"CourseName"
class=
"col-6 q-pr-lg q-pb-lg"
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
class=
"row wrap"
>
<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"
label="课程封面"
accept=".jpg, image/*"
:factory="uploadFile"
auto-upload
>
<q-uploader
: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>
</div>
<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
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"
:true-value=
"1"
v-model=
"objOption.IsOpenStepPrice"
/>
<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"
v-if=
"isShowPrice == 1"
>
<div
class=
"col-6"
>
<q-input
filled
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 || '请填写原价']"
/>
<q-input
filled
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
class=
"col-6"
>
<q-input
filled
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 || '请填写卖价']"
/>
<q-input
filled
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
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"
/>
<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 && 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"
>
<q-input
filled
stack-label
v-model=
"item.PersionNum"
@
keyup
.
native=
"checkInteger(item, 'PersionNum')"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"人"
/>
<q-input
filled
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
class=
"col-6"
style=
"position: relative"
>
<q-input
filled
stack-label
v-model=
"item.PersionPrice"
@
keyup
.
native=
"checkPrice(item, 'PersionPrice')"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"价格"
/>
<q-btn
style=
"position: absolute; right: -5px; top: 20px"
size=
"6px"
@
click=
"delStepPrice(index)"
round
color=
"red"
icon=
"iconfont icon-guanbi1"
/>
<q-input
filled
stack-label
v-model=
"item.PersionPrice"
@
keyup
.
native=
"checkPrice(item, 'PersionPrice')"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"价格"
/>
<q-btn
style=
"position: absolute; right: -5px; top: 20px"
size=
"6px"
@
click=
"delStepPrice(index)"
round
color=
"red"
icon=
"iconfont icon-guanbi1"
/>
</div>
</div>
</
template
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
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"
:true-value=
"1"
v-model=
"objOption.IsRenew"
/>
<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 && isShowPrice == 1"
>
<div
class=
"col-6"
>
<q-input
filled
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 || '请填写续费原价']"
/>
<q-input
filled
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
class=
"col-6"
>
<q-input
filled
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 || '请填写续费售价']"
/>
<q-input
filled
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
class=
"row wrap"
>
<div
class=
"col-6"
>
<q-input
filled
stack-label
:disable=
"!isHaveCourseHoursEdit"
@
keyup
.
native=
"checkPrice(objOption, 'ClassHours')"
reverse-fill-mask
v-model=
"objOption.ClassHours"
ref=
"ClassHours"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"课时数量"
:rules=
"[(val) => !!val || '请填写课时信息']"
/>
<q-input
filled
stack-label
:disable=
"!isHaveCourseHoursEdit"
@
keyup
.
native=
"checkPrice(objOption, 'ClassHours')"
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=
"objOption.CateId"
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=
"row wrap"
>
<div
class=
"col-6"
>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"objOption.CourseRate"
ref=
"CourseRate"
:options=
"courseLevelList"
label=
"课程等级"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
</div>
<div
class=
"col-6"
>
<q-select
filled
stack-label
option-value=
"CateId"
option-label=
"CateName"
v-model=
"objOption.CateId"
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>
<ext-editor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
<ext-editor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
<div
class=
"row wrap"
>
<div
class=
"col-9"
>
<span>
上架端口:
</span>
<
template
v-for=
"(item, index) in SaleplatList"
>
<q-checkbox
v-model=
"choosePlat"
:label=
"item.Name"
:val=
"item.Id"
:key=
"index"
/>
<q-checkbox
v-model=
"choosePlat"
:label=
"item.Name"
:val=
"item.Id"
:key=
"index"
/>
</
template
>
</div>
<div
class=
"col-3"
>
<q-toggle
style=
"float: right"
size=
"md"
left-label
label=
"K12课程"
color=
"primary"
:false-value=
"0"
:true-value=
"1"
v-model=
"objOption.IsKCourse"
/>
<q-toggle
style=
"float: right"
size=
"md"
left-label
label=
"K12课程"
color=
"primary"
:false-value=
"0"
:true-value=
"1"
v-model=
"objOption.IsKCourse"
/>
</div>
</div>
<div
class=
"row col-12"
v-if=
"choosePlat.find((e) => e == 4)"
>
<span
class=
"q-mb-sm"
>
选择分类:
</span>
<q-card
class=
"full-width"
>
<q-tree
class=
"col-sm-6"
:nodes=
"goodClassify"
node-key=
"Id"
label-key=
"Name"
children-key=
"ChildList"
tick-strategy=
"strict"
:ticked
.
sync=
"chooseGoodsClassify"
default-expand-all
@
update:ticked=
"handleCheckChange"
/>
<q-tree
class=
"col-sm-6"
:nodes=
"goodClassify"
node-key=
"Id"
label-key=
"Name"
children-key=
"ChildList"
tick-strategy=
"strict"
:ticked
.
sync=
"chooseGoodsClassify"
default-expand-all
@
update:ticked=
"handleCheckChange"
/>
</q-card>
</div>
</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-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
{
import
{
queryCourseCategoryTree
,
saveCourseInfo
,
queryCourseInfo
,
querySaleplatList
,
}
from
"../../api/course/index"
;
import
{
getTeacherDropDownList
}
from
"../../api/school/index"
;
import
{
UploadSelfFile
}
from
"../../api/common/common"
;
import
extEditor
from
"../common/ext-editor"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
getCourseRate
,
}
from
"../../api/course/index"
;
import
{
getTeacherDropDownList
}
from
"../../api/school/index"
;
import
{
UploadSelfFile
}
from
"../../api/common/common"
;
import
extEditor
from
"../common/ext-editor"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
components
:
{
extEditor
,
},
...
...
@@ -347,6 +183,7 @@ export default {
IsKCourse
:
0
,
//是否是K12课程(1-是)
ClassHours
:
0
,
CategoryList
:
[],
CourseRate
:
""
,
//课程等级
},
optionTitle
:
""
,
defaultArray
:
[],
...
...
@@ -361,12 +198,14 @@ export default {
goodClassify
:
[],
//商品分类列表
chooseGoodsClassify
:
[],
//选中的商品分类
modifyClassifyList
:
[],
//修改时返回的分类列表
courseLevelList
:
[],
//课程等级列表
};
},
created
()
{
this
.
GetTeacherList
();
this
.
getSaleplat
();
this
.
getGoodsClassify
();
this
.
getCourseRateList
();
},
computed
:
mapState
({
isHaveCourseHoursEdit
(
state
)
{
...
...
@@ -391,6 +230,14 @@ export default {
this
.
initObj
();
},
methods
:
{
//获取课程等级列表
getCourseRateList
()
{
getCourseRate
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
courseLevelList
=
res
.
Data
;
}
})
},
//获取教师下拉
GetTeacherList
()
{
getTeacherDropDownList
({}).
then
((
res
)
=>
{
...
...
@@ -471,6 +318,7 @@ export default {
this
.
objOption
.
RenewSlPrice
=
res
.
Data
.
RenewSlPrice
;
this
.
objOption
.
Saleplat
=
res
.
Data
.
Saleplat
;
this
.
objOption
.
IsKCourse
=
res
.
Data
.
IsKCourse
;
this
.
objOption
.
CourseRate
=
res
.
Data
.
CourseRate
;
if
(
res
.
Data
.
StepPriceList
&&
res
.
Data
.
StepPriceList
.
length
>
0
)
{
this
.
ladderPriceList
=
res
.
Data
.
StepPriceList
;
}
...
...
@@ -510,6 +358,7 @@ export default {
this
.
objOption
.
RenewSlPrice
=
0
;
this
.
objOption
.
Saleplat
=
""
;
this
.
objOption
.
IsKCourse
=
0
;
this
.
objOption
.
CourseRate
=
""
;
this
.
getCategorytree
();
}
},
...
...
@@ -635,5 +484,6 @@ export default {
});
},
},
};
};
</
script
>
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