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
: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="tableData" height='400'> <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,8 +24,9 @@ ...@@ -24,8 +24,9 @@
.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;
...@@ -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(){
......
...@@ -3,25 +3,44 @@ new Vue({ ...@@ -3,25 +3,44 @@ new Vue({
data:function(){ data:function(){
return { return {
ss:'sas', ss:'sas',
dateRange:[new Date(), new Date()], dateTime: '',
taskList:[], taskList:[],
taskvalue: '', taskvalue: '',
start_date: '', start_date: '',
end_date:'', isscrollTop: false,
dialogTableVisible: false, currentPage:1,
takeList:[], pagesize: 10,
takevalue: '', total: 10,
loading: true,
tableData: [],
poppage: 1, poppage: 1,
poppagesize: 10, poppagesize: 10,
poptotal: 10, poptotal: 10,
poprule: '', poprule: '',
poptables: '', poptables: '',
poploading: false,
popcurrentPage: 1, popcurrentPage: 1,
isHidePage: true,
scrollTop: 0,
end_date:'',
poploading: false,
dialogTableVisible: false,
takeList:[],
dateRange:[new Date(), new Date()],
takevalue: '',
titleInfo: {
"total_session": 0,
"validate_session": 0,
"ratio": 0,
},
loading: true,
poptableData: [],
tableData: []
} }
}, },
mounted () {
window.addEventListener('scroll', this.scrollToTop)
},
destroyed () {
window.removeEventListener('scroll', this.scrollToTop)
},
methods: { methods: {
changeRange(dateRange){ changeRange(dateRange){
this.start_date = dateRange[0]; this.start_date = dateRange[0];
...@@ -29,6 +48,7 @@ new Vue({ ...@@ -29,6 +48,7 @@ new Vue({
this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据 this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
}, },
changeTask(msg){ changeTask(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); // 获取统计数据
...@@ -36,6 +56,7 @@ new Vue({ ...@@ -36,6 +56,7 @@ new Vue({
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); // 获取统计数据
console.log(msg);
}, },
getTask(){ getTask(){
let that = this; let that = this;
...@@ -82,126 +103,20 @@ new Vue({ ...@@ -82,126 +103,20 @@ new Vue({
} }
}) })
}, },
Charts(msg){ CurrentChange(page){
let msgLen = msg.length; this.currentPage = page;
let msgArr = [];
let that = this;
for(let key in msg){
msgArr.unshift([msg[key].rule, msg[key].count , msg[key].tables])
}
let sourceArr = [
[ 'product', 'amount', 'tables'],
].concat(msgArr);
var option = {
dataZoom : [
{
type: 'slider',
show: true,
// orient: 'horizontal',
orient: 'vertical',
zoomLock: true,
// start: 25,
// end: 100,
startValue: msgLen,
endValue: msgLen-10,
handleSize: 8
},
{
type: 'inside',
// start: 25,
// end: 100,
orient: 'vertical',
zoomLock: true,
// zoomOnMouseWheel:false,
startValue: 17,
endValue: 7,
},
{
type: 'slider',
show: true,
xAxisIndex: 0,
filterMode: 'empty',
width: 12,
// height: '70%',
handleSize: 8,
orient: 'vertical',
zoomLock: true,
showDataShadow: false,
left: '93%'
}
],
dataset: {
source: sourceArr
},
grid: {containLabel: true},
xAxis: {name: 'amount'},
yAxis: {type: 'category',boundaryGap:'20%'},
series: [
{
type: 'bar',
barWidth: 20,
barCategoryGap: "20%",
label:{
normal: {
position: 'right',
show: true,
color: '#000'
}
},
itemStyle:{
normal:{
color: '#fccb04'
},
emphasis:{
color: '#f7d139'
}
},
encode: {
x: 'amount',
y: 'product'
}
}
]
};
var myChart = echarts.init(document.getElementById('main'));
myChart.setOption(option);
myChart.on('click',function(msg){
that.poptables = msg.data[2];
that.poprule = msg.data[0];
that.popcurrentPage = 1;
that.poppage = 1;
that.getDetail(that.taskvalue,that.start_date,that.end_date,that.poptables,that.poprule, that.poppage, that.poppagesize,that.takevalue);
//that.tableData = msg.data[2];
that.dialogTableVisible = true;
})
if(msg.length == 0){
myChart.showLoading({
text: '暂无数据',
color: '#ffffff',
textColor: '#8a8e91',
maskColor: 'rgba(255, 255, 255, 0.8)',
}
);
}else{
myChart.hideLoading();
}
window.onresize = function(){
myChart.resize();
}
}, },
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.takevalue); this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize);
}, },
getDetail(task,start_date,end_date, tables, rule, page, page_size,agentName){ getRule(task,start_date,end_date,agentName){
//this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
let that = this; let that = this;
//this.$loading({text:'数据加载中...'});
this.poploading = true; console.log(start_date,end_date);
RquestsPost('api/v1/tasks/rule_detail/',{task,end_date,start_date,tables,rule,page,page_size,agentName}).then(data => { let arr = [];
this.$loading({text:'数据加载中...'});
RquestsPost('api/v1/tasks/static_rule/',{task,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);
...@@ -211,19 +126,21 @@ new Vue({ ...@@ -211,19 +126,21 @@ new Vue({
that.$message('服务器错误') that.$message('服务器错误')
} }
} }
//that.titleInfo = data.data; if(!data.data){
that.poptotal = data.count;
that.poptableData = data.data; this.$loading().close();
//this.$loading().close(); return false;
that.tableData = data.data; }
this.poploading = false; //for(let key in data.data){
// arr.unshift([data.data[key],key])
//}
this.tableData = data.data;
this.total = data.data.length;
this.isHidePage = !(data.data.length > 0);
this.$loading().close();
}) })
}, RquestsPost('api/v1/tasks/static/',{task,end_date,start_date,agentName}).then(data => {
getRule(task,start_date,end_date,agentName){ console.log(data.data);
let that = this;
let arr = [];
this.$loading({text:'数据加载中...'});
RquestsPost('api/v1/tasks/rule/',{task,start_date,end_date,agentName}).then(data => {
if(data.code != 0){ if(data.code != 0){
that.$message(data.msg); that.$message(data.msg);
if(data.msg){ if(data.msg){
...@@ -237,46 +154,78 @@ new Vue({ ...@@ -237,46 +154,78 @@ new Vue({
this.$loading().close(); this.$loading().close();
return false; return false;
} }
//for(let key in data.data){ that.titleInfo = data.data;
// arr.unshift([data.data[key],key]) //this.$loading().close();
//}
that.Charts(data.data);
this.$loading().close();
}) })
},
formatSeconds(value) {
    var theTime = parseInt(value);// 秒
    var middle= 0;// 分
    var hour= 0;// 小时
    if(theTime > 60) {
        middle= parseInt(theTime/60);
        theTime = parseInt(theTime%60);
        if(middle> 60) {
            hour= parseInt(middle/60);
            middle= parseInt(middle%60);
        }
    }
    var result = ""+parseInt(theTime)+"";
    if(middle > 0) {
        result = ""+parseInt(middle)+""+result;
    }
    if(hour> 0) {
        result = ""+parseInt(hour)+"小时"+result;
    }
    return result;
}, },
dateFormat(date){ dateFormat(date){
return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate(); return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate();
}, },
rowDetail(index,tableData){
let data = tableData[index + (this.currentPage-1) * this.pagesize];
console.log(data);
//this.poptableData = tableData[index].details;
this.poptables = data.tables;
this.poprule = data.rule;
this.popcurrentPage = 1;
this.poppage = 1;
this.getDetail(this.taskvalue,this.start_date,this.end_date,this.poptables,this.poprule, this.poppage, this.poppagesize);
},
getDetail(task,start_date,end_date, tables, rule, page, page_size){
//this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
let that = this;
this.$loading({text:'数据加载中...'});
this.poploading = true;
RquestsPost('api/v1/tasks/rule_detail/',{task,end_date,start_date,tables,rule,page,page_size}).then(data => {
console.log(data.data);
this.$loading().close();
this.dialogTableVisible = true;
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){ handleTableDetail(index, msg){
let url = "/quality/audio/check-detail/"+msg.sessionCollectionId+"/"+msg.taskId+"?from=checkTask&sessionId=" + msg.sessionId; let url = "/quality/audio/check-detail/"+msg.sessionCollectionId+"/"+msg.taskId+"?from=checkTask&sessionId=" + msg.sessionId;
console.log(url);
let autoMessage = { let autoMessage = {
jumplink: url jumplink: url
}; };
console.log(autoMessage);
window.parent.postMessage(autoMessage,'*'); window.parent.postMessage(autoMessage,'*');
},
backTop () {
const that = this
let timer = setInterval(() => {
let ispeed = Math.floor(-that.scrollTop / 5)
document.documentElement.scrollTop = document.body.scrollTop = that.scrollTop + ispeed
if (that.scrollTop === 0) {
clearInterval(timer)
}
}, 16)
},
// 为了计算距离顶部的高度,当高度大于60显示回顶部图标,小于60则隐藏
scrollToTop () {
const that = this
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
that.scrollTop = scrollTop
if (that.scrollTop > 60) {
that.isscrollTop = true
} else {
that.isscrollTop = false
}
}, },
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()];
......
...@@ -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,12 +164,13 @@ new Vue({ ...@@ -162,12 +164,13 @@ 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);
...@@ -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