From 067c77dee145023f983eea591dfaf3be8ffc1ab9 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期三, 22 一月 2025 15:15:31 +0800
Subject: [PATCH] 1

---
 src/views/system/tijian/index.vue |   53 +++++++++++++++++++++++++----------------------------
 1 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index 9966fbe..7e99913 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -1075,6 +1075,9 @@
   },
   watch: {
 
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
     filterage(val) {
       this.$refs.treas.filter(val);
     },
@@ -2511,7 +2514,6 @@
       this.loading = true;
       getProParentIdDxList().then((response) => {
         this.Treedata = response.data.list;
-
         if (this.tableData[0]) {
           this.tableData[0].tjProjectList.forEach((selectionitem) => {
             this.Treedata.forEach((item) => {
@@ -2626,30 +2628,36 @@
         });
       }
     },
-    // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
       this.dataObj = data;
-      if (checked.checkedNodes.length != 0) {
-        let proId = data.proId;
-        getProSonDxList(proId).then((res) => {
-          this.TreedataList = res.data.list;
+      if (checked.checkedNodes.length > 0) {
+        const promises = checked.checkedNodes.map(node => getProSonDxList(node.proId));
+        Promise.all(promises).then(results => {
+          this.TreedataList = results.flatMap(res => res.data.list);
+          this.checkedListkey = [];
+          this.DataList = [];
+
           this.TreedataList.forEach((item) => {
             this.checkedListkey.push(item.proId);
-
             this.DataList.push(item);
-            this.spliceData();
-            this.DataList.forEach((item1) => {
-              if (item1.proParentId == data.proId) {
-                item1.propinName = data.proName;
-              }
-            });
           });
+
+          this.spliceData(); // 鍋囪杩欎釜鏂规硶鏄綘瀹氫箟鐨勫叾浠栧湴鏂瑰鐞嗘暟鎹殑
+
+          // 鏇存柊鍚嶇О鍜岃绠楁�讳环
+          this.DataList.forEach((item1) => {
+            const parent = checked.checkedNodes.find(node => node.proId === item1.proParentId);
+            if (parent) {
+              item1.propinName = parent.proName;
+            }
+          });
+
           this.TotalPrice1 = 0;
           this.marryall = 0;
           if (this.DataList.length != 0) {
             this.list1 = false;
             this.DataList.forEach((item) => {
-              this.marryall = item.proPrice * item.sl;
+              this.marryall += Number(item.proPrice) * Number(item.sl);
             });
           }
         });
@@ -2830,13 +2838,11 @@
       this.DataLists = [];
     },
 
+    // 澶勭悊璁㈠崟椤圭洰
     processOrderItems(cusId) {
       getTransitionList1(cusId).then((response) => {
         this.tableData1 = response.data;
         if (this.tableData1) {
-          let totalOrdPrice = new Big(0);
-          let totalNowPrice = new Big(0);
-
           this.tableData1.forEach((item) => {
             if (item.tjCategory != null) {
               this.tjCategory = item.tjCategory;
@@ -2846,18 +2852,9 @@
                 this.treeList.push(item9.proId);
               });
             }
-            // 浣跨敤Big.js杩涜鍔犳硶浠ラ伩鍏嶇簿搴︿涪澶�
-            totalOrdPrice = totalOrdPrice.plus(new Big(item.ordPrice || 0));
-            totalNowPrice = totalNowPrice.plus(new Big(item.nowPrice || 0));
+            this.TotalPrice1 += item.ordPrice || 0; // 绱姞搴旀敹閲戦
+            this.TotalPrice += item.nowPrice || 0; // 绱姞瀹炴敹閲戦
           });
-
-          // 灏咮ig鏁拌浆鎹㈠洖鏁板�煎苟淇濈暀涓や綅灏忔暟
-          this.TotalPrice1 = totalOrdPrice.toNumber().toFixed(2);
-          this.TotalPrice = totalNowPrice.toNumber().toFixed(2);
-
-          // 纭繚TotalPrice鏄竴涓瓧绗︿覆锛岄槻姝㈠悗缁搷浣滃鑷寸簿搴︿涪澶�
-          this.TotalPrice = this.TotalPrice.toString();
-
           // 璁$畻鎶樻墸
           this.discount = this.TotalPrice1 > 0 ?
             (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 : 0;

--
Gitblit v1.8.0