From e17811c1d7b1e6318af32a366d23bd586750b6d2 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期三, 27 十一月 2024 11:32:48 +0800
Subject: [PATCH] 2024 11 27

---
 src/views/system/tijian/index.vue |  143 +++++++++++++++++++----------------------------
 1 files changed, 59 insertions(+), 84 deletions(-)

diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index f84b262..1ea1d2c 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -574,6 +574,9 @@
                   :data="packagedataList"
                   node-key="proId"
                   :props="defaultpackProps"
+                  :filter-node-method="filterpackage"
+                  @check-change="handlePackageChecked"
+                  :default-checked-keys="checkedListkey1"
                   :render-content="renderContent"
                 >
                 </el-tree>
@@ -1593,6 +1596,7 @@
       treedataList: [],
       checkedkey: [],
       checkedListkey: [],
+      checkedListkey1: [],
       defaultProps: {
         children: [],
         label: "proName",
@@ -2505,7 +2509,7 @@
             }
           }
           _this.form.cusAddr = resultObj.data.addres;
-         
+
           _this.cardreader = false;
         };
 
@@ -2578,13 +2582,13 @@
         websocket.onmessage = function (event) {
           var resultObj = JSON.parse(event.data);
           _this.form.cusName = resultObj.data.name;
-       
-          if( resultObj.data.nation == "姹夋棌"){
-            _this.form.cusNational ="1";
+
+          if (resultObj.data.nation == "姹夋棌") {
+            _this.form.cusNational = "1";
           }
-          if(resultObj.data.gender == "鐢�"){
+          if (resultObj.data.gender == "鐢�") {
             _this.form.cusSex = 0;
-          }else{
+          } else {
             _this.form.cusSex = 1;
           }
           _this.form.cusBrithday = resultObj.data.birthday;
@@ -2915,33 +2919,6 @@
         getZhList().then((response) => {
           if (response.data) {
             this.packageList = response.data;
-            // this.checkedkeys.push(this.packageList[0].id);
-            // let datas = {
-            //   zhId: this.packageList[0].id,
-            // };
-            // getlistByZhId(datas).then((res) => {
-            //   this.packagedataList = res.data.tjProjectList;
-            //   for (var i = 0; i < this.packagedataList.length; i++) {
-            //     let proId = this.packagedataList[i].proId;
-            //     getProSonDxList(proId).then((res) => {
-            //       this.TreedataList = res.data.list;
-            //       this.TreedataList.forEach((item) => {
-            //         this.DataLists.push(item);
-            //         if (this.DataLists.length >= 1) {
-            //           this.marryalls = 0;
-            //           this.DataLists.forEach((item1) => {
-            //             this.marryalls += item1.proPrice;
-            //             this.packagedataList.forEach((item3) => {
-            //               if (item1.proParentId == item3.proId) {
-            //                 item1.propinName = item3.proName;
-            //               }
-            //             });
-            //           });
-            //         }
-            //       });
-            //     });
-            //   }
-            // });
           }
           this.loading = false;
         });
@@ -2959,6 +2936,8 @@
       this.loading = true;
       getProParentIdDxList().then((response) => {
         this.Treedata = response.data.list;
+        console.log(response, 77788);
+
         if (this.tableData[0]) {
           this.tableData[0].tjProjectList.forEach((selectionitem) => {
             this.Treedata.forEach((item) => {
@@ -2968,40 +2947,12 @@
             });
           });
         }
-        // if (this.DataLists.length != 0) {
-        //   this.DataLists.forEach((selectionitem) => {
-        //     this.Treedata.forEach((item) => {
-        //       if (selectionitem.propinName == item.proName) {
-        //         item.disabled = true;
-        //       }
-        //     });
-        //   });
-        // }
-        // this.checkedkey.push(this.Treedata[0].proId);
-        // let proId = this.Treedata[0].proId;
-        // getProSonDxList(proId).then((res) => {
-        //   this.TreedataList = res.data.list;
-        //   this.TreedataList.forEach((item) => {
-        //     this.checkedListkey.push(item.proId);
-        //     this.DataList.push(item);
-        //     this.DataList.forEach((item) => {
-        //       item.propinName = this.Treedata[0].proName;
-        //     });
-        //   });
-        //   this.TotalPrice1 = 0;
-        //   this.marryall = 0;
-        //   if (this.DataList.length != 0) {
-        //     this.list1 = false;
-        //     this.DataList.forEach((item) => {
-        //       this.TotalPrice1 = item.proPrice + this.TotalPrice1;
-        //       this.marryall += item.proPrice;
-        //     });
-        //   }
-        // });
         this.loading = false;
       });
     },
+
     handlepackage(data, checked, checkedNodes) {
+      this.dataObj = data;
       if (checked.checkedNodes.length != 0) {
         this.$refs.treas.setCheckedKeys([data.id]);
         let datas = {
@@ -3009,16 +2960,27 @@
         };
         getlistByZhId(datas).then((res) => {
           this.packagedataList = res.data.tjProjectList;
+          console.log(this.packagedataList, 1122);
+          this.DataLists = [];
+          this.checkedListkey1 = [];
           for (var i = 0; i < this.packagedataList.length; i++) {
             let proId = this.packagedataList[i].proId;
-            getProSonDxList(proId).then((res) => {
+            this.checkedListkey1.push(proId);
+            // this.DataLists.push(this.packagedataList[i]);
+              getProSonDxList(proId).then((res) => {
               this.TreedataList = res.data.list;
+              console.log(this.TreedataList,888);
+              
               this.TreedataList.forEach((item) => {
+                // this.checkedListkey1.push(item.proId);
+
                 this.DataLists.push(item);
+                // console.log(this.DataLists,556644);
                 if (this.DataLists.length >= 1) {
                   this.marryalls = 0;
                   this.DataLists.forEach((item1) => {
                     this.marryalls += item1.proPrice;
+                    
                     this.packagedataList.forEach((item3) => {
                       if (item1.proParentId == item3.proId) {
                         item1.propinName = item3.proName;
@@ -3031,25 +2993,12 @@
           }
         });
       } else if (checked.checkedNodes.length == 0) {
-        // for (var i = 0; i < data.tjProjectList.length; i++) {
-        //   let proId = data.tjProjectList[i].proId;
-        //   getProSonDxList(proId).then((res) => {
-        //     this.TreedataList = res.data.list;
-        //     this.TreedataList.forEach((item) => {
-        //       this.DataLists.forEach((item1, index) => {
-        //         if (item.proId == item1.proId) {
-        //           this.DataLists.splice(index, 1);
-        //         }
-        //       });
-        //     });
-        //     this.marryalls = 0
-        //     if(this.DataLists.length != 0){
-        //       this.DataLists.forEach((item1, index) => {
-        //       this.marryalls += item1.proPrice;
-        //       })
-        //     }
-        //   });
-        // }
+        this.DataLists = [];
+        this.marryalls = 0; // 娓呴浂鎬讳环
+        this.checkedListkey1 = [];
+
+        // 浣犲彲浠ュ湪姝ゅ鏍规嵁闇�瑕佽繘琛屽叾浠栨搷浣滐紝濡傛洿鏂� UI
+        console.log("鍙栨秷閫変腑锛屾暟鎹凡娓呯┖锛屾�讳环宸查噸缃�");
       }
     },
     objectspanmethod({ row, column, rowIndex, columnIndex }) {
@@ -3082,17 +3031,43 @@
       //   return [rowspan, 1];
       // }
     },
-
+    handlePackageChecked(data, checked, checkedNodes) {
+      if (checked == false) {
+        this.DataLists.forEach((item, index) => {
+          if (item.proId == data.proId) {
+            this.DataLists.splice(index, 1);
+            this.marryalls = 0; // 閲嶇疆鍚堣閲戦
+            this.DataLists.forEach((item1) => {
+              this.marryalls += item1.proPrice; // 閲嶆柊璁$畻鍚堣閲戦
+            });
+          }
+        });
+      } else if (checked == true) {
+        this.DataLists.push(data); // 娣诲姞鏁版嵁鍒板凡閫夊垪琛�
+        this.DataLists.forEach((item1) => {
+          if (item1.proParentId == this.dataObj.proId) {
+            item1.propinName = this.dataObj.proName; // 璁剧疆鐖剁骇鍚嶇О
+          }
+        });
+        // this.spliceData();
+        this.marryalls = 0; // 閲嶇疆鍚堣閲戦
+        this.DataLists.forEach((item1) => {
+          this.marryalls += item1.proPrice; // 閲嶆柊璁$畻鍚堣閲戦
+        });
+      }
+    },
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
       this.dataObj = data;
       if (checked.checkedNodes.length != 0) {
         this.$refs.tree.setCheckedKeys([data.proId]);
+
         let proId = data.proId;
         getProSonDxList(proId).then((res) => {
           this.TreedataList = res.data.list;
           this.TreedataList.forEach((item) => {
             this.checkedListkey.push(item.proId);
+
             this.DataList.push(item);
             this.spliceData();
             this.DataList.forEach((item1) => {

--
Gitblit v1.8.0