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
0bf5fcbe
Commit
0bf5fcbe
authored
Dec 03, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
1b2f333b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
58 deletions
+138
-58
class-form.vue
src/components/course/class-form.vue
+138
-58
No files found.
src/components/course/class-form.vue
View file @
0bf5fcbe
...
...
@@ -2,27 +2,78 @@
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{
objOption
.
C
ourse
Id
==
0
?
'新开班级'
:
'修改班级'
}}
</div>
<div
class=
"text-h6"
>
{{
objOption
.
C
lass
Id
==
0
?
'新开班级'
:
'修改班级'
}}
</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=
"text-caption q-mb-lg q-px-md text-grey-6"
>
基本
信息
</div>
<div
class=
"row wrap"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.CourseName"
ref=
"CourseName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"课程名称"
:rules=
"[val => !!val || '请填写课程名称']"
/>
<div
class=
"col-6 q-pr-lg q-pb-lg"
>
<selectTree
v-if=
"TreeCategoryList&&TreeCategoryList.length>0"
:treeData=
'TreeCategoryList'
:defaultArray=
"defaultArray"
nodeKey=
"CateId"
:multiple=
"false"
labelKey=
"CateName"
childrenKey=
"ChildList"
tipText=
"课程分类"
@
getChild=
"getChild"
></selectTree>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.ClassName"
ref=
"ClassName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"班级名称"
:rules=
"[val => !!val || '请填写班级名称']"
/>
</div>
<div
class=
"col-6
q-pb-lg upload-assiatant-box
"
>
<q-
uploader
:style=
"
{backgroundImage:'url(' + objOption.CoverImg + ')'}" flat hide-upload-btn max-files="1
"
label="课程封面" :max-file-size="512*1024" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader
>
<div
class=
"col-6"
>
<q-
select
filled
stack-label
option-value=
"CourseId"
option-label=
"CourseName"
v-model=
"objOption.CouseId
"
ref=
"CouseId"
:options=
"ClassList"
label=
"关联课程"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/
>
</div>
</div>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课程介绍
<div
class=
"row wrap"
>
<div
class=
"col-6"
>
<q-select
filled
stack-label
option-value=
"TId"
option-label=
"TeacherName"
v-model=
"objOption.Teacher_Id"
ref=
"Teacher_Id"
:options=
"TeacherList"
label=
"关联教师"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
</div>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.ClassPersion"
ref=
"ClassPersion"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"招生人数"
:rules=
"[val => !!val || '请填写招生人数']"
/>
</div>
</div>
<div
class=
"row wrap"
>
<div
class=
"col-6"
>
<q-input
filled
v-model=
"objOption.OpenTime"
class=
"col-6 q-pr-lg q-pb-lg"
mask=
"date"
label=
"开班时间"
>
<template
v-slot:append
>
<q-icon
name=
"event"
class=
"cursor-pointer"
>
<q-popup-proxy
ref=
"qDateProxy1"
transition-show=
"scale"
transition-hide=
"scale"
>
<q-date
v-model=
"objOption.OpenTime"
@
input=
"() => $refs.qDateProxy1.hide()"
/>
</q-popup-proxy>
</q-icon>
</
template
>
</q-input>
</div>
<div
class=
"col-6"
>
<q-input
filled
v-model=
"objOption.EndOrderTime"
class=
"col-6 q-pr-lg q-pb-lg"
mask=
"date"
label=
"截止报名时间"
>
<
template
v-slot:append
>
<q-icon
name=
"event"
class=
"cursor-pointer"
>
<q-popup-proxy
ref=
"qDateProxy2"
transition-show=
"scale"
transition-hide=
"scale"
>
<q-date
v-model=
"objOption.EndOrderTime"
@
input=
"() => $refs.qDateProxy2.hide()"
/>
</q-popup-proxy>
</q-icon>
</
template
>
</q-input>
</div>
</div>
<div
class=
"row wrap"
>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.OriginalPrice"
ref=
"OriginalPrice"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"原价"
:rules=
"[val => !!val || '请填写原价']"
/>
</div>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.SellPrice"
ref=
"SellPrice"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"卖价"
:rules=
"[val => !!val || '请填写卖价']"
/>
</div>
</div>
<div
class=
"row wrap"
>
<div
class=
"col-6"
>
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"objOption.School_Id"
ref=
"School_Id"
:options=
"SchoolList"
label=
"所属校区"
:dense=
"false"
class=
"col-6 q-pr-lg q-pr-lg"
emit-value
map-options
/>
</div>
<div
class=
"col-6"
>
<!-- <q-select filled stack-label @input="getDepartList(msg.School_Id),resetSearch()" option-value="SId"
option-label="SName" v-model="msg.School_Id" ref="School_Id" :options="SchoolList" label="所属校区"
:dense="false" class="col-6 q-pr-lg q-pr-lg" emit-value map-options /> -->
</div>
</div>
<ext-editor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
...
...
@@ -36,20 +87,14 @@
<
script
>
import
{
queryCourseCategoryTree
,
saveCourseInfo
,
queryCourseInfo
,
queryCourseDropdownList
,
}
from
'../../api/course/index'
import
{
UploadSelfFile
}
from
'../../api/common/common'
import
selectTree
from
'../common/select-tree'
import
extEditor
from
'../common/ext-editor'
getTeacherDropDownList
,
getSchoolDropdown
}
from
'../../api/school/index'
export
default
{
components
:
{
selectTree
,
extEditor
,
},
components
:
{},
props
:
{
saveObj
:
{
type
:
Object
,
...
...
@@ -60,48 +105,52 @@
return
{
persistent
:
true
,
objOption
:
{
CourseId
:
0
,
//课程编号
CoverImg
:
""
,
//课程封面图
CourseName
:
""
,
//课程名称
CourseIntro
:
""
,
//课程介绍
CateId
:
0
,
//课程编号
ClassId
:
0
,
//班级编号
ClassName
:
""
,
//班级名称
CouseId
:
0
,
//课程Id
Teacher_Id
:
0
,
//讲师Id
Assist_Id
:
0
,
//助教Id
Group_Id
:
0
,
//集团编号
School_Id
:
0
,
//学校编号
CreateBy
:
0
,
//创建人
CreateTime
:
''
,
//创建时间
UpdateBy
:
''
,
//修改人
UpdateTime
:
''
,
//更新时间
Status
:
0
,
//0正常 1禁用
ClassPersion
:
''
,
//招生人数
OpenTime
:
''
,
//开学时间
EndOrderTime
:
''
,
//截止报名时间
OriginalPrice
:
''
,
//原价
SellPrice
:
''
,
//售价
IsStepPrice
:
1
,
//是否阶梯价(1-是)
ClassRoomId
:
''
,
//教室编号
IsOpenCommission
:
1
,
//是否开启提成设置(1-是)
CommissionType
:
1
,
//提成类型(1-人头,2-百分比)
CommissionValue
:
''
,
//提成值
ClassHours
:
''
,
//课时
ClassStyle
:
1
,
//排课方式(1-周,2-月,3-固定日期,4-约课)
ClassStatus
:
1
,
//班级状态
InnerRemark
:
''
,
//对内备注
OutRemark
:
''
,
//对外备注
CompleteProgress
:
0
//完成进度
},
optionTitle
:
""
,
defaultArray
:
[],
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
ClassList
:
[],
//关联课程下拉数据
TeacherList
:
[],
//关联教师下拉数据
SchoolList
:
[],
//关联校区下拉数据
}
},
mounted
()
{
this
.
getCategorytree
();
this
.
CourseList
();
this
.
GetTeacherList
();
this
.
getSchool
();
this
.
initObj
()
},
methods
:
{
//获取编辑器值
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
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
objOption
.
CoverImg
=
res
.
FileUrl
;
}
})
},
getCategorytree
()
{
this
.
TreeCategoryList
=
[];
var
qMsg
=
{}
queryCourseCategoryTree
(
qMsg
).
then
(
res
=>
{
this
.
TreeCategoryList
=
res
.
Data
;
})
},
//初始化表单
initObj
()
{
this
.
defaultArray
=
[];
...
...
@@ -148,7 +197,38 @@
}).
catch
(()
=>
{
this
.
saveCourseLoading
=
false
})
}
},
//获取课程
CourseList
()
{
queryCourseDropdownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
ClassList
=
res
.
Data
;
}
})
},
//获取教师下拉
GetTeacherList
()
{
getTeacherDropDownList
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
console
.
log
(
res
,
'老师'
);
this
.
TeacherList
=
res
.
Data
;
}
})
},
//获取校区下拉
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
){
this
.
SchoolList
=
res
.
Data
;
var
obj
=
{
SName
:
'全部'
,
SId
:
0
}
this
.
SchoolList
.
unshift
(
obj
);
}
})
},
},
}
...
...
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