Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
train-admin-h5
Overview
Overview
Details
Activity
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
tangjiale
train-admin-h5
Commits
f65b4310
Commit
f65b4310
authored
Jul 05, 2022
by
tangjiale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复Bug
parent
bf854654
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
43 deletions
+45
-43
add-course.vue
pages/components/add-course.vue
+45
-43
No files found.
pages/components/add-course.vue
View file @
f65b4310
...
...
@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 09:28:37
* @LastEditors: tangjiale
* @LastEditTime: 2022-07-05 11:
04:48
* @LastEditTime: 2022-07-05 11:
15:52
-->
<
template
>
<div
class=
"add-course-bg"
>
...
...
@@ -204,49 +204,51 @@ export default {
},
onSubmit
(
data
,
form
){
let
that
=
this
this
.
$refs
.
courseFrom
.
validate
((
valid
)
=>
{
if
(
!
that
.
checkList
.
length
){
that
.
$message
.
error
(
'请选择校区'
)
return
}
if
(
!
that
.
param
.
pxEmployeeList
.
length
){
that
.
$message
.
error
(
'请选择校区人员'
)
return
}
if
(
!
(
that
.
param
.
pxEmployeeList
.
filter
(
v
=>
v
.
empPosition
==
'coach'
)).
length
){
that
.
$message
.
error
(
'请添加教练'
)
return
}
if
(
!
(
that
.
param
.
pxEmployeeList
.
filter
(
v
=>
v
.
empPosition
==
'manger'
)).
length
){
that
.
$message
.
error
(
'请添加班主任'
)
return
}
if
(
!
that
.
param
.
poster
){
that
.
$message
.
error
(
'请上传课程图片'
)
return
}
if
(
!
that
.
param
.
detail
){
that
.
$message
.
error
(
'请输入课程详情'
)
return
}
let
param
=
{
...
that
.
param
,
status
:
that
.
param
.
status
==
1
?
1
:
form
,
//0未发布 1已发布
schIds
:
that
.
checkList
.
join
(
','
),
}
if
(
param
.
cost
<=
0
){
that
.
$message
.
error
(
'课程价格不能小于等于0'
)
return
}
//单位:分
param
.
cost
=
param
.
cost
*
100
param
.
courseDefNum
=
param
.
courseDefNum
||
0
this
.
$refs
.
courseFrom
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
!
that
.
checkList
.
length
){
that
.
$message
.
error
(
'请选择校区'
)
return
}
if
(
!
that
.
param
.
pxEmployeeList
.
length
){
that
.
$message
.
error
(
'请选择校区人员'
)
return
}
if
(
!
(
that
.
param
.
pxEmployeeList
.
filter
(
v
=>
v
.
empPosition
==
'coach'
)).
length
){
that
.
$message
.
error
(
'请添加教练'
)
return
}
if
(
!
(
that
.
param
.
pxEmployeeList
.
filter
(
v
=>
v
.
empPosition
==
'manger'
)).
length
){
that
.
$message
.
error
(
'请添加班主任'
)
return
}
if
(
!
that
.
param
.
poster
){
that
.
$message
.
error
(
'请上传课程图片'
)
return
}
if
(
!
that
.
param
.
detail
){
that
.
$message
.
error
(
'请输入课程详情'
)
return
}
let
param
=
{
...
that
.
param
,
status
:
that
.
param
.
status
==
1
?
1
:
form
,
//0未发布 1已发布
schIds
:
that
.
checkList
.
join
(
','
),
}
if
(
param
.
cost
<=
0
){
that
.
$message
.
error
(
'课程价格不能小于等于0'
)
return
}
//单位:分
param
.
cost
=
param
.
cost
*
100
param
.
courseDefNum
=
param
.
courseDefNum
||
0
let
funName
=
param
.
id
?
'emitCourse'
:
'addCourse'
this
.
$service
.
course
[
funName
](
param
).
then
(
res
=>
{
that
.
$notifySuccess
()
that
.
$emit
(
'update'
)
})
let
funName
=
param
.
id
?
'emitCourse'
:
'addCourse'
this
.
$service
.
course
[
funName
](
param
).
then
(
res
=>
{
that
.
$notifySuccess
()
that
.
$emit
(
'update'
)
})
}
})
},
...
...
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