From 7f3bd68b67a4f8ae0565b19433299c5e6336f951 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期四, 19 五月 2022 14:46:07 +0800
Subject: [PATCH] 其他业务

---
 src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue |  299 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 225 insertions(+), 74 deletions(-)

diff --git a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue
index 3c7584a..dc510dc 100644
--- a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue
+++ b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue
@@ -3,62 +3,217 @@
     <div class="shebaoShouzhiZongbiao-table">
       <h1>绀句細淇濋殰鍩洪噾缁熻琛�</h1>
       <el-table
-        :cell-style="handleCellStyle"
         :data="tableData"
+        :cell-style="handleCellStyle"
         style="width: 100%">
-        <template v-for="(item,index) in headerArry">
+        <!--<template v-for="(item,index) in headerArry">
           <template v-if="index == 0">
             <el-table-column
               align="center"
-              :prop="item.name"
+              :prop="item.item"
               label="椤圭洰"
               fixed>
               <template slot-scope="scope">
-                <span :class="[Number(item.taxesIncome) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.name}}</span>
+                <span style="margin-left: 10px">{{scope.row.item}}</span>
               </template>
             </el-table-column>
+            <template v-for="(e,i) in item.dataList">
+              <el-table-column :label="e.month" align="center">
+                <el-table-column
+                  align="center"
+                  label="鎬绘敹鍏�">
+                  <template slot-scope="scope">
+                    <template>
+                      <template>
+                        <span :class="[Number(e.taxesIncome) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{scope.row.dataList[0].totalIncome}}</span>
+                      </template>
+                    </template>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  align="center"
+                  label="寰侀泦鏀跺叆">
+                  <template slot-scope="scope">
+                    <span :class="[Number(e.taxesIncome) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{scope.row.dataList[0].taxesIncome}}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  align="center"
+                  label="鏈湀鏀嚭">
+                  <template slot-scope="scope">
+                    <span :class="[Number(e.pay) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{scope.row.dataList[0].pay}}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  align="center"
+                  label="鏈湀缁撲綑">
+                  <template slot-scope="scope">
+                    <span :class="[Number(e.balance) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{scope.row.dataList[0].balance}}</span>
+                  </template>
+                </el-table-column>
+              </el-table-column>
+            </template>
+            <template>
+              <el-table-column
+                align="center"
+                :prop="item.surplus"
+                label="绱缁撲綑">
+                <template slot-scope="scope">
+                  <span :class="[Number(item.surplus) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.surplus}}</span>
+                </template>
+              </el-table-column>
+            </template>
           </template>
-          <el-table-column :label="item.month" align="center">
-            <el-table-column
-              align="center"
-              label="鎬绘敹鍏�">
-              <template slot-scope="scope">
-                <span :class="[Number(item.totalIncome) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.totalIncome}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="center"
-              label="寰侀泦鏀跺叆">
-              <template slot-scope="scope">
-                <span :class="[Number(item.taxesIncome) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.taxesIncome}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="center"
-              label="鏈湀鏀嚭">
-              <template slot-scope="scope">
-                <span :class="[Number(item.pay) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.pay}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="center"
-              label="鏈湀缁撲綑">
-              <template slot-scope="scope">
-                <span :class="[Number(item.balance) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.balance}}</span>
-              </template>
-            </el-table-column>
+        </template>-->
+        <el-table-column
+          width="260"
+          align="center"
+          prop="item"
+          label="椤圭洰">
+        </el-table-column>
+        <el-table-column v-if="tableData[0]" :label="tableData[0].month1" align="center">
+          <el-table-column
+            align="center"
+            label="鎬绘敹鍏�">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.totalIncome1) < 0 ? 'fontColorRed' : ''">{{scope.row.totalIncome1}}</span>
+            </template>
           </el-table-column>
-          <template v-if="index == headerArry.length - 1">
-            <el-table-column
-              align="center"
-              :prop="item.surplus"
-              label="绱缁撲綑">
-              <template slot-scope="scope">
-                <span :class="[Number(item.surplus) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.surplus}}</span>
-              </template>
-            </el-table-column>
+          <el-table-column
+            align="center"
+            prop="taxesIncome1"
+            label="寰侀泦鏀跺叆">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.taxesIncome1) < 0 ? 'fontColorRed' : ''">{{scope.row.taxesIncome1}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="pay1"
+            label="鏈湀鏀嚭">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.pay1) < 0 ? 'fontColorRed' : ''">{{scope.row.pay1}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="balance1"
+            label="鏈湀缁撲綑">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.balance1) < 0 ? 'fontColorRed' : ''">{{scope.row.balance1}}</span>
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column v-if="tableData[0]" :label="tableData[0].month2" align="center">
+          <el-table-column
+            align="center"
+            prop="totalIncome2"
+            label="鎬绘敹鍏�">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.totalIncome2) < 0 ? 'fontColorRed' : ''">{{scope.row.totalIncome2}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="taxesIncome2"
+            label="寰侀泦鏀跺叆">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.taxesIncome2) < 0 ? 'fontColorRed' : ''">{{scope.row.taxesIncome2}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="pay2"
+            label="鏈湀鏀嚭">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.pay2) < 0 ? 'fontColorRed' : ''">{{scope.row.pay2}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="balance2"
+            label="鏈湀缁撲綑">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.balance2) < 0 ? 'fontColorRed' : ''">{{scope.row.balance2}}</span>
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column v-if="tableData[0]" :label="tableData[0].month3" align="center">
+          <el-table-column
+            align="center"
+            prop="totalIncome3"
+            label="鎬绘敹鍏�">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.totalIncome3) < 0 ? 'fontColorRed' : ''">{{scope.row.totalIncome3}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="taxesIncome3"
+            label="寰侀泦鏀跺叆">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.taxesIncome3) < 0 ? 'fontColorRed' : ''">{{scope.row.taxesIncome3}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="pay3"
+            label="鏈湀鏀嚭">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.pay3) < 0 ? 'fontColorRed' : ''">{{scope.row.pay3}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="balance3"
+            label="鏈湀缁撲綑">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.balance3) < 0 ? 'fontColorRed' : ''">{{scope.row.balance3}}</span>
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column v-if="tableData[0]" :label="tableData[0].month4" align="center">
+          <el-table-column
+            align="center"
+            prop="totalIncome4"
+            label="鎬绘敹鍏�">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.totalIncome4) < 0 ? 'fontColorRed' : ''">{{scope.row.totalIncome4}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="taxesIncome4"
+            label="寰侀泦鏀跺叆">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.taxesIncome4) < 0 ? 'fontColorRed' : ''">{{scope.row.taxesIncome4}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="pay4"
+            label="鏈湀鏀嚭">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.pay4) < 0 ? 'fontColorRed' : ''">{{scope.row.pay4}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="balance4"
+            label="鏈湀缁撲綑">
+            <template slot-scope="scope">
+              <span :class="Number(scope.row.balance4) < 0 ? 'fontColorRed' : ''">{{scope.row.balance4}}</span>
+            </template>
+          </el-table-column>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="surplus"
+          label="绱缁撲綑">
+          <template slot-scope="scope">
+            <span :class="Number(scope.row.surplus) < 0 ? 'fontColorRed' : ''">{{scope.row.surplus}}</span>
           </template>
