Commit addb0f2d authored by lvshibao's avatar lvshibao

数据分析-违规坐席分析

parent 23d0d818
...@@ -179,12 +179,14 @@ class TasksApi(viewsets.ViewSet): ...@@ -179,12 +179,14 @@ class TasksApi(viewsets.ViewSet):
return Response({'code': 0, 'msg': 'success', 'data': data_max_return}) return Response({'code': 0, 'msg': 'success', 'data': data_max_return})
@action(['post'], detail=False) @action(['post'], detail=False)
@get_account_info
def seat_rule(self, req: Request): def seat_rule(self, req: Request):
""" """
坐席违规分析-按照得分 坐席违规分析-按照得分
:param req: :param req:
:return: :return:
""" """
username = req.data.get('username', '')
task_id = req.data.get('task', '') task_id = req.data.get('task', '')
agent_name = req.data.get('agentName', '') agent_name = req.data.get('agentName', '')
sort = req.data.get('sort', 'des') sort = req.data.get('sort', 'des')
...@@ -197,6 +199,8 @@ class TasksApi(viewsets.ViewSet): ...@@ -197,6 +199,8 @@ class TasksApi(viewsets.ViewSet):
task_condition = {'create_date__gte': q_start_date, 'create_date__lt': q_end_date} task_condition = {'create_date__gte': q_start_date, 'create_date__lt': q_end_date}
if task_id: if task_id:
task_condition['task'] = task_id task_condition['task'] = task_id
if username in name_list:
task_condition['task'] = username
if agent_name: if agent_name:
task_condition['agentName'] = agent_name task_condition['agentName'] = agent_name
if sort == 'des': if sort == 'des':
...@@ -232,7 +236,7 @@ class TasksApi(viewsets.ViewSet): ...@@ -232,7 +236,7 @@ class TasksApi(viewsets.ViewSet):
for i in range(len(data_sort)): for i in range(len(data_sort)):
data_sort[i]['ranking'] = (int(page)-1)*int(page_size) + i + 1 data_sort[i]['ranking'] = (int(page)-1)*int(page_size) + i + 1
data_sort[i]['ratio'] = '{0}%'.format(int(data_sort[i]['ratio'] * 100)) data_sort[i]['ratio'] = '{0}%'.format(int(data_sort[i]['ratio'] * 100))
return Response({'code': 0, 'msg': 'success', 'count': total_count, 'data': data_sort}) return Response({'code': 0, 'msg': 'success', 'count': total_count, 'data': data_sort, 'username': username})
@action(['post'], detail=False) @action(['post'], detail=False)
@get_account_info @get_account_info
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
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-model="taskvalue" filterable placeholder="请选择" @change="changeTask"> <el-select v-if="sel_is_show == true" v-model="taskvalue" filterable placeholder="请选择" @change="changeTask">
<el-option <el-option
v-for="item in taskList" v-for="item in taskList"
:key="item.id" :key="item.id"
......
This diff is collapsed.
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