Commit 410c43a0 authored by zhengjinlei's avatar zhengjinlei

增加报表

parent f917478d
...@@ -573,7 +573,7 @@ class TasksApi(viewsets.ViewSet): ...@@ -573,7 +573,7 @@ class TasksApi(viewsets.ViewSet):
:return: :return:
""" """
agent_name = req.data.get('agentName', '') agent_name = req.data.get('agentName', '')
area = req.data.get('area', '') area = req.data.get('task', '')
page = req.data.get('page', '1') page = req.data.get('page', '1')
page_size = req.data.get('page_size', '10') page_size = req.data.get('page_size', '10')
start_date = req.data.get('start_date', (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d')) start_date = req.data.get('start_date', (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d'))
......
...@@ -173,33 +173,45 @@ ...@@ -173,33 +173,45 @@
<div id='main' style='width:100%;padding-bottom:20px'> <div id='main' style='width:100%;padding-bottom:20px'>
<el-table <el-table
:data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)" :data="tableData"
border border
style="width: 100%;margin-bottom:20px;"> style="width: 100%;margin-bottom:20px;">
<el-table-column <el-table-column
prop="rule" prop="area"
label="违规项" label="地市"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="count" prop="total_session"
label="违规次数" label="全部会话数"
width="180"> >
</el-table-column>
<el-table-column
prop="validate_num"
label="触发违规项次数">
</el-table-column>
<el-table-column
prop="avg_score_svc"
label="服务类平均分">
</el-table-column>
<el-table-column
prop="avg_score_bus"
label="业务类平均分">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="call_count" prop="avg_score"
label="通话次数"> label="总平均分(包含0分项)">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="ratio" prop="validate_zero"
label="违规占比"> label="触发0分项次数">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
width="120"> width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@click.native.prevent="rowDetail(scope.$index, tableData)" @click.native.prevent="rowDetail(scope.$index, scope.row)"
type="text" type="text"
size="small"> size="small">
详情 详情
......
...@@ -8,15 +8,74 @@ ...@@ -8,15 +8,74 @@
<link rel="stylesheet" href="{% static "inspect/css/element.css" %}"> <link rel="stylesheet" href="{% static "inspect/css/element.css" %}">
<!-- 引入组件库 --> <!-- 引入组件库 -->
<link rel='stylesheet' type='text/css' href="{% static "inspect/css/all.css" %}"> <link rel='stylesheet' type='text/css' href="{% static "inspect/css/all.css" %}">
<style>
#OneTime{
display: inline-block;
}
#OneTime .el-input__icon {
line-height: 32px;
}
#OneTime .el-input .el-input__inner {
padding-left: 30px;
}
.groutTitle span{
display:inline-block;
margin-right: 20px;
color:#565656;
font-size:15px;
}
.groutTitle{
display: flex;
flex-direction: row;
margin-bottom: 20px;
margin-top: 10px;
}
.groutTitle > div{
order: 1;
flex-grow: 1;
background-color:#fff;
}
.groutTitle > div:nth-child(2){
margin: 0 10px;
}
.groutTitle > div:last-child{
margin-left:10px;
}
.groutTitle .grid-content{
padding: 20px;
}
.groutTitle .grid-content .icon{
font-size: 30px;
margin-right:10px;
}
.groutTitle .grid-content div{
display: inline-block;
vertical-align: middle;
}
.groutTitle .grid-content .content-value{
font-size: 30px;
}
#main{
background-color: #fff;
}
.el-dialog{
width: 700px
}
.is-fullscreen{
//z-index: 2222 !important;
}
#dialogDetail .el-table{
//min-height: 500px ;
}
</style>
</head> </head>
<body style='height:100%'> <body style='height:100%'>
<div class='child-title'>语音坐席</div> <div class='child-title'>语音坐席</div>
<div class='child-main' id='childApp'> <div class='child-main' id='childApp'>
<div style='text-align:right;' class='childTitle'> <div style='text-align:right;margin-bottom:15px;' class='childTitle'>
<div class='childTitleName'>违规项分析</div> <div class='childTitleName'>违规项分析</div>
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
...@@ -36,23 +95,58 @@ ...@@ -36,23 +95,58 @@
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="takevalue" filterable placeholder="请选择" @change='changeTake'>
<el-option
label="全部坐席"
value="">
</el-option>
<el-option
v-for="item in takeList"
:key="item.agentName"
:label="item.agentName"
:value="item.agentName">
</el-option>
</el-select>
</div> </div>
<div id='main' style='width:80%;height:600px' v-loading='true'></div> <div id='main' style='width:100%;padding-bottom:20px'>
<el-dialog title="详情" v-loading='poploading' width='700px' :visible.sync="dialogTableVisible">
<el-table style='margin-top:-20px' :data="tableData" height='400'> <el-table
:data="tableData"
border
style="width: 100%;margin-bottom:20px;">
<el-table-column
prop="rule"
label="违规项"
>
</el-table-column>
<el-table-column
prop="count"
label="违规次数"
width="180">
</el-table-column>
<el-table-column
prop="call_count"
label="通话次数">
</el-table-column>
<el-table-column
prop="ratio"
label="违规占比">
</el-table-column>
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-button
@click.native.prevent="rowDetail(scope.$index, tableData)"
type="text"
size="small">
详情
</el-button>
</template>
</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
:total="total">
</el-pagination>
-->
</div>
<el-dialog id='dialogDetail' v-loading='poploading' title="详情" :visible.sync="dialogTableVisible">
<el-table style='margin-top:-20px' :data="poptableData" height='300'>
<el-table-column prop="agentName" label="坐席id" width='190'></el-table-column> <el-table-column prop="agentName" label="坐席id" width='190'></el-table-column>
<el-table-column prop="customName" label="客户" width='190'></el-table-column> <el-table-column prop="customName" label="客户" width='190'></el-table-column>
<el-table-column prop="remainTime" label="通话时间(秒)"> <el-table-column prop="remainTime" label="通话时间(秒)">
...@@ -76,7 +170,11 @@ ...@@ -76,7 +170,11 @@
:page-size="poppagesize" :page-size="poppagesize"
:total="poptotal"> :total="poptotal">
</el-pagination> </el-pagination>
</el-dialog> </el-dialog>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function(){ window.onload = function(){
......
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
.groutTitle span{ .groutTitle span{
display:inline-block; display:inline-block;
margin-right: 20px; margin-right: 20px;
color:#565656; }
font-size:15px; .groutTitle button{
color:#409EFF!important;
} }
.groutTitle{ .groutTitle{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 10px; margin-top: 10px;
...@@ -39,13 +40,13 @@ ...@@ -39,13 +40,13 @@
background-color:#fff; background-color:#fff;
} }
.groutTitle > div:nth-child(2){ .groutTitle > div:nth-child(2){
margin: 0 10px; margin: 0 10px;
} }
.groutTitle .grid-content{ .groutTitle .grid-content{
padding: 20px; padding: 20px;
} }
.groutTitle .grid-content .icon{ .groutTitle .grid-content .icon{
font-size: 30px; font-size: 30px;
margin-right:10px; margin-right:10px;
} }
.groutTitle .grid-content div{ .groutTitle .grid-content div{
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
vertical-align: middle; vertical-align: middle;
} }
.groutTitle .grid-content .content-value{ .groutTitle .grid-content .content-value{
font-size: 30px; font-size: 30px;
} }
#main{ #main{
background-color: #fff; background-color: #fff;
...@@ -71,6 +72,9 @@ ...@@ -71,6 +72,9 @@
//padding: 0; //padding: 0;
//height: 30px; //height: 30px;
} }
.el-dialog{
width: 700px
}
</style> </style>
</head> </head>
<body style='height:100%'> <body style='height:100%'>
...@@ -139,18 +143,55 @@ ...@@ -139,18 +143,55 @@
<el-table-column <el-table-column
prop="area" prop="area"
label="地市" label="地市"
width="250"> width="150">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="agentName" prop="agentName"
label="工号" label="坐席工号"
width="250"> width="">
</el-table-column>
<el-table-column
prop="total_session"
label="全部会话数"
width="">
</el-table-column>
<el-table-column
prop="validate_num"
label="触发违规项次数"
>
</el-table-column>
<el-table-column
prop="avg_score_svc"
label="服务类平均分"
>
</el-table-column>
<el-table-column
prop="avg_score_bus"
label="业务类平均分"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="avg_score" prop="avg_score"
label="平均分" label="平均分"
> >
</el-table-column> </el-table-column>
<el-table-column
prop="validate_zero"
label="触发0分项次数"
>
</el-table-column>
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-button
@click.native.prevent="rowDetail(scope.$index, scope.row)"
type="text"
size="small">
详情
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
<el-pagination <el-pagination
...@@ -162,6 +203,34 @@ ...@@ -162,6 +203,34 @@
:total="total"> :total="total">
</el-pagination> </el-pagination>
<el-button v-if='isscrollTop' @click='backTop' id='backTop' type="warning" icon="el-icon-upload2" circle></el-button> <el-button v-if='isscrollTop' @click='backTop' id='backTop' type="warning" icon="el-icon-upload2" circle></el-button>
<el-dialog id='dialogDetail' v-loading='poploading' title="详情" :visible.sync="dialogTableVisible">
<el-table style='margin-top:-20px' :data="poptableData" height='300'>
<el-table-column prop="agentName" label="坐席id" width='190'></el-table-column>
<el-table-column prop="customName" label="客户" width='190'></el-table-column>
<el-table-column prop="remainTime" label="通话时间(秒)">
{# <template slot-scope='scope'>#}
{# <span>{{formatSeconds(scope.row.remainTime)}}</span>#}
{# </template>#}
</el-table-column>
<el-table-column prop="score" label="分数"></el-table-column>
<el-table-column label="操作">
<template slot-scope='scope'>
<el-button type='text' size="mini" @click="handleTableDetail(scope.$index, scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@current-change='popCurrentChange'
style='margin: 0 auto;text-align:center;margin-bottom:20px;'
layout="prev, pager, next"
:current-page.sync='popcurrentPage'
background
:page-size="poppagesize"
:total="poptotal">
</el-pagination>
</el-dialog>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function(){ window.onload = function(){
......
This diff is collapsed.
...@@ -45,17 +45,17 @@ new Vue({ ...@@ -45,17 +45,17 @@ new Vue({
changeRange(dateRange){ changeRange(dateRange){
this.start_date = dateRange[0]; this.start_date = dateRange[0];
this.end_date = dateRange[1]; this.end_date = dateRange[1];
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue, this.currentPage , 10); // 获取统计数据
}, },
changeTask(msg){ changeTask(msg){
console.log(msg); console.log(msg);
this.taskvalue = msg; this.taskvalue = msg;
this.getTake() 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, this.currentPage , 10); // 获取统计数据
}, },
changeTake(msg){ changeTake(msg){
this.takevalue = msg; this.takevalue = msg;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue, this.currentPage , 10); // 获取统计数据
console.log(msg); console.log(msg);
}, },
getTask(){ getTask(){
...@@ -105,18 +105,20 @@ new Vue({ ...@@ -105,18 +105,20 @@ new Vue({
}, },
CurrentChange(page){ CurrentChange(page){
this.currentPage = page; this.currentPage = page;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue, this.currentPage , 10); // 获取统计数据
}, },
popCurrentChange(page){ popCurrentChange(page){
this.poppage = page; this.poppage = page;
this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize); this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize);
}, },
getRule(task,start_date,end_date,agentName){ getRule(task,start_date,end_date,agentName,page,page_size){
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/',{task,end_date,start_date,agentName}).then(data => { RquestsPost('api/v1/tasks/static_score/',{task,end_date,start_date,agentName,page,page_size}).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);
...@@ -135,7 +137,7 @@ new Vue({ ...@@ -135,7 +137,7 @@ new Vue({
// arr.unshift([data.data[key],key]) // arr.unshift([data.data[key],key])
//} //}
this.tableData = data.data; this.tableData = data.data;
this.total = data.data.length; this.total = data.count;
this.isHidePage = !(data.data.length > 0); this.isHidePage = !(data.data.length > 0);
this.$loading().close(); this.$loading().close();
}) })
...@@ -162,15 +164,16 @@ new Vue({ ...@@ -162,15 +164,16 @@ new Vue({
return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate(); return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate();
}, },
rowDetail(index,tableData){ rowDetail(index,tableData){
let data = tableData[index + (this.currentPage-1) * this.pagesize]; let data = tableData;
console.log(data); console.log(data);
//this.poptableData = tableData[index].details; //this.poptableData = tableData[index].details;
this.poptables = data.tables; this.poptables = data.tables;
this.poprule = data.rule; this.poprule = data.rule;
this.taskvalue = data.area;
this.popcurrentPage = 1; this.popcurrentPage = 1;
this.poppage = 1; this.poppage = 1;
this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize); this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize);
this.dialogTableVisible = true; this.dialogTableVisible = true;
}, },
...@@ -179,7 +182,7 @@ new Vue({ ...@@ -179,7 +182,7 @@ new Vue({
let that = this; let that = this;
//this.$loading({text:'数据加载中...'}); //this.$loading({text:'数据加载中...'});
this.poploading = true; this.poploading = true;
RquestsPost('api/v1/tasks/rule_detail/',{task,end_date,start_date,tables,rule,page,page_size}).then(data => { RquestsPost('api/v1/tasks/score_detail/',{task,end_date,start_date,tables,rule,page,page_size}).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);
...@@ -233,7 +236,7 @@ new Vue({ ...@@ -233,7 +236,7 @@ new Vue({
this.getTask(); // 获取任务 this.getTask(); // 获取任务
//this.getTake(); // 获取坐席 //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, this.currentPage , 10); // 获取统计数据
} }
}, },
......
...@@ -33,7 +33,7 @@ new Vue({ ...@@ -33,7 +33,7 @@ new Vue({
wgzlf:'13', wgzlf:'13',
mgc:'14', mgc:'14',
}, { }, {
createdAt: '质检考核项目编号', createdAt: '质检考核权重',
fwyy:'10%', fwyy:'10%',
kcb:'10%', kcb:'10%',
jsy:'5%', jsy:'5%',
...@@ -127,7 +127,8 @@ new Vue({ ...@@ -127,7 +127,8 @@ new Vue({
}, },
getTake(){ getTake(){
let that = this; let that = this;
RquestsGet('api/v1/tasks/seat/?task=' + that.taskvalue).then(data => { RquestsGet('api/v1/tasks/seat/?task=' + that.taskvalue+'&start_date='+this.start_date+'&end_date='+this.end_date).then(data => {
//RquestsGet('api/v1/tasks/seat/?task=' + that.taskvalue).then(data => {
//console.log(data); //console.log(data);
if(data.code != 0){ if(data.code != 0){
......
...@@ -15,12 +15,22 @@ new Vue({ ...@@ -15,12 +15,22 @@ new Vue({
takevalue: '', takevalue: '',
loading: true, loading: true,
tableData: [], tableData: [],
poploading: false,
currentPage:1, currentPage:1,
page: 1, page: 1,
page_size: 10, page_size: 10,
pagesize: 10, pagesize: 10,
total: 10, total: 10,
isHidePage: true, isHidePage: true,
dialogTableVisible: false,
poptableData: [],
popcurrentPage: 1,
poptables: '',
poppage: 1,
poppagesize: 10,
poptotal: 10,
poprule: '',
agentName: '',
} }
}, },
mounted () { mounted () {
...@@ -73,12 +83,11 @@ new Vue({ ...@@ -73,12 +83,11 @@ new Vue({
}, },
getRule(task,start_date,end_date,agentName,page,page_size){ getRule(task,start_date,end_date,agentName,page,page_size){
let that = this; let that = this;
// 获取表格数据
this.$loading({text:'数据加载中...'}); this.$loading({text:'数据加载中...'});
RquestsPost('api/v1/tasks/seat_area/',{task,start_date,end_date,agentName,page,page_size}).then(data => { RquestsPost('api/v1/tasks/seat_area/',{task,start_date,end_date,agentName,page,page_size}).then(data => {
if(data.code != 0){ if(data.code != 0){
//that.takeList = [{agentName:'全部坐席'}]
}else{ }else{
that.tableData = data.data; that.tableData = data.data;
this.total = data.count; this.total = data.count;
...@@ -89,7 +98,7 @@ new Vue({ ...@@ -89,7 +98,7 @@ new Vue({
}, },
getTake(){ getTake(){
let that = this; let that = this;
RquestsGet('api/v1/tasks/seat/?task=' + that.taskvalue).then(data => { RquestsGet('api/v1/tasks/seat/?task=' + that.taskvalue+'&start_date='+this.start_date+'&end_date='+this.end_date).then(data => {
//console.log(data); //console.log(data);
if(data.code != 0){ if(data.code != 0){
...@@ -139,6 +148,47 @@ new Vue({ ...@@ -139,6 +148,47 @@ new Vue({
this.currentPage = page; this.currentPage = page;
this.page = page; this.page = page;
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue,this.page,this.page_size); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue,this.page,this.page_size); // 获取统计数据
},
rowDetail(index,tableData){
this.agentName = tableData.agentName;
this.taskvalue = tableData.area
this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize, this.agentName);
},
popCurrentChange(page){
this.poppage = page;
this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize, this.agentName);
},
getDetail(task,start_date,end_date, tables, rule, page, page_size, agentName){
let that = this;
this.$loading({text:'数据加载中...'});
this.poploading = true;
RquestsPost('api/v1/tasks/score_detail/',{task,end_date,start_date,tables,rule,page,page_size, agentName}).then(data => {
console.log(data.data);
this.dialogTableVisible = true;
this.$loading().close();
if(data.code != 0){
that.$message(data.msg);
if(data.msg){
that.$message(data.msg);
}else{
that.$message('服务器错误')
}
}
//that.titleInfo = data.data;
that.poptotal = data.count;
that.poptableData = data.data;
//this.$loading().close();
this.poploading = false;
})
},
handleTableDetail(index, msg){
let url = "/quality/audio/check-detail/"+msg.sessionCollectionId+"/"+msg.taskId+"?from=checkTask&sessionId=" + msg.sessionId;
console.log(url);
let autoMessage = {
jumplink: url
};
window.parent.postMessage(autoMessage,'*');
}, },
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()];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment