Commit 97f79f1d authored by lvshibao's avatar lvshibao

score页面修改

parent 4316bbf1
......@@ -201,11 +201,12 @@ class DataApi(viewsets.ViewSet):
"""
city_id = req.GET.get('city', None)
country_id = req.GET.get('country', None)
team_id = req.GET.get('team', None)
agent_name = req.GET.get('seat', '')
sort = req.GET.get('sort', '-avg_score')
task_condition = req.data.get('date_condition', '')
team_names = get_team_names(city_id, country_id)
team_names = get_team_names(city_id, country_id, team_id)
task_condition['task__in'] = team_names
......
......@@ -417,13 +417,14 @@ class TasksApi(viewsets.ViewSet):
"""
city_id = req.data.get('city', None)
country_id = req.data.get('country', None)
team_id = req.data.get('team', None)
agent_name = req.data.get('seat', '')
page = req.data.get('page', '1')
page_size = req.data.get('page_size', '10')
sort = req.data.get('sort', '-avg_score')
task_condition = req.data.get('date_condition', '')
team_names = get_team_names(city_id, country_id)
team_names = get_team_names(city_id, country_id, team_id)
task_condition['task__in'] = team_names
......
......@@ -127,6 +127,18 @@
:value="item.id">
</el-option>
</el-select>
<el-select v-model="teamvalue" v-if="team_show == true" filterable placeholder="请选择团队" @change="changeTeam">
<el-option
label="全部团队"
value="">
</el-option>
<el-option
v-for="item in teamList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="seatvalue" v-if="seat_show == true" filterable placeholder="请选择工号" @change='changeSeat'>
<el-option
label="全部工号"
......@@ -147,6 +159,7 @@
<input type="hidden" name="end_date" :value="end_date">
<input type="hidden" name="city" :value="cityvalue">
<input type="hidden" name="country" :value="countryvalue">
<input type="hidden" name="team" :value="teamvalue">
<input type="hidden" name="seat" :value="seatvalue">
<input type="hidden" name="sort" :value="sortObj.sort">
</form>
......
......@@ -6,6 +6,7 @@ new Vue({
dateTime: '',
cityList: [],
countryList: [],
teamList: [],
cityvalue: null,
countryvalue: '',
country_show: false,
......@@ -13,12 +14,11 @@ new Vue({
popseatName: '',
scrollTop: 0,
dateRange: [new Date(), new Date()],
start_date: '',
end_date: '',
seatList: [],
seatvalue: null,
seat_show: true,
teamvalue: null,
teamvalue: '',
loading: true,
tableData: [],
poploading: false,
......@@ -71,7 +71,7 @@ new Vue({
name: item.prop,
sort: order
}
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
changeRange(dateRange) {
this.start_date = dateRange[0];
......@@ -79,28 +79,55 @@ new Vue({
this.seatvalue = null;
this.page = 1;
this.getTake();
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
changeCity(msg) {
this.cityvalue = msg;
this.countryvalue = '';
this.teamvalue = '';
this.seatvalue = null;
this.getCountry();
this.getTeam();
this.getTake();
this.page = 1;
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
changeCountry(msg) {
this.countryvalue = msg;
this.teamvalue = '';
this.seatvalue = null;
this.getTeam();
this.getTake();
this.page = 1;
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
changeTeam(msg) {
this.seatvalue = null;
this.getTake();
this.page = 1;
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
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); // 获取统计数据
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
},
getTeam() {
let that = this;
RquestsGet('api/v1/agency/team/?country_id=' + this.countryvalue + '&city_id=' + this.cityvalue).then(data => {
//console.log(data);
if (data.code != 0) {
that.$message('服务器错误')
} else {
that.teamList = data.data.team_list;
if (that.teamList.length > 0) {
that.team_show = true;
} else {
that.team_show = false;
};
}
})
},
getCountry() {
let that = this;
......@@ -148,7 +175,7 @@ new Vue({
that.$message('服务器错误');
}
},
getRule(city, country, start_date, end_date, seat, page, page_size) {
getRule(city, country, team, start_date, end_date, seat, page, page_size) {
let that = this;
// 获取表格数据
let sort = this.sortObj.sort;
......@@ -156,6 +183,7 @@ new Vue({
RquestsPost('api/v1/tasks/seat_area/', {
city,
country,
team,
start_date,
end_date,
seat,
......@@ -290,8 +318,9 @@ new Vue({
this.start_date = this.dateFormat(new Date(new Date() - 24 * 60 * 60 * 1000));
this.end_date = this.dateFormat(new Date());
this.getCity(); // 获取任务
this.getTeam(); // 获取团队
this.getTake(); // 获取坐席
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue, this.page, this.page_size); // 获取统计数据
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, 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