mayf
2024-09-12 7c07b846eb42962867d7c9815c84f1235158eca0
订单打印增加总金额
已修改3个文件
20 ■■■■■ 文件已修改
components/order/print-list.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/list/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/print/custom.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/order/print-list.vue
@@ -34,7 +34,7 @@
        </el-row>
        <el-table-print
          :data="item.items"
          :summary-method="getSummaries"
          :summary-method="getSummaries.bind(this, item.totalAmount)"
          show-summary
          border
          style="width: 100%"
@@ -107,17 +107,15 @@
        }
      }
    },
    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] = ''
        }
pages/order/list/index.vue
@@ -200,7 +200,7 @@
                        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'
                          }
                        }
static/print/custom.css
@@ -18,6 +18,10 @@
  font-weight: bold;
}
.el-table__footer-wrapper td .cell {
  white-space: pre-wrap;
}
.area-text {
  text-align: center;
  font-size: 18px;