From 0303c170c6ff96ad5b2da77e54d6f9c8fd461470 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期二, 26 三月 2024 10:47:32 +0800
Subject: [PATCH] qxtj

---
 src/views/hosp/order/index.vue |   44 +++++++++++++++++---------------------------
 1 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 20ea617..94af7c0 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -880,6 +880,7 @@
       loading: true,
       // 閫変腑鏁扮粍
       ids: [],
+      dataObj:{},
       // 闈炲崟涓鐢�
       single: true,
       // 闈炲涓鐢�
@@ -1287,11 +1288,6 @@
         cusPhone: this.cusPhone,
         cusSex: this.cusSex,
       };
-      // if (row.tjType) {
-      //   this.form.tjType = parseInt(row.tjType);
-      // } else {
-      //   this.form.tjType = 0;
-      // }
       /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
       this.getDataList();
       this.Projectopen1 = true;
@@ -1299,8 +1295,7 @@
     },
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
-      console.log(data, checked, checkedNodes);
-      console.log(this.DataList,22222);
+      this.dataObj = data
       if (checked.checkedNodes.length != 0) {
         this.$refs.tree.setCheckedKeys([data.proId]);
         let proId = data.proId;
@@ -1309,13 +1304,13 @@
           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);
           this.TotalPrice1 = 0;
           if (this.DataList.length != 0) {
             this.list1 = false;
@@ -1328,34 +1323,23 @@
         let proId = data.proId;
         getProSonDxList(proId).then((res) => {
           this.TreedataList = res.data.list;
-          this.DataList.forEach((item, index) => {
-            this.TreedataList.forEach((item1) => {
-              if (item.proId == item1.proId) {
-                this.DataList.splice(index, this.TreedataList.length);
-                this.TotalPrice1 = 0;
-                this.DataList.forEach((item1) => {
-                  this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
-                });
-              }
-            });
-          });
+          this.checkedListkey = [];
         });
-        this.checkedListkey = [];
-        console.log(this.DataList,1111)
+        
       }
     },
 
-    spliceData(row) {
-      for (var i = 0; i < row.length; i++) {
-        for (var j = i + 1; j < row.length; j++) {
-          if (row[i].proId == row[j].proId) {
+    spliceData() {
+      for (var i = 0; i < this.DataList.length; i++) {
+        for (var j = i + 1; j < this.DataList.length; j++) {
+          if (this.DataList[i].proId == this.DataList[j].proId) {
             //濡傛灉绗竴涓瓑浜庣浜屼釜锛宻plice鏂规硶鍒犻櫎绗簩涓�
-            row.splice(j, 1);
+            this.DataList.splice(j, 1);
             j--;
           }
         }
       }
-      return row;
+      return this.DataList;
     },
 
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
@@ -1372,6 +1356,12 @@
         });
       } else if (checked == true) {
         this.DataList.push(data);
+        this.DataList.forEach((item1) => {
+              if (item1.proParentId == this.dataObj.proId) {
+                item1.propinName = this.dataObj.proName;
+              }
+            });
+        this.spliceData()
         this.TotalPrice1 = 0;
         this.DataList.forEach((item1) => {
           this.TotalPrice1 = item1.proPrice + this.TotalPrice1;

--
Gitblit v1.8.0