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

---
 src/views/system/tijian/index.vue    |  483 +++++++++++++++++++++++-------
 src/views/hosp/order/index.vue       |   70 +--
 src/views/system/tijianall/index.vue |  375 ++++++++++++++++++++---
 3 files changed, 720 insertions(+), 208 deletions(-)

diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 94af7c0..3a04bfa 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -412,7 +412,7 @@
     <el-dialog
       :title="title"
       :visible.sync="Projectopen"
-      width="1500px"
+      width="1100px"
       style="height: 860px"
       append-to-body
     >
@@ -426,7 +426,7 @@
           <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
           </el-input>
           <div class="tab3">
-            <div class="outside1">
+           
               <el-tree
                 class="filter-tree"
                 v-loading="loading"
@@ -434,23 +434,22 @@
                 :props="defaultProps"
                 show-checkbox
                 node-key="proId"
-                @check-change="handleCurrentChecked"
+                @check="handleCurrentChecked"
                 :default-checked-keys="checkedkey"
                 :filter-node-method="filterNode"
                 ref="tree"
               >
               </el-tree>
-            </div>
+           
           </div>
         </el-col>
-        <el-col :span="4">
+        <el-col :span="5">
           <div
             style="text-align: center; margin-bottom: 10px; margin-top: 10px"
           >
-            椤圭洰鍒楄〃
+            鏄庣粏椤圭洰鍒楄〃
           </div>
           <div class="tab3">
-            <div class="outside1">
               <el-tree
                 class="filter-tree"
                 v-loading="loading"
@@ -463,33 +462,24 @@
                 :default-checked-keys="checkedListkey"
               >
               </el-tree>
-            </div>
           </div>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="11">
           <div class="grid-content bg-purple">
             <div style="text-align: center; margin-bottom: 10px">
               宸查�夐」鐩垪琛�
             </div>
-            <div
-              style="
-                padding: 0px 6px;
-                border: 1px solid #e6ebf5;
-                max-height: 420px;
-                overflow: auto;
-              "
-            >
               <el-table
                 :data="DataList"
                 border
                 style="width: 100%"
                 height="250"
               >
-                <el-table-column prop="propinName" label="鐖堕」">
+              <el-table-column prop="propinName" label="妫�鏌ラ」鐩�" >
                 </el-table-column>
-                <el-table-column prop="proName" label="椤圭洰" width="180">
+                <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
                 </el-table-column>
-                <el-table-column prop="proPrice" label="鍘熶环">
+                <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                 </el-table-column>
 
                 <el-table-column
@@ -497,7 +487,7 @@
                   align="center"
                   fixed="right"
                   class-name="small-padding fixed-width"
-                  width="80px"
+                  width="50px"
                 >
                   <template slot-scope="scope">
                     <el-button
@@ -505,7 +495,8 @@
                       type="text"
                       icon="el-icon-delete"
                       @click="handleDelete(scope.row)"
-                      >鍒犻櫎</el-button
+                      title="鍒犻櫎"
+                      ></el-button
                     >
                   </template>
                 </el-table-column>
@@ -522,7 +513,6 @@
                   </el-collapse-item>
                 </div>
               </el-collapse>
-            </div>
             <template>
               <el-form :model="form">
                 <el-form-item label="浣撴绫诲瀷" prop="tjType">
@@ -593,7 +583,7 @@
     <el-dialog
       :title="title"
       :visible.sync="Projectopen1"
-      width="1500px"
+      width="1100px"
       style="height: 860px"
       append-to-body
     >
@@ -607,7 +597,7 @@
           <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
           </el-input>
           <div class="tab3">
-            <div class="outside1">
+           
               <el-tree
                 class="filter-tree"
                 v-loading="loading"
@@ -621,14 +611,14 @@
                 ref="tree"
               >
               </el-tree>
-            </div>
+           
           </div>
         </el-col>
-        <el-col :span="4">
+        <el-col :span="5">
           <div
             style="text-align: center; margin-bottom: 10px; margin-top: 10px"
           >
-            椤圭洰鍒楄〃
+          鏄庣粏椤圭洰鍒楄〃
           </div>
           <div class="tab3">
             <div class="outside1">
@@ -647,30 +637,23 @@
             </div>
           </div>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="11">
           <div class="grid-content bg-purple">
             <div style="text-align: center; margin-bottom: 10px">
               宸查�夐」鐩垪琛�
             </div>
-            <div
-              style="
-                padding: 0px 6px;
-                border: 1px solid #e6ebf5;
-                max-height: 420px;
-                overflow: auto;
-              "
-            >
+            
               <el-table
                 :data="DataList"
                 border
                 style="width: 100%"
                 height="250"
               >
