This commit is contained in:
cclu 2023-06-29 19:25:35 +08:00
parent 850fa0a868
commit 647a59fd05
10 changed files with 170 additions and 89 deletions

View File

@ -117,8 +117,9 @@ export default {
bestsellerList:[],// bestsellerList:[],//
serviceInfo:{} ,// serviceInfo:{} ,//
backType:'',// backType:'',//
analyseInfo:{}, analyseInfo:{
analysisins_type: 1401, analysisins_type: 1401,
},
single:'',// single:'',//
endData:'', // endData:'', //
month:'',// month:'',//

View File

@ -6,7 +6,7 @@
</div> </div>
<div class="main" v-if="isHaveData"> <div class="main" v-if="isHaveData">
<div class="header" :style="{backgroundImage: 'url('+ 'https://eshangtech.com/ShopICO/ahyd-BID/commercial/car.svg' +')'}"> <div class="header" :style="{backgroundImage: 'url('+ 'https://eshangtech.com/ShopICO/ahyd-BID/commercial/car.svg' +')'}">
<div class="analyse"> <div class="analyse" v-if="analyseText">
<text class="title">分析</text> <text class="title">分析</text>
<text class="content">{{analyseText}}</text> <text class="content">{{analyseText}}</text>
</div> </div>
@ -78,20 +78,24 @@
</picker> </picker>
</div> </div>
</div> </div>
<view class="tab" v-if="serviceInfo.Serverpart_ID"> <view class="tab" v-if="serviceInfo.Serverpart_ID">
<view v-for="(item,index) in tabList" :key="index" :class="selectTab===item.value?'tabItem tabItemActive':'tabItem'" @click="handleChangeTab(item.value)">{{item.name}}</view> <view v-for="(item,index) in tabList" :key="index" :class="selectTab===item.value?'tabItem tabItemActive':'tabItem'" @click="handleChangeTab(item.value)">{{item.name}}</view>
</view> </view>
<p class="title">{{thisMonth?thisMonth:'-'}}月车辆归属地</p> <p class="title">{{thisMonth?thisMonth:'-'}}月车辆归属地</p>
<div v-if="homePlace.length>0"> <div v-if="homePlace.length>0">
<home-place :homeData="homePlace" :homeCity="cityPlace" @getHomeDate="getHomeData"/> <home-place :selectProvinceName="selectProvinceName" :selectValue="selectValue" :homeData="homePlace" :homeCity="cityPlace" @getHomeDate="getHomeData"/>
<div style="display: flex">
<!-- <div class="selectType" >-->
<!-- <view :class="allProvince?'item itemSelect':'item itemUnSelect'" @click="handleAllProvince">全部省份</view>-->
<!-- </div>-->
<div class="selectType"> <div class="selectType">
<div :class="item.select?'item itemSelect':'item itemUnSelect'" v-for="(item,index) in carTypeList" :key="index" @click="handleCarType(item)"> <div :class="carType===item.value?'item itemSelect':'item itemUnSelect'" v-for="(item,index) in carTypeList" :key="index" @click="handleCarType(item)">
<div class="text">{{item.name}}</div> <div class="text">{{item.name}}</div>
</div> </div>
</div> </div>
</div>
<analyse :analyseInfo="{analysisins_type: 1103,analysisins_format: 2000}" /> <analyse :analyseInfo="{analysisins_type: 1103,analysisins_format: 2000}" />
</div> </div>
<no-data v-if="!homePlace.length" :type="'car'"/> <no-data v-if="!homePlace.length" :type="'car'"/>
@ -193,6 +197,9 @@ export default {
endData:'',// endData:'',//
isFirst:true,// isFirst:true,//
carType:'',// carType:'',//
selectProvinceName:'',//
selectValue:'',//
allProvince:true,//
} }
}, },
components: { components: {
@ -207,6 +214,11 @@ export default {
this.backType = option.type this.backType = option.type
}, },
onShow(){ onShow(){
this.carTypeList.forEach(item=>{
item.select = false
})
this.selectProvinceName = ''
this.carType = ''
this.isFirst = true this.isFirst = true
// bi 西 // bi 西
// //
@ -267,30 +279,41 @@ export default {
}, },
onUnload() { onUnload() {
this.$util.addUserBehavior() this.$util.addUserBehavior()
this.carTypeList.forEach(item=>{
item.select = false
})
this.selectProvinceName = ''
this.carType = ''
}, },
methods:{ methods:{
// //
handleCarType(selectItem){ handleCarType(selectItem){
this.carTypeList.forEach(item=>{ if (selectItem.value===this.carType){
if (item.value === selectItem.value){ this.carType=''
if (item.select){ }else{
item.select = false this.carType = selectItem.value
}else{ }
item.select = true this.selectProvinceName = ''
} this.selectValue = ''
}else{ this.getHomeData(this.carType)
item.select = false
}
})
let type
this.carTypeList.forEach(item=>{
if (item.select){
type = item.value
}
})
this.carType = type
this.getHomeData(type)
}, },
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(){ async getServiceInfo(){
let id = '' let id = ''
@ -550,8 +573,7 @@ export default {
}) })
}) })
}, },
getHomeData(type){ getHomeData(){
console.log('type',type)
const date = new Date(this.endTime?this.endTime:this.time) const date = new Date(this.endTime?this.endTime:this.time)
let y = date.getFullYear() let y = date.getFullYear()
let m = date.getMonth() + 1 let m = date.getMonth() + 1
@ -560,30 +582,23 @@ export default {
} }
let statistic = `${y}${m}` let statistic = `${y}${m}`
let req let req
if (type){
req = { req = {
StatisticsMonth:statistic, StatisticsMonth:statistic,
Serverpart_ID:this.serviceInfo.Serverpart_ID, Serverpart_ID:this.serviceInfo.Serverpart_ID,
ContainWhole:true, 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=>{ request.$webGet('CommercialApi/Revenue/GetBayonetOAList',req).then(res=>{
if (this.isFirst){ if (this.isFirst){
let list = [] let list = []
res.Result_Data.OtherData.forEach(item=>{ res.Result_Data.OtherData.forEach(item=>{
list.push({name:item,value:item,select:false}) list.push({name:item,value:item})
}) })
this.carTypeList =list this.carTypeList =list
this.isFirst = false this.isFirst = false
} }
console.log('服务区',res)
// //
let result = res.Result_Data.List let result = res.Result_Data.List
@ -613,7 +628,6 @@ export default {
}) })
// //
this.cityPlaceAll = cityList this.cityPlaceAll = cityList
console.log('cityList',cityList)
this.cityPlace = cityList[this.selectTab]?cityList[this.selectTab]:[] this.cityPlace = cityList[this.selectTab]?cityList[this.selectTab]:[]
// //
this.homePlaceAll = dataList this.homePlaceAll = dataList
@ -621,6 +635,7 @@ export default {
}) })
}, },
getCityList(ProvinceName,allCount){ getCityList(ProvinceName,allCount){
uni.showLoading({ uni.showLoading({
title: '正在加载...' title: '正在加载...'
@ -634,14 +649,13 @@ export default {
let statistic = `${y}${m}` let statistic = `${y}${m}`
const req = { const req = {
StatisticsMonth:statistic, StatisticsMonth:statistic,
ProvinceName:ProvinceName, ProvinceName:ProvinceName ,
Serverpart_ID:this.serviceInfo.Serverpart_ID, Serverpart_ID:this.serviceInfo.Serverpart_ID,
VehicleType: this.carType, VehicleType: this.carType || '',
isExclude:ProvinceName.indexOf(',') !== -1 isExclude:ProvinceName.indexOf(',') !== -1,
ContainWhole:true
} }
console.log('req',req)
request.$webGet('CommercialApi/Revenue/GetBayonetProvinceOAList',req).then(res=>{ request.$webGet('CommercialApi/Revenue/GetBayonetProvinceOAList',req).then(res=>{
console.log('res',res)
let result = res.Result_Data.List let result = res.Result_Data.List
result.forEach(item=>{ result.forEach(item=>{
item.OwnerCityList.forEach(subItem=>{ item.OwnerCityList.forEach(subItem=>{
@ -653,6 +667,7 @@ export default {
}) })
uni.hideLoading() uni.hideLoading()
}, },
getCarTypeTime(){ getCarTypeTime(){
request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{ request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{
StatisticsDate:this.endTime?this.endTime:this.time, 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.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]:[] this.carTypeTimeData = this.carTypeTimeDataAll[this.selectTab]?this.carTypeTimeDataAll[this.selectTab]:[]
console.log('this.carTypeTimeData',this.carTypeTimeData)
}else{ }else{
this.carTypeTimeDataAll = [] this.carTypeTimeDataAll = []
this.carTypeTimeData = [] this.carTypeTimeData = []

View File

@ -1,8 +1,11 @@
<template> <template>
<div class="main"> <view>
<div class="main" v-if="analyseText">
<p class="title">分析</p> <p class="title">分析</p>
<div class="text">{{ analyseText }}</div> <div class="text">{{ analyseText }}</div>
</div> </div>
<view v-else></view>
</view>
</template> </template>
<script> <script>

View File

@ -12,6 +12,7 @@
<!-- <div class="dashed box4"></div>--> <!-- <div class="dashed box4"></div>-->
<!-- <div class="dashed box5"></div>--> <!-- <div class="dashed box5"></div>-->
<!-- <div class="dashed box6"></div>--> <!-- <div class="dashed box6"></div>-->
<span class="title">{{provinceName}}</span>
<view class="item" v-for="(item,index) in progressList" :key="index" @click="handleShow(index)"> <view class="item" v-for="(item,index) in progressList" :key="index" @click="handleShow(index)">
<view class="top"> <view class="top">
<p class="title">{{item.name}}</p> <p class="title">{{item.name}}</p>
@ -57,6 +58,8 @@ export default {
}, },
textList:[], textList:[],
selectIndex:7, selectIndex:7,
provinceName:'',
selectValueNumber:''
} }
}, },
props: { props: {
@ -67,6 +70,14 @@ export default {
homeCity:{ homeCity:{
type:Array, type:Array,
default:() => [] default:() => []
},
selectProvinceName:{
type:String,
default:''
},
selectValue:{
type:Number,
default:0
} }
}, },
watch: { watch: {
@ -74,14 +85,12 @@ export default {
handler(value) { handler(value) {
this.homePlacePath = '' this.homePlacePath = ''
this.handleCarData(value) this.handleCarData(value)
console.log('val',value)
}, },
immediate:true, immediate:true,
deep:true deep:true
}, },
homeCity:{ homeCity:{
handler(value){ handler(value){
console.log('homeCity',value)
value.forEach(item=>{ value.forEach(item=>{
item.rate = item.rate.toFixed(2) + '%' item.rate = item.rate.toFixed(2) + '%'
}) })
@ -89,7 +98,21 @@ export default {
}, },
immediate:true, immediate:true,
deep:true deep:true
} },
selectProvinceName:{
handler(value){
this.provinceName= value
},
immediate:true,
deep:true
},
selectValue:{
handler(value){
this.selectValue= value
},
immediate:true,
deep:true
}
}, },
methods: { methods: {
// //
@ -98,8 +121,12 @@ export default {
}, },
// //
handleTap(e){ handleTap(e){
console.log('e',e) let index = uChartsInstance[e.target.id].getCurrentDataIndex(e);
uChartsInstance[e.target.id].showToolTip(e,{ if (index===-1){
this.$parent.handleGetHome(null,null,true)
uChartsInstance[e.target.id].showToolTip(e,{})
}else{
uChartsInstance[e.target.id].showToolTip(e,{
formatter: (item, category, index, opts) =>{ formatter: (item, category, index, opts) =>{
if (item.name.split(' ')[0] === '其他'){ if (item.name.split(' ')[0] === '其他'){
let str = '' let str = ''
@ -112,16 +139,14 @@ export default {
} }
} }
}) })
this.$parent.getCityList(str,item.value) this.$parent.handleGetHome(str,item.value)
}else{ }else{
this.$parent.getCityList(item.name.split(' ')[0],item.value) this.$parent.handleGetHome(item.name.split(' ')[0],item.value)
} }
console.log('item',item)
console.log('homeCity',this.homeCity)
return item.name + ":" + item.data + '辆'; return item.name + ":" + item.data + '辆';
} }
}); });
}
uChartsInstance[e.target.id].touchLegend(e); uChartsInstance[e.target.id].touchLegend(e);
}, },
// //
@ -138,12 +163,13 @@ export default {
} }
] ]
} }
this.drawCharts('homePlace', res) this.drawCharts('homePlace', res,this.provinceName)
}, },
drawCharts(id, data) { drawCharts(id, data,provinceName) {
const ctx = uni.createCanvasContext(id, this); const ctx = uni.createCanvasContext(id, this);
let phoneInfo = uni.getStorageSync('phoneInfo') let phoneInfo = uni.getStorageSync('phoneInfo')
let width = phoneInfo.screenWidth-32 let width = phoneInfo.screenWidth-32
const _this = this
uChartsInstance[id] = new uCharts({ uChartsInstance[id] = new uCharts({
type: "ring", type: "ring",
context: ctx, context: ctx,
@ -159,6 +185,9 @@ export default {
padding: [5, 5, 5, 5], padding: [5, 5, 5, 5],
dataLabel: false, dataLabel: false,
enableScroll: false, enableScroll: false,
// title:{
// name: provinceName
// },
legend: { legend: {
show: true, show: true,
position: "right", position: "right",
@ -209,6 +238,8 @@ export default {
height: 160px; height: 160px;
width: 100%; width: 100%;
.carNum{ .carNum{
position: absolute;
width: 100%; width: 100%;
height: 160px; height: 160px;
} }
@ -217,6 +248,13 @@ export default {
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
.title{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #160002;
line-height: 20px;
}
.dashed{ .dashed{
width: 1px; width: 1px;
height: 85%; height: 85%;

View File

@ -31,7 +31,7 @@
>{{ item }}</div> >{{ item }}</div>
</div> </div>
</div> </div>
<div class="analyse"> <div class="analyse" v-if="analyseText">
<text class="title">分析</text> <text class="title">分析</text>
<text class="content">{{analyseText}}</text> <text class="content">{{analyseText}}</text>
</div> </div>

View File

@ -45,66 +45,66 @@ export default {
if (index >m){ if (index >m){
if (this.selectIndex===0){ if (this.selectIndex===0){
if (item.name === '工作日平均'){ if (item.name === '工作日平均'){
return item.name + ":" + item.data + '万元' return item.name + "" + item.data + '万元'
}else if(item.name === '周末平均'){ }else if(item.name === '周末平均'){
return item.name + ":" + item.data + '万元' return item.name + "" + item.data + '万元'
}else { }else {
return item.name + ":" + item.data + '万元' return item.name + "" + item.data + '万元'
} }
}else if(this.selectIndex === 1){ }else if(this.selectIndex === 1){
if (item.name === '工作日平均'){ if (item.name === '工作日平均'){
return item.name + ":" + item.data + '笔' return item.name + "" + this.$util.noDecimal(item.data) + '笔'
}else if(item.name === '周末平均'){ }else if(item.name === '周末平均'){
return item.name + ":" + item.data + '笔' return item.name + "" + this.$util.noDecimal(item.data) + '笔'
}else { }else {
return item.name + ":" + item.data + '笔' return item.name + "" +this.$util.noDecimal(item.data) + '笔'
} }
}else if(this.selectIndex === 2){ }else if(this.selectIndex === 2){
if (item.name === '工作日平均'){ if (item.name === '工作日平均'){
return item.name + ":" + item.data + '元' return item.name + "" + item.data + '元'
}else if(item.name === '周末平均'){ }else if(item.name === '周末平均'){
return item.name + ":" + item.data + '元' return item.name + "" + item.data + '元'
}else { }else {
return item.name + ":" + item.data + '元' return item.name + "" + item.data + '元'
} }
} }
}else{ }else{
if (this.selectIndex===0){ if (this.selectIndex===0){
if (item.name === '工作日平均'){ if (item.name === '工作日平均'){
return item.name + ":" + item.data + '万元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' return item.name + "" + item.data + '万元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%'
}else if(item.name === '周末平均'){ }else if(item.name === '周末平均'){
return item.name + ":" + item.data + '万元,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%' return item.name + "" + item.data + '万元,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%'
}else { }else {
// //
if (opts.series[2].holiday[index][1]){ if (opts.series[2].holiday[index][1]){
return item.name + ":" + item.data + '万元' + '(' + opts.series[2].holiday[index][1] + ')' return item.name + "" + item.data + '万元' + '(' + opts.series[2].holiday[index][1] + ')'
}else{ }else{
return item.name + ":" + item.data + '万元' return item.name + "" + item.data + '万元'
} }
} }
}else if (this.selectIndex === 1){ }else if (this.selectIndex === 1){
if (item.name === '工作日平均'){ if (item.name === '工作日平均'){
return item.name + ":" + item.data + '笔,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' return item.name + "" + this.$util.noDecimal(item.data) + '笔,' + '较上月:' + opts.series[0].qoqAdd[index] + '%'
}else if(item.name === '周末平均'){ }else if(item.name === '周末平均'){
return item.name + ":" + item.data + '笔,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%' return item.name + "" + this.$util.noDecimal(item.data) + '笔,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%'
}else { }else {
if (opts.series[2].holiday[index][1]){ if (opts.series[2].holiday[index][1]){
return item.name + ":" + item.data + '笔' + '(' + opts.series[2].holiday[index][1] + ')' return item.name + "" + this.$util.noDecimal(item.data) + '笔' + '(' + opts.series[2].holiday[index][1] + ')'
}else{ }else{
return item.name + ":" + item.data + '笔' return item.name + "" + this.$util.noDecimal(item.data) + '笔'
} }
} }
}else if(this.selectIndex === 2){ }else if(this.selectIndex === 2){
if (item.name === '工作日平均'){ if (item.name === '工作日平均'){
return item.name + ":" + item.data + '元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' return item.name + "" + item.data + '元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%'
}else if(item.name === '周末平均'){ }else if(item.name === '周末平均'){
return item.name + ":" + item.data + '元,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%' return item.name + "" + item.data + '元,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%'
}else { }else {
if (opts.series[2].holiday[index][1]){ if (opts.series[2].holiday[index][1]){
return item.name + ":" + item.data + '元' + '(' + opts.series[2].holiday[index][1] + ')' return item.name + "" + item.data + '元' + '(' + opts.series[2].holiday[index][1] + ')'
}else{ }else{
return item.name + ":" + item.data + '元' return item.name + "" + item.data + '元'
} }
} }
} }

View File

@ -61,7 +61,9 @@ export default {
watch: { watch: {
data: { data: {
handler(value) { handler(value) {
this.dataInfo = value this.dataInfo = value
this.dataInfo.ContractProfitLoss = this.$util.fmoney(this.dataInfo.ContractProfitLoss)
this.dataInfo.SalesPerSquareMeter = this.$util.fmoney(this.dataInfo.SalesPerSquareMeter)
console.log('value',value) console.log('value',value)
} }
} }

View File

@ -526,7 +526,7 @@ export default {
}, },
}, },
{ {
data:data.Result_Data.TicketCount, data:this.$util.noDecimal(data.Result_Data.TicketCount),
add:data.Result_Data.TicketCountYOYRate , add:data.Result_Data.TicketCountYOYRate ,
list:{ list:{
categories: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"], categories: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],

View File

@ -132,8 +132,10 @@
<image class="bottomIcon" src="https://eshangtech.com/ShopICO/ahyd-BID/brand/date.svg"></image> <image class="bottomIcon" src="https://eshangtech.com/ShopICO/ahyd-BID/brand/date.svg"></image>
<text class="text">{{ item.PROJECT_STARTDATE && item.PROJECT_ENDDATE ?`${item.PROJECT_STARTDATE}-${item.PROJECT_ENDDATE}`:'-' }}</text> <text class="text">{{ item.PROJECT_STARTDATE && item.PROJECT_ENDDATE ?`${item.PROJECT_STARTDATE}-${item.PROJECT_ENDDATE}`:'-' }}</text>
</div> </div>
<div class="bottomItem"> <div class="bottomItem progressBox">
<div class="bottomIcon"></div> <div class="progress">
<div class="have" :style="{width:item.progress }"></div>
</div>
<text class="text">{{item.progress}}</text> <text class="text">{{item.progress}}</text>
</div> </div>
</div> </div>
@ -722,6 +724,21 @@ export default {
margin-right: 4px; margin-right: 4px;
margin-top: 2px; margin-top: 2px;
} }
.progress{
width: 150px;
height: 8px;
border-radius: 4px;
background: #f5f2f2;
margin-right: 4px;
position: relative;
overflow: hidden;
.have{
position: absolute;
left: 0;top: 0;
height: 100%;
background: rgb(107, 150, 248);
}
}
.text{ .text{
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
@ -731,6 +748,10 @@ export default {
line-height: 22px; line-height: 22px;
} }
} }
.progressBox{
display: flex;
align-items: center;
}
} }
.bottomItemRight{ .bottomItemRight{
width: 60px; width: 60px;

View File

@ -336,6 +336,8 @@ export default {
}, },
// //
handleShowPopup(value,obj){ handleShowPopup(value,obj){
console.log('value',value)
console.log('obj',obj)
this.popupShow = value this.popupShow = value
if (value===2){ if (value===2){
// //