diff --git a/pages/commercialBI/businessPortrait.vue b/pages/commercialBI/businessPortrait.vue
index edff31b..b1ddc63 100644
--- a/pages/commercialBI/businessPortrait.vue
+++ b/pages/commercialBI/businessPortrait.vue
@@ -117,8 +117,9 @@ export default {
bestsellerList:[],//商超畅销品
serviceInfo:{} ,//当前服务区信息
backType:'',//返回的页面类型
- analyseInfo:{},
- analysisins_type: 1401,
+ analyseInfo:{
+ analysisins_type: 1401,
+ },
single:'',//显示时间
endData:'', // 结束时间
month:'',//显示月份
diff --git a/pages/commercialBI/carPortrait.vue b/pages/commercialBI/carPortrait.vue
index 9a16b39..ea55a02 100644
--- a/pages/commercialBI/carPortrait.vue
+++ b/pages/commercialBI/carPortrait.vue
@@ -6,7 +6,7 @@
-
{{item.name}}
-
{{thisMonth?thisMonth:'-'}}月车辆归属地
@@ -193,6 +197,9 @@ export default {
endData:'',//截止日期
isFirst:true,//是不是第一次调用
carType:'',// 车辆类型
+ selectProvinceName:'',// 点击的省份名称
+ selectValue:'',// 点击的省份值
+ allProvince:true,// 是否选择了全省
}
},
components: {
@@ -207,6 +214,11 @@ export default {
this.backType = option.type
},
onShow(){
+ this.carTypeList.forEach(item=>{
+ item.select = false
+ })
+ this.selectProvinceName = ''
+ this.carType = ''
this.isFirst = true
// 总的来说商业bi的五个页面都是 往组件里面传值 就可以出现图表和要求的东西
// 外面的一层页面主要用于处理数据
@@ -267,30 +279,41 @@ export default {
},
onUnload() {
this.$util.addUserBehavior()
+ this.carTypeList.forEach(item=>{
+ item.select = false
+ })
+ this.selectProvinceName = ''
+ this.carType = ''
},
methods:{
//车型选择
handleCarType(selectItem){
- this.carTypeList.forEach(item=>{
- if (item.value === selectItem.value){
- if (item.select){
- item.select = false
- }else{
- item.select = true
- }
- }else{
- item.select = false
- }
- })
- let type
- this.carTypeList.forEach(item=>{
- if (item.select){
- type = item.value
- }
- })
- this.carType = type
- this.getHomeData(type)
+ if (selectItem.value===this.carType){
+ this.carType=''
+ }else{
+ this.carType = selectItem.value
+ }
+ this.selectProvinceName = ''
+ this.selectValue = ''
+ this.getHomeData(this.carType)
},
+ handleGetHome(ProvinceName,allCount,isCancel){
+ if (isCancel){
+ this.selectValue = allCount
+ this.selectProvinceName = ''
+ this.getHomeData(this.carType)
+ }else{
+ this.selectValue = allCount
+ if (ProvinceName.indexOf(',')!==-1){
+ this.selectProvinceName = '其他'
+ this.getCityList(ProvinceName,this.selectValue)
+ }else{
+ this.selectProvinceName = ProvinceName
+ this.getCityList(this.selectProvinceName,this.selectValue)
+ }
+ }
+ },
+
//获取服务区基本信息
async getServiceInfo(){
let id = ''
@@ -550,8 +573,7 @@ export default {
})
})
},
- getHomeData(type){
- console.log('type',type)
+ getHomeData(){
const date = new Date(this.endTime?this.endTime:this.time)
let y = date.getFullYear()
let m = date.getMonth() + 1
@@ -560,30 +582,23 @@ export default {
}
let statistic = `${y}${m}`
let req
- if (type){
req = {
StatisticsMonth:statistic,
Serverpart_ID:this.serviceInfo.Serverpart_ID,
ContainWhole:true,
- VehicleType:type
+ VehicleType:this.carType|| '',
+ ProvinceName:this.selectProvinceName ,
+ isExclude:this.selectProvinceName.indexOf(',') !== -1,
}
- }else{
- req = {
- StatisticsMonth:statistic,
- Serverpart_ID:this.serviceInfo.Serverpart_ID,
- ContainWhole:true
- }
- }
request.$webGet('CommercialApi/Revenue/GetBayonetOAList',req).then(res=>{
if (this.isFirst){
let list = []
res.Result_Data.OtherData.forEach(item=>{
- list.push({name:item,value:item,select:false})
+ list.push({name:item,value:item})
})
this.carTypeList =list
this.isFirst = false
}
- console.log('服务区',res)
// 因为只让接口调用一次 所以要把全部和不同区域的内容要放在同一个列表里面 然后通过选项卡的点击来切换展示哪一块的数据
let result = res.Result_Data.List
@@ -613,7 +628,6 @@ export default {
})
//城市
this.cityPlaceAll = cityList
- console.log('cityList',cityList)
this.cityPlace = cityList[this.selectTab]?cityList[this.selectTab]:[]
//省份
this.homePlaceAll = dataList
@@ -621,6 +635,7 @@ export default {
})
},
+
getCityList(ProvinceName,allCount){
uni.showLoading({
title: '正在加载...'
@@ -634,14 +649,13 @@ export default {
let statistic = `${y}${m}`
const req = {
StatisticsMonth:statistic,
- ProvinceName:ProvinceName,
+ ProvinceName:ProvinceName ,
Serverpart_ID:this.serviceInfo.Serverpart_ID,
- VehicleType: this.carType,
- isExclude:ProvinceName.indexOf(',') !== -1
+ VehicleType: this.carType || '',
+ isExclude:ProvinceName.indexOf(',') !== -1,
+ ContainWhole:true
}
- console.log('req',req)
request.$webGet('CommercialApi/Revenue/GetBayonetProvinceOAList',req).then(res=>{
- console.log('res',res)
let result = res.Result_Data.List
result.forEach(item=>{
item.OwnerCityList.forEach(subItem=>{
@@ -653,6 +667,7 @@ export default {
})
uni.hideLoading()
},
+
getCarTypeTime(){
request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{
StatisticsDate:this.endTime?this.endTime:this.time,
@@ -703,7 +718,6 @@ export default {
this.carTypeTimeDataAll[2] ={categories:result[2].Vehicle_Type?result[2].Vehicle_Type:[], series:[series[5],series[4]]}
}
this.carTypeTimeData = this.carTypeTimeDataAll[this.selectTab]?this.carTypeTimeDataAll[this.selectTab]:[]
- console.log('this.carTypeTimeData',this.carTypeTimeData)
}else{
this.carTypeTimeDataAll = []
this.carTypeTimeData = []
diff --git a/pages/commercialBI/components/analyse.vue b/pages/commercialBI/components/analyse.vue
index 7a491a0..c01c31b 100644
--- a/pages/commercialBI/components/analyse.vue
+++ b/pages/commercialBI/components/analyse.vue
@@ -1,8 +1,11 @@
-
+
+