Commit d3ad6ead authored by lvshibao's avatar lvshibao

seat页面修改

parent f6fb253d
...@@ -135,10 +135,11 @@ class DataApi(viewsets.ViewSet): ...@@ -135,10 +135,11 @@ 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', 'des') sort = req.GET.get('sort', 'des')
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
......
...@@ -189,13 +189,14 @@ class TasksApi(viewsets.ViewSet): ...@@ -189,13 +189,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', '')
sort = req.data.get('sort', 'des') sort = req.data.get('sort', 'des')
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')
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
......
...@@ -44,6 +44,18 @@ ...@@ -44,6 +44,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-if="seat_show == true" v-model="seatvalue" filterable placeholder="请选择坐席" @change='changeSeat'> <el-select v-if="seat_show == true" v-model="seatvalue" filterable placeholder="请选择坐席" @change='changeSeat'>
<el-option <el-option
label="全部坐席" label="全部坐席"
...@@ -64,6 +76,7 @@ ...@@ -64,6 +76,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,9 +6,12 @@ new Vue({ ...@@ -6,9 +6,12 @@ new Vue({
dateRange: [new Date(), new Date()], dateRange: [new Date(), new Date()],
cityList: [], cityList: [],
countryList: [], countryList: [],
teamList: [],
cityvalue: '', cityvalue: '',
countryvalue: '', countryvalue: '',
teamvalue: '',
country_show: false, country_show: false,
team_show: false,
start_date: '', start_date: '',
end_date: '', end_date: '',
seatList: [], seatList: [],
...@@ -39,29 +42,41 @@ new Vue({ ...@@ -39,29 +42,41 @@ new Vue({
this.seatvalue = null; this.seatvalue = null;
this.currentPage = 1; this.currentPage = 1;
this.getTake(); this.getTake();
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
}, },
changeCity(msg) { changeCity(msg) {
console.log(msg); console.log(msg);
this.currentPage = 1; this.currentPage = 1;
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.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
}, },
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.currentPage = 1; this.currentPage = 1;
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
},
changeTeam(msg) {
this.currentPage = 1;
this.teamvalue = msg;
this.seatvalue = null;
this.getTake();
this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
console.log(msg);
}, },
changeSeat(msg) { changeSeat(msg) {
this.currentPage = 1; this.currentPage = 1;
this.seatvalue = msg; this.seatvalue = msg;
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
console.log(msg); console.log(msg);
}, },
getCountry() { getCountry() {
...@@ -81,6 +96,23 @@ new Vue({ ...@@ -81,6 +96,23 @@ new Vue({
} }
}) })
}, },
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;
};
}
})
},
getCity(){ getCity(){
let that = this; let that = this;
var request = new XMLHttpRequest(); var request = new XMLHttpRequest();
...@@ -142,15 +174,15 @@ new Vue({ ...@@ -142,15 +174,15 @@ 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.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
}, },
getRule(city, country, start_date, end_date, seat) { getRule(city, country, team, start_date, end_date, seat) {
let that = this; let that = this;
let page = this.currentPage; let page = this.currentPage;
let arr = []; let arr = [];
this.$loading({text: '数据加载中...'}); this.$loading({text: '数据加载中...'});
let sort = this.sortObj.sort; let sort = this.sortObj.sort;
RquestsPost('api/v1/tasks/seat_rule/', {city, country, start_date, end_date, seat, page, sort}).then(data => { RquestsPost('api/v1/tasks/seat_rule/', {city, country, team, start_date, end_date, seat, page, sort}).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);
...@@ -178,7 +210,7 @@ new Vue({ ...@@ -178,7 +210,7 @@ new Vue({
CurrentChange(page) { CurrentChange(page) {
this.currentPage = page; this.currentPage = page;
//this.tableData = this.basearr.concat(this.allData.slice((page-1)*this.pagesize,page*this.pagesize)); //this.tableData = this.basearr.concat(this.allData.slice((page-1)*this.pagesize,page*this.pagesize));
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
//that.allData = data.data; //that.allData = data.data;
}, },
dateFormat(date) { dateFormat(date) {
...@@ -189,10 +221,11 @@ new Vue({ ...@@ -189,10 +221,11 @@ 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(); // 获取坐席
console.log(this.dateRange); console.log(this.dateRange);
this.getRule(this.cityvalue, this.countryvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据 this.getRule(this.cityvalue, this.countryvalue, this.teamvalue, this.start_date, this.end_date, this.seatvalue); // 获取统计数据
} }
}, },
......
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