Commit 21d1af54 authored by agping's avatar agping

总监周报 城市选择

parent 8f3f1a3c
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</header> </header>
<!--总监周报 加城市选择--> <!--总监周报 加城市选择-->
<div class="top-city-select-area flex-center" > <div class="top-city-select-area flex-center" >
<select @changeCity="changeCity"> <select @change="changeCity($event)">
<option v-for="(item, index) in dataListCity" :value="item.id">{{item.name}}</option> <option v-for="(item, index) in dataListCity" :value="item.id">{{item.name}}</option>
</select> </select>
</div> </div>
......
...@@ -7,14 +7,17 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){ ...@@ -7,14 +7,17 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
token: localStorage.getItem('token'), token: localStorage.getItem('token'),
dataList: [], dataList: [],
dataListCity:[], dataListCity:[],
hrefPre: 'weekly_image?imgsrc=' hrefPre: 'weekly_image?imgsrc=',
isShowCity:false,
}, },
created: function() { created: function() {
var _this = this; var _this = this;
document.body.style.display = 'block'; document.body.style.display = 'block';
if(localStorage.getItem('userlevel')*1 != 20){//总监周报 if(localStorage.getItem('userlevel')*1 != 20){//总监周报
_this.getCity(); _this.getCity();
}else{ _this.isShowCity = true;
}else{//店长周报
_this.isShowCity = false;
_this.loadMain(); _this.loadMain();
} }
...@@ -60,24 +63,27 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){ ...@@ -60,24 +63,27 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
}); });
}, },
getCity: function(){//获取总监的城市 loadMainZj: function(id){
var _this =this; var _this =this;
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: ServerHostTempC + '/broker/getAgentDistrictId', url: ServerHostTempC + '/broker/getWeekOrDayV2',
data: { data: {
'AuthToken': localStorage.getItem('token'), 'AuthToken': _this.token,
'phone': localStorage.getItem('userphone') 'type': 0,
'agent_id': id,
}, },
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
beforeSend: function() { beforeSend: function() {
document.querySelector('#loading_pic').style.display = 'block';
document.querySelector('#no_more').style.display = 'none';
}, },
success: function(_data) { success: function(_data) {
if(typeof _data === 'object') { if(typeof _data === 'object') {
if(_data['code'] == '200') { if(_data['code'] == '200') {
_this.dataListCity = _data.data; _this.dataList = _data.data.list;
} else { } else {
layerTipsX(_data['msg']); layerTipsX(_data['msg']);
} }
...@@ -89,6 +95,8 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){ ...@@ -89,6 +95,8 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
layerTipsX('enter error'); layerTipsX('enter error');
}, },
complete: function(xhr, textStatus) { complete: function(xhr, textStatus) {
document.querySelector('#loading_pic').style.display = 'none';
document.querySelector('#no_more').style.display = 'block';
if(textStatus === 'timeout') { if(textStatus === 'timeout') {
//处理超时的逻辑 //处理超时的逻辑
layerTipsX('overtime'); layerTipsX('overtime');
...@@ -97,7 +105,7 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){ ...@@ -97,7 +105,7 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
}); });
}, },
changeCity: function(){//切换城市 getCity: function(){//获取总监的城市
var _this =this; var _this =this;
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
...@@ -115,6 +123,7 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){ ...@@ -115,6 +123,7 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
if(typeof _data === 'object') { if(typeof _data === 'object') {
if(_data['code'] == '200') { if(_data['code'] == '200') {
_this.dataListCity = _data.data; _this.dataListCity = _data.data;
_this.loadMainZj(_data.data[0].id);//默认显示第一个城市的总监周报
} else { } else {
layerTipsX(_data['msg']); layerTipsX(_data['msg']);
} }
...@@ -134,6 +143,12 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){ ...@@ -134,6 +143,12 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
}); });
}, },
changeCity: function(e){//切换城市
var _this =this;
_this.loadMainZj(e.target.value);//总监周报 切换城市
},
} }
}); });
}); });
\ No newline at end of file
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