Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhengjinlei
inspect_report
Commits
addb0f2d
Commit
addb0f2d
authored
Mar 25, 2020
by
lvshibao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据分析-违规坐席分析
parent
23d0d818
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
172 additions
and
161 deletions
+172
-161
tasksapi.py
src/inspect_report/api/tasksapi.py
+5
-1
seat.html
src/inspect_report/templates/inspect/seat.html
+1
-1
seat.js
static/inspect/js/seat.js
+166
-159
No files found.
src/inspect_report/api/tasksapi.py
View file @
addb0f2d
...
@@ -179,12 +179,14 @@ class TasksApi(viewsets.ViewSet):
...
@@ -179,12 +179,14 @@ class TasksApi(viewsets.ViewSet):
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'data'
:
data_max_return
})
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'data'
:
data_max_return
})
@
action
([
'post'
],
detail
=
False
)
@
action
([
'post'
],
detail
=
False
)
@
get_account_info
def
seat_rule
(
self
,
req
:
Request
):
def
seat_rule
(
self
,
req
:
Request
):
"""
"""
坐席违规分析-按照得分
坐席违规分析-按照得分
:param req:
:param req:
:return:
:return:
"""
"""
username
=
req
.
data
.
get
(
'username'
,
''
)
task_id
=
req
.
data
.
get
(
'task'
,
''
)
task_id
=
req
.
data
.
get
(
'task'
,
''
)
agent_name
=
req
.
data
.
get
(
'agentName'
,
''
)
agent_name
=
req
.
data
.
get
(
'agentName'
,
''
)
sort
=
req
.
data
.
get
(
'sort'
,
'des'
)
sort
=
req
.
data
.
get
(
'sort'
,
'des'
)
...
@@ -197,6 +199,8 @@ class TasksApi(viewsets.ViewSet):
...
@@ -197,6 +199,8 @@ class TasksApi(viewsets.ViewSet):
task_condition
=
{
'create_date__gte'
:
q_start_date
,
'create_date__lt'
:
q_end_date
}
task_condition
=
{
'create_date__gte'
:
q_start_date
,
'create_date__lt'
:
q_end_date
}
if
task_id
:
if
task_id
:
task_condition
[
'task'
]
=
task_id
task_condition
[
'task'
]
=
task_id
if
username
in
name_list
:
task_condition
[
'task'
]
=
username
if
agent_name
:
if
agent_name
:
task_condition
[
'agentName'
]
=
agent_name
task_condition
[
'agentName'
]
=
agent_name
if
sort
==
'des'
:
if
sort
==
'des'
:
...
@@ -232,7 +236,7 @@ class TasksApi(viewsets.ViewSet):
...
@@ -232,7 +236,7 @@ class TasksApi(viewsets.ViewSet):
for
i
in
range
(
len
(
data_sort
)):
for
i
in
range
(
len
(
data_sort
)):
data_sort
[
i
][
'ranking'
]
=
(
int
(
page
)
-
1
)
*
int
(
page_size
)
+
i
+
1
data_sort
[
i
][
'ranking'
]
=
(
int
(
page
)
-
1
)
*
int
(
page_size
)
+
i
+
1
data_sort
[
i
][
'ratio'
]
=
'{0}
%
'
.
format
(
int
(
data_sort
[
i
][
'ratio'
]
*
100
))
data_sort
[
i
][
'ratio'
]
=
'{0}
%
'
.
format
(
int
(
data_sort
[
i
][
'ratio'
]
*
100
))
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'count'
:
total_count
,
'data'
:
data_sort
})
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'count'
:
total_count
,
'data'
:
data_sort
,
'username'
:
username
})
@
action
([
'post'
],
detail
=
False
)
@
action
([
'post'
],
detail
=
False
)
@
get_account_info
@
get_account_info
...
...
src/inspect_report/templates/inspect/seat.html
View file @
addb0f2d
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
end-placeholder=
"结束日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
>
:default-time=
"['00:00:00', '23:59:59']"
>
</el-date-picker>
</el-date-picker>
<el-select
v-model=
"taskvalue"
filterable
placeholder=
"请选择"
@
change=
"changeTask"
>
<el-select
v-
if=
"sel_is_show == true"
v-
model=
"taskvalue"
filterable
placeholder=
"请选择"
@
change=
"changeTask"
>
<el-option
<el-option
v-for=
"item in taskList"
v-for=
"item in taskList"
:key=
"item.id"
:key=
"item.id"
...
...
static/inspect/js/seat.js
View file @
addb0f2d
new
Vue
({
new
Vue
({
el
:
'
#childApp
'
,
el
:
'
#childApp
'
,
data
:
function
(){
data
:
function
()
{
return
{
return
{
ss
:
'
sas
'
,
ss
:
'
sas
'
,
dateRange
:[
new
Date
(),
new
Date
()],
dateRange
:
[
new
Date
(),
new
Date
()],
taskList
:[],
taskList
:
[],
taskvalue
:
''
,
taskvalue
:
''
,
start_date
:
''
,
start_date
:
''
,
end_date
:
''
,
end_date
:
''
,
takeList
:[],
takeList
:
[],
takevalue
:
''
,
takevalue
:
''
,
loading
:
true
,
loading
:
true
,
tableData
:
[],
tableData
:
[],
sortObj
:{
sortObj
:
{
name
:
''
,
name
:
''
,
sort
:
'
des
'
,
sort
:
'
des
'
,
},
},
BASEURL
:
window_url
,
sel_is_show
:
true
,
currentPage
:
1
,
BASEURL
:
window_url
,
pagesize
:
15
,
currentPage
:
1
,
total
:
10
,
pagesize
:
15
,
isHidePage
:
true
,
total
:
10
,
}
isHidePage
:
true
,
},
}
methods
:
{
loadData
(){
this
.
$refs
.
loadModal
.
submit
();
this
.
$message
(
'
文件下载中请稍后...
'
);
},
},
changeRange
(
dateRange
){
methods
:
{
console
.
log
(
dateRange
);
loadData
()
{
this
.
start_date
=
dateRange
[
0
];
this
.
$refs
.
loadModal
.
submit
();
this
.
end_date
=
dateRange
[
1
];
this
.
$message
(
'
文件下载中请稍后...
'
);
this
.
currentPage
=
1
;
},
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
changeRange
(
dateRange
)
{
},
console
.
log
(
dateRange
);
changeTask
(
msg
){
this
.
start_date
=
dateRange
[
0
];
console
.
log
(
msg
);
this
.
end_date
=
dateRange
[
1
];
this
.
currentPage
=
1
;
this
.
currentPage
=
1
;
this
.
taskvalue
=
msg
;
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getTake
()
},
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
changeTask
(
msg
)
{
},
console
.
log
(
msg
);
changeTake
(
msg
){
this
.
currentPage
=
1
;
this
.
currentPage
=
1
;
this
.
taskvalue
=
msg
;
this
.
takevalue
=
msg
;
this
.
getTake
()
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
console
.
log
(
msg
);
},
},
changeTake
(
msg
)
{
getTask
(){
this
.
currentPage
=
1
;
let
that
=
this
;
this
.
takevalue
=
msg
;
that
.
taskList
=
[
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
{
id
:
''
,
name
:
'
全省
'
},
console
.
log
(
msg
);
{
id
:
'
合肥
'
,
name
:
'
合肥
'
},
},
{
id
:
'
芜湖
'
,
name
:
'
芜湖
'
},
getTask
()
{
{
id
:
'
蚌埠
'
,
name
:
'
蚌埠
'
},
let
that
=
this
;
{
id
:
'
淮南
'
,
name
:
'
淮南
'
},
that
.
taskList
=
[
{
id
:
'
马鞍山
'
,
name
:
'
马鞍山
'
},
{
id
:
''
,
name
:
'
全省
'
},
{
id
:
'
淮北
'
,
name
:
'
淮北
'
},
{
id
:
'
合肥
'
,
name
:
'
合肥
'
},
{
id
:
'
铜陵
'
,
name
:
'
铜陵
'
},
{
id
:
'
芜湖
'
,
name
:
'
芜湖
'
},
{
id
:
'
安庆
'
,
name
:
'
安庆
'
},
{
id
:
'
蚌埠
'
,
name
:
'
蚌埠
'
},
{
id
:
'
黄山
'
,
name
:
'
黄山
'
},
{
id
:
'
淮南
'
,
name
:
'
淮南
'
},
{
id
:
'
滁州
'
,
name
:
'
滁州
'
},
{
id
:
'
马鞍山
'
,
name
:
'
马鞍山
'
},
{
id
:
'
阜阳
'
,
name
:
'
阜阳
'
},
{
id
:
'
淮北
'
,
name
:
'
淮北
'
},
{
id
:
'
亳州
'
,
name
:
'
亳州
'
},
{
id
:
'
铜陵
'
,
name
:
'
铜陵
'
},
{
id
:
'
宿州
'
,
name
:
'
宿州
'
},
{
id
:
'
安庆
'
,
name
:
'
安庆
'
},
{
id
:
'
六安
'
,
name
:
'
六安
'
},
{
id
:
'
黄山
'
,
name
:
'
黄山
'
},
{
id
:
'
宣城
'
,
name
:
'
宣城
'
},
{
id
:
'
滁州
'
,
name
:
'
滁州
'
},
{
id
:
'
巢湖
'
,
name
:
'
巢湖
'
},
{
id
:
'
阜阳
'
,
name
:
'
阜阳
'
},
{
id
:
'
池州
'
,
name
:
'
池州
'
},
{
id
:
'
亳州
'
,
name
:
'
亳州
'
},
{
id
:
'
安徽省营业部
'
,
name
:
'
安徽省营业部
'
},
{
id
:
'
宿州
'
,
name
:
'
宿州
'
},
];
{
id
:
'
六安
'
,
name
:
'
六安
'
},
//RquestsGet('api/v1/tasks/obtain/').then(data => {
{
id
:
'
宣城
'
,
name
:
'
宣城
'
},
// //console.log(data);
{
id
:
'
巢湖
'
,
name
:
'
巢湖
'
},
// if(data.code != 0){
{
id
:
'
池州
'
,
name
:
'
池州
'
},
// that.taskList = [{id:'',name:'全部任务'}];
{
id
:
'
安徽省营业部
'
,
name
:
'
安徽省营业部
'
},
// }else{
];
// that.taskList = [{id:'',name:'全部任务'}].concat(data.data);
//RquestsGet('api/v1/tasks/obtain/').then(data => {
// that.getTake()
// //console.log(data);
// }
// if(data.code != 0){
//})
// that.taskList = [{id:'',name:'全部任务'}];
},
// }else{
getTake
(){
// that.taskList = [{id:'',name:'全部任务'}].concat(data.data);
let
that
=
this
;
// that.getTake()
RquestsGet
(
'
api/v1/tasks/seat/?task=
'
+
that
.
taskvalue
).
then
(
data
=>
{
// }
//console.log(data);
//})
},
getTake
()
{
let
that
=
this
;
RquestsGet
(
'
api/v1/tasks/seat/?task=
'
+
that
.
taskvalue
).
then
(
data
=>
{
//console.log(data);
if
(
data
.
code
!=
0
){
if
(
data
.
code
!=
0
)
{
//that.takeList = [{agentName:'全部坐席'}]
//that.takeList = [{agentName:'全部坐席'}]
}
else
{
}
else
{
that
.
takeList
=
data
.
data
;
that
.
takeList
=
data
.
data
;
}
}
})
})
},
},
sortChange
(
item
){
sortChange
(
item
)
{
console
.
log
(
item
);
console
.
log
(
item
);
let
order
;
let
order
;
if
(
item
.
order
==
'
descending
'
){
if
(
item
.
order
==
'
descending
'
)
{
order
=
'
des
'
;
order
=
'
des
'
;
}
else
if
(
item
.
order
==
'
ascending
'
){
}
else
if
(
item
.
order
==
'
ascending
'
)
{
order
=
'
asc
'
;
order
=
'
asc
'
;
}
else
{
}
else
{
order
=
null
;
order
=
null
;
}
}
this
.
sortObj
=
{
this
.
sortObj
=
{
name
:
item
.
prop
,
name
:
item
.
prop
,
sort
:
order
sort
:
order
}
}
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
},
},
getRule
(
task
,
start_date
,
end_date
,
agentName
){
getRule
(
task
,
start_date
,
end_date
,
agentName
)
{
let
that
=
this
;
let
that
=
this
;
let
page
=
this
.
currentPage
;
let
page
=
this
.
currentPage
;
let
arr
=
[];
let
arr
=
[];
this
.
$loading
({
text
:
'
数据加载中...
'
});
this
.
$loading
({
text
:
'
数据加载中...
'
});
let
sort
=
this
.
sortObj
.
sort
;
let
sort
=
this
.
sortObj
.
sort
;
RquestsPost
(
'
api/v1/tasks/seat_rule/
'
,{
task
,
start_date
,
end_date
,
agentName
,
page
,
sort
}).
then
(
data
=>
{
RquestsPost
(
'
api/v1/tasks/seat_rule/
'
,
{
task
,
start_date
,
end_date
,
agentName
,
page
,
sort
}).
then
(
data
=>
{
console
.
log
(
data
.
data
);
console
.
log
(
data
.
data
);
if
(
data
.
code
!=
0
){
if
(
data
.
code
!=
0
)
{
that
.
$message
(
data
.
msg
);
that
.
$message
(
data
.
msg
);
if
(
data
.
msg
){
if
(
data
.
msg
)
{
that
.
$message
(
data
.
msg
);
that
.
$message
(
data
.
msg
);
}
else
{
}
else
{
that
.
$message
(
'
服务器错误
'
)
that
.
$message
(
'
服务器错误
'
)
}
}
}
}
this
.
tableData
=
data
.
data
;
if
([
'
合肥
'
,
'
芜湖
'
,
'
淮北
'
,
'
安庆
'
,
'
黄山
'
,
'
滁州
'
,
'
阜阳
'
,
'
亳州
'
,
'
宿州
'
,
'
六安
'
,
'
宣城
'
,
'
巢湖
'
,
'
池州
'
,
'
淮南
'
,
'
安徽省营业部
'
,
'
蚌埠
'
,
'
马鞍山
'
,
'
铜陵
'
].
indexOf
(
data
.
username
)
!==
-
1
)
{
this
.
total
=
data
.
count
;
that
.
sel_is_show
=
false
;
this
.
isHidePage
=
!
(
data
.
data
.
length
>
0
);
that
.
taskvalue
=
data
.
username
;
if
(
!
data
.
data
){
}
else
{
that
.
sel_is_show
=
true
;
}
this
.
tableData
=
data
.
data
;
this
.
total
=
data
.
count
;
this
.
isHidePage
=
!
(
data
.
data
.
length
>
0
);
if
(
!
data
.
data
)
{
this
.
$loading
().
close
();
this
.
$loading
().
close
();
return
false
;
return
false
;
}
}
//for(let key in data.data){
//for(let key in data.data){
// arr.unshift([data.data[key],key])
// arr.unshift([data.data[key],key])
//}
//}
this
.
$loading
().
close
();
this
.
$loading
().
close
();
})
})
},
},
CurrentChange
(
page
)
{
CurrentChange
(
page
)
{
this
.
currentPage
=
page
;
this
.
currentPage
=
page
;
//this.tableData = this.basearr.concat(this.allData.slice((page-1)*this.pagesize,page*this.pagesize));
//this.tableData = this.basearr.concat(this.allData.slice((page-1)*this.pagesize,page*this.pagesize));
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
//that.allData = data.data;
//that.allData = data.data;
},
},
dateFormat
(
date
)
{
dateFormat
(
date
)
{
return
date
.
getFullYear
()
+
"
-
"
+
(
date
.
getMonth
()
+
1
)
+
"
-
"
+
date
.
getDate
();
return
date
.
getFullYear
()
+
"
-
"
+
(
date
.
getMonth
()
+
1
)
+
"
-
"
+
date
.
getDate
();
},
},
init
()
{
init
()
{
this
.
dateRange
=
[
new
Date
(
new
Date
()
-
24
*
60
*
60
*
1000
),
new
Date
()];
this
.
dateRange
=
[
new
Date
(
new
Date
()
-
24
*
60
*
60
*
1000
),
new
Date
()];
this
.
start_date
=
this
.
dateFormat
(
new
Date
(
new
Date
()
-
24
*
60
*
60
*
1000
));
this
.
start_date
=
this
.
dateFormat
(
new
Date
(
new
Date
()
-
24
*
60
*
60
*
1000
));
this
.
end_date
=
this
.
dateFormat
(
new
Date
());
this
.
end_date
=
this
.
dateFormat
(
new
Date
());
this
.
getTask
();
// 获取任务
this
.
getTask
();
// 获取任务
//this.getTake(); // 获取坐席
//this.getTake(); // 获取坐席
console
.
log
(
this
.
dateRange
);
console
.
log
(
this
.
dateRange
);
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
}
}
},
},
created
()
{
created
()
{
this
.
init
()
this
.
init
()
},
},
})
})
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