-        </template>
+        </el-table-column>
       </el-table>
       <div class="shebaoShouzhiZongbiaoEcharts" id="shebaoShouzhiZongbiaoEcharts"></div>
     </div>
@@ -67,47 +222,34 @@
 
 <script>
   import nowSize from "../../../../libs/nowSize";
-  import {getStatisticsTable} from '@/api/shehuiBaozhang'
+  import {getStatisticsTable,getStatisticsChart } from '@/api/shehuiBaozhang'
+  import index from "../../index/index";
 export default {
   name: "shebaoShouzhiZongbiao",
   data() {
     return {
       tableHead:[],
       tableData:[],
-      headerArry:[]
+      headerArry:{},
+      echartsSeries:{}
     }
   },
   mounted() {
       this.getStatisticsTable()
-     this.shebaoShouzhiZongbiaoEcharts()
+     this.getStatisticsChart()
   },
   methods: {
       getStatisticsTable() {
           getStatisticsTable().then(res => {
               if(res.code == 1000) {
                   this.tableData = res.list
-                  this.getData()
+                  res.list.forEach((item,index) => {
+                      if(index == 0) {
+                          this.headerArry = item
+                          console.log(this.headerArry,'this.headerArry====')
+                      }
+                  })
               }
-          })
-      },
-      getData() {
-          let row = []
-          this.tableData.forEach((e,index) => {
-              e.dataList.forEach((c,i) => {
-                  if(index == 0) {
-                      row.push({
-                          name: e.item,
-                          "month": c.month ,
-                          "totalIncome": c.totalIncome,
-                          "taxesIncome": c.taxesIncome,
-                          "pay": c.pay,
-                          "balance": c.balance,
-                          "surplus": c.surplus || null
-                      })
-                  }
-              })
-              this.headerArry = row
-              console.log(this.headerArry)
           })
       },
       shebaoShouzhiZongbiaoEcharts() {
@@ -142,13 +284,13 @@
                   top: '15%',
                   left: '4%',
                   right: '18%',
-                  bottom: '3%',
+                  bottom: '9%',
                   containLabel: true
               },
               xAxis: {
                   type: 'category',
                   boundaryGap: false,
-                  data: ['2021/4', '2021/5', '2021/6', '2021/7', '2021/8', '2021/9', '2021/10'],
+                  data: this.echartsSeries.years,
                   axisLabel: {
                       show: true,
                       textStyle: {
@@ -191,22 +333,22 @@
                   {
                       name: '骞寸疮璁℃�绘敹鍏�',
                       type: 'line',
-                      data: [370, 332, 401, 534, 490, 530, 910]
+                      data: this.echartsSeries.income
                   },
                   {
                       name: '骞寸疮璁℃敮鍑�',
                       type: 'line',
-                      data: [220, 182, 191, 234, 290, 330, 310]
+                      data: this.echartsSeries.pay
                   },
                   {
                       name: '骞寸疮璁″緛缂存敹鍏�',
                       type: 'line',
-                      data: [150, 132, 201, 154, 190, 330, 410]
+                      data: this.echartsSeries.taxes
                   },
                   {
                       name: '骞寸疮璁$粨浣�',
                       type: 'line',
-                      data: [350, 112, 209, 164, 290, 310, 400]
+                      data:this.echartsSeries.balance
                   }
               ]
           };
@@ -215,11 +357,20 @@
               myEchart.resize()
           })
       },
-      handleCellStyle({rowIndex, columnIndex}) {
+      handleCellStyle({row, column, rowIndex, columnIndex}) {
           if(columnIndex == 0) {
               return { background:'#51D2FF' }
           }
       },
+    //35. 鏌ヨ鍘嗗勾绀句繚鍩洪噾鏁版嵁鍒嗘瀽鍥炬暟鎹帴鍙�
+    getStatisticsChart() {
+      getStatisticsChart().then(res => {
+        if(res.code ===1000){
+          this.echartsSeries = res.obj
+          this.shebaoShouzhiZongbiaoEcharts()
+        }
+      })
+    }
   }
 }
 </script>

--
Gitblit v1.9.1