Commit bee8ce54 authored by xishifeng's avatar xishifeng

业绩城市选择

parent f303178b
<template>
<div>
<header-pulic :data="headerData"></header-pulic>
<!--站点选择-->
<div class="top-city-select-area flex-center" v-if="userLevel == '30' || userLevel == '40'">
<city-select :datasiteid="datasiteid" @changeCity="changeCity"></city-select>
</div>
<div class="achieve-top">
<!--顶部圈圈数据区域-->
<ul class="achieve-top-circle-area flex">
......@@ -69,11 +75,12 @@
</template>
<script>
import '@/assets/js/layer041002.js';
import citySelect from '@/components/achieveMain/citySelect';
import achieveSearchBlock from '@/components/achieveMain/achieveSearchBlock';
export default {
name: '',
components: {
'city-select': citySelect,
'achieve-search-block': achieveSearchBlock
},
data() {
......@@ -84,6 +91,7 @@
'noborder': true,
'isBack': true
},
datasiteid: localStorage.getItem('tlSiteid'),
token: '',
startDate: '',
endDate: '',
......@@ -169,9 +177,10 @@
loadMain() {
var _this = this;
_this.userLevel = localStorage.getItem('userlevel');
console.log(_this.userLevel);
_this.token = localStorage.getItem('token');
if(_this.userLevel == '30' || _this.userLevel == '40') {
_this.headerTitle = '区域业绩';
_this.headerData.title = '分部业绩';
_this.tabsMain.unshift({
'title': '门店业绩排行榜',
'isLoadMain': false,
......@@ -179,7 +188,7 @@
'dataList': []
});
} else if(_this.userLevel == '20') {
_this.headerTitle = '门店业绩';
_this.headerData.title = '门店业绩';
} else {
layerTipsX('level error');
};
......@@ -216,7 +225,11 @@
};
},
search(type) {
var _this = this;
let _this = this;
_this.realSearch(type);
},
realSearch(type) {
let _this = this;
_this.resetSomeData(1);
if(type == 'today') {
_this.endDate = _this.startDate = _this.nowDate;
......@@ -248,7 +261,6 @@
_this.ajaxUl(1);
}
});
},
ajaxMainNum(fn) {
var _this = this;
......@@ -262,7 +274,7 @@
'agent_id': _this.ywyId,
'start_time': _this.startDate,
'end_time': _this.endDate,
'site_id': '',
'site_id': localStorage.getItem('tlSiteid'),
}
})
.then(function(response) {
......@@ -308,7 +320,7 @@
'start_time': _this.startDate,
'end_time': _this.endDate,
'is_store': type,
'site_id': '',
'site_id': localStorage.getItem('tlSiteid'),
}
})
.then(function(response) {
......@@ -340,6 +352,11 @@
'endTime': _this.endDate
}
});
},
changeCity(c) {
let _this = this;
console.log(c);
_this.realSearch('normal');
}
},
computed: {
......
<template>
<div>
<header-pulic :data="headerData"></header-pulic>
<!--站点选择-->
<div class="top-city-select-area flex-center" v-if="userLevel == '30' || userLevel == '40'">
<city-select :datasiteid="datasiteid" @changeCity="changeCity"></city-select>
</div>
<div class="achieve-top">
<!--顶部圈圈数据区域-->
<ul class="achieve-top-circle-area flex">
......@@ -75,12 +69,11 @@
</template>
<script>
import citySelect from '@/components/achieveMain/citySelect';
import '@/assets/js/layer041002.js';
import achieveSearchBlock from '@/components/achieveMain/achieveSearchBlock';
export default {
name: '',
components: {
'city-select': citySelect,
'achieve-search-block': achieveSearchBlock
},
data() {
......@@ -91,7 +84,6 @@
'noborder': true,
'isBack': true
},
datasiteid: localStorage.getItem('tlSiteid'),
token: '',
startDate: '',
endDate: '',
......@@ -179,7 +171,7 @@
_this.userLevel = localStorage.getItem('userlevel');
_this.token = localStorage.getItem('token');
if(_this.userLevel == '30' || _this.userLevel == '40') {
_this.headerData.title = '分部业绩';
_this.headerTitle = '区域业绩';
_this.tabsMain.unshift({
'title': '门店业绩排行榜',
'isLoadMain': false,
......@@ -187,7 +179,7 @@
'dataList': []
});
} else if(_this.userLevel == '20') {
_this.headerData.title = '门店业绩';
_this.headerTitle = '门店业绩';
} else {
layerTipsX('level error');
};
......@@ -224,11 +216,7 @@
};
},
search(type) {
let _this = this;
_this.realSearch(type);
},
realSearch(type) {
let _this = this;
var _this = this;
_this.resetSomeData(1);
if(type == 'today') {
_this.endDate = _this.startDate = _this.nowDate;
......@@ -260,6 +248,7 @@
_this.ajaxUl(1);
}
});
},
ajaxMainNum(fn) {
var _this = this;
......@@ -273,7 +262,7 @@
'agent_id': _this.ywyId,
'start_time': _this.startDate,
'end_time': _this.endDate,
'site_id': localStorage.getItem('tlSiteid'),
'site_id': '',
}
})
.then(function(response) {
......@@ -319,7 +308,7 @@
'start_time': _this.startDate,
'end_time': _this.endDate,
'is_store': type,
'site_id': localStorage.getItem('tlSiteid'),
'site_id': '',
}
})
.then(function(response) {
......@@ -351,11 +340,6 @@
'endTime': _this.endDate
}
});
},
changeCity(c) {
let _this = this;
console.log(c);
_this.realSearch('normal');
}
},
computed: {
......
......@@ -20,7 +20,10 @@
},
created() {
let _this = this;
let _tempData = localStorage.getItem('tlAppSiteList');
if(_tempData){
this.siteList = JSON.parse(decodeURIComponent(localStorage.getItem('tlAppSiteList')));
};
},
methods: {
changeCity(e) {
......
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