Commit eb3c8855 authored by lvshibao's avatar lvshibao

scores页面修改

parent fb937fe0
...@@ -6,7 +6,7 @@ from rest_framework.request import Request ...@@ -6,7 +6,7 @@ from rest_framework.request import Request
from before_request import before_request from before_request import before_request
from inspect_report.agency import get_team_names from inspect_report.agency import get_team_names
from inspect_report.models import Tasks, CheckSession, RulesStat, SeatStat, ScoreStat, Round from inspect_report.models import Tasks, CheckSession, RulesStat, SeatStat, ScoreStat, Round, Seat
import json import json
from datetime import datetime, timedelta from datetime import datetime, timedelta
from config.config import TABLE_PRE, name_list from config.config import TABLE_PRE, name_list
...@@ -82,7 +82,8 @@ class DataApi(viewsets.ViewSet): ...@@ -82,7 +82,8 @@ class DataApi(viewsets.ViewSet):
task_condition['task__in'] = team_names task_condition['task__in'] = team_names
call_count = SeatStat.objects.filter(**task_condition).aggregate(Sum("validate_session"))['validate_session__sum'] call_count = SeatStat.objects.filter(**task_condition).aggregate(Sum("validate_session"))[
'validate_session__sum']
task_condition = req.data.get('date_condition', {}) task_condition = req.data.get('date_condition', {})
...@@ -133,7 +134,7 @@ class DataApi(viewsets.ViewSet): ...@@ -133,7 +134,7 @@ class DataApi(viewsets.ViewSet):
task_id = req.GET.get('task', '') task_id = req.GET.get('task', '')
agent_name = req.GET.get('agentName', '') agent_name = req.GET.get('agentName', '')
sort = req.GET.get('sort', 'des') sort = req.GET.get('sort', 'des')
start_date = req.GET.get('start_date', (datetime.now()+timedelta(days=-1)).strftime('%Y-%m-%d')) start_date = req.GET.get('start_date', (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d'))
end_date = req.GET.get('end_date', datetime.now().strftime('%Y-%m-%d')) end_date = req.GET.get('end_date', datetime.now().strftime('%Y-%m-%d'))
q_start_date = datetime.strptime(start_date, '%Y-%m-%d').date() q_start_date = datetime.strptime(start_date, '%Y-%m-%d').date()
q_end_date = (datetime.strptime(end_date, '%Y-%m-%d') + + timedelta(days=1)).date() q_end_date = (datetime.strptime(end_date, '%Y-%m-%d') + + timedelta(days=1)).date()
...@@ -155,7 +156,7 @@ class DataApi(viewsets.ViewSet): ...@@ -155,7 +156,7 @@ class DataApi(viewsets.ViewSet):
for s in seats: for s in seats:
detail = {'agentName': s['agentName'], 'validate_session': s['validate_session'], detail = {'agentName': s['agentName'], 'validate_session': s['validate_session'],
'remainTime': s['remainTime'], 'total_session': s['total_session'], 'remainTime': s['remainTime'], 'total_session': s['total_session'],
'ratio': round(s['validate_session']/s['total_session'], 2)} 'ratio': round(s['validate_session'] / s['total_session'], 2)}
return_data.append(detail) return_data.append(detail)
if sort == 'asc': if sort == 'asc':
data_sort = sorted(return_data, key=lambda x: x['ratio']) data_sort = sorted(return_data, key=lambda x: x['ratio'])
...@@ -182,22 +183,23 @@ class DataApi(viewsets.ViewSet): ...@@ -182,22 +183,23 @@ class DataApi(viewsets.ViewSet):
return response return response
@action(['get'], detail=False) @action(['get'], detail=False)
@before_request
def seat_area_export(self, req: Request): def seat_area_export(self, req: Request):
""" """
地市坐席成绩分析-导出 地市坐席成绩分析-导出
:param req: :param req:
:return: :return:
""" """
task_id = req.GET.get('task', '') city_id = req.GET.get('city', None)
agent_name = req.GET.get('agentName', '') country_id = req.GET.get('country', None)
agent_name = req.GET.get('seat', '')
sort = req.GET.get('sort', '-avg_score') sort = req.GET.get('sort', '-avg_score')
start_date = req.GET.get('start_date', (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d')) task_condition = req.data.get('date_condition', '')
end_date = req.GET.get('end_date', datetime.now().strftime('%Y-%m-%d'))
q_start_date = datetime.strptime(start_date, '%Y-%m-%d').date() team_names = get_team_names(city_id, country_id)
q_end_date = (datetime.strptime(end_date, '%Y-%m-%d') + + timedelta(days=1)).date()
task_condition = {'create_date__gte': q_start_date, 'create_date__lt': q_end_date} task_condition['task__in'] = team_names
if task_id:
task_condition['task'] = task_id
if agent_name: if agent_name:
task_condition['agentName'] = agent_name task_condition['agentName'] = agent_name
# , 'total_session', 'validate_num', 'validate_session', 'validate_zero' # , 'total_session', 'validate_num', 'validate_session', 'validate_zero'
...@@ -207,6 +209,13 @@ class DataApi(viewsets.ViewSet): ...@@ -207,6 +209,13 @@ class DataApi(viewsets.ViewSet):
avg_score=Round(Avg('score'), 2), total_session=Sum('total_session'), avg_score=Round(Avg('score'), 2), total_session=Sum('total_session'),
validate_num=Sum('validate_num'), validate_zero=Sum('validate_zero')) \ validate_num=Sum('validate_num'), validate_zero=Sum('validate_zero')) \
.order_by(sort) .order_by(sort)
agent_names = [x['agentName'] for x in rules]
seats_code_name_list = Seat.objects.filter(code__in=agent_names).values('code', 'name')
seats_code_name = dict()
for seat_code_name in seats_code_name_list:
seats_code_name[seat_code_name['code']] = seat_code_name['name']
for rule_dict in rules:
rule_dict['seatName'] = seats_code_name.get(rule_dict['agentName'], rule_dict['agentName'])
response = HttpResponse(content_type='text/csv') response = HttpResponse(content_type='text/csv')
file_name = '坐席成绩_' + datetime.now().strftime('%Y%m%d%H%M%S') + '.csv' file_name = '坐席成绩_' + datetime.now().strftime('%Y%m%d%H%M%S') + '.csv'
response['Content-Type'] = 'application/octet-stream' response['Content-Type'] = 'application/octet-stream'
...@@ -215,11 +224,11 @@ class DataApi(viewsets.ViewSet): ...@@ -215,11 +224,11 @@ class DataApi(viewsets.ViewSet):
response.write(codecs.BOM_UTF8) response.write(codecs.BOM_UTF8)
writer = csv.writer(response) writer = csv.writer(response)
# 设置表头 # 设置表头
header = ['地市', '坐席工号', '全部会话数', '触发违规项次数', '服务类平均分', '业务类平均分', '平均分', '触发0分项次数'] header = ['地市', '坐席工号', '坐席名称', '全部会话数', '触发违规项次数', '服务类平均分', '业务类平均分', '平均分', '触发0分项次数']
writer.writerow(header) writer.writerow(header)
# 设置表数据 # 设置表数据
for r in rules: for r in rules:
row = [r['area'], r['agentName'], r['total_session'], r['validate_num'], r['avg_score_svc'], row = [r['area'], r['agentName'], r['seatName'], r['total_session'], r['validate_num'], r['avg_score_svc'],
r['avg_score_bus'], r['avg_score'], r['validate_zero']] r['avg_score_bus'], r['avg_score'], r['validate_zero']]
writer.writerow(row) writer.writerow(row)
return response return response
...@@ -309,7 +318,8 @@ class DataApi(viewsets.ViewSet): ...@@ -309,7 +318,8 @@ class DataApi(viewsets.ViewSet):
writer.writerow(header) writer.writerow(header)
# 设置表数据 # 设置表数据
for r in return_data: for r in return_data:
row = [r['createdAt'], r['area'], r['agentName'], r['filename'], r['remainTime'], r['fwyy'], r['kcb'], r['jsy'], row = [r['createdAt'], r['area'], r['agentName'], r['filename'], r['remainTime'], r['fwyy'], r['kcb'],
r['jsy'],
r['fwtd'], r['yssb'], r['jysb'], r['yycl'], r['ywcc'], r['yyjlz'], r['fwjs'], r['wtgbj'], r['fwtd'], r['yssb'], r['jysb'], r['yycl'], r['ywcc'], r['yyjlz'], r['fwjs'], r['wtgbj'],
r['cgjxxhs'], r['wgzlf'], r['mgc'], r['total_score']] r['cgjxxhs'], r['wgzlf'], r['mgc'], r['total_score']]
writer.writerow(row) writer.writerow(row)
......
...@@ -8,7 +8,7 @@ from rest_framework.response import Response ...@@ -8,7 +8,7 @@ from rest_framework.response import Response
from before_request import before_request from before_request import before_request
from inspect_report.agency import get_team_names, get_country_names from inspect_report.agency import get_team_names, get_country_names
from inspect_report.models import Tasks, CheckSession, RulesStat, SeatStat, ScoreStat, Round, Team, Country from inspect_report.models import Tasks, CheckSession, RulesStat, SeatStat, ScoreStat, Round, Team, Country, Seat
import json import json
from datetime import datetime, timedelta from datetime import datetime, timedelta
from config.config import TABLE_PRE, name_list, name_code_dict from config.config import TABLE_PRE, name_list, name_code_dict
...@@ -45,19 +45,17 @@ class TasksApi(viewsets.ViewSet): ...@@ -45,19 +45,17 @@ class TasksApi(viewsets.ViewSet):
:param req: :param req:
:return: :return:
""" """
username = req.data.get('username', '') city_id = req.GET.get('city', None)
task_id = req.GET.get('task', '') country_id = req.GET.get('country', None)
session_condition = req.data.get('date_condition', {}) session_condition = req.data.get('date_condition', {})
if task_id: team_names = get_team_names(city_id, country_id)
session_condition['task'] = task_id
if username in name_list: session_condition['task__in'] = team_names
session_condition['task'] = username seat_ids = SeatStat.objects.filter(**session_condition).values_list('agentName', flat=True)
seats = SeatStat.objects.filter(**session_condition).values('agentName') seat_id_names = Seat.objects.filter(code__in=seat_ids).values('code', 'name')
return_data = [] seat_ids_with_name = [x['code'] for x in seat_id_names]
for agent in seats: extra = [({'code': seat_id, 'name': seat_id} for seat_id in seat_ids if seat_id not in seat_ids_with_name)]
if agent not in return_data: return Response({'code': 0, 'msg': 'success', 'data': list(seat_id_names) + extra})
return_data.append(agent)
return Response({'code': 0, 'msg': 'success', 'data': return_data, 'username': username})
@action(['post'], detail=False) @action(['post'], detail=False)
def rule(self, req: Request): def rule(self, req: Request):
...@@ -408,17 +406,18 @@ class TasksApi(viewsets.ViewSet): ...@@ -408,17 +406,18 @@ class TasksApi(viewsets.ViewSet):
:param req: :param req:
:return: :return:
""" """
username = req.data.get('username', '') city_id = req.data.get('city', None)
task_id = req.data.get('task', '') country_id = req.data.get('country', None)
agent_name = req.data.get('agentName', '') agent_name = req.data.get('seat', '')
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')
sort = req.data.get('sort', '-avg_score') sort = req.data.get('sort', '-avg_score')
task_condition = req.data.get('date_condition', '') task_condition = req.data.get('date_condition', '')
if task_id:
task_condition['task'] = task_id team_names = get_team_names(city_id, country_id)
if username in name_list:
task_condition['task'] = username task_condition['task__in'] = team_names
if agent_name: if agent_name:
task_condition['agentName'] = agent_name task_condition['agentName'] = agent_name
# , 'total_session', 'validate_num', 'validate_session', 'validate_zero' # , 'total_session', 'validate_num', 'validate_session', 'validate_zero'
...@@ -428,6 +427,13 @@ class TasksApi(viewsets.ViewSet): ...@@ -428,6 +427,13 @@ class TasksApi(viewsets.ViewSet):
avg_score=Round(Avg('score'), 2), total_session=Sum('total_session'), avg_score=Round(Avg('score'), 2), total_session=Sum('total_session'),
validate_num=Sum('validate_num'), validate_zero=Sum('validate_zero')) \ validate_num=Sum('validate_num'), validate_zero=Sum('validate_zero')) \
.order_by(sort) .order_by(sort)
agent_names = [x['agentName'] for x in rules]
seats_code_name_list = Seat.objects.filter(code__in=agent_names).values('code', 'name')
seats_code_name = dict()
for seat_code_name in seats_code_name_list:
seats_code_name[seat_code_name['code']] = seat_code_name['name']
for rule_dict in rules:
rule_dict['seatName'] = seats_code_name.get(rule_dict['agentName'], rule_dict['agentName'])
paginator = Paginator(rules, page_size) paginator = Paginator(rules, page_size)
total_count = paginator.count total_count = paginator.count
try: try:
...@@ -565,12 +571,9 @@ class TasksApi(viewsets.ViewSet): ...@@ -565,12 +571,9 @@ class TasksApi(viewsets.ViewSet):
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')
session_condition = req.data.get('date_condition', {}) session_condition = req.data.get('date_condition', {})
team = req.data.get('team', '')
if agent_name: if agent_name:
session_condition['agentName'] = agent_name session_condition['agentName'] = agent_name
if team:
session_condition['task'] = team
checks = RulesStat.objects.filter(**session_condition) \ checks = RulesStat.objects.filter(**session_condition) \
.extra(select={'sessionCollectionId': 'sessionCollectionId'}) \ .extra(select={'sessionCollectionId': 'sessionCollectionId'}) \
......
...@@ -107,24 +107,32 @@ ...@@ -107,24 +107,32 @@
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-if="sel_is_show == true" v-model="taskvalue" filterable placeholder="请选择" @change="changeTask"> <el-select v-model="cityvalue" filterable placeholder="请选择" @change="changeCity">
<el-option <el-option
v-for="item in taskList" v-for="item in cityList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="takevalue" filterable placeholder="请选择" @change='changeTake'> <el-select v-model="countryvalue" filterable placeholder="请选择" @change="changeCountry">
<el-option
v-for="item in countryList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="seatvalue" filterable placeholder="请选择" @change='changeSeat'>
<el-option <el-option
label="全部工号" label="全部工号"
value=""> value="">
</el-option> </el-option>
<el-option <el-option
v-for="item in takeList" v-for="item in seatList"
:key="item.agentName" :key="item.code"
:label="item.agentName" :label="item.name"
:value="item.agentName"> :value="item.code">
</el-option> </el-option>
</el-select> </el-select>
<el-button type='primary' size='mini' style='height:30px;' @click='loadData()'> <el-button type='primary' size='mini' style='height:30px;' @click='loadData()'>
...@@ -133,8 +141,9 @@ ...@@ -133,8 +141,9 @@
<form ref="loadModal" :action="`${BASEURL}api/v1/data/seat_area_export/`" method="get"> <form ref="loadModal" :action="`${BASEURL}api/v1/data/seat_area_export/`" method="get">
<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">
<input type="hidden" name="task" :value="taskvalue"> <input type="hidden" name="city" :value="cityvalue">
<input type="hidden" name="agentName" :value="takevalue"> <input type="hidden" name="country" :value="countryvalue">
<input type="hidden" name="seat" :value="seatvalue">
<input type="hidden" name="sort" :value="sortObj.sort"> <input type="hidden" name="sort" :value="sortObj.sort">
</form> </form>
</div> </div>
...@@ -153,13 +162,18 @@ ...@@ -153,13 +162,18 @@
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="area" prop="area"
label="地市" label="团队"
width="150"> width="150">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="agentName" prop="agentName"
label="坐席工号" label="坐席工号"
width=""> width="">
</el-table-column>
<el-table-column
prop="seatName"
label="坐席姓名"
width="">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="total_session" prop="total_session"
...@@ -230,9 +244,7 @@ ...@@ -230,9 +244,7 @@
<el-table style='margin-top:-20px' :data="poptableData" height='300'> <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="seatName" 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="通话时间(秒)">
{# <template slot-scope='scope'>#} {# <template slot-scope='scope'>#}
{# <span>{{formatSeconds(scope.row.remainTime)}}</span>#} {# <span>{{formatSeconds(scope.row.remainTime)}}</span>#}
...@@ -264,7 +276,6 @@ ...@@ -264,7 +276,6 @@
<script src="{% static "inspect/js/vue.min.js" %}"></script> <script src="{% static "inspect/js/vue.min.js" %}"></script>
<script src="{% static "inspect/js/element.js" %}"></script> <script src="{% static "inspect/js/element.js" %}"></script>
<script src="{% static "inspect/js/http.js" %}"></script> <script src="{% static "inspect/js/http.js" %}"></script>
<script type="text/javascript" src="{% static "inspect/js/config.js" %}"></script>
<script type="text/javascript" src="{% static "inspect/js/score.js" %}"></script> <script type="text/javascript" src="{% static "inspect/js/score.js" %}"></script>
</body> </body>
</html> </html>
...@@ -4,15 +4,18 @@ new Vue({ ...@@ -4,15 +4,18 @@ new Vue({
return { return {
ss: 'sas', ss: 'sas',
dateTime: '', dateTime: '',
taskList: [], cityList: [],
taskvalue: '', countryList: [],
cityvalue: null,
isscrollTop: false, isscrollTop: false,
popseatName: '',
scrollTop: 0, scrollTop: 0,
dateRange: [new Date(), new Date()], dateRange: [new Date(), new Date()],
start_date: '', start_date: '',
end_date: '', end_date: '',
takeList: [], seatList: [],
takevalue: '', seatvalue: null,
teamvalue: null,
loading: true, loading: true,
tableData: [], tableData: [],
poploading: false, poploading: false,
...@@ -65,60 +68,69 @@ new Vue({ ...@@ -65,60 +68,69 @@ new Vue({
name: item.prop, name: item.prop,
sort: order sort: order
} }
this.getRule(this.taskvalue, this.start_date, this.end_date, this.takevalue, this.page, this.page_size); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
}, },
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.page = 1; this.page = 1;
this.getTake(); this.getTake();
this.getRule(this.taskvalue, this.start_date, this.end_date, this.takevalue, this.page, this.page_size); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
}, },
changeTask(msg) { changeCity(msg) {
this.taskvalue = msg; this.cityvalue = msg;
this.countryvalue = null;
this.seatvalue = null;
this.getTake(); this.getTake();
this.page = 1; this.page = 1;
this.getRule(this.taskvalue, this.start_date, this.end_date, this.takevalue, this.page, this.page_size); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
}, },
changeTake(msg) { changeCountry(msg) {
this.takevalue = msg; this.countryvalue = msg;
this.seatvalue = null;
this.page = 1; this.page = 1;
this.getRule(this.taskvalue, this.start_date, this.end_date, this.takevalue, this.page, this.page_size); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
}, },
getTask() { changeSeat(msg) {
this.seatvalue = msg;
this.page = 1;
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
getCity() {
let that = this; let that = this;
that.taskList = [ var request = new XMLHttpRequest();
{id: '', name: '全省'},
{id: '合肥', name: '合肥'}, let uri = window_url + 'api/v1/agency/city/';
{id: '芜湖', name: '芜湖'},
{id: '蚌埠', name: '蚌埠'}, request.open('GET', uri, false);
{id: '淮南', name: '淮南'}, request.send(null);
{id: '马鞍山', name: '马鞍山'}, if (request.status === 200) {
{id: '淮北', name: '淮北'}, data = JSON.parse(request.response);
{id: '铜陵', name: '铜陵'}, console.log(data.code);
{id: '安庆', name: '安庆'}, if (data.code != 0) {
{id: '黄山', name: '黄山'}, that.$message('服务器错误');
{id: '滁州', name: '滁州'}, } else {
{id: '阜阳', name: '阜阳'}, that.cityList = data.data.city_list;
{id: '亳州', name: '亳州'}, that.countryList = data.data.country_list;
{id: '宿州', name: '宿州'}, that.cityvalue = data.data.city_id;
{id: '六安', name: '六安'}, console.log(that.cityvalue);
{id: '宣城', name: '宣城'}, that.init_simple = true;
{id: '巢湖', name: '巢湖'}, }
{id: '池州', name: '池州'}, } else {
{id: '安徽省营业部', name: '安徽省营业部'}, that.$message('服务器错误');
]; }
}, },
getRule(task, start_date, end_date, agentName, page, page_size) { getRule(city, country, start_date, end_date, seat, page, page_size) {
let that = this; let that = this;
// 获取表格数据 // 获取表格数据
let sort = this.sortObj.sort; let sort = this.sortObj.sort;
this.$loading({text: '数据加载中...'}); this.$loading({text: '数据加载中...'});
RquestsPost('api/v1/tasks/seat_area/', { RquestsPost('api/v1/tasks/seat_area/', {
task, city,
country,
start_date, start_date,
end_date, end_date,
agentName, seat,
page, page,
page_size, page_size,
sort sort
...@@ -135,20 +147,13 @@ new Vue({ ...@@ -135,20 +147,13 @@ new Vue({
}, },
getTake() { getTake() {
let that = this; let that = this;
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/?city=' + that.cityvalue + '&country=' + that.countryvalue + '&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) {
//that.takeList = [{agentName:'全部坐席'}] //that.takeList = [{agentName:'全部坐席'}]
} else { } else {
that.takeList = data.data; that.seatList = data.data;
}
if (name_list.indexOf(data.username) !== -1) {
that.sel_is_show = false;
that.taskvalue = data.username;
} else {
that.sel_is_show = true;
} }
}) })
...@@ -192,24 +197,24 @@ new Vue({ ...@@ -192,24 +197,24 @@ new Vue({
CurrentChange(page) { CurrentChange(page) {
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.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
}, },
rowDetail(index, tableData) { rowDetail(index, tableData) {
this.agentName = tableData.agentName; this.agentName = tableData.agentName;
this.taskvalue = tableData.area; this.popseatName = tableData.seatName;
this.getDetail(this.taskvalue, this.start_date, this.end_date, this.poptables, this.poprule, this.poppage, this.poppagesize, this.agentName); this.teamvalue = tableData.area;
this.getDetail(this.start_date, this.end_date, this.poptables, this.poprule, this.poppage, this.poppagesize, this.agentName);
}, },
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.agentName); this.getDetail(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) { getDetail(start_date, end_date, tables, rule, page, page_size, agentName, seatName) {
let that = this; let that = this;
this.$loading({text: '数据加载中...'}); this.$loading({text: '数据加载中...'});
this.poploading = true; this.poploading = true;
RquestsPost('api/v1/tasks/score_detail/', { RquestsPost('api/v1/tasks/score_detail/', {
task,
end_date, end_date,
start_date, start_date,
tables, tables,
...@@ -232,6 +237,9 @@ new Vue({ ...@@ -232,6 +237,9 @@ new Vue({
//that.titleInfo = data.data; //that.titleInfo = data.data;
that.poptotal = data.count; that.poptotal = data.count;
that.poptableData = data.data; that.poptableData = data.data;
for(let i = 0, len = that.poptableData.length; i < len; i++){
that.poptableData[i].seatName = that.popseatName
}
//this.$loading().close(); //this.$loading().close();
this.poploading = false; this.poploading = false;
}) })
...@@ -248,9 +256,9 @@ new Vue({ ...@@ -248,9 +256,9 @@ new Vue({
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.getCity(); // 获取任务
this.getTake(); // 获取坐席 this.getTake(); // 获取坐席
this.getRule(this.taskvalue, this.start_date, this.end_date, this.takevalue, this.page, this.page_size); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
} }
......
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