From 87cbee9b14970d997c1e5c54b5fef4d04369c968 Mon Sep 17 00:00:00 2001 From: zhangxiaoxu123456 <zxx19900626> Date: 星期四, 05 五月 2022 09:57:52 +0800 Subject: [PATCH] 社会收支总表修改 --- src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue | 70 +++++++++++++++++++++++++++++++--- 1 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue index ad90328..dc510dc 100644 --- a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue +++ b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoShouzhiZongbiao.vue @@ -71,98 +71,148 @@ prop="item" label="椤圭洰"> </el-table-column> - <el-table-column :label="month1" align="center"> + <el-table-column v-if="tableData[0]" :label="tableData[0].month1" align="center"> <el-table-column align="center" - prop="totalIncome1" label="鎬绘敹鍏�"> + <template slot-scope="scope"> + <span :class="Number(scope.row.totalIncome1) < 0 ? 'fontColorRed' : ''">{{scope.row.totalIncome1}}</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 :label="month2" align="center"> + <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 :label="month3" align="center"> + <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 :label="month4" align="center"> + <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> </el-table-column> </el-table> <div class="shebaoShouzhiZongbiaoEcharts" id="shebaoShouzhiZongbiaoEcharts"></div> @@ -180,7 +230,7 @@ return { tableHead:[], tableData:[], - headerArry:[], + headerArry:{}, echartsSeries:{} } }, @@ -193,6 +243,12 @@ getStatisticsTable().then(res => { if(res.code == 1000) { this.tableData = res.list + res.list.forEach((item,index) => { + if(index == 0) { + this.headerArry = item + console.log(this.headerArry,'this.headerArry====') + } + }) } }) }, @@ -301,7 +357,7 @@ myEchart.resize() }) }, - handleCellStyle({rowIndex, columnIndex}) { + handleCellStyle({row, column, rowIndex, columnIndex}) { if(columnIndex == 0) { return { background:'#51D2FF' } } -- Gitblit v1.9.1