Shannon_mu 3 år sedan
förälder
incheckning
d2ee43400f

+ 6 - 5
commandCenter/src/views/financialAnalysis/smallModuleIndex/incomeMode.vue

@@ -66,8 +66,8 @@ export default {
     },
     methods: {
         getData() {
-            this.$http.get('/sc-community/statisticsUserIdentities', this.mixins_query).then(({ data, msg, status }) => {
-                if (status == 0 && !!data.datas) {
+            this.$http.get('/sc-community/statisticIncomeMethod', this.mixins_query).then(({ data, msg, status }) => {
+                if (status == 0 &&  !!data.datas && Object.keys(data.datas).length !==0) {
                     this.clientOptions = ringType(colors, this.eachartObj(data), {}, { type: '%', total: data.total }, 30);
                 } else {
                     this.clientOptions = ringType(
@@ -87,11 +87,11 @@ export default {
             });
         },
         changeTime(v) {
-            this.mixins_query.date = v;
+            this.mixins_query.date = v + '-01';
             this.getData();
         },
         eachartObj(data) {
-            this.total = data.total;
+            this.total = data.total || 0;
             let typeName = {
                 1: '微信在线',
                 2: '支付宝',
@@ -107,12 +107,13 @@ export default {
                     value: data.datas[a],
                     name: typeName[a]
                 });
+                 this.total = this.total + data.datas[a];
             }
             return newData;
         }
     },
     created() {
-        this.mixins_query.date = this.$moment().format('YYYY-MM');
+        this.mixins_query.date = this.$moment().format('YYYY-MM') + '-01';
         this.date = this.$moment().format('YYYY-MM');
     }
 };

+ 28 - 20
commandCenter/src/views/financialAnalysis/smallModuleIndex/netReceipts.vue

@@ -29,8 +29,10 @@
     </div>
 </template>
 <script>
-import { discountedWave } from './indexOptionChart';
+import { discountedChart } from './indexOptionChart';
 import allcommunit from './allcommunit';
+let dataArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+let dataDay = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
 export default {
     mixins: [allcommunit],
     data() {
@@ -38,40 +40,46 @@ export default {
             mixins_query: {
                 communityId: '',
                 chargeType: '',
-                endTime: '',
-                startTime: ''
+                year: '',
             },
             date: '',
-            clientOptions: discountedWave('(元)', [], [])
+              clientOptions: discountedChart('(元)', dataDay, dataArr),
         };
     },
     methods: {
         getData() {
-            this.$http.post('/sc-charge/charge/report/total/month', this.mixins_query).then(({ data, msg, status }) => {
+            this.$http.get('/sc-charge/charge/report/months/total', this.mixins_query).then(({ data, msg, status }) => {
                 if (status == 0 && !!data) {
-                    let times = [],
-                        total = [];
-
-                    data.map((item) => {
-                        times.push(item.months);
-                        total.push(item.totalAmount);
-                    });
-                    this.clientOptions = discountedWave('(元)', times, total);
-                } else {
-                    this.clientOptions = discountedWave('(元)', [], []);
-                }
+                    let dateTimes = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
+                            let dateRes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+                            dateRes[0] = data.january == null ? 0 : data.january;
+                            dateRes[1] = data.february == null ? 0 : data.february;
+                            dateRes[2] = data.march == null ? 0 : data.march;
+                            dateRes[3] = data.april == null ? 0 : data.april;
+                            dateRes[4] = data.may == null ? 0 : data.may;
+                            dateRes[5] = data.june == null ? 0 : data.june;
+                            dateRes[6] = data.july == null ? 0 : data.july;
+                            dateRes[7] = data.august == null ? 0 : data.august;
+                            dateRes[8] = data.september == null ? 0 : data.september;
+                            dateRes[9] = data.october == null ? 0 : data.october;
+                            dateRes[10] = data.november == null ? 0 : data.november;
+                            dateRes[11] = data.december == null ? 0 : data.december;
+                            this.clientOptions = discountedChart('(元)', dateTimes, dateRes);
+                        } else {
+                            let dateTimes = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
+                            let dateRes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+                            this.clientOptions = discountedChart('(元)', dateTimes, dateRes);
+                        }
             });
         },
         changeTime(v) {
-            this.mixins_query.endTime = v;
-            this.mixins_query.startTime = v;
+            this.mixins_query.year = v;
             this.getData();
         }
     },
     created() {
         this.date = this.$moment().format('YYYY');
-        this.mixins_query.startTime = this.$moment().format('YYYY');
-        this.mixins_query.endTime = this.$moment().format('YYYY');
+        this.mixins_query.year = this.$moment().format('YYYY');
     }
 };
 </script>

+ 16 - 1
operationSupport/src/views/newWorkBench/components/workbenchMent/proportionIncomeMode.vue

@@ -83,8 +83,23 @@ export default {
     methods: {
         getData() {
             this.$http.get('/sc-community/statisticIncomeMethod', this.mixins_query).then(({ data, msg, status }) => {
-                if (status == 0 && !!data.datas) {
+                if (status == 0 && !!data.datas && Object.keys(data.datas).length !== 0) {
                     this.clientOptions = ringType(colors, this.eachartObj(data), {}, { type: 'number', total: this.total });
+                } else {
+                    this.clientOptions = ringType(
+                        colors,
+                        [
+                            { value: 0, name: '微信' },
+                            { value: 0, name: '支付宝' },
+                            { value: 0, name: '现金' },
+                            { value: 0, name: '预存' },
+                            { value: 0, name: '其他' }
+                        ],
+                        {},
+                        { type: '%', total: 0 },
+                        30
+                    );
+                    this.total = 0;
                 }
             });
         },