-                <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+              <el-table-column prop="propinName" label="妫�鏌ラ」鐩�" >
                 </el-table-column>
-                <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="180">
+                <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
                 </el-table-column>
-                <el-table-column prop="proPrice" label="鍘熶环">
+                <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                 </el-table-column>
 
                 <el-table-column
@@ -678,7 +661,7 @@
                   align="center"
                   fixed="right"
                   class-name="small-padding fixed-width"
-                  width="80px"
+                  width="50px"
                 >
                   <template slot-scope="scope">
                     <el-button
@@ -703,7 +686,7 @@
                   </el-collapse-item>
                 </div>
               </el-collapse>
-            </div>
+            
             <template>
               <el-form :model="form">
                 <el-form-item label="浣撴绫诲瀷" prop="tjType">
@@ -1552,7 +1535,7 @@
 // }
 
 .outside {
-  width: 700px;
+  width: 500px;
   display: flex;
   margin-top: 8px;
 }
@@ -1560,6 +1543,7 @@
 .tab3 {
   max-height: 500px;
   overflow-y: auto;
+  border: 1px solid #d9d9d9;
 }
 
 .outside1 {
diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index c50bc9c..54b3a21 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -219,7 +219,7 @@
     </el-row>
 
     <el-dialog title="閫夋嫨濂楅" :visible.sync="taocan" width="50%" height="700px">
-      <el-tabs type="border-card" style="height: 560px; margin: 0 10px; width: 100%">
+      <el-tabs type="border-card" style="height: 560px; margin: 0 10px; width: 100%"  @tab-click="handleClick">
         <el-tab-pane label="濂楅">
           <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" v-show="showSearch"
             label-width="auto">
@@ -266,27 +266,132 @@
           </div>
         </el-tab-pane>
         <el-tab-pane label="鍗曢」">
-          <div class="tab3">
-            <!-- <div class="tab2"> -->
-            <v-tree-transfer :treeData="treedataList" :defaultProps="{ children: 'tjProjectList', label: 'proName' }"
-              :defaultKeys="defaultKeys" @changeKeys="changeCategoryKeys" :key="datekey"></v-tree-transfer>
-            <!-- <el-tree ref="tree" :data="treedataList" show-checkbox node-key="proId" :props="defaultProps"
-                :default-expanded-keys="treeId" :default-checked-keys="treeList" @check-change="handleCurrentChecked">
+          <div class="tab8">
+            <!-- <div class="tab7">
+              <v-tree-transfer
+                :treeData="treedataList"
+                :defaultProps="{ children: 'tjProjectList', label: 'proName' }"
+                :defaultKeys="defaultKeys"
+                @changeKeys="changeCategoryKeys"
+                :key="datekey"
+              ></v-tree-transfer> -->
+            <!-- <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" :default-checked-keys="treeList"
+                @check-change="handleCurrentChecked">
               </el-tree> -->
             <!-- </div> -->
-            <!-- <el-button
-                style="
-                  width: 20px;
-                  height: 100px;
-                  margin-left: 10px;
-                  margin-top: 20%;
-                  font-size: 10px;
-                "
-                type="primary"
-                size="mini"
-                @click="submit"
-                ><i style="font-size: 18px" class="el-icon-d-arrow-right"></i
-              ></el-button> -->
+            <el-row  :gutter="20">
+              <el-col :span="6">
+                <div
+                  style="
+                    text-align: center;
+                    margin-bottom: 10px;
+                    margin-top: 10px;
+                  "
+                >
+                  椤圭洰鍒楄〃
+                </div>
+                <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
+                </el-input>
+                <div class="tab3">
+                  <el-tree
+                    class="filter-tree"
+                    v-loading="loading"
+                    :data="Treedata"
+                    :props="defaultProps"
+                    show-checkbox
+                    node-key="proId"
+                    @check="handleCurrentChecked"
+                    :default-checked-keys="checkedkey"
+                    :filter-node-method="filterNode"
+                    ref="tree"
+                  >
+                  </el-tree>
+                </div>
+              </el-col>
+              <el-col :span="6">
+                <div
+                  style="
+                    text-align: center;
+                    margin-bottom: 10px;
+                    margin-top: 10px;
+                  "
+                >
+                  鏄庣粏椤圭洰鍒楄〃
+                </div>
+                <div class="tab3">
+                  <el-tree
+                    class="filter-tree"
+                    v-loading="loading"
+                    :data="TreedataList"
+                    node-key="proId"
+                    :props="defaultProps"
+                    :filter-node-method="filterNode"
+                    show-checkbox
+                    @check-change="handleCurrentChecked1"
+                    :default-checked-keys="checkedListkey"
+                  >
+                  </el-tree>
+                </div>
+              </el-col>
+              <el-col :span="11">
+                <div class="grid-content bg-purple">
+                  <div style="text-align: center; margin-bottom: 10px">
+                    宸查�夐」鐩垪琛�
+                  </div>
+                  <el-table
+                    :data="DataList"
+                    border
+                    style="width: 100%"
+                    height="250"
+                  >
+                    <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+                    </el-table-column>
+                    <el-table-column
+                      prop="proName"
+                      label="鏄庣粏椤圭洰"
+                      width="260px"
+                    >
+                    </el-table-column>
+                    <el-table-column prop="proPrice" label="鍘熶环" width="56px">
+                    </el-table-column>
+
+                    <el-table-column
+                      label="鎿嶄綔"
+                      align="center"
+                      fixed="right"
+                      class-name="small-padding fixed-width"
+                      width="50px"
+                    >
+                      <template slot-scope="scope">
+                        <el-button
+                          size="mini"
+                          type="text"
+                          icon="el-icon-delete"
+                          @click="handleDelete(scope.row)"
+                          title="鍒犻櫎"
+                        ></el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                  <el-collapse v-model="activeName" accordion v-if="list1">
+                    <div>
+                      <el-collapse-item title="璇烽�夋嫨椤圭洰">
+                        <el-table :data="DataList" border style="width: 100%">
+                          <el-table-column
+                            prop="proName"
+                            label="椤圭洰"
+                            width="180"
+                          >
+                          </el-table-column>
+                          <el-table-column prop="ordPrice" label="鍘熶环">
+                          </el-table-column>
+                        </el-table>
+                      </el-collapse-item>
+                    </div>
+                  </el-collapse>
+                </div>
+              </el-col>
+            </el-row>
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -296,7 +401,7 @@
       </span>
     </el-dialog>
 <!-- -->
-    <el-row  v-if="tcShow">
+    <el-row v-if="tcShow" >
       <el-col :span="15">
         <div class="grid-content bg-purple">
           <!-- <el-table :data="fData" border height="220px" style="width: 100%; ">
@@ -643,7 +748,8 @@
 import {
   deptTreeSelect,
   projectGetList,
-  getOrder,
+  getOrder, getProParentIdDxList,
+  getProSonDxList,
   getCusIdcard,
   getPackageListName,
   getaddtTransition,
@@ -679,6 +785,7 @@
   },
   data() {
     return {
+      filterText: "",
       proIdList: [],
       tableDatas: [],
       dialogVisiblese: false,
@@ -802,9 +909,13 @@
       // 鏄剧ず鎼滅储鏉′欢
       showSearch: true,
       // 鏍戠姸褰㈢姸
+      Treedata: [],
+      TreedataList: [],
       treedataList: [],
+      checkedkey: [],
+      checkedListkey: [],
       defaultProps: {
-        children: "tjProjectList",
+        children: [],
         label: "proName",
       },
       formPacId: "",
@@ -880,12 +991,17 @@
       },
     };
   },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
   created() {
     this.getCurrentDateTime();
 
     this.startTimer();
     this.getList1();
-    this.getData();
+    // this.getData();
   },
   methods: {
     getCurrentDateTime() {
@@ -917,7 +1033,10 @@
         this.getCurrentDateTime();
       }, 1000); //姣忕閽熸洿鏂颁竴娆�
     },
