Commit bee8ce54 authored by xishifeng's avatar xishifeng

业绩城市选择

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