Commit 848073f11ed1b06c896fe9d31a7e503f9a98d007

Authored by liuqimichale
1 parent c9493378

api 接口封装 收入

src/api/api.js
@@ -7,4 +7,7 @@ export const memberAddress = p => post('urban/intelligence/appuser/queryUserPers @@ -7,4 +7,7 @@ export const memberAddress = p => post('urban/intelligence/appuser/queryUserPers
7 export const tollmanAddress = p => post('urban/intelligence/employee/queryEmployeeStaByOrgIds',p) 7 export const tollmanAddress = p => post('urban/intelligence/employee/queryEmployeeStaByOrgIds',p)
8 8
9 //....设备 9 //....设备
  10 +export const incomeAddress = p => post('urban/intelligence/income/queryIncomeStaByOrgIds',p)
  11 +
  12 +//....设备
10 export const deviceAddress = p => post('urban/intelligence/device/queryDeviceStatistic',p) 13 export const deviceAddress = p => post('urban/intelligence/device/queryDeviceStatistic',p)
src/components/incomeOverview/index.vue
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 <script> 19 <script>
20 import common from '../../api/common'; 20 import common from '../../api/common';
21 import echarts from 'echarts' 21 import echarts from 'echarts'
  22 + import { incomeAddress } from '../../api/api'
22 export default { 23 export default {
23 name: "incomeOverview", 24 name: "incomeOverview",
24 data() { 25 data() {
@@ -38,38 +39,27 @@ @@ -38,38 +39,27 @@
38 } 39 }
39 }, 40 },
40 mounted() { 41 mounted() {
41 - this.axios.post('urban/intelligence/income/queryIncomeStaByOrgIds',{  
42 - orgIds: this.GLOBAL.paramsvariables  
43 - }).then((response)=>{  
44 - let data = response.data.data  
45 - this.incomeTotal = data.totalPay  
46 - //this.incomeTotal = common.formatNumToStr(this.incomeTotal)  
47 - this.incomeTotal = common.formatNumToStr(Math.round(this.incomeTotal/100))  
48 - this.barChartOption.barColor[0].value = Math.round(data.aliPay/100)  
49 - this.barChartOption.barColor[1].value = Math.round(data.wxPay/100)  
50 - this.barChartOption.barColor[2].value = Math.round(data.otherPay/100)  
51 - let barChartOption = this.barChartOption  
52 - this.barChart=this.createBar(barChartOption);  
53 - window.addEventListener('resize', function() {  
54 - this.barChart.resize()  
55 - }.bind(this));  
56 - }).catch((response)=>{  
57 - console.log(response);  
58 - })  
59 -  
60 - //this.createLine();  
61 - //debugger;  
62 - //总收入  
63 - this.incomeTotal=this.formatNumToStr();  
64 - //收入Bar  
65 - 42 + this.onLoad()
66 }, 43 },
67 methods: { 44 methods: {
68 - /*  
69 - * 格式化收入总数  
70 - * */  
71 - formatNumToStr:function(){  
72 - return common.formatNumToStr(this.$options.data().demo); 45 + onLoad() {
  46 + incomeAddress({
  47 + orgIds: this.GLOBAL.paramsvariables
  48 + }).then((response)=>{
  49 + let data = response.data.data
  50 + this.incomeTotal = data.totalPay
  51 + this.incomeTotal = common.formatNumToStr(Math.round(this.incomeTotal/100))
  52 + this.barChartOption.barColor[0].value = Math.round(data.aliPay/100)
  53 + this.barChartOption.barColor[1].value = Math.round(data.wxPay/100)
  54 + this.barChartOption.barColor[2].value = Math.round(data.otherPay/100)
  55 + let barChartOption = this.barChartOption
  56 + this.barChart=this.createBar(barChartOption);
  57 + window.addEventListener('resize', function() {
  58 + this.barChart.resize()
  59 + }.bind(this));
  60 + }).catch((response)=>{
  61 + console.log(response);
  62 + })
73 }, 63 },
74 /* 64 /*
75 * 创建收入Bar 65 * 创建收入Bar