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
906690da
Commit
906690da
authored
Aug 02, 2019
by
linking2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移交功能
parent
da9ec16c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
182 additions
and
36 deletions
+182
-36
App.vue
src/App.vue
+18
-1
index.vue
src/components/teacher/index.vue
+131
-26
index.vue
src/components/teacherDetail/index.vue
+26
-7
api.js
src/service/api.js
+7
-2
No files found.
src/App.vue
View file @
906690da
...
...
@@ -75,7 +75,7 @@ export default {
};
</
script
>
<
style
>
<
style
>
#app
{
height
:
100%
;
}
...
...
@@ -88,7 +88,24 @@ body {
.el-collapse-item__arrow
{
margin-left
:
0
;
}
.fl
{
float
:
left
;
}
.fr
{
float
:
right
;
}
.clearfix
{
*
zoom
:
1
;
}
.clearfix
:after
{
content
:
""
;
display
:
block
;
height
:
0
;
visibility
:
hidden
;
clear
:
both
;
}
</
style
>
src/components/teacher/index.vue
View file @
906690da
...
...
@@ -33,7 +33,7 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
plain
@
click=
"getUser"
>
搜索
</el-button>
<el-button
type=
"primary"
plain
@
click=
"getUser"
>
搜索
</el-button>
</el-form-item>
<el-form-item
v-if=
"$store.state.orderRefund"
>
<el-button
type=
"success"
plain
@
click=
"add"
>
新增教师
</el-button>
...
...
@@ -53,15 +53,21 @@
width=
"250"
label=
"老师"
>
<template
slot-scope=
"scope"
>
<a
:href=
"scope.row.qr"
target=
"_blank"
>
<img
class=
"avatar"
:src=
"scope.row.qr"
alt=
"二维码"
>
</a>
<div>
老师名:
{{
scope
.
row
.
name
}}
<br>
微信号:
{{
scope
.
row
.
alias
}}
<br>
类别:
{{
scope
.
row
.
type
|
teacherType
}}
<div
style=
"display: flex;"
>
<a
:href=
"scope.row.qr"
target=
"_blank"
class=
"clearfix"
>
<img
class=
"avatar"
:src=
"scope.row.qr"
alt=
"二维码"
>
</a>
<div
style=
"display: flex;"
>
老师名:
{{
scope
.
row
.
name
}}
<br>
微信号:
{{
scope
.
row
.
alias
}}
<br>
类别:
{{
scope
.
row
.
type
|
teacherType
}}
<br>
顾问:
{{
scope
.
row
.
adviser
}}
<br>
开始时间:
{{
scope
.
row
.
teacher_start
}}
</div>
</div>
</
template
>
</el-table-column>
...
...
@@ -147,19 +153,12 @@
width=
"100"
label=
"当月业绩"
>
</el-table-column>
<el-table-column
width=
"280"
label=
"操作"
>
<el-table-column
width=
"320"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
plain
type=
"primary"
@
click=
"goToTeacherDetail(scope.row)"
>
查看详情
</el-button>
<el-button
size=
"mini"
plain
type=
"warning"
@
click=
"edit(scope.row)"
v-if=
"!$store.state.readonly"
>
编辑
</el-button>
<el-button
size=
"mini"
plain
type=
"danger"
@
click=
"delTeacher(scope.row)"
v-if=
"$store.state.deletePermission && !$store.state.readonly"
>
删除
</el-button>
<el-button
size=
"mini"
plain
type=
"primary"
@
click=
"goToTeacherDetail(scope.row)"
>
查看详情
</el-button>
<el-button
size=
"mini"
plain
type=
"warning"
@
click=
"edit(scope.row)"
v-if=
"!$store.state.readonly"
>
编辑
</el-button>
<el-button
size=
"mini"
plain
type=
"success"
@
click=
"transferToggle(scope.row)"
v-if=
"!$store.state.readonly"
>
移交
</el-button>
<el-button
size=
"mini"
plain
type=
"danger"
@
click=
"delTeacher(scope.row)"
v-if=
"$store.state.deletePermission && !$store.state.readonly"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -237,11 +236,40 @@
<teacher-detail
:parentDetail=
"dialogDetail"
></teacher-detail>
</div>
</el-dialog>
<el-dialog
width=
"500px"
:visible
.
sync=
"transfer.show"
>
<el-form
ref=
"transferForm"
:rules=
"transfer.form.rules"
:model=
"transfer.form"
label-width=
"100px"
>
<el-form-item
label=
"当前设备:"
prop=
"teacher_name"
>
{{transfer.form.teacher_name}}
</el-form-item>
<el-form-item
label=
"当前顾问:"
prop=
"staff_current_name"
>
{{transfer.form.staff_current_name}}
</el-form-item>
<el-form-item
label=
"移交顾问:"
prop=
"staff_id"
>
<el-select
v-model=
"transfer.form.staff_id"
filterable
placeholder=
"请选择"
:clearable=
"false"
@
change=
"transferStaffName"
>
<el-option
v-for=
"(data,index) in transfer.staff"
:key=
"index"
:label=
"data.name"
:value=
"data.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"移交时间:"
prop=
"transfer_at"
>
<el-date-picker
v-model=
"transfer.form.transfer_at"
type=
"date"
value-format=
"yyyy-MM-dd"
:clearable=
"false"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-form>
<div
slot=
"footer"
>
<el-button
@
click=
"transferToggle"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"transferSave"
>
确定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
getTeacherListApi
,
delTeacherApi
}
from
"../../service/api"
;
import
{
getTeacherListApi
,
delTeacherApi
,
getStaffListApi
,
postTransferTeacherApi
}
from
"../../service/api"
;
import
{
TEACHERTYPE
}
from
"../../util/wordbook"
;
import
page
from
'../framework/page'
import
teacherDetail
from
'../teacherDetail/index'
...
...
@@ -252,6 +280,22 @@
data
(){
let
nowDate
=
this
.
formatTime
(
new
Date
());
return
{
transfer
:
{
show
:
false
,
form
:
{
teacher_name
:
''
,
teacher_id
:
''
,
staff_current_name
:
''
,
// 当前顾问名
staff_name
:
''
,
// 移交顾问name
staff_id
:
''
,
// 移交顾问id
transfer_at
:
''
,
rules
:
{
staff_id
:
[{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}],
transfer_at
:
[{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}],
},
},
staff
:
[
0
]
},
searchFrom
:{
name
:
''
,
alias
:
""
,
...
...
@@ -380,6 +424,67 @@
this
.
res
=
res
;
})
},
transferStaffName
(
data
)
{
this
.
transfer
.
form
.
staff_name
=
this
.
transfer
.
staff
.
find
(
x
=>
x
.
id
==
data
).
name
;
},
transferToggle
(
data
)
{
this
.
transfer
.
show
=
!
this
.
transfer
.
show
;
if
(
this
.
transfer
.
show
){
if
(
this
.
transfer
.
staff
[
0
]
===
0
)
{
let
json
=
{
limit
:
1000
,
page
:
1
};
getStaffListApi
(
json
).
then
(
res
=>
{
this
.
transfer
.
staff
=
res
.
list
;
});
}
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'transferForm'
].
resetFields
();
this
.
transfer
.
form
.
teacher_name
=
data
.
name
;
this
.
transfer
.
form
.
teacher_id
=
data
.
id
;
this
.
transfer
.
form
.
staff_current_name
=
data
.
adviser
;
})
}
else
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'transferForm'
].
resetFields
();
})
}
},
transferSave
()
{
this
.
$refs
[
'transferForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$confirm
(
`确认将
${
this
.
transfer
.
form
.
teacher_name
}
移交给
${
this
.
transfer
.
form
.
staff_name
}
移交开始时间
${
this
.
transfer
.
form
.
transfer_at
}
`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
var
json
=
{
teacher_id
:
this
.
transfer
.
form
.
teacher_id
,
staff_id
:
this
.
transfer
.
form
.
staff_id
,
transfer_at
:
this
.
transfer
.
form
.
transfer_at
,
};
postTransferTeacherApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'移交成功!'
});
this
.
transferToggle
();
this
.
getUser
();
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消移交'
});
});
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
edit
(
data
){
this
.
dialogObj
.
id
=
data
.
id
;
this
.
dialogObj
.
type
=
2
;
...
...
@@ -462,9 +567,9 @@
min-width: 80px;
width: 80px;
}
&>div:nth-child(
6
){
min-width:
280
px;
width:
280
px;
&>div:nth-child(
7
){
min-width:
320px + 12
px;
width:
320px + 12
px;
}
&>div:nth-child(2),
...
...
src/components/teacherDetail/index.vue
View file @
906690da
...
...
@@ -6,7 +6,7 @@
<span>
<label>
{{
detail
.
type
|
teacherType
}}
:
</label>
{{
detail
.
name
}}
(T
{{
detail
.
squad
}}
)
</span>
<el-button
style=
"float: right;"
size=
"small"
type=
"success"
v-if=
"!$store.state.readonly"
plain
@
click=
"onAddUser(true)"
>
老师绑定用户
</el-button>
<el-button
style=
"float: right;
margin-top: -6px;
"
size=
"small"
type=
"success"
v-if=
"!$store.state.readonly"
plain
@
click=
"onAddUser(true)"
>
老师绑定用户
</el-button>
</div>
<div
class=
"card-content"
>
<div
class=
"text item"
>
...
...
@@ -14,12 +14,22 @@
<img
:src=
"detail.qr"
/>
</a>
</div>
<div
class=
"text item"
>
<label>
微信号:
</label>
{{
detail
.
alias
}}
<br>
<label>
带班总人数:
</label>
{{
detail
.
total_join_num
}}
<br>
<label>
老师状态:
</label>
{{
detail
.
status
===
0
?
'正常'
:
'禁用'
}}
<div
class=
"text item style-fix"
>
<span>
<label>
微信号:
</label>
{{
detail
.
alias
}}
</span>
<span>
<label>
带班总人数:
</label>
{{
detail
.
total_join_num
}}
</span>
<span>
<label>
老师状态:
</label>
{{
detail
.
status
===
0
?
'正常'
:
'禁用'
}}
</span>
<span>
<label>
顾问:
</label>
{{
detail
.
adviser
}}
</span>
<span>
<label>
开始时间:
</label>
{{
detail
.
teacher_start
}}
</span>
</div>
</div>
</el-card>
...
...
@@ -1158,6 +1168,15 @@
label{
width: 120px;
}
&.style-fix {
/*display: flex;
flex-direction: column;
justify-content: space-between;*/
line-height: 25px;
span {
display: block;
}
}
}
.el-card{
/*height: 50px;*/
...
...
src/service/api.js
View file @
906690da
...
...
@@ -80,6 +80,10 @@ const delTeacherUrl = `${_baseUrl}api/admin/teacher`;
export
const
delTeacherApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$del
(
`
${
delTeacherUrl
}
/
${
id
}
`
)
};
//设备移交
export
const
postTransferTeacherApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
_baseUrl
}
api/admin/teacher/transfer`
,
json
)
};
//获取课程列表
const
getLessonUrl
=
`
${
_baseUrl
}
api/admin/course/list`
;
export
const
getLessonApi
=
function
(
json
)
{
...
...
@@ -1254,14 +1258,15 @@ export const putSourceStudentApi = function (type,json) {
return
Vue
.
prototype
.
$put
(
`
${
_baseUrl
}
api/admin/source/student/edit/
${
type
}
`
,
json
)
};
// /api/admin/source/student/list
//
员工
//
获取员工列表
export
const
getStaffListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/staff/list`
,
json
)
};
// 添加员工
export
const
postStaffListApi
=
function
(
json
)
{
console
.
log
(
json
)
return
Vue
.
prototype
.
$post
(
`
${
_baseUrl
}
api/admin/staff/add`
,
json
)
};
// 编辑员工
export
const
putStaffListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
_baseUrl
}
api/admin/staff/edit/
${
json
.
id
}
`
,
json
)
};
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