Commit 0a68f0b2ba1a4e73fe63a1c53cf4493089929ae2
1 parent
f9c79059
Exists in
master
fix:合并小计单元格
Showing
1 changed file
with
18 additions
and
35 deletions
Show diff stats
frontend/front/src/views/pages/reviewOfFinancialDailyReport/index.vue
@@ -16,19 +16,23 @@ | @@ -16,19 +16,23 @@ | ||
16 | style="width: 100%; margin-top: 20px"> | 16 | style="width: 100%; margin-top: 20px"> |
17 | <!-- <el-table-column type="selection" width="55"></el-table-column> --> | 17 | <!-- <el-table-column type="selection" width="55"></el-table-column> --> |
18 | <el-table-column prop="wdailyfundsforgtype" align="center" label="公司类型"></el-table-column> | 18 | <el-table-column prop="wdailyfundsforgtype" align="center" label="公司类型"></el-table-column> |
19 | - <el-table-column prop="wdailyfundsfdate" align="center" sortable label="日期"></el-table-column> | 19 | + <el-table-column prop="wdailyfundsfdate" align="center" sortable label="日期"> |
20 | + </el-table-column> | ||
20 | <el-table-column prop="wdailyfundsforgname" align="center" label="公司"> </el-table-column> | 21 | <el-table-column prop="wdailyfundsforgname" align="center" label="公司"> </el-table-column> |
21 | <el-table-column prop="wdailyfundsfyesterdayaccountbalance" align="center" label="昨日余额"> | 22 | <el-table-column prop="wdailyfundsfyesterdayaccountbalance" align="center" label="昨日余额"> |
22 | </el-table-column> | 23 | </el-table-column> |
23 | - <el-table-column prop="wdailyfundsftodayaccountbalance" align="center" label="今日余额"> </el-table-column> | 24 | + <el-table-column prop="wdailyfundsftodayaccountbalance" align="center" label="今日余额"> |
25 | + </el-table-column> | ||
24 | <el-table-column prop="wdailyfundsfaccountbalancedifference" align="center" label="差额(今日-昨日)"> | 26 | <el-table-column prop="wdailyfundsfaccountbalancedifference" align="center" label="差额(今日-昨日)"> |
25 | </el-table-column> | 27 | </el-table-column> |
26 | <el-table-column prop="wdailyfundsftodaynetcashflow" align="center" label="净现金流"> </el-table-column> | 28 | <el-table-column prop="wdailyfundsftodaynetcashflow" align="center" label="净现金流"> </el-table-column> |
27 | <el-table-column prop="wdailyfundsftodayfreezing" align="center" label="冻结金额"> </el-table-column> | 29 | <el-table-column prop="wdailyfundsftodayfreezing" align="center" label="冻结金额"> </el-table-column> |
28 | - <el-table-column prop="wdailyfundsftodayfreezeamount" align="center" label="冻结金额上限"> </el-table-column> | 30 | + <el-table-column prop="wdailyfundsftodayfreezeamount" align="center" label="冻结金额上限"> |
31 | + </el-table-column> | ||
29 | <el-table-column prop="wdailyfundsfinspstatusname" align="center" label="复核"> </el-table-column> | 32 | <el-table-column prop="wdailyfundsfinspstatusname" align="center" label="复核"> </el-table-column> |
30 | <el-table-column prop="" align="center" label="复核人"> </el-table-column> | 33 | <el-table-column prop="" align="center" label="复核人"> </el-table-column> |
31 | <el-table-column prop="" align="center" label="填报人"> </el-table-column> | 34 | <el-table-column prop="" align="center" label="填报人"> </el-table-column> |
35 | + <el-table-column prop="remake" label="备注"> </el-table-column> | ||
32 | </el-table> | 36 | </el-table> |
33 | </el-main> | 37 | </el-main> |
34 | <el-footer> | 38 | <el-footer> |
@@ -39,7 +43,6 @@ | @@ -39,7 +43,6 @@ | ||
39 | </div> | 43 | </div> |
40 | </el-footer> | 44 | </el-footer> |
41 | </el-container> | 45 | </el-container> |
42 | - <!-- <el-table-column prop="amount3" label="备注"> </el-table-column> --> | ||
43 | <!-- <div slot="append" style="display:flex;"> | 46 | <!-- <div slot="append" style="display:flex;"> |
44 | <div class="sum_footer"> | 47 | <div class="sum_footer"> |
45 | <div class="sum_footer_unit center" style="width:160px;"> | 48 | <div class="sum_footer_unit center" style="width:160px;"> |
@@ -153,34 +156,6 @@ export default { | @@ -153,34 +156,6 @@ export default { | ||
153 | }, | 156 | }, |
154 | getSummaries(param) { | 157 | getSummaries(param) { |
155 | const { columns, data } = param; | 158 | const { columns, data } = param; |
156 | - console.log('data', JSON.parse(JSON.stringify(data))); | ||
157 | - const sums = []; | ||
158 | - columns.forEach((column, index) => { | ||
159 | - if (index === 0) { | ||
160 | - sums[index] = '汇总'; | ||
161 | - return; | ||
162 | - } | ||
163 | - const values = data.map(item => Number(item[column.property])); | ||
164 | - if (!values.every(value => isNaN(value))) { | ||
165 | - sums[index] = values.reduce((prev, curr) => { | ||
166 | - const value = Number(curr); | ||
167 | - if (!isNaN(value)) { | ||
168 | - return prev + curr; | ||
169 | - } else { | ||
170 | - return prev; | ||
171 | - } | ||
172 | - }, 0); | ||
173 | - sums[index] += ' .00'; | ||
174 | - } else { | ||
175 | - sums[index] = 'N/A'; | ||
176 | - } | ||
177 | - }); | ||
178 | - // 可直接调接口获取后修改sums。 | ||
179 | - // console.log("合计列",sums); | ||
180 | - return sums; | ||
181 | - }, | ||
182 | - getSummaries(param) { | ||
183 | - const { columns, data } = param; | ||
184 | const sums = []; | 159 | const sums = []; |
185 | columns.forEach((column, index) => { | 160 | columns.forEach((column, index) => { |
186 | if (index === 0) { | 161 | if (index === 0) { |
@@ -209,15 +184,16 @@ export default { | @@ -209,15 +184,16 @@ export default { | ||
209 | return sums; | 184 | return sums; |
210 | }, | 185 | }, |
211 | spanMethod({ row, column, rowIndex, columnIndex }) { | 186 | spanMethod({ row, column, rowIndex, columnIndex }) { |
212 | - // console.log('row',JSON.parse(JSON.stringify(row))); | ||
213 | - // console.log('column',JSON.parse(JSON.stringify(column))); | 187 | + // console.log('row', JSON.parse(JSON.stringify(row))); |
188 | + // console.log('column', JSON.parse(JSON.stringify(column))); | ||
189 | + // console.log(rowIndex, columnIndex); | ||
214 | if (columnIndex === 0) { | 190 | if (columnIndex === 0) { |
215 | // 第一列合并单元格 | 191 | // 第一列合并单元格 |
216 | if (row.wdailyfundsforderno === 'subtotal') { | 192 | if (row.wdailyfundsforderno === 'subtotal') { |
217 | // 小计行 | 193 | // 小计行 |
218 | return { | 194 | return { |
219 | rowspan: 1, | 195 | rowspan: 1, |
220 | - colspan: 1, | 196 | + colspan: 3, |
221 | content: '小计' | 197 | content: '小计' |
222 | }; | 198 | }; |
223 | } else if (rowIndex > 0 && row.wdailyfundsforgtype === this.tableData[rowIndex - 1].wdailyfundsforgtype) { | 199 | } else if (rowIndex > 0 && row.wdailyfundsforgtype === this.tableData[rowIndex - 1].wdailyfundsforgtype) { |
@@ -241,6 +217,13 @@ export default { | @@ -241,6 +217,13 @@ export default { | ||
241 | content: row.wdailyfundsforgtype | 217 | content: row.wdailyfundsforgtype |
242 | }; | 218 | }; |
243 | } | 219 | } |
220 | + } else if (columnIndex === 1 || columnIndex === 2) { | ||
221 | + if (row.wdailyfundsforderno === 'subtotal' && (!row.wdailyfundsfdate || !wdailyfundsforgname)) { | ||
222 | + return { | ||
223 | + rowspan: 0, | ||
224 | + colspan: 0 | ||
225 | + } | ||
226 | + } | ||
244 | } | 227 | } |
245 | 228 | ||
246 | }, | 229 | }, |