From 3f386968d4b5cbb002ad93483f86a5443159e18a Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期六, 08 二月 2025 09:54:32 +0800
Subject: [PATCH] 1.递交

---
 src/views/workOrder/produceOrderList.vue |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/src/views/workOrder/produceOrderList.vue b/src/views/workOrder/produceOrderList.vue
index 42f8aa0..e6ca71b 100644
--- a/src/views/workOrder/produceOrderList.vue
+++ b/src/views/workOrder/produceOrderList.vue
@@ -172,6 +172,8 @@
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
+          :summary-method="getSummaries"
+          show-summary
           @sort-change="sortChange"
           @selection-change="handleSelectionChange"
         >
@@ -823,7 +825,7 @@
       this.form.paystartdate = ''
       this.form.payenddate = ''
       this.form.creatuser = ''
-      this.form.erpordercode = ''
+      this.form.saleordercode = ''
       this.form.createdate = ''
 
       this.form.timeValue = []
@@ -1078,6 +1080,45 @@
     },
     tableRowClassName({ row, rowIndex }) {
       return 'custom-row'
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      const i = 7
+      columns.forEach((column, index) => {
+        if (index === i) {
+          sums[index] = '鎬绘暟'
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        if (column.property === 'qty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+              // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100
+            }
+          }, 0)
+
+          sums[index] += ' 鍗�'
+        }
+        if (column.property === 'relse_qty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+              // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100
+            }
+          }, 0)
+
+          sums[index] += ' 鍗�'
+        }
+      })
+
+      this.$nextTick(() => {
+        this.$refs.tableDataRef.doLayout()
+      })
+      return sums
     }
   }
 }

--
Gitblit v1.9.3