mayf
2024-09-12 7c07b846eb42962867d7c9815c84f1235158eca0
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) => {
          sums[index] = `总扎数合计:${data.reduce((total, current) => {
              total += current.num
              return total
            }, 0)
          }, 0)}                总金额:¥${totalAmount}`
        } else {
          sums[index] = ''
        }