cloudroam
2024-09-14 7f177f5915a1dbdf8ad6cd840b4d7408b9f3598f
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] = ''
        }