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
b3daf8a9
Commit
b3daf8a9
authored
Sep 03, 2019
by
赵茹林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
21e65c86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
9 deletions
+51
-9
dialog.vue
src/components/team/dialog.vue
+19
-2
index.vue
src/components/team/index.vue
+28
-7
api.js
src/service/api.js
+4
-0
No files found.
src/components/team/dialog.vue
View file @
b3daf8a9
...
...
@@ -2,7 +2,7 @@
<el-dialog
:title=
"title"
append-to-body
:visible
.
sync=
"show"
width=
"800px"
>
<div
v-loading=
"loading"
>
<div>
销售顾问:
{{
dialogObj
.
staff_name
}}
</div>
<div></div>
<el-table
:data=
"list"
>
<el-table-column
prop=
"month_order_rate"
>
...
...
@@ -18,7 +18,7 @@
</
template
>
<
script
>
import
{
getVisitedApi
,
getClassOpenedApi
}
from
"@service/api"
;
import
{
getVisitedApi
,
getClassOpenedApi
,
getAchievementApi
}
from
"@service/api"
;
import
page
from
'@framework/page'
export
default
{
...
...
@@ -52,11 +52,28 @@
this
.
show
=
this
.
dialogObj
.
show
;
if
(
this
.
dialogObj
.
type
==
'callback'
)
{
this
.
getVisited
();
this
.
title
=
`销售顾问:
${
this
.
dialogObj
.
staff_name
}
T
${
this
.
dialogObj
.
team
}
`
}
else
if
(
this
.
dialogObj
.
type
==
'class'
)
{
this
.
getClass
();
this
.
title
=
`销售顾问:
${
this
.
dialogObj
.
staff_name
}
T
${
this
.
dialogObj
.
team
}
`
}
else
if
(
this
.
dialogObj
.
type
==
'achievement'
)
{
this
.
getAchievement
();
this
.
title
=
`业绩详情:
${
this
.
dialogObj
.
staff_name
}
T
${
this
.
dialogObj
.
team
}
`
}
}
},
getAchievement
()
{
let
json
=
{
teacher_id
:
this
.
dialogObj
.
teacher_id
,
start_at
:
this
.
dialogObj
.
start_at
,
page
:
this
.
nowPage
,
limit
:
this
.
limit
}
getAchievementApi
(
json
).
then
(
res
=>
{
this
.
loading
=
false
;
console
.
log
(
res
)
})
},
getVisited
()
{
let
json
=
{
teacher_id
:
this
.
dialogObj
.
teacher_id
,
...
...
src/components/team/index.vue
View file @
b3daf8a9
...
...
@@ -15,11 +15,11 @@
<el-table
class=
"team-table"
border
size=
"small"
:data=
"list"
v-loading=
"loading"
:row-class-name=
"tableRowClassName"
>
<el-table-column
label=
"组别"
width=
"50px"
>
<template
slot-scope=
"scope"
>
{{
`T${scope.row.squad
}
`
}}
<
/template
>
<template
slot-scope=
"scope"
>
{{
(
String
(
scope
.
row
.
squad
).
indexOf
(
','
)
>
-
1
&&
scope
.
row
.
total
)
?
'合计'
:
`T${scope.row.squad
}
`
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"销售顾问"
>
<
template
slot
-
scope
=
"scope"
>
{{
scope
.
row
.
total
?
'合计'
:
scope
.
row
.
staff_name
}}
<
span
v
-
html
=
"transStaff(scope.row)"
><
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"reach_class_num"
>
...
...
@@ -149,7 +149,9 @@
<
/el-tooltip
>
<
/template
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
link
@
click
=
"dialogToggle"
>
{{
scope
.
row
.
month_order_rate
}}
<
/el-link
>
<
el
-
link
@
click
=
"dialogToggle"
>
{{
transRate
(
scope
.
row
.
month_trans_order_num
,
scope
.
row
.
month_trans_user_num
)
}}
<
/el-link
>
<
/template
>
<
/el-table-column
>
...
...
@@ -247,6 +249,22 @@
this
.
getData
();
}
,
methods
:
{
transStaff
(
row
)
{
if
(
row
.
total
)
{
return
'合计'
}
else
if
(
row
.
staff_name
.
indexOf
(
','
)
>-
1
){
return
row
.
staff_name
.
split
(
','
).
join
(
'<br>'
)
}
else
{
return
row
.
staff_name
}
}
,
transRate
(
child
,
mother
)
{
if
(
mother
)
{
return
`${Math.floor(child * 100) / mother
}
%`
}
else
{
return
'-'
}
}
,
tableRowClassName
({
row
,
rowIndex
}
)
{
if
(
rowIndex
===
0
)
{
return
'primary-row'
;
...
...
@@ -256,6 +274,7 @@
dialogToggle
(
row
,
type
)
{
console
.
log
(
'row'
,
row
);
this
.
dialogObj
=
{
team
:
this
.
search
.
team
,
show
:
true
,
type
:
type
,
teacher_id
:
row
.
teacher_id
,
...
...
@@ -269,15 +288,17 @@
team
:
this
.
search
.
team
}
getTeamApi
(
json
).
then
(
res
=>
{
if
(
Object
.
keys
(
res
).
length
)
{
if
(
res
.
team_total
[
1
]
)
{
res
.
team_total
[
1
]
.
total
=
true
;
// 方便"合计" 可以这样写,也可以用scope.$index
res
.
team_list
.
page_data
.
unshift
(
res
.
team_total
[
1
]
);
if
(
Object
.
keys
(
res
).
length
&&
res
.
team_list
&&
res
.
team_list
.
page_data
)
{
if
(
Object
.
keys
(
res
.
team_total
).
length
)
{
res
.
team_total
.
total
=
true
;
// 方便"合计" 可以这样写,也可以用scope.$index
res
.
team_list
.
page_data
.
unshift
(
res
.
team_total
);
}
this
.
list
=
res
.
team_list
.
page_data
;
this
.
total
=
res
.
team_list
.
total
;
this
.
loading
=
false
;
}
else
{
this
.
list
=
[];
this
.
total
=
0
;
this
.
loading
=
false
;
}
}
)
...
...
src/service/api.js
View file @
b3daf8a9
...
...
@@ -1481,3 +1481,7 @@ export const getVisitedApi = function (json) {
export
const
getClassOpenedApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/teacher/reachstartclasslist`
,
json
)
};
// 获取业绩详情
export
const
getAchievementApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/teacher/teamachievement`
,
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