Browse Source

bug修复

lucw 7 months ago
parent
commit
ece418447d
1 changed files with 23 additions and 21 deletions
  1. 23 21
      src/views/batchRecord/components/statistics.vue

+ 23 - 21
src/views/batchRecord/components/statistics.vue

@@ -651,27 +651,29 @@
                 };
               });
 
-            const list = inStoreageRecordList.map((record) => {
-              const rowsCopy = JSON.parse(JSON.stringify(rows));
-              rowsCopy.forEach((item) => {
-                if (item.title.includes('成品入库数')) {
-                  item.value = record.totalCount;
-                } else if (
-                  item.title === '成品入库时间' ||
-                  item.title === '入库时间'
-                ) {
-                  item.value = record.executorTime;
-                }
-                item.unit = record.measuringUnit || this.unit;
+            if (this.rulesDetailList.length > 0) {
+              const list = inStoreageRecordList.map((record) => {
+                const rowsCopy = JSON.parse(JSON.stringify(rows));
+                rowsCopy.forEach((item) => {
+                  if (item.title.includes('成品入库数')) {
+                    item.value = record.totalCount;
+                  } else if (
+                    item.title === '成品入库时间' ||
+                    item.title === '入库时间'
+                  ) {
+                    item.value = record.executorTime;
+                  }
+                  item.unit = record.measuringUnit || this.unit;
+                });
+                return rowsCopy;
               });
-              return rowsCopy;
-            });
-            // 赋值
-            this.localDetails[0].statisticsValue = list;
-            console.log(
-              'this.localDetails[0].statisticsValue 重新',
-              this.localDetails[0].statisticsValue
-            );
+              // 赋值
+              this.localDetails[0].statisticsValue = list;
+              console.log(
+                'this.localDetails[0].statisticsValue 重新',
+                this.localDetails[0].statisticsValue
+              );
+            }
           }
         }
 
@@ -780,7 +782,7 @@
       },
       // 当数据变化时计算公式
       handleDataChange(row) {
-        console.log('row 触发',row)
+        console.log('row 触发', row);
         // todo 计算公式
         // 寻找当前行的所有可计算项,进行计算更新
         const formulaItmes = row.filter((i) => i.formula);