diff --git a/pages/index/index.vue b/pages/index/index.vue index 207f844..36c3780 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -28,10 +28,10 @@
- - - - + + + + @@ -39,7 +39,7 @@ - + {{showTableData.CashPayChange?showTableData.CashPayChange:'0.00'}} @@ -61,7 +61,6 @@ {{selectMonth}}月对客营收/万元 同比 - @@ -125,7 +124,7 @@ - + - @@ -185,7 +184,7 @@ - + 查看更多 @@ -329,7 +328,7 @@
- {{index+1}}月 + {{index>11?(index+1)%12===0?12:(index+1)%12:index+1}}月
@@ -339,7 +338,7 @@ 111 - + @@ -821,6 +820,7 @@ export default { components: {RateCharts, MonthCharts, Tabbar,uniPopup}, data() { const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1) + // const lastDay = '2025-01-01' const nowDay = this.$util.cutDate(new Date(), 'MM月DD日') return { statusBarHeight:'',// 每个手机的状态栏高度 @@ -909,6 +909,7 @@ export default { warningList:[],// 预警列表 selectDetail:0,// 选中的统计标签 nowMonth:0,// 当前的月份 + swiperList:[],// 滑动块有多少项 selectMonth:0,//选择的月份 useInfo:{},//用户信息 showRealBox:false,// 是否显示对客营收的完整数据 @@ -1029,6 +1030,7 @@ export default { // setTimeout(()=>{ // _this.moneyRateList = [0,0] // },3000) + // 顶部显示的时间 this.single = timestampToTimeMonth((new Date(this.lastDay).getTime())) // 获取手机参数对页面进行适配 主要是用于拿到胶囊的位置 @@ -1039,15 +1041,45 @@ export default { // 拿到用户手机的宽 用设计图的宽高比去设定上半部的高度 this.phoneWidth = systemInfo.windowWidth // 拿到昨天的时间戳 + // 当年份不是2023 要判断有多少个可以滑动的项 + console.log('this.lastDay',this.lastDay) const date = new Date(this.lastDay) + let y = date.getFullYear() + let m = date.getMonth() + 1 + let sum = 0 + let swiperList = [] + if (2023-y<0){ + sum = 12 * (y - 2023) + m + console.log('sum',sum) + for (let i=0;i11?(e.detail.current + 1)%12===0?12:(e.detail.current + 1)%12:e.detail.current + 1 this.selectDetail = e.detail.current + console.log('this.selectMonth',this.selectMonth) + console.log('this.selectDetail',this.selectDetail) + let y = e.detail.current>11? Math.floor((e.detail.current + 1)%12===0?(e.detail.current + 1)/12-1:(e.detail.current + 1)/12) : 0 + let m = e.detail.current>11?(e.detail.current + 1)%12===0?12:(e.detail.current + 1)%12:e.detail.current + 1 const date = new Date(this.lastDay) - let y = date.getFullYear() - let m = e.detail.current + 1 - if(m<10){ - m='0'+m - } - this.single = `${y}-${m}` - let day - if (this.selectMonth === date.getMonth()+1){ - day = date.getDate()<10?'0'+date.getDate():date.getDate() - }else{ - day = this.$util.getThisMonthDay(this.single) - } + // let y = date.getFullYear() + // let m = e.detail.current + 1 + // if(m<10){ + // m='0'+m + // } + this.single = `${2023+y}-${m}` this.showTableData = null // this.yesObj = null this.typeList = [] @@ -1643,14 +1674,14 @@ export default { // 月份详情卡片的详情 this.initYesterdayData(this.selectMonth!==date.getMonth()+1) // 自营计划 - this.monthYearPlan(`${y}-${m}-${day}`) + this.monthYearPlan() // 切换月份的车流量变化 // 是当前月份传入日期 不是当前日期传入月份 let carDate if (this.selectMonth === date.getMonth()+1){ carDate = this.lastDay }else{ - carDate = `${y}${m}` + carDate = `${2023+y}-${m}` } this.getCarInfo(carDate) // 切换考核的数据 @@ -1754,7 +1785,7 @@ export default { // ShowCompareRate: true, // ShowYearRevenue: true // } - const nowDate = new Date(this.lastDay) + const nowDate = new Date(this.single) let month = JSON.parse(JSON.stringify(this.selectMonth)) if (month<10){ month = '0'+ month @@ -1762,24 +1793,30 @@ export default { let req if (type){ if (nowDate.getMonth() + 1 === this.selectMonth ){ + console.log('1') req = { pushProvinceCode:this.useInfo.userData.ProvinceCode || '340000', StatisticsMonth:`${nowDate.getFullYear()}${month}`, StatisticsDate:this.lastDay } + console.log('req',req) }else{ + console.log('2') req = { pushProvinceCode:this.useInfo.userData.ProvinceCode || '340000', StatisticsMonth:`${nowDate.getFullYear()}${month}`, StatisticsDate:this.lastDay } + console.log('req',req) } }else{ + console.log('3') req = { pushProvinceCode:this.useInfo.userData.ProvinceCode || '340000', StatisticsMonth:`${nowDate.getFullYear()}${month}`, StatisticsDate:type?null:this.lastDay } + console.log('req',req) } uni.showLoading({ title: '正在加载...' @@ -1973,8 +2010,22 @@ export default { handleSelectTab(value){ this.selectTab = value }, + // 根据当前时间 拿到滑块索引的办法 + handleGetSwiperIndex(time){ + const date = new Date(time) + let y = date.getFullYear() + let m = date.getMonth() + 1 + if (y-2023>0){ + let currentY = y - 2023 + let currentM = m % 12===0?12:m % 12 + return currentY*12 + currentM - 1 + }else{ + return m - 1 + } + }, // 顶部的时间组件切换时间触发的方法 bindDateChange(e){ + this.showTableData = null // this.yesObj = null this.typeList = [] @@ -1987,8 +2038,10 @@ export default { this.stopSwiper = true let isOnRefresh = false const date = new Date(e.detail.value) - this.selectMonth = date.getMonth() + 1 - this.selectDetail = date.getMonth() + let y = date.getFullYear() + let m = date.getMonth()+1 + this.selectMonth = m + 1 + this.selectDetail = this.handleGetSwiperIndex(e.detail.value) // this.stopSwiper = false diff --git a/pages/revenue/incomeDetail.vue b/pages/revenue/incomeDetail.vue index f2e8601..63e324c 100644 --- a/pages/revenue/incomeDetail.vue +++ b/pages/revenue/incomeDetail.vue @@ -37,19 +37,19 @@ {{subItem.name}} 本月预算: - {{subItem.budgetMonth||'-'}}万元 + {{subItem.budgetMonth?$util.fmoney(subItem.budgetMonth,2):'-'}}万元 本月执行: - {{subItem.monthExecute||'-'}}万元 + {{subItem.monthExecute?$util.fmoney(subItem.monthExecute,2):'-'}}万元 年度预算: - {{subItem.budgetYear||'-'}}万元 + {{subItem.budgetYear?$util.fmoney(subItem.budgetYear,2):'-'}}万元 累计执行: - {{subItem.accumulateExecute||'-'}}万元 + {{subItem.accumulateExecute?$util.fmoney(subItem.accumulateExecute,2):'-'}}万元 @@ -59,20 +59,20 @@ 本月占比: - {{`${item.monthRate||'-'}%`}} + {{`${item.monthRate||'-'}`}} - + 累计完成进度占比: - {{`${item.accumulateRate||'-'}%`}} + {{`${item.accumulateRate||'-'}`}} - + @@ -86,11 +86,11 @@ 本月占比: - {{`${subItem.monthRate||'-'}%`}} + {{`${subItem.monthRate||'-'}`}} 累计占比: - {{`${subItem.accumulateRate||'-'}%`}} + {{`${subItem.accumulateRate||'-'}`}} @@ -174,6 +174,7 @@ export default { handleChangePageTab(value){ this.selectTab = value this.pageList = this.selectTab===1?this.pageData.supportList:this.pageData.otherList + console.log('this.pageList',this.pageList) }, // 改变类型的方法 handleChangeType(e){ @@ -207,13 +208,20 @@ export default { uni.showLoading({ title:'正在加载' }) - const req = { - Month:this.month + const date = new Date(this.single) + let y = date.getFullYear() + let m = date.getMonth() + 1 + if (m<10){ + m = '0'+m } - const data = await request.$webGet('EShangApiMain/Budget/GetbudgetProjectReportIn',req) + const req = { + Month:`${y}${m}` + } + const data = await request.$webGetTest('EShangApiMain/Budget/GetbudgetProjectReportInDynamic',req) console.log('data',data) this.pageData = data.Result_Data this.pageList = this.selectTab===1?data.Result_Data.supportList:data.Result_Data.otherList + console.log('this.pageList',this.pageList) uni.hideLoading() } } @@ -384,7 +392,7 @@ export default { box-sizing: border-box; padding: 12rpx 0; display: block; - width: 300px; + width: 320px; box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(166, 158, 159, 0.3); .noticeTitle{ font-size: 28rpx; @@ -396,7 +404,7 @@ export default { } .noticeItem{ display: inline-block; - width: 140px; + width: 150px; color: #A69E9F; font-size: 12px; font-weight: 500; diff --git a/pages/revenue/index.vue b/pages/revenue/index.vue index 91b1bdb..7ef733e 100644 --- a/pages/revenue/index.vue +++ b/pages/revenue/index.vue @@ -62,14 +62,14 @@ - {{ currentResult.thisMonthInCome||'-' }} + {{ currentResult.thisMonthInCome?$util.fmoney(currentResult.thisMonthInCome,2):'-' }} 本月收入 /万元 - {{ currentResult.inComeThisYear||'-' }} + {{ currentResult.inComeThisYear?$util.fmoney(currentResult.inComeThisYear,2):'-' }} 累计收入 /万元 @@ -79,7 +79,7 @@ {{ - `${currentResult.costYear||'-'}%` + `${currentResult.inComeYear?$util.fmoney(currentResult.inComeYear,2):'-'}%` }} 收入同比 @@ -102,7 +102,7 @@ - {{ currentResult.thisMonthExpend || '-' }} + {{ currentResult.thisMonthExpend?$util.fmoney(currentResult.thisMonthExpend,2):'-' }} 本月支出 /万元 @@ -110,7 +110,7 @@ - {{ currentResult.expenditureThisYear || '-' }} + {{ currentResult.expenditureThisYear?$util.fmoney(currentResult.expenditureThisYear,2):'-' }} 累计支出 /万元 @@ -121,7 +121,7 @@ {{ - `${currentResult.expendYear||'-'}%` + `${currentResult.costYear?$util.fmoney(currentResult.costYear,2):'-'}%` }} 成本同比 @@ -145,10 +145,10 @@ - 利润总额完成率=本年累计/年度预算
{{ `(${currentResult.profitThisYearReal||'-'} / ${currentResult.profitBudgetThisYearReal||'-'})` }}
- 净利润完成度=本年净利润/净利润预算
{{ `(${currentResult.thisYearNetProfitReal||'-'} / ${currentResult.thisYearNetProfitBudgetReal||'-'})` }}
- 净利润预算=年度预算-年度预计所得税费用{{`(${currentResult.profitBudgetThisYearReal||'-'} - ${(currentResult.profitBudgetThisYearReal - currentResult.thisYearNetProfitBudgetReal).toFixed(2)})`}} - 本年净利润=本年累计-本年累计所得税{{`(${currentResult.profitThisYearReal||'-'} - ${(currentResult.profitThisYearReal - currentResult.thisYearNetProfitReal).toFixed(2)})`}} + 利润总额完成率=本年累计/年度预算
{{ `(${currentResult.profitThisYear?$util.fmoney(currentResult.profitThisYear,2):'-'} / ${currentResult.profitBudgetThisYear?$util.fmoney(currentResult.profitBudgetThisYear,2):'-'})` }}
+ 净利润完成度=本年净利润/净利润预算
{{ `(${currentResult.thisYearNetProfit?$util.fmoney(currentResult.thisYearNetProfit,2):'-'} / ${currentResult.thisYearNetProfitBudget?$util.fmoney(currentResult.thisYearNetProfitBudget,2):'-'})` }}
+ 净利润预算=年度预算-年度预计所得税费用{{`(${currentResult.profitBudgetThisYear?$util.fmoney(currentResult.profitBudgetThisYear,2):'-'} - ${(currentResult.profitBudgetThisYearReal - currentResult.thisYearNetProfitBudgetReal).toFixed(2)})`}} + 本年净利润=本年累计-本年累计所得税{{`(${currentResult.profitThisYear?$util.fmoney(currentResult.profitThisYear,2):'-'} - ${(currentResult.profitThisYearReal - currentResult.thisYearNetProfitReal).toFixed(2)})`}}
@@ -170,13 +170,13 @@ - {{ currentResult.profitThisYear||'-' }} + {{ currentResult.profitThisYear?$util.fmoney(currentResult.profitThisYear,2):'-' }} 含税累计/万元 - {{currentResult.profitBudgetThisYear||'-'}} + {{currentResult.profitBudgetThisYear?$util.fmoney(currentResult.profitBudgetThisYear,2):'-'}} 年度预算/万元 @@ -193,13 +193,13 @@ - {{currentResult.thisYearNetProfit||'-'}} + {{currentResult.thisYearNetProfit?$util.fmoney(currentResult.thisYearNetProfit,2):'-'}} 除税净利润/万元 - {{currentResult.thisYearNetProfitBudget||'-'}} + {{currentResult.thisYearNetProfitBudget?$util.fmoney(currentResult.thisYearNetProfitBudget,2):'-'}} 净利润预算/万元 @@ -298,7 +298,7 @@ - 完成率=本年累计收入 / 年度预算
{{ `(${currentResult.inComeThisYearReal||'-'} / ${currentResult.thisYearInComeBudgetReal||'-'})` }}
+ 完成率=本年累计收入 / 年度预算
{{ `(${currentResult.inComeThisYearReal||'-'} / ${currentResult.thisYearInComeBudget?$util.fmoney(Number(currentResult.thisYearInComeBudget)*10000,2):'-'})` }}
成本比=本年累计成本/本年累计收入
{{ `(${currentResult.costReal||'-'} /${currentResult.inComeThisYearReal||'-'})` }}
年度预算:年度预算包含营业外 年度预算同比: 本年累计收入的同比值 @@ -308,15 +308,15 @@ - + - {{`${currentResult.inComeSuccess || '-'}%`}} + {{`${currentResult.thisYearInComeRate || '-'}%`}} - {{ currentResult.inComeThisYear || '' }} + {{ currentResult.inComeThisYear?$util.fmoney(currentResult.inComeThisYear,2):'-' }} 本年累计 /万元 @@ -331,7 +331,7 @@ - {{ currentResult.thisYearInComeBudget||'-' }} + {{ currentResult.thisYearInComeBudget?$util.fmoney(currentResult.thisYearInComeBudget,2):'-' }} 年度预算 /万元 @@ -347,12 +347,12 @@ - 自营收入:{{currentResult.inComeList[0].thisYear}}万元,{{`${((currentResult.inComeList[0].thisYearRealNumber / (currentResult.inComeList[0].thisYearRealNumber + currentResult.inComeList[1].thisYearRealNumber))*100).toFixed(2)}%`}} - 其他收入:{{currentResult.inComeList[1].thisYear}}万元,{{`${((currentResult.inComeList[1].thisYearRealNumber / (currentResult.inComeList[0].thisYearRealNumber + currentResult.inComeList[1].thisYearRealNumber))*100).toFixed(2)}%`}} + 自营收入:{{currentResult.inComeList[0].thisYear?$util.fmoney(currentResult.inComeList[0].thisYear,2):'-'}}万元,{{`${((currentResult.inComeList[0].thisYear / (Number(currentResult.inComeList[0].thisYear) + Number(currentResult.inComeList[1].thisYear)))*100).toFixed(2)}%`}} + 其他收入:{{currentResult.inComeList[1].thisYear?$util.fmoney(currentResult.inComeList[1].thisYear,2):'-'}}万元,{{`${((currentResult.inComeList[1].thisYear / (Number(currentResult.inComeList[0].thisYear) + Number(currentResult.inComeList[1].thisYear)))*100).toFixed(2)}%`}} - - + + @@ -425,13 +425,13 @@ - {{item.thisYear || '-'}} + {{item.thisYear?$util.fmoney(item.thisYear,2):'-'}} 本年累计/万元 - {{item.thisMonth || '-'}} + {{item.thisMonth?$util.fmoney(item.thisMonth,2):'-'}} {{ `${thisMonth}月累计` }} @@ -442,12 +442,12 @@ - {{item.thisYearBudget || '-'}} + {{item.thisYearBudget?$util.fmoney(item.thisYearBudget,2):'-'}} 年度预算/万元 - {{ `${item.thisMonthRate || '-'}%` }} + {{ `${item.thisYearYOY || '-'}%` }} 本月占比 @@ -487,7 +487,7 @@ - + 支出合计 @@ -502,7 +502,7 @@ - {{currentResult.expenditureThisYear}} + {{currentResult.expenditureThisYear?$util.fmoney(currentResult.expenditureThisYear,2):'-'}} 本年累计/万元 @@ -518,7 +518,7 @@ - {{currentResult.expenditureThisYearBudget}} + {{currentResult.expenditureThisYearBudget?$util.fmoney(currentResult.expenditureThisYearBudget,2):'-'}} 年度预计/万元 @@ -532,10 +532,10 @@ - 营业成本:{{currentResult.outList[0].expenditureCostThisYear}}万元,{{`${outFirst.toFixed(2)}%`}} - 销售费用:{{currentResult.outList[1].expenditureCostThisYear}}万元,{{`${outSecond.toFixed(2)}%`}} - 管理费用:{{currentResult.outList[2].expenditureCostThisYear}}万元,{{`${outThird.toFixed(2)}%`}} - 财务费用:{{currentResult.outList[3].expenditureCostThisYear}}万元,{{`${outFourth.toFixed(2)}%`}} + 营业成本:{{currentResult.outList[0].thisYear}}万元,{{`${outFirst.toFixed(2)}%`}} + 销售费用:{{currentResult.outList[1].thisYear}}万元,{{`${outSecond.toFixed(2)}%`}} + 管理费用:{{currentResult.outList[2].thisYear}}万元,{{`${outThird.toFixed(2)}%`}} + 财务费用:{{currentResult.outList[3].thisYear}}万元,{{`${outFourth.toFixed(2)}%`}} @@ -581,14 +581,14 @@ - - {{`${item.expenditureCostRate}%`}} + + {{`${item.rate}%`}} - {{ item.expenditureCostThisYear }} + {{ item.thisYear?$util.fmoney(item.thisYear,2):'-' }} 本年累计/万元 @@ -596,7 +596,7 @@ - {{ item.expenditureCostThisMonth }} + {{ item.thisMonth?$util.fmoney(item.thisMonth,2):'-' }} {{ `${thisMonth}月累计` }}/万元 @@ -604,11 +604,11 @@ - {{ item.expenditureCostThisYearBudget }} + {{ item.thisYearBudget?$util.fmoney(item.thisYearBudget,2):'-' }} 年度预计/万元 - {{ item.expenditureCostThisRate }} + {{ `${item.thisYearYOY || '-'}%` }} 本月占比 @@ -1367,12 +1367,9 @@ export default { // 滑动swiper的方法 handleChangeSwiper(e){ this.selectMonth = e.target.current - console.log('this.selectMonth',this.selectMonth) this.thisMonth = this.monthList[this.selectMonth] this.single = `${this.thisYear}-${this.thisMonth<10?'0'+this.thisMonth:this.thisMonth}` - console.log('this.single',this.single) // this.currentResult = this.monthResult[this.selectMonth] - console.log('11111') this.handleGetPageData() }, // 拿到数据的方法 @@ -1387,21 +1384,19 @@ export default { Month:`${y}${m}` } // const data = await request.$webGet('EShangApiMain/Budget/GetbudgetProjectReport',req) - const data = await request.$webGet('EShangApiMain/Budget/GetbudgetProjectReportDynamic',req) - console.log('data',data) + const data = await request.$webGetTest('EShangApiMain/Budget/GetbudgetProjectReportDynamic',req) this.currentResult = data.Result_Data let sum = 0 console.log('this.currentResult',this.currentResult) if (this.currentResult.outList && this.currentResult.outList.length>0){ this.currentResult.outList.forEach(item=>{ - sum+=item.expenditureCostThisYearNumber + sum+=Number(item.thisYear) }) this.outAll = sum - console.log('this.outAll',this.outAll) - this.outFirst = (this.currentResult.outList[0].expenditureCostThisYearNumber/sum)*100 - this.outSecond = (this.currentResult.outList[1].expenditureCostThisYearNumber/sum)*100 - this.outThird = (this.currentResult.outList[2].expenditureCostThisYearNumber/sum)*100 - this.outFourth = (this.currentResult.outList[3].expenditureCostThisYearNumber/sum)*100 + this.outFirst = (Number(this.currentResult.outList[0].thisYear)/sum)*100 + this.outSecond = (Number(this.currentResult.outList[1].thisYear)/sum)*100 + this.outThird = (Number(this.currentResult.outList[2].thisYear)/sum)*100 + this.outFourth = (Number(this.currentResult.outList[3].thisYear)/sum)*100 } uni.hideLoading() }, @@ -1708,7 +1703,7 @@ export default { .content{ width: 100%; box-sizing: border-box; - padding: 24rpx 36rpx 0; + padding: 24rpx 36rpx 32rpx; background: #F5F5F5; .profitYear{ width: 100%; diff --git a/pages/revenueStatistics/index.vue b/pages/revenueStatistics/index.vue index 4fff4ba..48beb45 100644 --- a/pages/revenueStatistics/index.vue +++ b/pages/revenueStatistics/index.vue @@ -8,7 +8,7 @@ - {{ searchText }} + {{ searchText }} @@ -23,11 +23,14 @@ - 驿达营收 + - + + + 驿达营收 + {{pageDataObj.OwnerRevenue?$util.fmoney(pageDataObj.OwnerRevenue/10000,2):'0.00'}} 总计/万元 @@ -144,11 +147,14 @@ - 商家营收 + - + + + 商家营收 + {{pageDataObj.MerchantRevenue?$util.fmoney(pageDataObj.MerchantRevenue/10000):"0.00"}} 总计/万元 @@ -263,7 +269,7 @@ - 其他数据 + @@ -416,7 +422,8 @@ export default { searchText:'', pageDataObj:{}, OwnerListSum:{}, - MerchantSum:{} + MerchantSum:{}, + thisMonth:0 } }, onLoad(option){ @@ -430,6 +437,9 @@ export default { console.log('menu',this.menu) if (option.time){ this.lastDay = option.time + const date = new Date(this.lastDay) + let m = date.getMonth() + 1 + this.thisMonth = m } if (option.month){ this.searchText = option.month @@ -627,20 +637,32 @@ export default { margin-top: 22rpx; display: flex; justify-content: space-between; - .sumLogo{ - width: 96rpx; - height: 96rpx; + .left{ + display: flex; + align-items: center; + .sumLogo{ + width: 96rpx; + height: 96rpx; + } + .headerTitle{ + font-size: 36rpx; + font-family: Alimama ShuHeiTi; + font-weight: bold; + line-height: 44rpx; + margin-left: 12rpx; + } } + .sumText{ display: flex; flex-direction: column; align-items: flex-end; .sumMoney{ - font-size: 40rpx; - font-family: DINAlternate, DINAlternate; + font-size: 36rpx; + font-family: DINAlternate-Bold, DINAlternate; font-weight: bold; color: #160002; - line-height: 48rpx; + line-height: 44rpx; } .sumUnit{ margin-top: 8rpx; @@ -693,11 +715,11 @@ export default { } } .itemTopRight{ - font-size: 40rpx; - font-family: DINAlternate, DINAlternate; + font-size: 36rpx; + font-family: DINAlternate-Bold, DINAlternate; font-weight: bold; color: #160002; - line-height: 40rpx; + line-height: 44rpx; } } .itemBottom{