update
This commit is contained in:
parent
ccabdb6424
commit
2869daa75f
@ -138,13 +138,20 @@ export default {
|
||||
dataList:[],// 数据数组
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
onLoad(query){
|
||||
console.log('query',query)
|
||||
this.menu = uni.getMenuButtonBoundingClientRect()
|
||||
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 m = date.getMonth() + 1
|
||||
this.single = `${y}-${m<10?'0'+m :m}`
|
||||
console.log('this.single',this.single)
|
||||
this.endData = lastDay
|
||||
this.handleGetPageData()
|
||||
},
|
||||
|
||||
@ -11,6 +11,11 @@
|
||||
<view class="tabBox" >
|
||||
{{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'"/>-->
|
||||
<div class="timeSelect">
|
||||
<span class="moreText" @click="handleShowPopup">更多筛选</span>
|
||||
<!-- <uni-datetime-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`}">
|
||||
@ -193,11 +198,37 @@
|
||||
</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>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/util/index.js'
|
||||
import uniPopup from '@/components/uni-popup'
|
||||
export default {
|
||||
components:{
|
||||
uniPopup
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
statusBarHeight: '',
|
||||
@ -219,6 +250,10 @@ export default {
|
||||
curYear:2024,// 当前年
|
||||
ServerpartId:'',
|
||||
ServerpartName:'',// 服务区名称
|
||||
selectStart:'',// 开始时间
|
||||
selectEnd:'',// 结束时间
|
||||
showPop: false,// 低层的弹出框
|
||||
endTime:''
|
||||
}
|
||||
},
|
||||
async onLoad(option){
|
||||
@ -247,6 +282,7 @@ export default {
|
||||
if (option.name){
|
||||
this.ServerpartName = option.name
|
||||
}
|
||||
|
||||
if (option.month){
|
||||
this.searchText = option.month
|
||||
const selectDate = new Date(option.month)
|
||||
@ -255,6 +291,8 @@ export default {
|
||||
|
||||
const nowDate = new Date()
|
||||
let nowYear = nowDate.getFullYear()
|
||||
let nowMonth = nowDate.getMonth() + 1
|
||||
this.endTime = `${nowYear}-${nowMonth<10?'0'+nowMonth:nowMonth}`
|
||||
let monthNumber = 0
|
||||
if (nowYear>selectYear){
|
||||
monthNumber = 12
|
||||
@ -267,21 +305,115 @@ export default {
|
||||
this.selectIndex = selectMonth
|
||||
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.unshift('累计')
|
||||
}
|
||||
console.log('this.selectList',this.selectList)
|
||||
await this.handleGetRevenueData()
|
||||
|
||||
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)
|
||||
await this.handleGetRevenueData()
|
||||
}
|
||||
|
||||
// await this.handleGetTableData()
|
||||
uni.hideLoading()
|
||||
},
|
||||
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){
|
||||
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(){
|
||||
const date = new Date()
|
||||
let y = date.getFullYear()
|
||||
@ -339,7 +471,11 @@ export default {
|
||||
uni.showLoading({
|
||||
title:'正在加载'
|
||||
})
|
||||
await this.handleGetRevenueData()
|
||||
if (index===0){
|
||||
await this.handleGetSearchAll
|
||||
}else{
|
||||
await this.handleGetRevenueData()
|
||||
}
|
||||
// await this.handleGetTableData()
|
||||
uni.hideLoading()
|
||||
},
|
||||
@ -514,6 +650,11 @@ export default {
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-left: 32rpx;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
.tabItem{
|
||||
width: 204rpx;
|
||||
height: 68rpx;
|
||||
@ -524,6 +665,23 @@ export default {
|
||||
height: 68rpx;
|
||||
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{
|
||||
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>
|
||||
|
||||
@ -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'"/>
|
||||
</div>
|
||||
<div class="timeSelect">
|
||||
<span class="moreText" @click="handleShowPopup">更多筛选</span>
|
||||
<!-- <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>
|
||||
@ -641,12 +636,40 @@
|
||||
|
||||
</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>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/util/index.js'
|
||||
|
||||
import uniPopup from '@/components/uni-popup'
|
||||
export default {
|
||||
components:{
|
||||
uniPopup
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
statusBarHeight: '',
|
||||
@ -672,6 +695,9 @@ export default {
|
||||
selectStart:'',// 选择的开始时间
|
||||
selectEnd:'',// 选择的结束时间
|
||||
endTime:'',// 截止时间
|
||||
endSelectTime: '',// 限制截止时间
|
||||
showPop: false,// 低层的弹出框
|
||||
optionMonth:'',// 传入的月份
|
||||
}
|
||||
},
|
||||
async onLoad(option){
|
||||
@ -696,6 +722,7 @@ export default {
|
||||
let m = date.getMonth() + 1
|
||||
}
|
||||
if (option.month){
|
||||
this.optionMonth = option.month
|
||||
this.searchText = option.month
|
||||
const selectDate = new Date(option.month)
|
||||
let selectYear = selectDate.getFullYear()
|
||||
@ -706,14 +733,17 @@ export default {
|
||||
this.selectStart = `${selectYear}-01`
|
||||
|
||||
const nowDate = new Date()
|
||||
let nowY = nowDate.getFullYear()
|
||||
let endMonth = nowDate.getMonth() + 1
|
||||
this.endSelectTime = `${nowY}-${endMonth}`
|
||||
this.endTime = `${selectYear}-${endMonth<10?'0'+endMonth:endMonth}`
|
||||
let nowYear = nowDate.getFullYear()
|
||||
let nowMonth = nowDate.getMonth() + 1
|
||||
let monthNumber = 0
|
||||
if (nowYear>selectYear){
|
||||
monthNumber = 12
|
||||
}else{
|
||||
monthNumber = selectDate.getMonth() + 1
|
||||
monthNumber = nowMonth
|
||||
}
|
||||
let selectMonth = selectDate.getMonth() + 1
|
||||
|
||||
@ -732,19 +762,40 @@ export default {
|
||||
uni.hideLoading()
|
||||
},
|
||||
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){
|
||||
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()
|
||||
}
|
||||
// if (this.selectStart && this.selectEnd){
|
||||
// uni.showLoading({
|
||||
// title:'正在加载'
|
||||
// })
|
||||
// this.handleGetPageData(m)
|
||||
// uni.hideLoading()
|
||||
// }
|
||||
},
|
||||
// 选择结束时间
|
||||
async handleChangeSelectEnd(e){
|
||||
@ -753,24 +804,33 @@ export default {
|
||||
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()
|
||||
}
|
||||
// if (this.selectStart && this.selectEnd){
|
||||
// uni.showLoading({
|
||||
// title:'正在加载'
|
||||
// })
|
||||
// await this.handleGetPageData(m)
|
||||
// uni.hideLoading()
|
||||
// }
|
||||
},
|
||||
// 请求数据的方法
|
||||
async handleGetPageData(month){
|
||||
|
||||
// 请求数据的方法 更多筛选的解读请求方法
|
||||
async handleGetPageData(){
|
||||
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 = {
|
||||
calcType: 2,
|
||||
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
||||
curYear: this.curYear,//本年年份
|
||||
compareYear: this.curYear-1,//历年年份
|
||||
StatisticsMonth: month,//结算月份
|
||||
StatisticsStartMonth:startMonth,
|
||||
StatisticsMonth: endM,//结算月份
|
||||
StatisticsDate: this.lastDay
|
||||
}
|
||||
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){
|
||||
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(){
|
||||
const date = new Date()
|
||||
let y = date.getFullYear()
|
||||
@ -824,7 +948,7 @@ export default {
|
||||
pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000',
|
||||
curYear: this.curYear,//本年年份
|
||||
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
|
||||
}
|
||||
console.log('req',req)
|
||||
@ -864,6 +988,8 @@ export default {
|
||||
}
|
||||
},
|
||||
async handleChangMonth(index){
|
||||
this.selectStart = `${this.curYear}-01`
|
||||
this.selectEnd = ''
|
||||
this.selectIndex = index
|
||||
this.currentScroll = 'item' + index
|
||||
this.thisMonth = index
|
||||
@ -889,7 +1015,7 @@ export default {
|
||||
},
|
||||
handleGoMerchantAccount(){
|
||||
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){
|
||||
@ -899,9 +1025,10 @@ export default {
|
||||
this.searchText = e.detail.value
|
||||
this.handleGetTableData()
|
||||
},
|
||||
// 正常的请求 不是更多筛选的
|
||||
async handleGetTableData(){
|
||||
|
||||
const date = new Date()
|
||||
console.log('this.thisMonth',this.thisMonth)
|
||||
const date = new Date(this.optionMonth)
|
||||
let y = date.getFullYear()
|
||||
let m = date.getMonth() + 1
|
||||
const type = this.currentScroll.split('item')[1]==='0'?2:1
|
||||
@ -982,7 +1109,7 @@ export default {
|
||||
position: fixed;
|
||||
top: 0;left: 0;
|
||||
width: 100%;
|
||||
z-index: 9999;
|
||||
z-index: 997;
|
||||
background-image: url("https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/revenueBackground.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
@ -1059,9 +1186,15 @@ export default {
|
||||
.timeSelect{
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 0;
|
||||
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;
|
||||
@ -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>
|
||||
|
||||
@ -21,7 +21,9 @@
|
||||
<view :class="pageType===2?'normal select':'normal'" @click="handleChangeType(2)">累计统计</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 class="revenueContent">
|
||||
<view class="navBigList" v-if="pageType===1">
|
||||
@ -186,11 +188,21 @@ export default {
|
||||
sortName: 3,// 排序字段 1 24年营收 2 23年营收 3营收增长 4营收增幅
|
||||
selectIndexPage: 1,// 页数
|
||||
query:{},// 传递的query
|
||||
selectStart:'',// 开始时间
|
||||
selectEnd:'',// 结束时间
|
||||
defaultStart:'',// 没有传入开始结束时间的时候显示的开始时间
|
||||
defaultEnd:'',// 没有传入开始结束时间的时候显示的结束时间
|
||||
}
|
||||
},
|
||||
onLoad(query){
|
||||
},
|
||||
onLoad(query){
|
||||
console.log('query',query)
|
||||
this.query = query
|
||||
|
||||
if (query.searchAll === 'true'){
|
||||
this.pageType = 2
|
||||
this.selectStart =query.selectStart
|
||||
this.selectEnd =query.selectEnd
|
||||
}
|
||||
this.query = query
|
||||
// 获取手机参数对页面进行适配
|
||||
let systemInfo = uni.getSystemInfoSync()
|
||||
this.statusBarHeight = Number(systemInfo.statusBarHeight)
|
||||
@ -219,7 +231,7 @@ export default {
|
||||
timeList.push(`${i}月`)
|
||||
}
|
||||
}else{
|
||||
for (let i = 1;i<=compareMonth;i++){
|
||||
for (let i = 1;i<=nowMonth;i++){
|
||||
timeList.push(`${i}月`)
|
||||
}
|
||||
}
|
||||
@ -229,8 +241,13 @@ export default {
|
||||
this.scrollList = timeList
|
||||
|
||||
|
||||
|
||||
// 请求数据
|
||||
this.handleGetData()
|
||||
if (query.searchAll === 'true'){
|
||||
this.handleSearchAllData()
|
||||
}else{
|
||||
this.handleGetData()
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
handleBack(){
|
||||
@ -241,7 +258,7 @@ export default {
|
||||
// 跳转到详情
|
||||
handleGoServerPartDetail(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(){
|
||||
@ -258,8 +275,12 @@ export default {
|
||||
// 改变按月还是统计
|
||||
handleChangeType(value){
|
||||
this.pageType = value
|
||||
if (value===1){
|
||||
this.handleGetData()
|
||||
}else{
|
||||
this.handleSearchAllData()
|
||||
}
|
||||
// 请求数据
|
||||
this.handleGetData()
|
||||
},
|
||||
// 获取排名信息
|
||||
async handleGetData(){
|
||||
@ -291,6 +312,62 @@ export default {
|
||||
|
||||
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){
|
||||
uni.showLoading({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user