update
This commit is contained in:
parent
ccabdb6424
commit
2869daa75f
@ -138,13 +138,20 @@ export default {
|
|||||||
dataList:[],// 数据数组
|
dataList:[],// 数据数组
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(query){
|
||||||
|
console.log('query',query)
|
||||||
this.menu = uni.getMenuButtonBoundingClientRect()
|
this.menu = uni.getMenuButtonBoundingClientRect()
|
||||||
let lastDay = uni.getStorageSync('lastDay')
|
let lastDay = uni.getStorageSync('lastDay')
|
||||||
const date = new Date(lastDay)
|
let date = undefined
|
||||||
|
if (query.month){
|
||||||
|
date = new Date(query.month)
|
||||||
|
}else{
|
||||||
|
date = new Date(lastDay)
|
||||||
|
}
|
||||||
let y = date.getFullYear()
|
let y = date.getFullYear()
|
||||||
let m = date.getMonth() + 1
|
let m = date.getMonth() + 1
|
||||||
this.single = `${y}-${m<10?'0'+m :m}`
|
this.single = `${y}-${m<10?'0'+m :m}`
|
||||||
|
console.log('this.single',this.single)
|
||||||
this.endData = lastDay
|
this.endData = lastDay
|
||||||
this.handleGetPageData()
|
this.handleGetPageData()
|
||||||
},
|
},
|
||||||
|
|||||||
@ -11,6 +11,11 @@
|
|||||||
<view class="tabBox" >
|
<view class="tabBox" >
|
||||||
{{ServerpartName || ''}}
|
{{ServerpartName || ''}}
|
||||||
<!-- <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===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'"/>-->
|
||||||
|
<div class="timeSelect">
|
||||||
|
<span class="moreText" @click="handleShowPopup">更多筛选</span>
|
||||||
|
<!-- <uni-datetime-picker />-->
|
||||||
|
|
||||||
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="scrollView" :current="currentScroll" scroll-x="true" :scroll-into-view="'item'+selectIndex" scroll-with-animation>
|
<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`}">
|
<view class="bigView" :style="{width: `${60*selectList.length +20}px`}">
|
||||||
@ -193,11 +198,37 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<uniPopup class="popupBox" type="bottom" :round="true" :showIndex="1" :show="showPop" @hidePopup="hidePopup">
|
||||||
|
<view class="popupContentBox">
|
||||||
|
<view class="label">统计时间:</view>
|
||||||
|
<view class="popupTitleBox">
|
||||||
|
<view class="timeSelectBox">
|
||||||
|
<picker mode="date" fields="month" class="screen-unit" :end="endTime" @change="handleChangeSelectStart($event)">
|
||||||
|
<text class="time">{{ selectStart || '开始时间' }}</text>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<span class="unit" style="margin: 0 4px">-</span>
|
||||||
|
<view class="timeSelectBox">
|
||||||
|
<picker mode="date" fields="month" class="screen-unit" :start="selectStart" :end="endTime" @change="handleChangeSelectEnd($event)">
|
||||||
|
<text class="time">{{ selectEnd || '结束时间' }}</text>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="searchButton" @click="handleSearchTime">查询</view>
|
||||||
|
</view>
|
||||||
|
</uniPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/util/index.js'
|
import request from '@/util/index.js'
|
||||||
|
import uniPopup from '@/components/uni-popup'
|
||||||
export default {
|
export default {
|
||||||
|
components:{
|
||||||
|
uniPopup
|
||||||
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
statusBarHeight: '',
|
statusBarHeight: '',
|
||||||
@ -219,6 +250,10 @@ export default {
|
|||||||
curYear:2024,// 当前年
|
curYear:2024,// 当前年
|
||||||
ServerpartId:'',
|
ServerpartId:'',
|
||||||
ServerpartName:'',// 服务区名称
|
ServerpartName:'',// 服务区名称
|
||||||
|
selectStart:'',// 开始时间
|
||||||
|
selectEnd:'',// 结束时间
|
||||||
|
showPop: false,// 低层的弹出框
|
||||||
|
endTime:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onLoad(option){
|
async onLoad(option){
|
||||||
@ -247,6 +282,7 @@ export default {
|
|||||||
if (option.name){
|
if (option.name){
|
||||||
this.ServerpartName = option.name
|
this.ServerpartName = option.name
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option.month){
|
if (option.month){
|
||||||
this.searchText = option.month
|
this.searchText = option.month
|
||||||
const selectDate = new Date(option.month)
|
const selectDate = new Date(option.month)
|
||||||
@ -255,6 +291,8 @@ export default {
|
|||||||
|
|
||||||
const nowDate = new Date()
|
const nowDate = new Date()
|
||||||
let nowYear = nowDate.getFullYear()
|
let nowYear = nowDate.getFullYear()
|
||||||
|
let nowMonth = nowDate.getMonth() + 1
|
||||||
|
this.endTime = `${nowYear}-${nowMonth<10?'0'+nowMonth:nowMonth}`
|
||||||
let monthNumber = 0
|
let monthNumber = 0
|
||||||
if (nowYear>selectYear){
|
if (nowYear>selectYear){
|
||||||
monthNumber = 12
|
monthNumber = 12
|
||||||
@ -267,21 +305,115 @@ export default {
|
|||||||
this.selectIndex = selectMonth
|
this.selectIndex = selectMonth
|
||||||
this.currentScroll = 'item' + this.thisMonth
|
this.currentScroll = 'item' + this.thisMonth
|
||||||
|
|
||||||
for (let i=1;i<=monthNumber;i++){
|
for (let i=1;i<=nowMonth;i++){
|
||||||
this.selectList.push(`${i}月`)
|
this.selectList.push(`${i}月`)
|
||||||
}
|
}
|
||||||
this.selectList.unshift('累计')
|
this.selectList.unshift('累计')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (option.allSearch==='true'){
|
||||||
|
this.selectStart = option.selectStart
|
||||||
|
this.selectEnd = option.selectEnd
|
||||||
|
this.currentScroll = 'item0'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option.allSearch==='true'){
|
||||||
|
await this.handleGetSearchAll()
|
||||||
|
}else{
|
||||||
console.log('this.selectList',this.selectList)
|
console.log('this.selectList',this.selectList)
|
||||||
await this.handleGetRevenueData()
|
await this.handleGetRevenueData()
|
||||||
|
}
|
||||||
|
|
||||||
// await this.handleGetTableData()
|
// await this.handleGetTableData()
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
// 点击查询调用的方法
|
||||||
|
async handleSearchTime(){
|
||||||
|
if (this.selectStart && this.selectEnd){
|
||||||
|
this.hidePopup()
|
||||||
|
this.currentScroll = 'item0'
|
||||||
|
uni.showLoading({
|
||||||
|
title:'正在加载'
|
||||||
|
})
|
||||||
|
await this.handleGetSearchAll()
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleChangeSelectStart(e){
|
||||||
|
this.selectStart = e.detail.value
|
||||||
|
},
|
||||||
|
async handleChangeSelectEnd(e){
|
||||||
|
this.selectEnd = e.detail.value
|
||||||
|
},
|
||||||
|
// 弹出框点击打开
|
||||||
|
handleShowPopup(){
|
||||||
|
this.showPop = true
|
||||||
|
},
|
||||||
|
|
||||||
|
// 弹出框点击蒙层关闭
|
||||||
|
hidePopup(){
|
||||||
|
this.showPop = false
|
||||||
|
},
|
||||||
// 跳转到服务区排名
|
// 跳转到服务区排名
|
||||||
handleGoSort(type){
|
handleGoSort(type){
|
||||||
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/servicePartList?type=${type}&yearMonth=${this.searchText}&thisMonth=${this.thisMonth}`)
|
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/servicePartList?type=${type}&yearMonth=${this.searchText}&thisMonth=${this.thisMonth}`)
|
||||||
},
|
},
|
||||||
|
// 查累计的
|
||||||
|
async handleGetSearchAll(){
|
||||||
|
let startDate = new Date(this.selectStart)
|
||||||
|
let y = startDate.getFullYear()
|
||||||
|
let m = startDate.getMonth() + 1
|
||||||
|
let startMonth = `${y}${m<10?'0'+m:m}`
|
||||||
|
|
||||||
|
let endDate = new Date(this.selectEnd)
|
||||||
|
let endY = endDate.getFullYear()
|
||||||
|
let endM = endDate.getMonth() + 1
|
||||||
|
let endMonth = `${endY}${endM<10?'0'+endM:endM}`
|
||||||
|
let lastDay = uni.getStorageSync('lastDay')
|
||||||
|
const req = {
|
||||||
|
calcType: 2,
|
||||||
|
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
||||||
|
curYear: this.curYear,//本年年份
|
||||||
|
compareYear: this.curYear-1,//历年年份
|
||||||
|
StatisticsStartMonth:startMonth,
|
||||||
|
StatisticsMonth: endM,//结算月份
|
||||||
|
StatisticsDate: lastDay,
|
||||||
|
ServerpartId:this.ServerpartId
|
||||||
|
}
|
||||||
|
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
|
||||||
|
this.pageAccountList = accountList
|
||||||
|
}
|
||||||
|
},
|
||||||
async handleGetRevenueData(){
|
async handleGetRevenueData(){
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
let y = date.getFullYear()
|
let y = date.getFullYear()
|
||||||
@ -339,7 +471,11 @@ export default {
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title:'正在加载'
|
title:'正在加载'
|
||||||
})
|
})
|
||||||
|
if (index===0){
|
||||||
|
await this.handleGetSearchAll
|
||||||
|
}else{
|
||||||
await this.handleGetRevenueData()
|
await this.handleGetRevenueData()
|
||||||
|
}
|
||||||
// await this.handleGetTableData()
|
// await this.handleGetTableData()
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},
|
},
|
||||||
@ -514,6 +650,11 @@ export default {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
margin-left: 32rpx;
|
margin-left: 32rpx;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
position: relative;
|
||||||
.tabItem{
|
.tabItem{
|
||||||
width: 204rpx;
|
width: 204rpx;
|
||||||
height: 68rpx;
|
height: 68rpx;
|
||||||
@ -524,6 +665,23 @@ export default {
|
|||||||
height: 68rpx;
|
height: 68rpx;
|
||||||
margin-right: 48rpx;
|
margin-right: 48rpx;
|
||||||
}
|
}
|
||||||
|
.timeSelect{
|
||||||
|
position: absolute;
|
||||||
|
right: 32rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.moreText{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.time{
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.scrollView{
|
.scrollView{
|
||||||
width: calc(100vw - 64rpx);
|
width: calc(100vw - 64rpx);
|
||||||
@ -1075,5 +1233,47 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.popupContentBox{
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 16px;
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
position: relative;
|
||||||
|
.label{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
.popupTitleBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.timeSelectBox{
|
||||||
|
width: 45%;
|
||||||
|
}
|
||||||
|
.unit{
|
||||||
|
width: 10%;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchButton{
|
||||||
|
position: absolute;
|
||||||
|
left: 10%;
|
||||||
|
bottom: 0;
|
||||||
|
//margin-left: 10%;
|
||||||
|
//margin-top: 40px;
|
||||||
|
width: 80%;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 6px 0;
|
||||||
|
text-align: center;
|
||||||
|
background: #1890FF;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -24,14 +24,9 @@
|
|||||||
<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'"/>
|
<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>
|
||||||
<div class="timeSelect">
|
<div class="timeSelect">
|
||||||
|
<span class="moreText" @click="handleShowPopup">更多筛选</span>
|
||||||
<!-- <uni-datetime-picker />-->
|
<!-- <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>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="scrollView" :current="currentScroll" scroll-x="true" :scroll-into-view="'item'+selectIndex" scroll-with-animation>
|
<scroll-view class="scrollView" :current="currentScroll" scroll-x="true" :scroll-into-view="'item'+selectIndex" scroll-with-animation>
|
||||||
@ -641,12 +636,40 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<uniPopup class="popupBox" type="bottom" :round="true" :showIndex="1" :show="showPop" @hidePopup="hidePopup">
|
||||||
|
<view class="popupContentBox">
|
||||||
|
<view class="label">统计时间:</view>
|
||||||
|
<view class="popupTitleBox">
|
||||||
|
<view class="timeSelectBox">
|
||||||
|
<picker mode="date" fields="month" :start="defaultStart" :end="endTime" class="screen-unit" @change="handleChangeSelectStart($event)">
|
||||||
|
<text class="time">{{ selectStart || '开始时间' }}</text>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<span class="unit" style="margin: 0 4px">-</span>
|
||||||
|
<view class="timeSelectBox">
|
||||||
|
<picker mode="date" fields="month" class="screen-unit" :start="selectStart" :end="endTime" @change="handleChangeSelectEnd($event)">
|
||||||
|
<text class="time">{{ selectEnd || '结束时间' }}</text>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="searchButton" @click="handleSearchTime">查询</view>
|
||||||
|
</view>
|
||||||
|
</uniPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/util/index.js'
|
import request from '@/util/index.js'
|
||||||
|
import uniPopup from '@/components/uni-popup'
|
||||||
export default {
|
export default {
|
||||||
|
components:{
|
||||||
|
uniPopup
|
||||||
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
statusBarHeight: '',
|
statusBarHeight: '',
|
||||||
@ -672,6 +695,9 @@ export default {
|
|||||||
selectStart:'',// 选择的开始时间
|
selectStart:'',// 选择的开始时间
|
||||||
selectEnd:'',// 选择的结束时间
|
selectEnd:'',// 选择的结束时间
|
||||||
endTime:'',// 截止时间
|
endTime:'',// 截止时间
|
||||||
|
endSelectTime: '',// 限制截止时间
|
||||||
|
showPop: false,// 低层的弹出框
|
||||||
|
optionMonth:'',// 传入的月份
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onLoad(option){
|
async onLoad(option){
|
||||||
@ -696,6 +722,7 @@ export default {
|
|||||||
let m = date.getMonth() + 1
|
let m = date.getMonth() + 1
|
||||||
}
|
}
|
||||||
if (option.month){
|
if (option.month){
|
||||||
|
this.optionMonth = option.month
|
||||||
this.searchText = option.month
|
this.searchText = option.month
|
||||||
const selectDate = new Date(option.month)
|
const selectDate = new Date(option.month)
|
||||||
let selectYear = selectDate.getFullYear()
|
let selectYear = selectDate.getFullYear()
|
||||||
@ -706,14 +733,17 @@ export default {
|
|||||||
this.selectStart = `${selectYear}-01`
|
this.selectStart = `${selectYear}-01`
|
||||||
|
|
||||||
const nowDate = new Date()
|
const nowDate = new Date()
|
||||||
|
let nowY = nowDate.getFullYear()
|
||||||
let endMonth = nowDate.getMonth() + 1
|
let endMonth = nowDate.getMonth() + 1
|
||||||
|
this.endSelectTime = `${nowY}-${endMonth}`
|
||||||
this.endTime = `${selectYear}-${endMonth<10?'0'+endMonth:endMonth}`
|
this.endTime = `${selectYear}-${endMonth<10?'0'+endMonth:endMonth}`
|
||||||
let nowYear = nowDate.getFullYear()
|
let nowYear = nowDate.getFullYear()
|
||||||
|
let nowMonth = nowDate.getMonth() + 1
|
||||||
let monthNumber = 0
|
let monthNumber = 0
|
||||||
if (nowYear>selectYear){
|
if (nowYear>selectYear){
|
||||||
monthNumber = 12
|
monthNumber = 12
|
||||||
}else{
|
}else{
|
||||||
monthNumber = selectDate.getMonth() + 1
|
monthNumber = nowMonth
|
||||||
}
|
}
|
||||||
let selectMonth = selectDate.getMonth() + 1
|
let selectMonth = selectDate.getMonth() + 1
|
||||||
|
|
||||||
@ -732,19 +762,40 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
// 弹出框点击打开
|
||||||
|
handleShowPopup(){
|
||||||
|
this.showPop = true
|
||||||
|
},
|
||||||
|
// 弹出框点击蒙层关闭
|
||||||
|
hidePopup(){
|
||||||
|
this.showPop = false
|
||||||
|
},
|
||||||
|
// 点击查询调用的方法
|
||||||
|
async handleSearchTime(){
|
||||||
|
if (this.selectStart && this.selectEnd){
|
||||||
|
this.hidePopup()
|
||||||
|
this.currentScroll = 'item0'
|
||||||
|
uni.showLoading({
|
||||||
|
title:'正在加载'
|
||||||
|
})
|
||||||
|
await this.handleGetPageData()
|
||||||
|
await this.handleGetTableDataFilter()
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
// 选择开始时间
|
// 选择开始时间
|
||||||
async handleChangeSelectStart(e){
|
async handleChangeSelectStart(e){
|
||||||
console.log('e',e)
|
console.log('e',e)
|
||||||
this.selectStart = e.detail.value
|
this.selectStart = e.detail.value
|
||||||
const date = new Date(this.selectEnd)
|
const date = new Date(this.selectEnd)
|
||||||
let m = date.getMonth() + 1
|
let m = date.getMonth() + 1
|
||||||
if (this.selectStart && this.selectEnd){
|
// if (this.selectStart && this.selectEnd){
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title:'正在加载'
|
// title:'正在加载'
|
||||||
})
|
// })
|
||||||
this.handleGetPageData(m)
|
// this.handleGetPageData(m)
|
||||||
uni.hideLoading()
|
// uni.hideLoading()
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
// 选择结束时间
|
// 选择结束时间
|
||||||
async handleChangeSelectEnd(e){
|
async handleChangeSelectEnd(e){
|
||||||
@ -753,24 +804,33 @@ export default {
|
|||||||
const date = new Date(this.selectEnd)
|
const date = new Date(this.selectEnd)
|
||||||
let m = date.getMonth() + 1
|
let m = date.getMonth() + 1
|
||||||
console.log(' m', m)
|
console.log(' m', m)
|
||||||
if (this.selectStart && this.selectEnd){
|
// if (this.selectStart && this.selectEnd){
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title:'正在加载'
|
// title:'正在加载'
|
||||||
})
|
// })
|
||||||
await this.handleGetPageData(m)
|
// await this.handleGetPageData(m)
|
||||||
uni.hideLoading()
|
// uni.hideLoading()
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
// 请求数据的方法
|
// 请求数据的方法 更多筛选的解读请求方法
|
||||||
async handleGetPageData(month){
|
async handleGetPageData(){
|
||||||
|
|
||||||
if (this.selectStart && this.selectEnd){
|
if (this.selectStart && this.selectEnd){
|
||||||
|
let startDate = new Date(this.selectStart)
|
||||||
|
let y = startDate.getFullYear()
|
||||||
|
let m = startDate.getMonth() + 1
|
||||||
|
let startMonth = `${y}${m<10?'0'+m:m}`
|
||||||
|
|
||||||
|
let endDate = new Date(this.selectEnd)
|
||||||
|
let endY = endDate.getFullYear()
|
||||||
|
let endM = endDate.getMonth() + 1
|
||||||
|
let endMonth = `${endY}${endM<10?'0'+endM:endM}`
|
||||||
const req = {
|
const req = {
|
||||||
calcType: 2,
|
calcType: 2,
|
||||||
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
||||||
curYear: this.curYear,//本年年份
|
curYear: this.curYear,//本年年份
|
||||||
compareYear: this.curYear-1,//历年年份
|
compareYear: this.curYear-1,//历年年份
|
||||||
StatisticsMonth: month,//结算月份
|
StatisticsStartMonth:startMonth,
|
||||||
|
StatisticsMonth: endM,//结算月份
|
||||||
StatisticsDate: this.lastDay
|
StatisticsDate: this.lastDay
|
||||||
}
|
}
|
||||||
console.log('req',req)
|
console.log('req',req)
|
||||||
@ -809,10 +869,74 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async handleGetTableDataFilter(){
|
||||||
|
let startDate = new Date(this.selectStart)
|
||||||
|
let y = startDate.getFullYear()
|
||||||
|
let m = startDate.getMonth() + 1
|
||||||
|
let startMonth = `${y}${m<10?'0'+m:m}`
|
||||||
|
|
||||||
|
let endDate = new Date(this.selectEnd)
|
||||||
|
let endY = endDate.getFullYear()
|
||||||
|
let endM = endDate.getMonth() + 1
|
||||||
|
let endMonth = `${endY}${endM<10?'0'+endM:endM}`
|
||||||
|
|
||||||
|
const req = {
|
||||||
|
calcType: 2,
|
||||||
|
pushProvinceCode:'340000',
|
||||||
|
StatisticsStartMonth: startMonth,
|
||||||
|
StatisticsMonth: endMonth,//结算月份
|
||||||
|
StatisticsDate:this.lastDay
|
||||||
|
}
|
||||||
|
const data = await request.$webGet('CommercialApi/Revenue/GetAccountReceivable',req)
|
||||||
|
if (data.Result_Code===100){
|
||||||
|
this.pageDataObj = data.Result_Data
|
||||||
|
let OwnerAcountSum = 0
|
||||||
|
let OwnerEntrySum = 0
|
||||||
|
let OwnerReceivableSum = 0
|
||||||
|
|
||||||
|
let MerchantAcountSum = 0
|
||||||
|
let MerchantEntrySum = 0
|
||||||
|
let MerchantReceivableSum = 0
|
||||||
|
this.pageDataObj.OwnerList.AcountList.forEach(item=>{
|
||||||
|
OwnerAcountSum+=Number(item.value)
|
||||||
|
})
|
||||||
|
this.pageDataObj.OwnerList.EntryList.forEach(item=>{
|
||||||
|
OwnerEntrySum+=Number(item.value)
|
||||||
|
})
|
||||||
|
this.pageDataObj.OwnerList.ReceivableList.forEach(item=>{
|
||||||
|
OwnerReceivableSum+=Number(item.value)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.pageDataObj.MerchantList.AcountList.forEach(item=>{
|
||||||
|
MerchantAcountSum+=Number(item.value)
|
||||||
|
})
|
||||||
|
this.pageDataObj.MerchantList.EntryList.forEach(item=>{
|
||||||
|
MerchantEntrySum+=Number(item.value)
|
||||||
|
})
|
||||||
|
this.pageDataObj.MerchantList.ReceivableList.forEach(item=>{
|
||||||
|
MerchantReceivableSum+=Number(item.value)
|
||||||
|
})
|
||||||
|
let OwnerListSum = {
|
||||||
|
AcountSum:OwnerAcountSum/ 10000,
|
||||||
|
EntrySum:OwnerEntrySum/ 10000,
|
||||||
|
ReceivableSum:OwnerReceivableSum / 10000
|
||||||
|
}
|
||||||
|
let MerchantSum = {
|
||||||
|
AcountSum:MerchantAcountSum/ 10000,
|
||||||
|
EntrySum:MerchantEntrySum/ 10000,
|
||||||
|
ReceivableSum:MerchantReceivableSum/ 10000
|
||||||
|
}
|
||||||
|
this.OwnerListSum = OwnerListSum
|
||||||
|
this.MerchantSum = MerchantSum
|
||||||
|
}
|
||||||
|
},
|
||||||
// 跳转到服务区排名
|
// 跳转到服务区排名
|
||||||
handleGoSort(type){
|
handleGoSort(type){
|
||||||
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/servicePartList?type=${type}&yearMonth=${this.searchText}&thisMonth=${this.thisMonth && this.thisMonth!=='0'?this.thisMonth:this.currentMonth}`)
|
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/servicePartList?type=${type}&yearMonth=${this.searchText}&thisMonth=${this.thisMonth && this.thisMonth!=='0'?this.thisMonth:this.currentMonth}&searchAll=${(!!(this.selectStart && this.selectEnd))}&selectStart=${this.selectStart}&selectEnd=${this.selectEnd}`)
|
||||||
|
// 选择的开始和结束时间都有就是true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 正常的请求 不是更多筛选的
|
||||||
async handleGetRevenueData(){
|
async handleGetRevenueData(){
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
let y = date.getFullYear()
|
let y = date.getFullYear()
|
||||||
@ -824,7 +948,7 @@ export default {
|
|||||||
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
||||||
curYear: this.curYear,//本年年份
|
curYear: this.curYear,//本年年份
|
||||||
compareYear: this.curYear-1,//历年年份
|
compareYear: this.curYear-1,//历年年份
|
||||||
StatisticsMonth:this.thisMonth===0?y>this.curYear?12:m-1:this.thisMonth,//结算月份
|
StatisticsMonth:this.thisMonth===0?y>this.curYear?12:m:this.thisMonth,//结算月份
|
||||||
StatisticsDate: this.lastDay
|
StatisticsDate: this.lastDay
|
||||||
}
|
}
|
||||||
console.log('req',req)
|
console.log('req',req)
|
||||||
@ -864,6 +988,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleChangMonth(index){
|
async handleChangMonth(index){
|
||||||
|
this.selectStart = `${this.curYear}-01`
|
||||||
|
this.selectEnd = ''
|
||||||
this.selectIndex = index
|
this.selectIndex = index
|
||||||
this.currentScroll = 'item' + index
|
this.currentScroll = 'item' + index
|
||||||
this.thisMonth = index
|
this.thisMonth = index
|
||||||
@ -889,7 +1015,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleGoMerchantAccount(){
|
handleGoMerchantAccount(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/merchantAccount/index'
|
url: `/pages/merchantAccount/index?month=${this.thisMonth===0?this.optionMonth: `${this.curYear}-${this.thisMonth<10?'0'+this.thisMonth:this.thisMonth}`}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
bindDateChange(e){
|
bindDateChange(e){
|
||||||
@ -899,9 +1025,10 @@ export default {
|
|||||||
this.searchText = e.detail.value
|
this.searchText = e.detail.value
|
||||||
this.handleGetTableData()
|
this.handleGetTableData()
|
||||||
},
|
},
|
||||||
|
// 正常的请求 不是更多筛选的
|
||||||
async handleGetTableData(){
|
async handleGetTableData(){
|
||||||
|
console.log('this.thisMonth',this.thisMonth)
|
||||||
const date = new Date()
|
const date = new Date(this.optionMonth)
|
||||||
let y = date.getFullYear()
|
let y = date.getFullYear()
|
||||||
let m = date.getMonth() + 1
|
let m = date.getMonth() + 1
|
||||||
const type = this.currentScroll.split('item')[1]==='0'?2:1
|
const type = this.currentScroll.split('item')[1]==='0'?2:1
|
||||||
@ -982,7 +1109,7 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;left: 0;
|
top: 0;left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 9999;
|
z-index: 997;
|
||||||
background-image: url("https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/revenueBackground.png");
|
background-image: url("https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/revenueBackground.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
@ -1059,9 +1186,15 @@ export default {
|
|||||||
.timeSelect{
|
.timeSelect{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 32rpx;
|
right: 32rpx;
|
||||||
top: 0;
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
.moreText{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
.time{
|
.time{
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -1620,5 +1753,48 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popupContentBox{
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 16px;
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
position: relative;
|
||||||
|
.label{
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
.popupTitleBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.timeSelectBox{
|
||||||
|
width: 45%;
|
||||||
|
}
|
||||||
|
.unit{
|
||||||
|
width: 10%;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchButton{
|
||||||
|
position: absolute;
|
||||||
|
left: 10%;
|
||||||
|
bottom: 0;
|
||||||
|
//margin-left: 10%;
|
||||||
|
//margin-top: 40px;
|
||||||
|
width: 80%;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 6px 0;
|
||||||
|
text-align: center;
|
||||||
|
background: #1890FF;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -21,7 +21,9 @@
|
|||||||
<view :class="pageType===2?'normal select':'normal'" @click="handleChangeType(2)">累计统计</view>
|
<view :class="pageType===2?'normal select':'normal'" @click="handleChangeType(2)">累计统计</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="pageType===2" style="display: flex;justify-content: flex-end;box-sizing: border-box;padding-right: 16px">
|
||||||
|
{{selectStart || defaultStart}}-{{selectEnd || defaultEnd}}
|
||||||
</view>
|
</view>
|
||||||
<view class="revenueContent">
|
<view class="revenueContent">
|
||||||
<view class="navBigList" v-if="pageType===1">
|
<view class="navBigList" v-if="pageType===1">
|
||||||
@ -186,10 +188,20 @@ export default {
|
|||||||
sortName: 3,// 排序字段 1 24年营收 2 23年营收 3营收增长 4营收增幅
|
sortName: 3,// 排序字段 1 24年营收 2 23年营收 3营收增长 4营收增幅
|
||||||
selectIndexPage: 1,// 页数
|
selectIndexPage: 1,// 页数
|
||||||
query:{},// 传递的query
|
query:{},// 传递的query
|
||||||
|
selectStart:'',// 开始时间
|
||||||
|
selectEnd:'',// 结束时间
|
||||||
|
defaultStart:'',// 没有传入开始结束时间的时候显示的开始时间
|
||||||
|
defaultEnd:'',// 没有传入开始结束时间的时候显示的结束时间
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(query){
|
onLoad(query){
|
||||||
console.log('query',query)
|
console.log('query',query)
|
||||||
|
|
||||||
|
if (query.searchAll === 'true'){
|
||||||
|
this.pageType = 2
|
||||||
|
this.selectStart =query.selectStart
|
||||||
|
this.selectEnd =query.selectEnd
|
||||||
|
}
|
||||||
this.query = query
|
this.query = query
|
||||||
// 获取手机参数对页面进行适配
|
// 获取手机参数对页面进行适配
|
||||||
let systemInfo = uni.getSystemInfoSync()
|
let systemInfo = uni.getSystemInfoSync()
|
||||||
@ -219,7 +231,7 @@ export default {
|
|||||||
timeList.push(`${i}月`)
|
timeList.push(`${i}月`)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for (let i = 1;i<=compareMonth;i++){
|
for (let i = 1;i<=nowMonth;i++){
|
||||||
timeList.push(`${i}月`)
|
timeList.push(`${i}月`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,8 +241,13 @@ export default {
|
|||||||
this.scrollList = timeList
|
this.scrollList = timeList
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 请求数据
|
// 请求数据
|
||||||
|
if (query.searchAll === 'true'){
|
||||||
|
this.handleSearchAllData()
|
||||||
|
}else{
|
||||||
this.handleGetData()
|
this.handleGetData()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
handleBack(){
|
handleBack(){
|
||||||
@ -241,7 +258,7 @@ export default {
|
|||||||
// 跳转到详情
|
// 跳转到详情
|
||||||
handleGoServerPartDetail(item){
|
handleGoServerPartDetail(item){
|
||||||
console.log('item',item)
|
console.log('item',item)
|
||||||
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/detail?time=${this.query.yearMonth}&&month=${this.curYear}-${this.thisMonth<10?'0'+this.thisMonth:this.thisMonth}&&id=${item.ServerpartId}&&name=${item.ServerpartName}`)
|
this.$util.toNextRoute('navigateTo', `/pages/revenueStatistics/detail?time=${this.query.yearMonth}&&month=${this.curYear}-${this.thisMonth<10?'0'+this.thisMonth:this.thisMonth}&&id=${item.ServerpartId}&&name=${item.ServerpartName}&allSearch=${(!!(this.selectStart && this.selectEnd))}&selectStart=${this.selectStart}&selectEnd=${this.selectEnd}`)
|
||||||
},
|
},
|
||||||
// 点击加载更多
|
// 点击加载更多
|
||||||
handleGetMore(){
|
handleGetMore(){
|
||||||
@ -258,8 +275,12 @@ export default {
|
|||||||
// 改变按月还是统计
|
// 改变按月还是统计
|
||||||
handleChangeType(value){
|
handleChangeType(value){
|
||||||
this.pageType = value
|
this.pageType = value
|
||||||
// 请求数据
|
if (value===1){
|
||||||
this.handleGetData()
|
this.handleGetData()
|
||||||
|
}else{
|
||||||
|
this.handleSearchAllData()
|
||||||
|
}
|
||||||
|
// 请求数据
|
||||||
},
|
},
|
||||||
// 获取排名信息
|
// 获取排名信息
|
||||||
async handleGetData(){
|
async handleGetData(){
|
||||||
@ -291,6 +312,62 @@ export default {
|
|||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},
|
},
|
||||||
|
// 传入调统计的方法
|
||||||
|
async handleSearchAllData(){
|
||||||
|
this.dataList = []
|
||||||
|
this.allDateList = []
|
||||||
|
this.selectIndexPage = 1
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在加载...'
|
||||||
|
})
|
||||||
|
|
||||||
|
let startMonth = ''
|
||||||
|
if (this.selectStart){
|
||||||
|
let startDate = new Date(this.selectStart)
|
||||||
|
let y = startDate.getFullYear()
|
||||||
|
let m = startDate.getMonth() + 1
|
||||||
|
startMonth = `${y}${m<10?'0'+m:m}`
|
||||||
|
}else{
|
||||||
|
startMonth = `${this.curYear}-01`
|
||||||
|
this.defaultStart = startMonth
|
||||||
|
}
|
||||||
|
let endMonth = ''
|
||||||
|
let endM = ''
|
||||||
|
if (this.selectEnd){
|
||||||
|
let endDate = new Date(this.selectEnd)
|
||||||
|
let endY = endDate.getFullYear()
|
||||||
|
endM = endDate.getMonth() + 1
|
||||||
|
// endMonth = `${endY}${endM<10?'0'+endM:endM}`
|
||||||
|
}else{
|
||||||
|
endM = this.thisMonth
|
||||||
|
this.defaultEnd = `${this.curYear}-${this.thisMonth<10?'0'+this.thisMonth : this.thisMonth}`
|
||||||
|
// startMonth = `${this.curYear}-${this.thisMonth<10?'0'+this.thisMonth : this.thisMonth}`
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let monthText = this.currentScroll.split('item')[1]
|
||||||
|
|
||||||
|
const req = {
|
||||||
|
calcType: 2,
|
||||||
|
pushProvinceCode:this.useInfo.userData.ProvinceCode || '340000',
|
||||||
|
curYear:this.curYear,
|
||||||
|
compareYear:this.curYear-1,
|
||||||
|
StatisticsStartMonth: startMonth,
|
||||||
|
StatisticsMonth: endM,
|
||||||
|
StatisticsDate:this.lastDay,
|
||||||
|
businessRegion:1,
|
||||||
|
Dimension: this.type===3?3:'',
|
||||||
|
SortStr:`${this.type===1?'revenue':this.type===2?'account':this.type===3?'bayonet':''} ${this.sortType===0?'asc':'desc'}`
|
||||||
|
}
|
||||||
|
console.log('req',req)
|
||||||
|
const data = await request.$webGet('CommercialApi/Revenue/GetMonthlySPINCAnalysis',req)
|
||||||
|
console.log('data',data)
|
||||||
|
|
||||||
|
this.allDateList = this.handleGetSort(data.Result_Data.List)
|
||||||
|
this.dataList = this.allDateList.slice(0,this.selectIndexPage * 10)
|
||||||
|
|
||||||
|
uni.hideLoading()
|
||||||
|
},
|
||||||
// 修改排序字段
|
// 修改排序字段
|
||||||
handleChangeSortName(value){
|
handleChangeSortName(value){
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user