From 4fbdf4c6b13d19b9be54900b5dcff29e2ca7ef01 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 24 六月 2025 17:31:45 +0800
Subject: [PATCH] 巡查单据自动下载功能(待完成)

---
 src/views/fysp/check/components/CompSubTaskStatistic.vue |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/views/fysp/check/components/CompSubTaskStatistic.vue b/src/views/fysp/check/components/CompSubTaskStatistic.vue
index 7f8d3e9..7e30a44 100644
--- a/src/views/fysp/check/components/CompSubTaskStatistic.vue
+++ b/src/views/fysp/check/components/CompSubTaskStatistic.vue
@@ -269,17 +269,39 @@
         completedTimes: 0,
         reviewTimes: 0
       };
-      this.monitorObjList.forEach((m) => {
-        if (this.sceneType == undefined || m.sceneTypeId == this.sceneType) {
-          _res.total++;
-          const times = parseInt(m.extension1);
-          if (times) {
-            _res.completedScenes++;
-            _res.completedTimes += times;
-            _res.reviewTimes += times - 1;
-          }
+
+      // Fixme 2025.5.30: 鐩墠姝ゅ鐨勭洃绠$増鏈俊鎭挓璁板綍鐨勪换鍔″畬鎴愭鏁版湁鍋忓樊锛屾墍浠ユ殏鏃跺厛鏀逛负閫氳繃宸℃煡浠诲姟鏈韩杩涜缁熻
+      /**************************************************************************************/
+      // this.monitorObjList.forEach((m) => {
+      //   if (this.sceneType == undefined || m.sceneTypeId == this.sceneType) {
+      //     _res.total++;
+      //     const times = parseInt(m.extension1);
+      //     if (times) {
+      //       _res.completedScenes++;
+      //       _res.completedTimes += times;
+      //       _res.reviewTimes += times - 1;
+      //     }
+      //   }
+      // });
+      /**************************************************************************************/
+
+      /**************************************************************************************/
+      _res.total = this.monitorObjList.filter(
+        (m) => this.sceneType == undefined || m.sceneTypeId == this.sceneType
+      ).length;
+      _res.completedTimes = this.subtasks.length;
+      const map = new Map();
+      const uniqueArr = [];
+      for (let item of this.subtasks) {
+        if (!map.has(item.data.sceneId)) {
+          map.set(item.data.sceneId, true);
+          uniqueArr.push(item);
         }
-      });
+      }
+      _res.completedScenes = uniqueArr.length;
+      _res.reviewTimes = _res.completedTimes - _res.completedScenes;
+
+      /**************************************************************************************/
       return _res;
     }
   },

--
Gitblit v1.9.3