-
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.proName.indexOf(value) !== -1;
+    },
     beforeDestroy() {
       clearInterval(this.timer);
     }, //娓呴櫎瀹氭椂鍣紝浠ラ伩鍏嶅唴瀛樻硠闇层��
@@ -1013,7 +1132,6 @@
             } else {
               item.list.forEach((items) => {
                 _this.proIdList.push(items.proId);
-                console.log(_this.pacId, 888);
               });
             }
           });
@@ -1031,7 +1149,6 @@
             this.proIds = [];
             getTransitionList(cusId).then((response) => {
               this.tableData1 = response.data;
-              console.log(this.tableData1);
               this.TotalPrice1 = 0;
               if (this.tableData1) {
                 this.tableData1.forEach((item) => {
@@ -1580,7 +1697,6 @@
     },
 
     cancell() {
-      console.log(this.addAddress.address);
       if (this.addAddress.address) {
         this.malldisble = false;
       } else {
@@ -1606,53 +1722,51 @@
     },
 
     // 鐐瑰嚮澶氶�夋鑾峰彇閫変腑鏁版嵁
-    handleSelectionChange(selection, row) {
-      this.tableData = selection;
-      if (selection.length > 1) {
-        let del_row = selection.shift();
-        this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
-      }
+    // handleSelectionChange(selection, row) {
+    //   this.tableData = selection;
+    //   if (selection.length > 1) {
+    //     let del_row = selection.shift();
+    //     this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
+    //   }
       // this.single = selection.length !== 1;
       // this.multiple = !selection.length;
       // this.tableData.forEach((item) => {
       //   this.fData = item.tjProjectList;
       // });
-      console.log(this.treedataList)
-      console.log(selection)
-      if (selection[0]) {
-        this.DataList = [];
+      // if (selection[0]) {
+      //   this.DataList = [];
         // this.data = JSON.parse(JSON.stringify(this.dXData));
-        if (selection[0].tjProjectList) {
-          selection[0].tjProjectList.forEach((selectionitem) => {
-            this.treedataList.forEach((item) => {
-              if (selectionitem.proName == item.proName) {
-                item.disabled = true;
-                item.tjProjectList = [];
-              }
-              if (item.tjProjectList) {
-                item.tjProjectList.forEach((item1) => {
-                  if (selectionitem.proName == item1.proName) {
-                    item1.disabled = true;
-                    item1.tjProjectList = [];
-                  }
-                  if (item1.tjProjectList) {
-                    item1.tjProjectList.forEach((item2) => {
-                      if (selectionitem.proName == item2.proName) {
-                        item2.disabled = true;
-                        item2.tjProjectList = [];
-                      }
-                    });
-                  }
-                });
-              }
-            });
-          });
-        }
-      } else {
-        this.treedataList = JSON.parse(JSON.stringify(this.dXData));
-        return;
-      }
-    },
+    //     if (selection[0].tjProjectList) {
+    //       selection[0].tjProjectList.forEach((selectionitem) => {
+    //         this.treedataList.forEach((item) => {
+    //           if (selectionitem.proName == item.proName) {
+    //             item.disabled = true;
+    //             item.tjProjectList = [];
+    //           }
+    //           if (item.tjProjectList) {
+    //             item.tjProjectList.forEach((item1) => {
+    //               if (selectionitem.proName == item1.proName) {
+    //                 item1.disabled = true;
+    //                 item1.tjProjectList = [];
+    //               }
+    //               if (item1.tjProjectList) {
+    //                 item1.tjProjectList.forEach((item2) => {
+    //                   if (selectionitem.proName == item2.proName) {
+    //                     item2.disabled = true;
+    //                     item2.tjProjectList = [];
+    //                   }
+    //                 });
+    //               }
+    //             });
+    //           }
+    //         });
+    //       });
+    //     }
+    //   } else {
+    //     this.treedataList = JSON.parse(JSON.stringify(this.dXData));
+    //     return;
+    //   }
+    // },
 
     Package() {
       this.taocan = true;
@@ -1662,8 +1776,7 @@
       this.loading = true;
       deptTreeSelect(cusSex).then((response) => {
         this.newpacName = response.rows;
-        console.log(this.newpacName)
-        console.log(this.tableData1)
+      
         try {
           if (this.tableData1.length >= 1) {
             this.newpacName.forEach((item3) => {
@@ -1683,46 +1796,186 @@
         } catch (error) { }
         this.loading = false;
       });
-      this.getData();
+      // this.getData();
     },
 
-    // checkSelectable(row, index) {
-    //   if (!row) { return }
-    //   if (this.tableData1) {
-    //     if (this.tableData1.length != 0){
-    //       for (let j = 0; j < this.tableData1.length; j++) {
-    //         for (let i = 0; i < row.tjProjectList.length; i++) {
-    //           if (this.tableData1[j].pacName == "鍗曢」") {
-    //             if (row.tjProjectList[i].proName === this.tableData1[j].parentName) {
-    //               return false
-    //             }
-    //           }
-    //         }
-    //         return true
-    //       }
-    //     }
-    //   } else {
-    //     return true
-    //   }
-    // },
+      // 鐐瑰嚮澶氶�夋鑾峰彇閫変腑鏁版嵁
+      handleSelectionChange(selection, row) {
+      this.tableData = selection;
+      if (selection.length > 1) {
+        let del_row = selection.shift();
+        this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
+      }
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+      if (selection[0]) {
+        // this.DataList = [];
+        // this.data = JSON.parse(JSON.stringify(this.dXData));
+        selection[0].tjProjectList.forEach((selectionitem) => {
+          this.Treedata.forEach((item) => {
+            if (selectionitem.proName == item.proName) {
+              item.disabled = true;
+              item.tjProjectList = [];
+            }
+            // if (item.tjProjectList) {
+            //   item.tjProjectList.forEach((item1) => {
+            //     if (selectionitem.proName == item1.proName) {
+            //       item1.disabled = true;
+            //       item1.tjProjectList = [];
+            //     }
+            //     if (item1.tjProjectList) {
+            //       item1.tjProjectList.forEach((item2) => {
+            //         if (selectionitem.proName == item2.proName) {
+            //           item2.disabled = true;
+            //           item2.tjProjectList = [];
+            //         }
+            //       });
+            //     }
+            //   });
+            // }
+          });
+          this.TreedataList.forEach((item3) => {
+            if (item3.proParentId == selectionitem.proId) {
+              item.disabled = true;
+            }
+          });
+        });
+      } else {
+        this.treedataList = JSON.parse(JSON.stringify(this.dXData));
+        return;
+      }
+    },
+    handleClick(tab, event) {
+      if (tab.label == "鍗曢」") {
+        this.DataList =[]
+        this.getDataList();      
+      }
+    },
+    getDataList() {
+      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) => {
+              if (selectionitem.proId == item.proId) {
+                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;
+
+          if (this.DataList.length != 0) {
+            this.list1 = false;
+            this.DataList.forEach((item) => {
+              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+            });
+          }
+        });
+        this.loading = false;
+      });
+    },
 
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
-      if (checked === true) {
-        this.DataList.push(data);
-      } else {
-        this.DataList.pop(data);
-      }
-
-      this.proIds = [];
-      if (this.DataList.length != 0) {
-        this.DataList.forEach((item) => {
-          this.proIds.push(item.proId);
+      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) => {
+              if (item1.proParentId == data.proId) {
+                item1.propinName = data.proName;
+              }
+            });
+          });
+          this.TotalPrice1 = 0;
+          if (this.DataList.length != 0) {
+            this.list1 = false;
+            this.DataList.forEach((item) => {
+              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+            });
+          }
         });
-      } else {
-        this.proIds = [];
+      } else if (checked.checkedNodes.length == 0) {
+        let proId = data.proId;
+        getProSonDxList(proId).then((res) => {
+          this.TreedataList = res.data.list;
+          this.checkedListkey = [];
+        });
       }
     },
