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
1a1b1120
Commit
1a1b1120
authored
Apr 24, 2020
by
lvshibao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rule页面修改
parent
a2b72d45
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
33 deletions
+95
-33
agency.py
src/inspect_report/agency.py
+15
-12
agencyapi.py
src/inspect_report/api/agencyapi.py
+22
-0
dataapi.py
src/inspect_report/api/dataapi.py
+2
-1
tasksapi.py
src/inspect_report/api/tasksapi.py
+4
-2
rule.html
src/inspect_report/templates/inspect/rule.html
+13
-0
rule.js
static/inspect/js/rule.js
+39
-18
No files found.
src/inspect_report/agency.py
View file @
1a1b1120
...
@@ -3,7 +3,10 @@ from django.db.models import Q
...
@@ -3,7 +3,10 @@ from django.db.models import Q
from
inspect_report.models
import
Team
,
Country
from
inspect_report.models
import
Team
,
Country
def
get_team_names
(
city_id
,
country_id
):
def
get_team_names
(
city_id
,
country_id
,
team_id
=
None
):
if
team_id
is
not
None
and
team_id
!=
''
:
team_names
=
Team
.
objects
.
filter
(
id
=
team_id
)
.
values_list
(
'name'
)
else
:
# # 获取坐席团队关系
# # 获取坐席团队关系
team_names
=
list
()
team_names
=
list
()
if
city_id
and
country_id
:
if
city_id
and
country_id
:
...
...
src/inspect_report/api/agencyapi.py
View file @
1a1b1120
...
@@ -77,3 +77,25 @@ class AgencyApi(viewsets.ViewSet):
...
@@ -77,3 +77,25 @@ class AgencyApi(viewsets.ViewSet):
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'data'
:
{
'country_list'
:
country_list
}})
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'data'
:
{
'country_list'
:
country_list
}})
else
:
else
:
return
Response
({
'code'
:
-
1
,
'msg'
:
'未找到对应的县市'
})
return
Response
({
'code'
:
-
1
,
'msg'
:
'未找到对应的县市'
})
@
action
([
'get'
],
detail
=
False
)
def
team
(
self
,
req
:
Request
):
"""
查询任务列表
:param req:
:return:
"""
city_id
=
req
.
GET
.
get
(
'city_id'
,
''
)
country_id
=
req
.
GET
.
get
(
'country_id'
,
''
)
team_list
=
list
()
top
=
Country
.
objects
.
filter
(
id
=
city_id
)
.
first
()
if
top
is
not
None
:
if
top
.
parent
is
None
:
pass
elif
country_id
is
None
or
country_id
==
''
:
team_list
=
Team
.
objects
.
filter
(
country_id
=
city_id
)
.
values
(
'id'
,
'name'
)
else
:
team_list
=
Team
.
objects
.
filter
(
country_id
=
country_id
)
.
values
(
'id'
,
'name'
)
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'data'
:
{
'team_list'
:
team_list
}})
else
:
return
Response
({
'code'
:
-
1
,
'msg'
:
'未找到对应的县市'
})
src/inspect_report/api/dataapi.py
View file @
1a1b1120
...
@@ -76,9 +76,10 @@ class DataApi(viewsets.ViewSet):
...
@@ -76,9 +76,10 @@ class DataApi(viewsets.ViewSet):
"""
"""
city_id
=
req
.
GET
.
get
(
'city'
,
None
)
city_id
=
req
.
GET
.
get
(
'city'
,
None
)
country_id
=
req
.
GET
.
get
(
'country'
,
None
)
country_id
=
req
.
GET
.
get
(
'country'
,
None
)
team_id
=
req
.
GET
.
get
(
'country'
,
None
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
team_names
=
get_team_names
(
city_id
,
country_id
)
team_names
=
get_team_names
(
city_id
,
country_id
,
team_id
)
task_condition
[
'task__in'
]
=
team_names
task_condition
[
'task__in'
]
=
team_names
...
...
src/inspect_report/api/tasksapi.py
View file @
1a1b1120
...
@@ -466,8 +466,9 @@ class TasksApi(viewsets.ViewSet):
...
@@ -466,8 +466,9 @@ class TasksApi(viewsets.ViewSet):
city_id
=
req
.
data
.
get
(
'city'
,
None
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
team_names
=
get_team_names
(
city_id
,
country_id
)
team_names
=
get_team_names
(
city_id
,
country_id
,
team_id
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
...
@@ -509,6 +510,7 @@ class TasksApi(viewsets.ViewSet):
...
@@ -509,6 +510,7 @@ class TasksApi(viewsets.ViewSet):
"""
"""
city_id
=
req
.
data
.
get
(
'city'
,
None
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
tables
=
req
.
data
.
get
(
'tables'
,
''
)
tables
=
req
.
data
.
get
(
'tables'
,
''
)
rule_name
=
req
.
data
.
get
(
'rule'
,
''
)
rule_name
=
req
.
data
.
get
(
'rule'
,
''
)
page
=
req
.
data
.
get
(
'page'
,
'1'
)
page
=
req
.
data
.
get
(
'page'
,
'1'
)
...
@@ -520,7 +522,7 @@ class TasksApi(viewsets.ViewSet):
...
@@ -520,7 +522,7 @@ class TasksApi(viewsets.ViewSet):
session_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
session_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
session_condition
[
'rule'
]
=
rule_name
session_condition
[
'rule'
]
=
rule_name
session_condition
[
'sessionCollectionId__in'
]
=
table_list
session_condition
[
'sessionCollectionId__in'
]
=
table_list
session_condition
[
'task__in'
]
=
get_team_names
(
city_id
,
country_id
)
session_condition
[
'task__in'
]
=
get_team_names
(
city_id
,
country_id
,
team_id
)
checks
=
RulesStat
.
objects
.
filter
(
**
session_condition
)
.
values
(
'agentName'
,
'customName'
,
'remainTime'
,
'score'
,
checks
=
RulesStat
.
objects
.
filter
(
**
session_condition
)
.
values
(
'agentName'
,
'customName'
,
'remainTime'
,
'score'
,
'sessionCollectionId'
,
'sessionId'
,
'taskId'
)
'sessionCollectionId'
,
'sessionId'
,
'taskId'
)
paginator
=
Paginator
(
checks
,
page_size
)
paginator
=
Paginator
(
checks
,
page_size
)
...
...
src/inspect_report/templates/inspect/rule.html
View file @
1a1b1120
...
@@ -107,12 +107,25 @@
...
@@ -107,12 +107,25 @@
:value=
"item.id"
>
:value=
"item.id"
>
</el-option>
</el-option>
</el-select>
</el-select>
<el-select
v-model=
"teamvalue"
v-if=
"team_show == true"
filterable
placeholder=
"请选择团队"
@
change=
"changeTeam"
>
<el-option
label=
"全部县"
value=
""
>
</el-option>
<el-option
v-for=
"item in teamList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
</el-option>
</el-select>
<el-button
type=
'primary'
size=
'mini'
style=
'height:30px;'
@
click=
'loadData()'
>
<el-button
type=
'primary'
size=
'mini'
style=
'height:30px;'
@
click=
'loadData()'
>
导出数据
导出数据
</el-button>
</el-button>
<form
ref=
"loadModal"
:action=
"`${BASEURL}api/v1/data/static_rule_export/`"
method=
"get"
>
<form
ref=
"loadModal"
:action=
"`${BASEURL}api/v1/data/static_rule_export/`"
method=
"get"
>
<input
type=
"hidden"
name=
"city"
:value=
"cityvalue"
>
<input
type=
"hidden"
name=
"city"
:value=
"cityvalue"
>
<input
type=
"hidden"
name=
"country"
:value=
"countryvalue"
>
<input
type=
"hidden"
name=
"country"
:value=
"countryvalue"
>
<input
type=
"hidden"
name=
"team"
:value=
"teamvalue"
>
<input
type=
"hidden"
name=
"start_date"
:value=
"start_date"
>
<input
type=
"hidden"
name=
"start_date"
:value=
"start_date"
>
<input
type=
"hidden"
name=
"end_date"
:value=
"end_date"
>
<input
type=
"hidden"
name=
"end_date"
:value=
"end_date"
>
</form>
</form>
...
...
static/inspect/js/rule.js
View file @
1a1b1120
...
@@ -6,9 +6,12 @@ new Vue({
...
@@ -6,9 +6,12 @@ new Vue({
dateTime
:
''
,
dateTime
:
''
,
cityList
:[],
cityList
:[],
countryList
:[],
countryList
:[],
teamList
:[],
cityvalue
:
null
,
cityvalue
:
null
,
countryvalue
:
null
,
countryvalue
:
null
,
teamvalue
:
null
,
country_show
:
false
,
country_show
:
false
,
team_show
:
true
,
start_date
:
''
,
start_date
:
''
,
isscrollTop
:
false
,
isscrollTop
:
false
,
currentPage
:
1
,
currentPage
:
1
,
...
@@ -58,13 +61,39 @@ new Vue({
...
@@ -58,13 +61,39 @@ new Vue({
console
.
log
(
msg
);
console
.
log
(
msg
);
this
.
cityvalue
=
msg
;
this
.
cityvalue
=
msg
;
this
.
countryvalue
=
null
;
this
.
countryvalue
=
null
;
this
.
getCountry
(
this
.
cityvalue
);
this
.
teamvalue
=
null
;
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getCountry
();
this
.
getTeam
();
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
teamvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
},
},
changeCountry
(
msg
){
changeCountry
(
msg
){
console
.
log
(
msg
);
console
.
log
(
msg
);
this
.
countryvalue
=
msg
;
this
.
countryvalue
=
msg
;
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
teamvalue
=
null
;
this
.
getTeam
();
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
teamvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
},
changeTeam
(
msg
){
console
.
log
(
msg
);
this
.
teamvalue
=
msg
;
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
teamvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
},
getTeam
()
{
let
that
=
this
;
RquestsGet
(
'
api/v1/agency/team/?country_id=
'
+
this
.
countryvalue
+
'
&city_id=
'
+
this
.
cityvalue
).
then
(
data
=>
{
//console.log(data);
if
(
data
.
code
!=
0
)
{
that
.
$message
(
'
服务器错误
'
)
}
else
{
that
.
teamList
=
data
.
data
.
team_list
;
if
(
that
.
teamList
.
length
>
0
)
{
that
.
team_show
=
true
;
}
else
{
that
.
team_show
=
false
;
};
}
})
},
},
getCountry
()
{
getCountry
()
{
let
that
=
this
;
let
that
=
this
;
...
@@ -111,15 +140,6 @@ new Vue({
...
@@ -111,15 +140,6 @@ new Vue({
}
else
{
}
else
{
that
.
$message
(
'
服务器错误
'
);
that
.
$message
(
'
服务器错误
'
);
}
}
//RquestsGet('api/v1/tasks/obtain/').then(data => {
// //console.log(data);
// if(data.code != 0){
// that.taskList = [{id:'',name:'全部任务'}];
// }else{
// that.taskList = [{id:'',name:'全部任务'}].concat(data.data);
// that.getTake()
// }
//})
},
},
CurrentChange
(
page
){
CurrentChange
(
page
){
this
.
currentPage
=
page
;
this
.
currentPage
=
page
;
...
@@ -128,13 +148,13 @@ new Vue({
...
@@ -128,13 +148,13 @@ new Vue({
this
.
poppage
=
page
;
this
.
poppage
=
page
;
this
.
getDetail
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
poptables
,
this
.
poprule
,
this
.
poppage
,
this
.
poppagesize
);
this
.
getDetail
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
poptables
,
this
.
poprule
,
this
.
poppage
,
this
.
poppagesize
);
},
},
getRule
(
city
,
country
,
start_date
,
end_date
,
agentName
){
getRule
(
city
,
country
,
team
,
start_date
,
end_date
,
agentName
){
let
that
=
this
;
let
that
=
this
;
console
.
log
(
start_date
,
end_date
);
console
.
log
(
start_date
,
end_date
);
let
arr
=
[];
let
arr
=
[];
this
.
$loading
({
text
:
'
数据加载中...
'
});
this
.
$loading
({
text
:
'
数据加载中...
'
});
RquestsPost
(
'
api/v1/tasks/static_rule/
'
,{
city
,
country
,
end_date
,
start_date
,
agentName
}).
then
(
data
=>
{
RquestsPost
(
'
api/v1/tasks/static_rule/
'
,{
city
,
country
,
team
,
end_date
,
start_date
,
agentName
}).
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
);
...
@@ -189,15 +209,15 @@ new Vue({
...
@@ -189,15 +209,15 @@ new Vue({
this
.
popcurrentPage
=
1
;
this
.
popcurrentPage
=
1
;
this
.
poppage
=
1
;
this
.
poppage
=
1
;
//this.taskvalue = tableData.area;
//this.taskvalue = tableData.area;
this
.
getDetail
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
poptables
,
this
.
poprule
,
this
.
poppage
,
this
.
poppagesize
);
this
.
getDetail
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
teamvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
poptables
,
this
.
poprule
,
this
.
poppage
,
this
.
poppagesize
);
},
},
getDetail
(
city
,
country
,
start_date
,
end_date
,
tables
,
rule
,
page
,
page_size
){
getDetail
(
city
,
country
,
team
,
start_date
,
end_date
,
tables
,
rule
,
page
,
page_size
){
//this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
//this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
let
that
=
this
;
let
that
=
this
;
this
.
$loading
({
text
:
'
数据加载中...
'
});
this
.
$loading
({
text
:
'
数据加载中...
'
});
this
.
poploading
=
true
;
this
.
poploading
=
true
;
RquestsPost
(
'
api/v1/tasks/rule_detail/
'
,{
city
,
country
,
end_date
,
start_date
,
tables
,
rule
,
page
,
page_size
}).
then
(
data
=>
{
RquestsPost
(
'
api/v1/tasks/rule_detail/
'
,{
city
,
country
,
team
,
end_date
,
start_date
,
tables
,
rule
,
page
,
page_size
}).
then
(
data
=>
{
console
.
log
(
data
.
data
);
console
.
log
(
data
.
data
);
this
.
$loading
().
close
();
this
.
$loading
().
close
();
this
.
dialogTableVisible
=
true
;
this
.
dialogTableVisible
=
true
;
...
@@ -251,9 +271,10 @@ new Vue({
...
@@ -251,9 +271,10 @@ new Vue({
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
.
getCity
();
// 获取任务
this
.
getCity
();
// 获取任务
this
.
getTeam
();
//this.getTake(); // 获取坐席
//this.getTake(); // 获取坐席
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getRule
(
this
.
cityvalue
,
this
.
countryvalue
,
this
.
teamvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
}
}
},
},
...
...
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