From 41d6da7f5f8f0ce37c3521f6c4d639ab77ed9aac Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期五, 29 四月 2022 14:49:52 +0800
Subject: [PATCH] 其他业务

---
 src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue |  601 ++++++++++++++++++++++++++----------------------------
 1 files changed, 293 insertions(+), 308 deletions(-)

diff --git a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue
index 87aa6e3..149ec42 100644
--- a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue
+++ b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue
@@ -3,330 +3,315 @@
     <div class="shebaoShouzhiZongbiao-table">
       <h1>绀句細淇濋殰鍩洪噾缁熻琛�</h1>
       <el-table
-        v-fit-columns
+        :cell-style="handleCellStyle"
+        :data="tableData"
         style="width: 100%">
-        <el-table-column
-          prop="name"
-          label="椤圭洰"
-          :data="tableData"
-          fixed>
-        </el-table-column>
-        <el-table-column
-          label="1鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
+        <template v-for="(item,index) in headerArry">
+          <template v-if="index == 0">
+            <el-table-column
+              align="center"
+              :prop="item.name"
+              label="椤圭洰"
+              fixed>
+              <template slot-scope="scope">
+                <span :class="[Number(item.taxesIncome) < 0 ? 'fontColorRed' : '']" style="margin-left: 10px">{{item.name}}</span>
+              </template>
+            </el-table-column>
+          </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>
           </el-table-column>
-          <el-table-column
-            prop="zhengjishouru"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="benyuezhichu"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="benyuejieyu"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="2鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="3鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="4鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="5鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="6鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="7鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="9鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="10鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="11鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="12鏈�">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          label="鏈勾绱">
-          <el-table-column
-            prop="totalMoney"
-            label="鎬绘敹鍏�">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="寰侀泦鏀跺叆">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀鏀嚭">
-          </el-table-column>
-          <el-table-column
-            prop="totalMoney"
-            label="鏈湀缁撲綑">
-          </el-table-column>
-        </el-table-column>
-        <el-table-column
-          prop="name"
-          label="绱缁撲綑">
-        </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>
+          </template>
+        </template>
       </el-table>
+      <div class="shebaoShouzhiZongbiaoEcharts" id="shebaoShouzhiZongbiaoEcharts"></div>
     </div>
   </div>
 </template>
 
 <script>