+
+    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鏂规硶鍒犻櫎绗簩涓�
+            this.DataList.splice(j, 1);
+            j--;
+          }
+        }
+      }
+      return this.DataList;
+    },
+
+    // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
+    handleCurrentChecked1(data, checked, checkedNodes) {
+      if (checked == false) {
+        this.DataList.forEach((item, index) => {
+          if (item.proId == data.proId) {
+            this.DataList.splice(index, 1);
+            this.TotalPrice1 = 0;
+            this.DataList.forEach((item1) => {
+              this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+            });
+          }
+        });
+      } 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;
+        });
+      }
+    },
+
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+    handleDelete(row) {
+      this.DataList.forEach((item, index) => {
+        if (item.proId == row.proId) {
+          this.DataList.splice(index, 1);
+          this.TotalPrice1 = 0;
+          this.DataList.forEach((item1) => {
+            this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+          });
+        }
+      });
+    },
+   
 
     // 椤圭洰鎻愪氦
     submit() {
@@ -1740,6 +1993,12 @@
       } else {
         _this.pacId = "";
       }
+      this.proIds = [];
+      if (this.DataList.length != 0) {
+        this.DataList.forEach((item) => {
+          this.proIds.push(item.proId);
+        });
+      }
       let data = {
         cusId,
         pacId: _this.pacId,
@@ -1751,7 +2010,6 @@
           this.proIds = [];
           getTransitionList(cusId).then((response) => {
             this.tableData1 = response.data;
-            console.log(this.tableData1);
             this.TotalPrice1 = 0;
             if (this.tableData1) {
               this.tableData1.forEach((item) => {
@@ -1788,9 +2046,9 @@
       this.taocan = false;
       this.defaultKeys = [];
     },
-    changeCategoryKeys(val) {
-      this.proIds = [];
-      this.proIds = val;
+    // changeCategoryKeys(val) {
+    //   this.proIds = [];
+    //   this.proIds = val;
       // if (this.DataList.length != 0) {
       //   this.DataList.forEach((item) => {
       //     this.proIds.push(item.proId);
@@ -1798,7 +2056,7 @@
       // } else {
       //   this.proIds = [];
       // }
-    },
+    // },
     submitCheckinfee() {
       let _this = this;
       let List = _this.tableData1; //鍗曚釜椤圭洰淇℃伅
@@ -1898,7 +2156,6 @@
 
     // 琛ㄦ牸鍗曢��
     handleSelect(selection, val) {
-      console.log(selection, val);
       this.selectionList = this.$refs.multipleTable.selection;
       this.selectionList.forEach((item) => {
         this.formIn.name = item.tjName;
@@ -2180,9 +2437,11 @@
   display: flex;
 }
 
-.tab3 {
-  width: 100%;
-  display: flex;
+
+.tab3 { 
+  max-height: 400px;
+  overflow-y: auto;
+  border: 1px solid #d9d9d9;
 }
 
 .tab2 {
diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue
index d41219a..d273db9 100644
--- a/src/views/system/tijianall/index.vue
+++ b/src/views/system/tijianall/index.vue
@@ -367,12 +367,13 @@
     <el-dialog
       title="閫夋嫨濂楅"
       :visible.sync="taocan"
-      width="42%"
+      width="59%"
       height="700px"
     >
       <el-tabs
         type="border-card"
         style="height: 538px; margin: 0 10px; width: 100%"
+        @tab-click="handleClick"
       >
         <el-tab-pane label="濂楅">
           <el-form
@@ -380,7 +381,7 @@
             ref="queryForm"
             size="small"
             :inline="true"
-            v-show="showSearch"
+            v-if="showSearch"
             @submit.native.prevent
             label-width="auto"
           >
@@ -462,26 +463,131 @@
         </el-tab-pane>
         <el-tab-pane label="鍗曢」">
           <div class="tab8">
-            <div class="tab7">
+            <!-- <div class="tab7">
               <v-tree-transfer
                 :treeData="treedataList"
                 :defaultProps="{ children: 'tjProjectList', label: 'proName' }"
                 :defaultKeys="defaultKeys"
                 @changeKeys="changeCategoryKeys"
                 :key="datekey"
-              ></v-tree-transfer>
-              <!-- <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" :default-checked-keys="treeList"
+              ></v-tree-transfer> -->
+            <!-- <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" :default-checked-keys="treeList"
                 @check-change="handleCurrentChecked">
               </el-tree> -->
-            </div>
-            <!-- <el-button style="
-                        width: 20px;
-                        height: 100px;
-                        margin-left: 10px;
-                        margin-top: 20%;
-                        font-size: 10px;
-                      " type="primary" size="mini" @click="submit"><i style="font-size: 18px"
-                  class="el-icon-d-arrow-right"></i></el-button> -->
+            <!-- </div> -->
+            <el-row  :gutter="20">
+              <el-col :span="6">
+                <div
+                  style="
+                    text-align: center;
+                    margin-bottom: 10px;
+                    margin-top: 10px;
+                  "
+                >
+                  椤圭洰鍒楄〃
+                </div>
+                <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
+                </el-input>
+                <div class="tab3">
+                  <el-tree
+                    class="filter-tree"
+                    v-loading="loading"
+                    :data="Treedata"
+                    :props="defaultProps"
+                    show-checkbox
+                    node-key="proId"
+                    @check="handleCurrentChecked"
+                    :default-checked-keys="checkedkey"
+                    :filter-node-method="filterNode"
+                    ref="tree"
+                  >
+                  </el-tree>
+                </div>
+              </el-col>
+              <el-col :span="6">
+                <div
+                  style="
+                    text-align: center;
+                    margin-bottom: 10px;
+                    margin-top: 10px;
+                  "
+                >
+                  鏄庣粏椤圭洰鍒楄〃
+                </div>
+                <div class="tab3">
+                  <el-tree
+                    class="filter-tree"
+                    v-loading="loading"
+                    :data="TreedataList"
+                    node-key="proId"
+                    :props="defaultProps"
+                    :filter-node-method="filterNode"
+                    show-checkbox
+                    @check-change="handleCurrentChecked1"
+                    :default-checked-keys="checkedListkey"
+                  >
+                  </el-tree>
+                </div>
+              </el-col>
+              <el-col :span="11">
+                <div class="grid-content bg-purple">
+                  <div style="text-align: center; margin-bottom: 10px">
+                    宸查�夐」鐩垪琛�
+                  </div>
+                  <el-table
+                    :data="DataList"
+                    border
+                    style="width: 100%"
+                    height="250"
+                  >
+                    <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+                    </el-table-column>
+                    <el-table-column
+                      prop="proName"
+                      label="鏄庣粏椤圭洰"
+                      width="260px"
+                    >
+                    </el-table-column>
+                    <el-table-column prop="proPrice" label="鍘熶环" width="56px">
+                    </el-table-column>
+
+                    <el-table-column
+                      label="鎿嶄綔"
+                      align="center"
+                      fixed="right"
+                      class-name="small-padding fixed-width"
+                      width="50px"
+                    >
+                      <template slot-scope="scope">
+                        <el-button
+                          size="mini"
+                          type="text"
+                          icon="el-icon-delete"
+                          @click="handleDelete(scope.row)"
+                          title="鍒犻櫎"
+                        ></el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                  <el-collapse v-model="activeName" accordion v-if="list1">
+                    <div>
+                      <el-collapse-item title="璇烽�夋嫨椤圭洰">
+                        <el-table :data="DataList" border style="width: 100%">
+                          <el-table-column
+                            prop="proName"
+                            label="椤圭洰"
+                            width="180"
+                          >
+                          </el-table-column>
+                          <el-table-column prop="ordPrice" label="鍘熶环">
+                          </el-table-column>
+                        </el-table>
+                      </el-collapse-item>
+                    </div>
+                  </el-collapse>
+                </div>
+              </el-col>
+            </el-row>
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -780,7 +886,8 @@
   getPackageListName,
   getaddtTransition,
   getTransitionList,
-  getGuide,
+  getProParentIdDxList,
+  getProSonDxList,
   getaddTj,
   getHistryTjOrderByCusIdCard,
   getHistryTjOrderProByCusIdCard,
@@ -809,7 +916,6 @@
 
   data() {
     let checkPhoneNum = (rule, value, callback) => {
-      console.log(value);
       let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
       if (value == "" && value == undefined && !value) {
         return callback("");
@@ -844,6 +950,7 @@
     //   }
     // };
     return {
+      filterText: "",
       proIdList: [],
       tableDatas: [],
       dialogVisiblese: false,
@@ -934,9 +1041,13 @@
       // 鏄剧ず鎼滅储鏉′欢
       showSearch: true,
       // 鏍戠姸褰㈢姸
+      Treedata: [],
+      TreedataList: [],
       treedataList: [],
+      checkedkey: [],
+      checkedListkey: [],
       defaultProps: {
-        children: "tjProjectList",
+        children: [],
         label: "proName",
       },
       formPacId: "",
@@ -995,7 +1106,7 @@
         cusSex: [
           { required: true, validator: checkPhoneNum, trigger: "change" },
         ],
-         category: [
+        category: [
           { required: true, validator: checkPhoneNum, trigger: "change" },
         ],
         cusBrithday: [
@@ -1033,9 +1144,13 @@
       },
     };
   },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
   created() {
     this.getList1();
-    this.getData();
   },
   methods: {
     inputChange() {
@@ -1088,6 +1203,11 @@
     inputChanges() {
       this.$refs.historyTj.getlist();
     },
+
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.proName.indexOf(value) !== -1;
+    },
     cope() {
       let cusIdCard = this.form.cusIdcard;
       getHistryTjOrderProByCusIdCard(cusIdCard).then((res) => {
@@ -1117,7 +1237,6 @@
             } else {
               item.list.forEach((items) => {
                 _this.proIdList.push(items.proId);
-                console.log(_this.pacId, 888);
               });
             }
           });
@@ -1190,7 +1309,7 @@
           this.loading = false;
         });
       }
-      this.getData();
+      // this.getData();
     },
     getData() {
       /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
@@ -1374,7 +1493,6 @@
 
     Package() {
       this.taocan = true;
-      // this.getData();
       let cusSex = this.form.cusSex;
       this.datekey = Date.now();
       //鍏ㄩ儴濂楅
@@ -1397,6 +1515,7 @@
         } catch (error) {}
         this.loading = false;
       });
+      // this.getDataList();
     },
 
     // 鎶樻墸
@@ -1455,29 +1574,34 @@
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
       if (selection[0]) {
-        this.DataList = [];
+        // this.DataList = [];
         // this.data = JSON.parse(JSON.stringify(this.dXData));
         selection[0].tjProjectList.forEach((selectionitem) => {
-          this.treedataList.forEach((item) => {
+          this.Treedata.forEach((item) => {
             if (selectionitem.proName == item.proName) {
               item.disabled = true;
               item.tjProjectList = [];
             }
-            if (item.tjProjectList) {
-              item.tjProjectList.forEach((item1) => {
-                if (selectionitem.proName == item1.proName) {
-                  item1.disabled = true;
-                  item1.tjProjectList = [];
-                }
-                if (item1.tjProjectList) {
-                  item1.tjProjectList.forEach((item2) => {
-                    if (selectionitem.proName == item2.proName) {
-                      item2.disabled = true;
-                      item2.tjProjectList = [];
-                    }
-                  });
-                }
-              });
+            // if (item.tjProjectList) {
+            //   item.tjProjectList.forEach((item1) => {
+            //     if (selectionitem.proName == item1.proName) {
+            //       item1.disabled = true;
+            //       item1.tjProjectList = [];
+            //     }
+            //     if (item1.tjProjectList) {
+            //       item1.tjProjectList.forEach((item2) => {
+            //         if (selectionitem.proName == item2.proName) {
+            //           item2.disabled = true;
+            //           item2.tjProjectList = [];
+            //         }
+            //       });
+            //     }
+            //   });
+            // }
+          });
+          this.TreedataList.forEach((item3) => {
+            if (item3.proParentId == selectionitem.proId) {
+              item.disabled = true;
             }
           });
         });
@@ -1486,27 +1610,157 @@
         return;
       }
     },
+    handleClick(tab, event) {
+      if (tab.label == "鍗曢」") {
+        this.DataList =[]
+        this.getDataList();
+      }
+    },
+    getDataList() {
+      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) => {
+              if (selectionitem.proId == item.proId) {
+                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;
+
+          if (this.DataList.length != 0) {
+            this.list1 = false;
+            this.DataList.forEach((item) => {
+              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+            });
+          }
+        });
+        this.loading = false;
+      });
+    },
 
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
-      if (checked === true) {
-        this.DataList.push(data);
-      } else {
-        this.DataList.pop(data);
-      }
-      this.proIds = [];
-      if (this.DataList.length != 0) {
-        this.DataList.forEach((item) => {
-          this.proIds.push(item.proId);
+      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) => {
+              if (item1.proParentId == data.proId) {
+                item1.propinName = data.proName;
+              }
+            });
+          });
+          this.TotalPrice1 = 0;
+          if (this.DataList.length != 0) {
+            this.list1 = false;
+            this.DataList.forEach((item) => {
+              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
+            });
+          }
         });
-      } else {
-        this.proIds = [];
+      } else if (checked.checkedNodes.length == 0) {
+        let proId = data.proId;
+        getProSonDxList(proId).then((res) => {
+          this.TreedataList = res.data.list;
+          this.checkedListkey = [];
+        });
       }
     },
-    changeCategoryKeys(val) {
-      this.proIds = [];
-      this.proIds = val;
+
+    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鏂规硶鍒犻櫎绗簩涓�
+            this.DataList.splice(j, 1);
+            j--;
+          }
+        }
+      }
+      return this.DataList;
     },
