Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
fd7a86f4
Commit
fd7a86f4
authored
Sep 20, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
期数老师观摩带班老师不重复
parent
4d88aba8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
13 deletions
+34
-13
newDialog.vue
src/components/periods/newDialog.vue
+34
-13
No files found.
src/components/periods/newDialog.vue
View file @
fd7a86f4
...
...
@@ -46,9 +46,9 @@
</el-date-picker>
</el-form-item>
<el-form-item
label=
"带班老师"
prop=
"teacherList"
v-if =
"!form.id"
>
<el-select
v-model=
"form.teacherList"
multiple
placeholder=
"请选择"
>
<el-select
v-model=
"form.teacherList"
multiple
placeholder=
"请选择"
@
change=
"onTeacher1Change"
>
<el-option
v-for=
"item in teacherOptions"
v-for=
"item in teacher
1
Options"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
...
...
@@ -56,9 +56,9 @@
</el-select>
</el-form-item>
<el-form-item
label=
"观摩老师"
prop=
"viewTeacher"
v-if =
"!form.id"
>
<el-select
v-model=
"form.viewTeacher"
placeholder=
"请选择"
>
<el-select
v-model=
"form.viewTeacher"
placeholder=
"请选择"
@
change=
"onTeacher2Change"
>
<el-option
v-for=
"item in teacherOptions"
v-for=
"item in teacher
2
Options"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
...
...
@@ -135,6 +135,8 @@
}
],
teacherOptions
:
[],
teacher1Options
:
[],
teacher2Options
:
[],
goodList
:
[],
itemOptions
:
[],
rules
:{
...
...
@@ -187,14 +189,6 @@
},
methods
:{
sub
(){
// if (!this.teacherList) {
// this.$message.error('请选择老师ID');
// return;
// }
// if (!this.viewTeacher) {
// this.$message.error('请选择观摩老师');
// return;
// }
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
let
_id
=
this
.
form
.
goods_id
;
...
...
@@ -229,8 +223,36 @@
getTeachers
(){
getTeacherListApi
().
then
((
res
)
=>
{
this
.
teacherOptions
=
res
.
list
;
this
.
teacher1Options
=
res
.
list
;
this
.
teacher2Options
=
res
.
list
;
})
},
findDifferentArray
(
array1
,
array2
){
let
newArray
=
[]
array1
.
forEach
((
val
)
=>
{
let
index
=
array2
.
findIndex
((
item
)
=>
{
return
val
.
id
==
item
})
if
(
index
===
-
1
)
{
newArray
.
push
(
val
)
}
})
return
newArray
},
onTeacher1Change
(
ids
){
if
(
ids
){
this
.
teacher2Options
=
this
.
findDifferentArray
(
this
.
teacherOptions
,
ids
)
}
else
{
this
.
teacher2Options
=
this
.
teacherOptions
}
},
onTeacher2Change
(
id
){
if
(
id
){
this
.
teacher1Options
=
this
.
findDifferentArray
(
this
.
teacherOptions
,
[
id
])
}
else
{
this
.
teacher1Options
=
this
.
teacherOptions
}
},
onOptionChange
(
id
){
let
index
=
this
.
goodList
.
findIndex
((
val
)
=>
{
return
val
.
id
=
id
});
if
(
index
>-
1
){
...
...
@@ -238,7 +260,6 @@
}
},
getLessonDetail
(
id
){
console
.
log
(
'getLessonDetail'
,
id
);
this
.
form
.
start_num
=
''
getLessonDetailApi
(
id
,{}).
then
((
res
)
=>
{
this
.
itemOptions
=
res
.
detail
[
res
.
type
]
...
...
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