-    export default {
-        name: "shebaoShouzhiZongbiao",
-        data() {
-            return {
-                tableData:[{
-                    totalMoney: '323332',
-                    zhengjishouru: '223333',
-                    benyuezhichu: '3t638',
-                    benyuejieyu: '76373637'
-                }]
-            }
-        }
+  import nowSize from "../../../../libs/nowSize";
+  import {getStatisticsTable,getStatisticsChart } from '@/api/shehuiBaozhang'
+export default {
+  name: "shebaoShouzhiZongbiao",
+  data() {
+    return {
+      tableHead:[],
+      tableData:[],
+      headerArry:[],
+      echartsSeries:{}
     }
+  },
+  mounted() {
+      this.getStatisticsTable()
+     this.getStatisticsChart()
+  },
+  methods: {
+      getStatisticsTable() {
+          getStatisticsTable().then(res => {
+              if(res.code == 1000) {
+                  this.tableData = res.list
+                  this.getData()
+              }
+          })
+      },
+      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() {
+          let myEchart = this.$echarts.init(document.getElementById('shebaoShouzhiZongbiaoEcharts'))
+          let option = {
+              color : ['#FF5151','#51FF5D','#FFD151','#FFD151'],
+              title: {
+                  text: '鍘嗗勾绀句繚鍩洪噾绱鏁版嵁鍒嗘瀽鍥�',
+                  left: 'center',
+                  top: '8%',
+                  textStyle: {
+                      color: '#FFFFFF',
+                      fontSize: nowSize(30)
+                  },
+              },
+              tooltip: {
+                  trigger: 'axis'
+              },
+              legend: {
+                  itemWidth: nowSize(30),
+                  itemHeight: nowSize(4),
+                  itemGap: nowSize(50),
+                  right:'2%',
+                  top: 'center',
+                  orient: 'vertical',
+                  textStyle: {
+                      color: '#FFFFFF',
+                      fontSize: nowSize(24),
+                  }
+              },
+              grid: {
+                  top: '15%',
+                  left: '4%',
+                  right: '18%',
+                  bottom: '9%',
+                  containLabel: true
+              },
+              xAxis: {
+                  type: 'category',
+                  boundaryGap: false,
+                  data: this.echartsSeries.years,
+                  axisLabel: {
+                      show: true,
+                      textStyle: {
+                          color: "#fff",
+                          fontSize:nowSize(24)
+                      }
+                  },
+                  axisLine: {
+                      lineStyle: {
+                          color: "#999999",
+                          width: 1,
+                          type: "solid"
+                      }
+                  },
+                  splitLine: {
+                      show: false
+                  }
+              },
+              yAxis: {
+                  type: 'value',
+                  axisLabel: {
+                      show: true,
+                      textStyle: {
+                          color: "#fff",
+                          fontSize:nowSize(24)
+                      }
+                  },
+                  axisLine: {
+                      lineStyle: {
+                          color: "#999999",
+                          width: 1,
+                          type: "solid"
+                      }
+                  },
+                  splitLine: {
+                      show: false
+                  }
+              },
+              series: [
+                  {
+                      name: '骞寸疮璁℃�绘敹鍏�',
+                      type: 'line',
+                      data: this.echartsSeries.income
+                  },
+                  {
+                      name: '骞寸疮璁℃敮鍑�',
+                      type: 'line',
+                      data: this.echartsSeries.pay
+                  },
+                  {
+                      name: '骞寸疮璁″緛缂存敹鍏�',
+                      type: 'line',
+                      data: this.echartsSeries.taxes
+                  },
+                  {
+                      name: '骞寸疮璁$粨浣�',
+                      type: 'line',
+                      data:this.echartsSeries.balance
+                  }
+              ]
+          };
+          myEchart.setOption(option)
+          window.addEventListener('resize',function () {
+              myEchart.resize()
+          })
+      },
+      handleCellStyle({rowIndex, columnIndex}) {
+          if(columnIndex == 0) {
+              return { background:'#51D2FF' }
+          }
+      },
+    //35. 鏌ヨ鍘嗗勾绀句繚鍩洪噾鏁版嵁鍒嗘瀽鍥炬暟鎹帴鍙�
+    getStatisticsChart() {
+      getStatisticsChart().then(res => {
+        if(res.code ===1000){
+          this.echartsSeries = res.obj
+          this.shebaoShouzhiZongbiaoEcharts()
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss">
-  @import "../../../../assets/css/base";
-  .shebaoShouzhiZongbiao-table{
-    width: 100%;
-    height: calc(100% - 0.078125rem  /* 20/256 */);
-    margin-top: 0.078125rem  /* 20/256 */;
-    .el-table th.el-table__cell{
-      background-color:$color-blue;
-      height: 0.3125rem  /* 80/256 */;
-    }
-    .el-table tr{
-      height: 0.3125rem  /* 80/256 */;
-    }
-    .el-table tr:nth-child(odd){
-      background-color: #CEF2FF;
-    }
-    .el-table tr:nth-child(even){
-      background-color: #A8E9FF;
-    }
-    .el-table, .el-table__expanded-cell{
-      background-color: transparent;
-    }
-    .el-table thead{
-      color: $color-darkGrey;
-    }
-    .el-table{
-      color: $color-darkGrey;
-    }
-    .el-table .cell{
-      font-size: $fontSize-28;
-      color: $color-darkGrey;
-      font-weight: 300;
-      line-height: 1;
-      white-space:pre-line;
-    }
-    .el-table--border th.el-table__cell, .el-table__fixed-right-patch{
-      border-bottom:1Px solid $color-grey; /*no*/
-    }
-    .el-table thead.is-group th.el-table__cell{
-      background-color: $color-blue;
-    }
-    .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf{
-      border-bottom:1Px solid $color-grey; /*no*/
-    }
-    .el-table--border .el-table__cell, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{
-      border-right:1Px solid $color-grey; /*no*/
-    }
+@import "../../../../assets/css/base";
+.shebaoShouzhiZongbiao-table{
+  width: 100%;
+  height: calc(100% - 0.078125rem  /* 20/256 */);
+  margin-top: 0.078125rem  /* 20/256 */;
+  /*.el-table .cell, el-table th > .cell{*/
+  /*  display: inline-block;*/
+  /*  white-space: nowrap;*/
+  /*  width: auto;*/
+  /*  overflow: auto;*/
+  /*}*/
+  .el-table th.el-table__cell{
+    background-color:$color-blue;
+    height: 0.3125rem  /* 80/256 */;
   }
+  .el-table tr{
+    height: 0.3125rem  /* 80/256 */;
+  }
+  .el-table tr:nth-child(odd){
+    background-color: #CEF2FF;
+  }
+  .el-table tr:nth-child(even){
+    background-color: #A8E9FF;
+  }
+  .el-table, .el-table__expanded-cell{
+    background-color: transparent;
+  }
+  .el-table thead{
+    color: $color-darkGrey;
+  }
+  .el-table{
+    color: $color-darkGrey;
+  }
+  .el-table .cell{
+    font-size: $fontSize-28;
+    color: $color-darkGrey;
+    font-weight: 300;
+    line-height: 1;
+    white-space:pre-line;
+  }
+  .el-table--border th.el-table__cell, .el-table__fixed-right-patch{
+    border-bottom:1Px solid $color-grey; /*no*/
+  }
+  .el-table thead.is-group th.el-table__cell{
+    background-color: $color-blue;
+  }
+  .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf{
+    border-bottom:1Px solid $color-grey; /*no*/
+  }
+  .el-table--border .el-table__cell, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{
+    border-right:1Px solid $color-grey; /*no*/
+  }
+}
 </style>
 
 <style lang="scss" scoped>
-  @import "../../../../assets/css/base";
-  .shebaoShouzhiZongbiao-wrap{
-    width: 100%;
-    height: calc(100% - 0.078125rem  /* 20/256 */);
-    .shebaoShouzhiZongbiao-table{
-      margin-top: 0.078125rem  /* 20/256 */;
-      h1{
-        font-size: $fontSize-30;
-        color: $color-white;
-        text-align: center;
-        line-height: 2;
-      }
+@import "../../../../assets/css/base";
+.shebaoShouzhiZongbiao-wrap{
+  width: 100%;
+  height: calc(100% - 0.078125rem  /* 20/256 */);
+  .shebaoShouzhiZongbiao-table{
+    margin-top: 0.078125rem  /* 20/256 */;
+    h1{
+      font-size: $fontSize-30;
+      color: $color-white;
+      text-align: center;
+      line-height: 2;
+    }
+    .fontColorBlue {
+      color: $color-blue;
+    }
+    .fontColorRed {
+      color: #FF3939;
     }
   }
+  .shebaoShouzhiZongbiaoEcharts{
+    height: calc(100% - 640px - 0.33203125rem  /* 85/256 */);
+  }
+}
 </style>

--
Gitblit v1.9.1