| | |
| | | </el-row> |
| | | <el-table-print |
| | | :data="item.items" |
| | | :summary-method="getSummaries" |
| | | :summary-method="getSummaries.bind(this, item.totalAmount)" |
| | | show-summary |
| | | border |
| | | style="width: 100%" |
| | |
| | | } |
| | | } |
| | | }, |
| | | getSummaries(param) { |
| | | getSummaries(totalAmount, param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = |
| | | '总扎数合计:' + |
| | | data.reduce((total, current) => { |
| | | total += current.num |
| | | return total |
| | | }, 0) |
| | | sums[index] = `总扎数合计:${data.reduce((total, current) => { |
| | | total += current.num |
| | | return total |
| | | }, 0)} 总金额:¥${totalAmount}` |
| | | } else { |
| | | sums[index] = '' |
| | | } |
| | |
| | | for (const tr of trs) { |
| | | const tds = tr.querySelectorAll('td') |
| | | if (tds && tds.length > 0) { |
| | | tds[0].colSpan = 7 |
| | | tds[0].colSpan = 8 |
| | | tds[0].style.textAlign = 'center' |
| | | } |
| | | } |
| | |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .el-table__footer-wrapper td .cell { |
| | | white-space: pre-wrap; |
| | | } |
| | | |
| | | .area-text { |
| | | text-align: center; |
| | | font-size: 18px; |