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
8c2b0b3c
Commit
8c2b0b3c
authored
Jul 21, 2020
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户画像页面
parent
d3b2bac2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
213 additions
and
2 deletions
+213
-2
profileapi.py
src/inspect_report/api/profileapi.py
+1
-1
tasksapi.py
src/inspect_report/api/tasksapi.py
+5
-0
profile.html
src/inspect_report/templates/inspect/profile.html
+86
-0
urls.py
src/inspect_report/urls.py
+2
-1
report_utils.py
src/inspect_report/utils/report_utils.py
+2
-0
profile.js
static/inspect/js/profile.js
+117
-0
No files found.
src/inspect_report/api/profileapi.py
View file @
8c2b0b3c
...
@@ -28,7 +28,7 @@ class ProfileApi(viewsets.ViewSet):
...
@@ -28,7 +28,7 @@ class ProfileApi(viewsets.ViewSet):
logger
.
info
(
'[profile_labels]获取的username是:
%
s'
,
username
)
logger
.
info
(
'[profile_labels]获取的username是:
%
s'
,
username
)
region
=
username
region
=
username
condition
=
{}
condition
=
{}
if
region
:
if
region
and
region
!=
'安徽picc'
:
condition
[
'region'
]
=
region
condition
[
'region'
]
=
region
profiles
=
CustomProfile
.
objects
.
filter
(
**
condition
)
.
values
(
'phone_number'
,
'region'
,
'call_recent'
,
profiles
=
CustomProfile
.
objects
.
filter
(
**
condition
)
.
values
(
'phone_number'
,
'region'
,
'call_recent'
,
'call_count'
,
'custom_labels'
)
'call_count'
,
'custom_labels'
)
...
...
src/inspect_report/api/tasksapi.py
View file @
8c2b0b3c
...
@@ -445,3 +445,8 @@ def check(request):
...
@@ -445,3 +445,8 @@ def check(request):
@
xframe_options_exempt
@
xframe_options_exempt
def
city_score
(
request
):
def
city_score
(
request
):
return
render
(
request
,
'inspect/city_score.html'
)
return
render
(
request
,
'inspect/city_score.html'
)
@
xframe_options_exempt
def
profile
(
request
):
return
render
(
request
,
'inspect/profile.html'
)
src/inspect_report/templates/inspect/profile.html
0 → 100644
View file @
8c2b0b3c
<!DOCTYPE html>
{% load static %}
<html
lang=
"en"
>
<head>
<meta
charset=
'utf-8'
/>
<title>
客户画像
</title>
<!-- 引入样式 -->
<link
rel=
"stylesheet"
href=
"{% static "
inspect
/
css
/
element
.
css
"
%}"
>
<!-- 引入组件库 -->
<link
rel=
'stylesheet'
type=
'text/css'
href=
"{% static "
inspect
/
css
/
all
.
css
"
%}"
>
</head>
<body
style=
'height:100%'
>
<div
class=
'child-title'
>
客户画像
</div>
<div
class=
'child-main'
id=
'childApp'
>
<div
style=
'text-align:right;'
class=
'childTitle'
>
<div
class=
'childTitleName'
>
客户标签统计
</div>
<el-select
v-model=
"cityvalue"
filterable
placeholder=
"请选择市"
@
change=
"changeCity"
>
<el-option
v-for=
"item in cityList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.name"
>
</el-option>
</el-select>
</div>
<div
id=
'main'
style=
'margin-top:20px'
>
<el-table
:data=
"tableData"
border
height=
"600"
:default-sort=
"{prop: 'ranking', order: 'descending'}"
style=
"width: 100%"
>
<el-table-column
prop=
"region"
label=
"所属地市"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"phone_number"
label=
"客户手机号"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"call_recent"
label=
"最近通话日期"
width=
"200"
>
</el-table-column>
<el-table-column
prop=
"call_count"
label=
"通话次数"
width=
"100"
>
</el-table-column>
<el-table-column
prop=
"custom_labels"
label=
"客户标签"
>
</el-table-column>
</el-table>
<el-pagination
@
current-change=
'CurrentChange'
style=
'margin: 0 auto;text-align:center;margin-bottom:20px;'
layout=
"prev, pager, next"
:hide-on-single-page=
"isHidePage"
background
:page-size=
"pagesize"
:total=
"total"
>
</el-pagination>
</div>
</div>
<script
type=
"text/javascript"
>
window
.
onload
=
function
(){
};
</script>
<script
src=
"{% static "
inspect
/
js
/
vue
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
inspect
/
js
/
element
.
js
"
%}"
></script>
<script
src=
"{% static "
inspect
/
js
/
echarts
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
inspect
/
js
/
http
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
inspect
/
js
/
profile
.
js
"
%}"
></script>
</body>
</html>
src/inspect_report/urls.py
View file @
8c2b0b3c
...
@@ -15,7 +15,7 @@ Including another URLconf
...
@@ -15,7 +15,7 @@ Including another URLconf
"""
"""
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.urls
import
path
from
django.urls
import
path
from
.api.tasksapi
import
rule
,
seat
,
group
,
score
,
check
,
city_score
from
.api.tasksapi
import
rule
,
seat
,
group
,
score
,
check
,
city_score
,
profile
from
.views
import
stat_rules_every
,
stat_seats_every
,
stat_scores_every
,
stat_time_every
,
stat_data_every
from
.views
import
stat_rules_every
,
stat_seats_every
,
stat_scores_every
,
stat_time_every
,
stat_data_every
urlpatterns
=
[
urlpatterns
=
[
...
@@ -26,6 +26,7 @@ urlpatterns = [
...
@@ -26,6 +26,7 @@ urlpatterns = [
path
(
'inspect/score/'
,
score
),
path
(
'inspect/score/'
,
score
),
path
(
'inspect/check/'
,
check
),
path
(
'inspect/check/'
,
check
),
path
(
'inspect/city_score/'
,
city_score
),
path
(
'inspect/city_score/'
,
city_score
),
path
(
'inspect/profile/'
,
profile
),
path
(
'inspect/stat/rule/'
,
stat_rules_every
),
path
(
'inspect/stat/rule/'
,
stat_rules_every
),
path
(
'inspect/stat/seat/'
,
stat_seats_every
),
path
(
'inspect/stat/seat/'
,
stat_seats_every
),
path
(
'inspect/stat/score/'
,
stat_scores_every
),
path
(
'inspect/stat/score/'
,
stat_scores_every
),
...
...
src/inspect_report/utils/report_utils.py
View file @
8c2b0b3c
...
@@ -209,6 +209,8 @@ def save_custom_profile(task, check, name):
...
@@ -209,6 +209,8 @@ def save_custom_profile(task, check, name):
if
custom
:
if
custom
:
custom_name
=
custom
[
0
]
custom_name
=
custom
[
0
]
custom_phone
=
custom
[
-
1
]
custom_phone
=
custom
[
-
1
]
if
custom_phone
and
len
(
custom_phone
)
>
11
and
custom_phone
.
startswith
(
'0'
):
custom_phone
=
custom_phone
[
1
:]
profile
=
CustomProfile
.
objects
.
filter
(
phone_number
=
custom_phone
)
.
first
()
profile
=
CustomProfile
.
objects
.
filter
(
phone_number
=
custom_phone
)
.
first
()
team
=
'未找到团队'
team
=
'未找到团队'
# team = team_seat().get(check['agentName'], '未找到团队')
# team = team_seat().get(check['agentName'], '未找到团队')
...
...
static/inspect/js/profile.js
0 → 100644
View file @
8c2b0b3c
new
Vue
({
el
:
'
#childApp
'
,
data
:
function
(){
return
{
ss
:
'
sas
'
,
dateTime
:
''
,
cityList
:[],
countryList
:[],
teamList
:[],
cityvalue
:
''
,
countryvalue
:
''
,
teamvalue
:
''
,
country_show
:
false
,
team_show
:
true
,
start_date
:
''
,
isscrollTop
:
false
,
currentPage
:
1
,
pagesize
:
10
,
total
:
10
,
poppage
:
1
,
poppagesize
:
10
,
poptotal
:
10
,
poprule
:
''
,
poptables
:
''
,
popcurrentPage
:
1
,
isHidePage
:
true
,
scrollTop
:
0
,
end_date
:
''
,
poploading
:
false
,
BASEURL
:
window_url
,
dialogTableVisible
:
false
,
takeList
:[],
dateRange
:[
new
Date
(),
new
Date
()],
loading
:
true
,
poptableData
:
[],
tableData
:
[]
}
},
methods
:
{
changeCity
(
msg
)
{
console
.
log
(
msg
);
this
.
currentPage
=
1
;
this
.
cityvalue
=
msg
;
this
.
getProfile
();
// 获取统计数据
},
getCity
(){
let
that
=
this
;
var
request
=
new
XMLHttpRequest
();
let
uri
=
window_url
+
'
api/v1/agency/city/
'
;
request
.
open
(
'
GET
'
,
uri
,
false
);
request
.
send
(
null
);
if
(
request
.
status
===
200
)
{
data
=
JSON
.
parse
(
request
.
response
);
console
.
log
(
data
.
code
);
if
(
data
.
code
!=
0
){
that
.
$message
(
'
服务器错误
'
);
}
else
{
that
.
cityList
=
data
.
data
.
city_list
;
that
.
cityvalue
=
''
;
console
.
log
(
that
.
cityvalue
);
that
.
init_simple
=
true
;
}
}
else
{
that
.
$message
(
'
服务器错误
'
);
}
},
getProfile
()
{
let
that
=
this
;
let
page
=
this
.
currentPage
;
this
.
$loading
({
text
:
'
数据加载中...
'
});
RquestsGet
(
'
api/v1/profile/labels/?region=
'
+
that
.
cityvalue
).
then
(
data
=>
{
console
.
log
(
data
.
data
);
if
(
data
.
code
!=
0
)
{
that
.
$message
(
data
.
msg
);
if
(
data
.
msg
)
{
that
.
$message
(
data
.
msg
);
}
else
{
that
.
$message
(
'
服务器错误
'
)
}
}
this
.
tableData
=
data
.
data
;
this
.
total
=
data
.
count
;
this
.
isHidePage
=
!
(
data
.
data
.
length
>
0
);
if
(
!
data
.
data
)
{
this
.
$loading
().
close
();
return
false
;
}
//for(let key in data.data){
// arr.unshift([data.data[key],key])
//}
this
.
$loading
().
close
();
})
},
CurrentChange
(
page
)
{
this
.
currentPage
=
page
;
//this.tableData = this.basearr.concat(this.allData.slice((page-1)*this.pagesize,page*this.pagesize));
this
.
getProfile
();
// 获取统计数据
//that.allData = data.data;
},
dateFormat
(
date
)
{
return
date
.
getFullYear
()
+
"
-
"
+
(
date
.
getMonth
()
+
1
)
+
"
-
"
+
date
.
getDate
();
},
init
()
{
this
.
getCity
();
// 获取任务
this
.
getProfile
();
// 获取统计数据
}
},
created
()
{
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