update
This commit is contained in:
parent
2ba9a56866
commit
ccabdb6424
@ -18,9 +18,21 @@
|
||||
</view>
|
||||
<!-- <view class="pageTitle" :style="{top: menu.bottom + 5 + 12 +'px'}">营收统计</view>-->
|
||||
<view :style="{paddingTop: menu.bottom + 5 + 8 +'px'}">
|
||||
<view class="tabBox" >
|
||||
<image :class="selectTab===1?'selectTabItem':'tabItem'" @click="handleChangeTab(1)" :src="selectTab===1?'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/activeFirstTab.png':'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/firstTab.png'"/>
|
||||
<image :class="selectTab===2?'selectTabItem':'tabItem'" @click="handleChangeTab(2)" :src="selectTab===2?'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/activeSecondTab.png':'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/secondTab.png'"/>
|
||||
<view class="tabBox">
|
||||
<div class="tab">
|
||||
<image :class="selectTab===1?'selectTabItem':'tabItem'" @click="handleChangeTab(1)" :src="selectTab===1?'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/activeFirstTab.png':'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/firstTab.png'"/>
|
||||
<image :class="selectTab===2?'selectTabItem':'tabItem'" @click="handleChangeTab(2)" :src="selectTab===2?'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/activeSecondTab.png':'https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/secondTab.png'"/>
|
||||
</div>
|
||||
<div class="timeSelect">
|
||||
<!-- <uni-datetime-picker />-->
|
||||
<picker mode="date" fields="month" :start="defaultStart" class="screen-unit" @change="handleChangeSelectStart($event)">
|
||||
<text class="time">{{ selectStart || '开始时间' }}</text>
|
||||
</picker>
|
||||
<span style="margin: 0 4px">-</span>
|
||||
<picker mode="date" fields="month" class="screen-unit" :start="selectStart" :end="endTime" @change="handleChangeSelectEnd($event)">
|
||||
<text class="time">{{ selectEnd || '结束时间' }}</text>
|
||||
</picker>
|
||||
</div>
|
||||
</view>
|
||||
<scroll-view class="scrollView" :current="currentScroll" scroll-x="true" :scroll-into-view="'item'+selectIndex" scroll-with-animation>
|
||||
<view class="bigView" :style="{width: `${60*selectList.length +20}px`}">
|
||||
@ -655,7 +667,11 @@ export default {
|
||||
pageAccountList:[],// 页面上营业收入
|
||||
curYear:2024,// 当前年
|
||||
query:{},
|
||||
currentMonth:''
|
||||
currentMonth:'',
|
||||
defaultStart:'',// 默认开始时间
|
||||
selectStart:'',// 选择的开始时间
|
||||
selectEnd:'',// 选择的结束时间
|
||||
endTime:'',// 截止时间
|
||||
}
|
||||
},
|
||||
async onLoad(option){
|
||||
@ -686,8 +702,12 @@ export default {
|
||||
let currentMonth = selectDate.getMonth() + 1
|
||||
this.currentMonth = currentMonth
|
||||
this.curYear = selectYear
|
||||
this.defaultStart = `${selectYear}-01`
|
||||
this.selectStart = `${selectYear}-01`
|
||||
|
||||
const nowDate = new Date()
|
||||
let endMonth = nowDate.getMonth() + 1
|
||||
this.endTime = `${selectYear}-${endMonth<10?'0'+endMonth:endMonth}`
|
||||
let nowYear = nowDate.getFullYear()
|
||||
let monthNumber = 0
|
||||
if (nowYear>selectYear){
|
||||
@ -712,6 +732,83 @@ export default {
|
||||
uni.hideLoading()
|
||||
},
|
||||
methods:{
|
||||
// 选择开始时间
|
||||
async handleChangeSelectStart(e){
|
||||
console.log('e',e)
|
||||
this.selectStart = e.detail.value
|
||||
const date = new Date(this.selectEnd)
|
||||
let m = date.getMonth() + 1
|
||||
if (this.selectStart && this.selectEnd){
|
||||
uni.showLoading({
|
||||
title:'正在加载'
|
||||
})
|
||||
this.handleGetPageData(m)
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
// 选择结束时间
|
||||
async handleChangeSelectEnd(e){
|
||||
this.selectEnd = e.detail.value
|
||||
console.log('this.selectEnd',this.selectEnd)
|
||||
const date = new Date(this.selectEnd)
|
||||
let m = date.getMonth() + 1
|
||||
console.log(' m', m)
|
||||
if (this.selectStart && this.selectEnd){
|
||||
uni.showLoading({
|
||||
title:'正在加载'
|
||||
})
|
||||
await this.handleGetPageData(m)
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
// 请求数据的方法
|
||||
async handleGetPageData(month){
|
||||
|
||||
if (this.selectStart && this.selectEnd){
|
||||
const req = {
|
||||
calcType: 2,
|
||||
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
||||
curYear: this.curYear,//本年年份
|
||||
compareYear: this.curYear-1,//历年年份
|
||||
StatisticsMonth: month,//结算月份
|
||||
StatisticsDate: this.lastDay
|
||||
}
|
||||
console.log('req',req)
|
||||
const data = await request.$webGet('CommercialApi/Revenue/GetMonthlyBusinessAnalysis',req)
|
||||
let res = data.Result_Data.List
|
||||
if (res && res.length>0){
|
||||
let everyTop = {}// 每一块顶部内容的汇总对象
|
||||
let revenueList = [{},{},{},{},{}]// 对客营收
|
||||
let accountList = [{},{},{},{},{}]// 营业收入
|
||||
res.forEach(item=>{
|
||||
if (item.ServerpartName==='累计'){
|
||||
everyTop = item
|
||||
}else if(item.SPRegionTypeId===1){
|
||||
// SPRegionTypeId===1 自营
|
||||
revenueList[0] = {...item.RevenueINC, type:1}
|
||||
accountList[0] = {...item.AccountINC, type:1}
|
||||
}else if(item.SPRegionTypeId===2){
|
||||
// SPRegionTypeId===2 外包
|
||||
revenueList[3] = {...item.RevenueINC, type:1}
|
||||
accountList[3] = {...item.AccountINC, type:1}
|
||||
}else if(item.ServerpartId===1){
|
||||
revenueList[1] = {...item.RevenueINC, type:2}
|
||||
accountList[1] = {...item.AccountINC, type:2}
|
||||
}else if(item.ServerpartId===2){
|
||||
revenueList[2] = {...item.RevenueINC,type:2}
|
||||
accountList[2] = {...item.AccountINC,type:2}
|
||||
}else if(item.ServerpartId===3){
|
||||
revenueList[4] = {...item.RevenueINC,type:2}
|
||||
accountList[4] = {...item.AccountINC,type:2}
|
||||
}
|
||||
})
|
||||
this.topDetail = everyTop
|
||||
this.pageRevenueList = revenueList
|
||||
console.log('accountList',accountList)
|
||||
this.pageAccountList = accountList
|
||||
}
|
||||
}
|
||||
},
|
||||
// 跳转到服务区排名
|
||||
handleGoSort(type){
|
||||
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/servicePartList?type=${type}&yearMonth=${this.searchText}&thisMonth=${this.thisMonth && this.thisMonth!=='0'?this.thisMonth:this.currentMonth}`)
|
||||
@ -942,18 +1039,35 @@ export default {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 32rpx;
|
||||
padding-right: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.tabItem{
|
||||
width: 204rpx;
|
||||
height: 68rpx;
|
||||
margin-right: 48rpx;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
.tab{
|
||||
.tabItem{
|
||||
width: 204rpx;
|
||||
height: 68rpx;
|
||||
margin-right: 48rpx;
|
||||
}
|
||||
.selectTabItem{
|
||||
width: 204rpx;
|
||||
height: 68rpx;
|
||||
margin-right: 48rpx;
|
||||
}
|
||||
}
|
||||
.selectTabItem{
|
||||
width: 204rpx;
|
||||
height: 68rpx;
|
||||
margin-right: 48rpx;
|
||||
.timeSelect{
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.time{
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.scrollView{
|
||||
width: calc(100vw - 64rpx);
|
||||
|
||||
@ -187,10 +187,10 @@ export default {
|
||||
selectIndexPage: 1,// 页数
|
||||
query:{},// 传递的query
|
||||
}
|
||||
},
|
||||
onLoad(query){
|
||||
},
|
||||
onLoad(query){
|
||||
console.log('query',query)
|
||||
this.query = query
|
||||
this.query = query
|
||||
// 获取手机参数对页面进行适配
|
||||
let systemInfo = uni.getSystemInfoSync()
|
||||
this.statusBarHeight = Number(systemInfo.statusBarHeight)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user