diff --git a/pages/revenue/component/otherCharts.vue b/pages/revenue/component/otherCharts.vue
index a59ccac..d123d9a 100644
--- a/pages/revenue/component/otherCharts.vue
+++ b/pages/revenue/component/otherCharts.vue
@@ -1,7 +1,7 @@
-
-
+
+
@@ -12,7 +12,8 @@ export default {
name: "otherCharts",
data(){
return {
- preferPath:''
+ preferPath:'',
+ hide:true
}
},
props:{
@@ -23,13 +24,22 @@ export default {
colorList:{
type: Array,
default:[]
+ },
+ name:{
+ type: String,
+ default: ''
}
},
+ onUnload(){
+ let canvas = document.getElementById('month');
+ let context = uni.createCanvasContext(this.name,this);
+ context.clearRect(0, 0, canvas.width, canvas.height);
+ },
watch:{
success:{
handler(value){
+ this.hide = true
this.preferPath = ''
- console.log('value111',value)
let success = Number(value)>100?100:Number(value)
let error = Number(100 - value)<0?0:Number(100 - value)
let res = {
@@ -37,8 +47,16 @@ export default {
data:[{name:'已完成',value:success},{name:'未完成',value:error}]
}]
}
- console.log('res',res)
- this.drawCharts('month',res)
+ if (value){
+ this.drawCharts(this.name,res)
+ }else{
+ let res = {
+ series: [{
+ data: [{name: '已完成', value: 0}, {name: '未完成', value: 100}]
+ }]
+ }
+ this.drawCharts(this.name, res)
+ }
},
immediate:true
}
@@ -86,14 +104,13 @@ export default {
}
});
setTimeout( ()=>{
- this.canvasToTempImage('month')
- },100)
+ this.canvasToTempImage(this.name)
+ },500)
},
canvasToTempImage(id){
uni.canvasToTempFilePath({
canvasId:id,
complete:(res)=>{
- console.log('res2',res)
if (res.tempFilePath){
uni.getFileSystemManager().readFile({
filePath: res.tempFilePath,
@@ -101,6 +118,7 @@ export default {
success: res => {
let base64 = 'data:image/png;base64,' + res.data;
this.preferPath = base64
+ this.hide = false
}
})
}
@@ -115,5 +133,6 @@ export default {
.main{
width: 128rpx;
height: 128rpx;
+ position: relative;
}
diff --git a/pages/revenue/component/yearCharts.vue b/pages/revenue/component/yearCharts.vue
index 08891a9..f31f558 100644
--- a/pages/revenue/component/yearCharts.vue
+++ b/pages/revenue/component/yearCharts.vue
@@ -1,7 +1,7 @@
-
-
-
+
+
+
@@ -13,19 +13,31 @@ export default {
name: "YearCharts",
data() {
return {
- preferPath:''
+ preferPath:'',
+ showImg:false,
+ hide:true
}
},
props: {
success: {
type: Number,
default: 0
+ },
+ name:{
+ type: String,
+ default: ''
}
},
+ onUnload(){
+ let canvas = document.getElementById('month');
+ let context = uni.createCanvasContext(this.name,this);
+ context.clearRect(0, 0, canvas.width, canvas.height);
+ },
watch: {
success: {
handler(value) {
- console.log('value111', value)
+ this.hide = true
+ this.preferPath= ''
let success = Number(value) > 100 ? 100 : Number(value)
let error = Number(100 - value) < 0 ? 0 : Number(100 - value)
let res = {
@@ -33,13 +45,33 @@ export default {
data: [{name: '已完成', value: success}, {name: '未完成', value: error}]
}]
}
- console.log('res',res)
- this.drawCharts('month', res)
- }
+ if (value){
+ this.drawCharts(this.name, res)
+ }else{
+ let res = {
+ series: [{
+ data: [{name: '已完成', value: 0}, {name: '未完成', value: 100}]
+ }]
+ }
+ this.drawCharts(this.name, res)
+ }
+ },
+ immediate:true
+ },
+ preferPath:{
+ handler(value){
+ if (value){
+ this.showImg = true
+ }else{
+ this.showImg = false
+ }
+ },
+ immediate:true
}
},
methods: {
drawCharts(id, data) {
+
const ctx = uni.createCanvasContext(id, this);
let _this = this
uChartsInstance[id] = new uCharts({
@@ -75,15 +107,17 @@ export default {
}
}
});
+ console.log('_this.hide',_this.hide)
setTimeout( ()=>{
- this.canvasToTempImage('month')
- },100)
+ console.log('this.name',this.name)
+ this.canvasToTempImage(this.name)
+ },500)
},
canvasToTempImage(id){
- uni.canvasToTempFilePath({
+ wx.canvasToTempFilePath({
canvasId:id,
complete:(res)=>{
- console.log('res1',res)
+ console.log('res',res)
if (res.tempFilePath){
uni.getFileSystemManager().readFile({
filePath: res.tempFilePath,
@@ -91,6 +125,8 @@ export default {
success: res => {
let base64 = 'data:image/png;base64,' + res.data;
this.preferPath = base64
+ this.hide = false
+ console.log('this.hide ',this.hide )
}
})
}
diff --git a/pages/revenue/index.vue b/pages/revenue/index.vue
index da73507..6bd7fc4 100644
--- a/pages/revenue/index.vue
+++ b/pages/revenue/index.vue
@@ -28,88 +28,96 @@
*以下经营数据由财务部提供填入(非系统计算)
@@ -120,8 +128,11 @@
{{ `${thisYear}年度累计利润` }}
?
- 利润总额完成率=本年累计/年度预算
{{ `(${$util.fmoney(pageDetail.yearProfit.ThisYearTotal/10000,2)} / ${$util.fmoney(pageDetail.yearProfit.ThisYearBudget/10000,2)})` }}
- 净利润完成度=本年净利润/净利润预算
{{ `(${$util.fmoney(pageDetail.yearProfit.ThisYearTotalC/10000,2)} / ${$util.fmoney(pageDetail.yearProfit.ThisYearBudgetC/10000,2)})` }}
+
+
+
+ 利润总额完成率=本年累计/年度预算
{{ `(${currentResult.profitThisYearReal||'-'} / ${currentResult.profitBudgetThisYearReal||'-'})` }}
+ 净利润完成度=本年净利润/净利润预算
{{ `(${currentResult.thisYearNetProfitReal||'-'} / ${currentResult.thisYearNetProfitBudgetReal||'-'})` }}
@@ -132,28 +143,33 @@
完成率
- {{`88.43%`}}
+ {{`${currentResult.profitRate || '-'}%`}}
-
+
- {{$util.fmoney(pageDetail.yearProfit.ThisYearTotal/10000,2)}}
+
+ {{ currentResult.profitThisYear||'-' }}
本年累计/万元
- {{$util.fmoney(pageDetail.yearProfit.ThisYearBudget/10000,2)}}
+
+ {{currentResult.profitBudgetThisYear||'-'}}
年度预算/万元
+
+
+
{{
- `${pageDetail.yearProfit.TRate>0?'+':pageDetail.yearProfit.TRate<0?'-':''}${pageDetail.yearProfit.TRate||''}%`
+ `${currentResult.profitYOY || '-'}%`
}}
同比
@@ -161,13 +177,13 @@
- {{`486.00`}}
+ {{currentResult.thisYearNetProfit||'-'}}
本年净利润/万元
- {{`550.00`}}
+ {{currentResult.thisYearNetProfitBudget||'-'}}
净利润预算/万元
@@ -176,7 +192,7 @@
{{
- `88.43%`
+ `${currentResult.thisYearNetProfitSuccess||'-'}%`
}}
完成度
@@ -203,7 +219,7 @@
-
+
65.12%
@@ -264,8 +280,10 @@
- 完成率=本年累计收入 / 年度预算
{{ `(619,033,365.94 / 800,500,000.00)` }}
- 成本比=本年累计成本/本年累计收入
{{ `243,936,015.66 / 619,033,365.94)` }}
+
+
+ 完成率=本年累计收入 / 年度预算
{{ `(${currentResult.inComeThisYearReal||'-'} / ${currentResult.thisYearInComeBudgetReal||'-'})` }}
+ 成本比=本年累计成本/本年累计收入
{{ `${currentResult.costReal||'-'} /${currentResult.inComeThisYearReal||'-'})` }}
年度预算:年度预算包含营业外
年度预算同比: 本年累计收入的同比值
@@ -274,15 +292,15 @@
-
+
- {{`77.33%`}}
+ {{`${currentResult.inComeSuccess || '-'}%`}}
- {{ `61,903.00` }}
+ {{ currentResult.inComeThisYear || '' }}
本年累计
/万元
@@ -290,14 +308,14 @@
- {{`39.41%`}}
+ {{`${currentResult.thisYearCostRatio || '-'}%`}}
成本比
- {{`80,050.00`}}
+ {{ currentResult.thisYearInComeBudget||'-' }}
年度预算
/万元
@@ -305,7 +323,7 @@
- {{`70.92%`}}
+ {{`${currentResult.thisYearInComeYOY||'-'}%`}}
同比
@@ -328,8 +346,8 @@
便利店、餐饮及客房的累计数
- 完成率 = 本年累计自营收入 / 自营收入的年度预算
{{ `(449,927,347.31 / 538,140,000.00)` }}
- {{ `本月占比 = ${thisMonth}月自营收入 / 本年累计自营收入(50,843,071.60 / 449,927,347.31) `}}
+ 完成率 = 本年累计自营收入 / 自营收入的年度预算
{{ `(${currentResult.selfThisYearReal||'-'} / ${currentResult.selfThisYearBudgetReal||'-'})` }}
+ {{ `本月占比 = ${thisMonth}月自营收入 / 本年累计自营收入(${currentResult.selfThisMonthReal||'-'} / ${currentResult.selfThisYearReal||'-'}) `}}
服务区自营小计:城市店、批发团购及通道费的累计数
@@ -346,20 +364,20 @@
-
- {{ `83.61%` }}
+
+ {{ `${currentResult.selfRate||'-'}%` }}
- {{'44,992.73'}}
+ {{currentResult.selfThisYear || '-'}}
本年累计/万元
- {{'5,084.31'}}
+ {{currentResult.selfThisMonth || '-'}}
{{ `${thisMonth}月累计` }}
@@ -370,12 +388,12 @@
- {{'53,814.00'}}
+ {{currentResult.selfThisYearBudget || '-'}}
年度预算/万元
- {{ `11.3%` }}
+ {{ `${currentResult.selfThisMonthRate || '-'}%` }}
本月占比
@@ -392,7 +410,7 @@
完成率
- {{ `83.5%`}}
+ {{ `${currentResult.selfStoreRate||'-'}%`}}
@@ -405,7 +423,7 @@
完成率
- {{ `84.17%`}}
+ {{ `${currentResult.selfRoomRate||'-'}%`}}
@@ -426,8 +444,8 @@
场地租赁、物业及受托代管、公共服务补贴、营业外收入的累计数
- 完成率= 7月其他收入 / 其他收入的年度预算{{ `(169,106,018.63/ 262,360,000.00)` }}
- 本月占比 = 7月其他收入 / 本年累计其他收入{{ `(169,106,018.63/ 16,758,130.53)` }}
+ {{ `完成率= ${thisMonth}月其他收入 / 其他收入的年度预算( ${currentResult.otherThisMonthReal||'-'}/${currentResult.otherThisYearBudgetReal||'-'} )` }}
+ {{ `本月占比 = ${thisMonth}月其他收入 / 本年累计其他收入( ${currentResult.otherThisMonthReal||'-'}/${currentResult.otherThisYearReal||'-'} )` }}
服务区租赁小计:商铺、充电桩、汽修、加油站的租赁累计收入
@@ -444,21 +462,21 @@
-
+
- {{ `64.46%` }}
+ {{ `${currentResult.otherRate || '-'}%` }}
- {{'16,910.60'}}
+ {{currentResult.otherThisYear || '-'}}
本年累计/万元
- {{'1,675.81'}}
+ {{currentResult.otherThisMonth || '-'}}
{{ `${thisMonth}月累计` }}
@@ -469,12 +487,12 @@
- {{'26,236.00'}}
+ {{currentResult.otherThisYearBudget || '-'}}
年度预算/万元
- {{ `9.91%` }}
+ {{ `${currentResult.otherThisMonthRate||'-'}%` }}
本月占比
@@ -490,7 +508,7 @@
完成率
- {{ `63.83%`}}
+ {{ `${currentResult.leaseRate|| '-'}%`}}
@@ -502,7 +520,7 @@
完成率
- {{ `67.83%`}}
+ {{ `${currentResult.propertyRate|| '-'}%`}}
@@ -510,14 +528,14 @@
-
+
支出合计
-
+
{{`77.09%`}}
@@ -535,7 +553,7 @@
{{`100.79%` }}
- 收支比
+ 支出比
@@ -571,7 +589,7 @@
-
+
{{`84.13%`}}
@@ -626,7 +644,7 @@
-
+
{{`64.57%`}}
@@ -677,7 +695,7 @@
-
+
{{`74.54%`}}
@@ -730,7 +748,7 @@
-
+
{{`59.46%`}}
@@ -827,6 +845,113 @@ export default {
thisMonth:'',// 当前月份
pageDetail:'',// 接口返回的数据
childrenShow:false,// 收入合计的显示框
+ CostInRate:44.36,
+ InOutRate:56.29,
+ monthList:[7,8,9],// 月份列表
+ selectMonth:0,// 当前选中的月份
+ monthResult:[
+ // 7月
+ {
+ month:7,// 月份
+ costRatio:39.39,// 成本比
+ expendRatio:167.27,// 支出比
+ thisMonthInCome:'7,099.41',// 本月收入
+ thisMonthExpend:'4,244.22',// 本月支出
+ costYear:'+50.59',// 成本同比
+ expendYear:'+9.12',// 支出同比
+ profitRate:141.45,// 累计利润完成率
+ profitThisYear:'389.00',// 本年累计
+ profitThisYearReal:'389.00',// 本年累计详情
+ profitBudgetThisYear:'275.00',// 年度预算
+ profitBudgetThisYearReal:'275.00',// 年度预算详情
+ profitYOY:'+105.59',// 累计利润同比
+ thisYearNetProfit:'292.00',// 净利润
+ thisYearNetProfitReal:'292.00',// 净利润详情
+ thisYearNetProfitBudget:'156.00',// 净利润预算
+ thisYearNetProfitBudgetReal:'156.00',// 净利润预算详情
+ thisYearNetProfitSuccess:'187.18',// 净利润完成度
+ inComeSuccess:65.18,// 收入完成率
+ inComeThisYear:'47,376.60',// 本年收入累计
+ inComeThisYearReal:'473,766,021.71',// 本年收入累计详情
+ thisYearCostRatio:38.11,// 本年成本比
+ thisYearInComeBudget:'72,687.00',// 年度收入预算
+ thisYearInComeBudgetReal:'726,870,000.00',// 年度收入预算详情
+ costReal:'180,563,832.50',// 累计成本
+ thisYearInComeYOY:'+48.54',// 年度收入同比
+ selfRate:71.70,// 自营收入小计完成率
+ selfThisYear:'33,978.75',// 自营收入小计本年累计
+ selfThisYearReal:'339,787,552.17',// 自营收入小计本年累计详情
+ selfThisMonth:'5,070.82',// 自营收入小计本月
+ selfThisMonthReal:'50,708,267.25',// 自营收入小计本月详情
+ selfThisYearBudget:'47,392',// 自营收入小计年度预算
+ selfThisYearBudgetReal:'473,920,000.00',// 自营收入小计年度预算详情
+ selfThisMonthRate:'14.92',// 自营收入小计本月占比
+ selfStoreRate:'',// 便利店完成率
+ selfRoomRate:'',// 餐饮客房完成率
+ otherRate:'52.97',// 其他收入小计完成率
+ otherThisYear:'13,397.84',// 其他收入小计本年累计
+ otherThisYearReal:'133,978,469.54',// 其他收入小计本年累计详情
+ otherThisMonth:'2,028.58',// 其他收入小计本月
+ otherThisMonthReal:'20,285,867.69',// 其他收入小计本月详情
+ otherThisYearBudget:'25,295.00',//其他收入小计年度预算
+ otherThisYearBudgetReal:'252,950,000.00',//其他收入小计年度预算详情
+ otherThisMonthRate:'15.14',//其他收入预算本月占比
+ leaseRate:'35.99',// 租赁完成率
+ propertyRate:'',//物业及受托代管
+ },
+ {
+ month:8,// 月份
+ },
+ {
+ month:9,// 月份
+ costRatio:44.36,// 成本比
+ expendRatio:56.29,// 支出比
+ thisMonthInCome:'6,760.00',// 本月收入
+ thisMonthExpend:'3805.24',// 本月支出
+ costYear:'32.86',// 成本同比
+ expendYear:'65.62',// 支出同比
+ profitRate:88.43,// 累计利润完成率
+ profitThisYear:'486.00',// 本年累计
+ profitThisYearReal:'486.00',// 本年累计详情
+ profitBudgetThisYear:'550.00',// 年度预算
+ profitBudgetThisYearReal:'550.00',// 年度预算详情
+ profitYOY:'+194',// 累计利润同比
+ thisYearNetProfit:'486.00',// 净利润
+ thisYearNetProfitReal:'486.00',// 净利润详情
+ thisYearNetProfitBudget:'550.00',// 净利润预算
+ thisYearNetProfitBudgetReal:'550.00',// 净利润预算详情
+ thisYearNetProfitSuccess:'88.43',// 净利润完成度
+ inComeSuccess:77.33,// 收入完成率
+ inComeThisYear:'61,903.00',// 本年收入累计
+ inComeThisYearReal:'619,033,365.94',// 本年收入累计详情
+ thisYearCostRatio:39.41,// 本年成本比
+ thisYearInComeBudget:'80,050.00',// 年度收入预算
+ thisYearInComeBudgetReal:'800,500,000.00',// 年度收入预算详情
+ costReal:'243,936,015.66',// 累计成本详情
+ thisYearInComeYOY:'70.92',// 年度收入同比
+ selfRate:83.61,// 自营收入小计完成率
+ selfThisYear:'44,992.73',// 自营收入小计本年累计
+ selfThisYearReal:'449,927,347.31',// 自营收入小计本年累计详情
+ selfThisMonth:'5,084.31',// 自营收入小计本月
+ selfThisMonthReal:'50,843,071.60',// 自营收入小计本月详情
+ selfThisYearBudget:'53,814.00',// 自营收入小计年度预算
+ selfThisYearBudgetReal:'538,140,000.00',// 自营收入小计年度预算详情
+ selfThisMonthRate:'11.3',// 自营收入小计本月占比
+ selfStoreRate:'83.5',// 便利店完成率
+ selfRoomRate:'84.17',// 餐饮客房完成率
+ otherRate:'64.46',// 其他收入小计完成率
+ otherThisYear:'16,910.60',// 其他收入小计本年累计
+ otherThisYearReal:'16,758,130.53',// 其他收入小计本年累计详情
+ otherThisMonth:'1,675.81',// 其他收入小计本月
+ otherThisMonthReal:'169,106,018.63',// 其他收入小计本月详情
+ otherThisYearBudget:'26,236.00',//其他收入小计年度预算
+ otherThisYearBudgetReal:'262,360,000.00',//其他收入小计年度预算详情
+ otherThisMonthRate:'9.91',//其他收入预算本月占比
+ leaseRate:'63.83',// 租赁完成率
+ propertyRate:'67.83',//物业及受托代管
+ }
+ ],// 789月份的数据
+ currentResult:{},// 选择的数据
}
},
onLoad(){
@@ -854,10 +979,11 @@ export default {
this.thisYear = y
this.startDate = `${y}-07`
this.endData = `${y}-09`
- this.single = `${y}-09`
- this.thisMonth = '09'
+ this.single = `${y}-07`
+ this.thisMonth = '07'
// 请求的方法
this.handleGetData()
+ this.currentResult = this.monthResult[this.selectMonth]
},
methods:{
// 点击出现备注
@@ -1036,6 +1162,15 @@ export default {
this.thisYear = e.detail.value.split('-')[0]
this.thisMonth = e.detail.value.split('-')[1]
console.log('this.thisMonth',this.thisMonth)
+ if (this.thisMonth.indexOf('7')!==-1){
+ this.selectMonth = 0
+ }else if(this.thisMonth.indexOf('8')!==-1){
+ this.selectMonth = 1
+ }else if(this.thisMonth.indexOf('9')!==-1){
+ this.selectMonth = 2
+ }
+ console.log('selectMonth',this.selectMonth)
+ this.currentResult = this.monthResult[this.selectMonth]
this.handleGetData()
},
// 收入合计点击子项出现的悬浮框
@@ -1049,6 +1184,14 @@ export default {
}
console.log('userRevenueSmallSum',this.userRevenueSmallSum)
console.log('otherSmallSum',this.otherSmallSum)
+ },
+ // 滑动swiper的方法
+ handleChangeSwiper(e){
+ console.log('e',e)
+ this.selectMonth = e.target.current
+ this.thisMonth = this.monthList[this.selectMonth]
+ this.single = `${this.thisYear}-${this.thisMonth<10?'0'+this.thisMonth:this.thisMonth}`
+ this.currentResult = this.monthResult[this.selectMonth]
}
}
}