Commit 97f79f1d authored by lvshibao's avatar lvshibao

score页面修改

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