+
+    // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
+    handleCurrentChecked1(data, checked, checkedNodes) {
+      if (checked == false) {
+        this.DataList.forEach((item, index) => {
+          if (item.proId == data.proId) {
+            this.DataList.splice(index, 1);
+            this.TotalPrice1 = 0;
+            this.DataList.forEach((item1) => {
+              this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+            });
+          }
+        });
+      } 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;
+        });
+      }
+    },
+
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+    handleDelete(row) {
+      this.DataList.forEach((item, index) => {
+        if (item.proId == row.proId) {
+          this.DataList.splice(index, 1);
+          this.TotalPrice1 = 0;
+          this.DataList.forEach((item1) => {
+            this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+          });
+        }
+      });
+    },
+
+    // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
+    // handleCurrentChecked(data, checked, checkedNodes) {
+    //   if (checked === true) {
+    //     this.DataList.push(data);
+    //   } else {
+    //     this.DataList.pop(data);
+    //   }
+    //   this.proIds = [];
+    //   if (this.DataList.length != 0) {
+    //     this.DataList.forEach((item) => {
+    //       this.proIds.push(item.proId);
+    //     });
+    //   } else {
+    //     this.proIds = [];
+    //   }
+    // },
+    // changeCategoryKeys(val) {
+    //   this.proIds = [];
+    //   this.proIds = val;
+    // },
 
     // 椤圭洰鎻愪氦
     submit() {
@@ -1523,6 +1777,12 @@
         });
       } else {
         _this.pacId = "";
+      }
+      this.proIds = [];
+      if (this.DataList.length != 0) {
+        this.DataList.forEach((item) => {
+          this.proIds.push(item.proId);
+        });
       }
       let data = {
         cusId,
@@ -1687,6 +1947,15 @@
   display: block;
 }
 
+
+.tab3 { 
+  max-height: 400px;
+  overflow-y: auto;
+  border: 1px solid #d9d9d9;
+}
+
+
+
 .el-col-8 {
   width: 330px;
 }

--
Gitblit v1.8.0