From c0429d6f1786485a0a6e05d20f64f5435e3658b3 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期二, 25 六月 2024 09:52:39 +0800
Subject: [PATCH] qxtj

---
 src/views/system/tijianall/index.vue |  133 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 124 insertions(+), 9 deletions(-)

diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue
index ab2dcc4..63be90b 100644
--- a/src/views/system/tijianall/index.vue
+++ b/src/views/system/tijianall/index.vue
@@ -297,15 +297,16 @@
     <el-dialog
       title="閫夋嫨濂楅"
       :visible.sync="taocan"
-      width="59%"
+      width="80%"
       height="700px"
     >
       <el-tabs
         type="border-card"
         style="height: 538px; margin: 0 10px; width: 100%"
         @tab-click="handleClick"
+        v-model="activeNames" 
       >
-        <el-tab-pane label="濂楅">
+        <el-tab-pane label="濂楅" name="first">
           <el-form
             :model="queryParam"
             ref="queryForm"
@@ -391,8 +392,8 @@
                   class="el-icon-d-arrow-right"></i></el-button> -->
           </div>
         </el-tab-pane>
-        <el-tab-pane label="鍗曢」">
-          <div class="tab8">
+        <el-tab-pane label="鍗曢」" name="second" >
+          <div class="tab8" >
             <!-- <div class="tab7">
               <v-tree-transfer
                 :treeData="treedataList"
@@ -405,8 +406,8 @@
                 @check-change="handleCurrentChecked">
               </el-tree> -->
             <!-- </div> -->
-            <el-row :gutter="20">
-              <el-col :span="6">
+            <el-row :gutter="20" style="width:100%">
+              <el-col :span="8">
                 <div
                   style="
                     text-align: center;
@@ -430,6 +431,7 @@
                     :default-checked-keys="checkedkey"
                     :filter-node-method="filterNode"
                     ref="tree"
+                    :render-content="renderContent"
                   >
                   </el-tree>
                 </div>
@@ -455,6 +457,7 @@
                     show-checkbox
                     @check-change="handleCurrentChecked1"
                     :default-checked-keys="checkedListkey"
+                    :render-content="renderContent"
                   >
                   </el-tree>
                 </div>
@@ -506,6 +509,7 @@
                       </template>
                     </el-table-column>
                   </el-table>
+                  
                   <el-collapse v-model="activeName" accordion v-if="list1">
                     <div>
                       <el-collapse-item title="璇烽�夋嫨椤圭洰">
@@ -528,6 +532,7 @@
                       </el-collapse-item>
                     </div>
                   </el-collapse>
+                  <h3 v-else style="font-weight: 600;">鍚堣锛歿{ marryall }}鍏�</h3>
                 </div>
               </el-col>
             </el-row>
@@ -614,7 +619,12 @@
                 <el-button type="primary" @click="Package" size="mini"
                   >閫夋嫨濂楅</el-button
                 >
-
+                <el-button
+                  type="primary"
+                  @click="resetpackage"
+                  size="mini"
+                  >閲嶇疆濂楅</el-button
+                >
                 <el-button
                   type="primary"
                   @click="submitPrice"
@@ -669,6 +679,12 @@
                       ".00鍏�)"
                     }}
                   </template>
+                  <el-button
+                    type="primary"
+                    @click="candelete(item)"
+                    style="margin: 5px"
+                    >鍒� 闄�</el-button
+                  >
                   <el-table
                     :data="item.list"
                     border
@@ -832,6 +848,7 @@
   getaddTj,
   getHistryTjOrderByCusIdCard,
   getHistryTjOrderProByCusIdCard,
+  delTbBycusCardIdAndProId,
 } from "@/api/system/tijian";
 import { MessageBox } from "element-ui";
 import VTreeTransfer from "../tijian/TreeTransfer.vue";
@@ -891,6 +908,7 @@
     //   }
     // };
     return {
+      marryall: 0,
       filterText: "",
       proIdList: [],
       tableDatas: [],
@@ -923,6 +941,7 @@
       /** 鐓х浉鏈哄脊绐楁ā鍧�-start */
       videoWidth: 200,
       videoHeight: 200,
+      activeNames: 'first',
       // canvasWidth:300,
       // canvasHeight:300,
       imgSrc: "",
@@ -1144,10 +1163,55 @@
     inputChanges() {
       this.$refs.historyTj.getlist();
     },
+    candelete(item) {
+      let data = {
+        cusCardId: this.form.cusIdcard,
+        proId: item.proPrantId,
+      };
+      delTbBycusCardIdAndProId(data).then((res) => {
+        getTransitionList(this.form.cusIdcard).then((response) => {
+          this.tableData1 = response.data;
+          this.TotalPrice1 = 0;
+          if (this.tableData1) {
+            this.tableData1.forEach((item) => {
+              this.TotalPrice1 += item.nowPrice;
+              if (item.pacName === null) {
+                item.pacName = "鍗曢」";
+              }
+              if (item.pacName == "鍗曢」") {
+                item.list.forEach((item9) => {
+                  this.treeList.push(item9.proId);
+                });
+              }
+              this.pacName = item.pacName;
+            });
 
+            const r = /^\+?[0-9][0-9]*$/; //姝f暣鏁帮紙鍙互0鎵撳ご锛�
+            let TotalPrice = this.TotalPrice1 * (this.discount / 10);
+            if (r.test(TotalPrice)) {
+              this.TotalPrice = TotalPrice + ".00";
+            } else {
+              this.TotalPrice = TotalPrice;
+            }
+
+            this.list1 = false;
+            this.list3 = true;
+          } else {
+            this.list1 = true;
+
+            this.TotalPrice = "0.00";
+          }
+        });
+      });
+    },
     filterNode(value, data) {
       if (!value) return true;
-      return data.proName.indexOf(value) !== -1;
+      // return data.proName.indexOf(value) !== -1;
+      if(value == data.proName){
+        return data.proName.indexOf(value) !== -1;
+      }else{
+        return data.proEngName.indexOf(value) !== -1;
+      }
     },
     cope() {
       let cusIdCard = this.form.cusIdcard;
@@ -1431,10 +1495,44 @@
     //     return true;
     //   }
     // },
+    resetpackage(){
+      if (this.form.cusIdcard) {
+        var cusId = this.form.cusIdcard;
+      } else {
+        this.$message.warning("璇峰厛濉啓淇℃伅锛屽啀閫変綋妫�鍐呭");
+      }
+      let _this = this;
+        _this.pacId = "";
+      this.proIds = [];
+      let data = {
+        cusId,
+        pacId: _this.pacId,
+        proIds: this.proIds,
+      };
+      getaddtTransition(data).then((response) => {
+        if (response.code === 200) {
+          let cusId = this.form.cusIdcard;
+          this.proIds = [];
+          getTransitionList(cusId).then((response) => {
+            this.tableData1 = response.data;
+            this.TotalPrice1 = 0;
+            if (this.tableData1.length>=1) {
+              this.list1 = false;
+              this.list3 = true;
+            } else {
+              this.list1 = true;
+
+              this.TotalPrice = "0.00";
+            }
+          });
+        }
+      });
+    },
 
     Package() {
       this.taocan = true;
       let cusSex = this.form.cusSex;
+       this.activeNames="first"
       this.datekey = Date.now();
       //鍏ㄩ儴濂楅
       this.loading = true;
@@ -1557,6 +1655,14 @@
         this.getDataList();
       }
     },
+    renderContent(h, { node, data, store }) {
+      return (
+        <span class="custom-tree-node">
+          <span>{node.label}</span>
+          <span>({data.proPrice}鍏�)</span>
+        </span>
+      );
+    },
     getDataList() {
       this.loading = true;
       getProParentIdDxList().then((response) => {
@@ -1582,11 +1688,12 @@
             });
           });
           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;
             });
           }
         });
@@ -1613,10 +1720,12 @@
             });
           });
           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;
             });
           }
         });
@@ -1649,8 +1758,10 @@
           if (item.proId == data.proId) {
             this.DataList.splice(index, 1);
             this.TotalPrice1 = 0;
+            this.marryall = 0;
             this.DataList.forEach((item1) => {
               this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+              this.marryall += item1.proPrice;
             });
           }
         });
@@ -1663,8 +1774,10 @@
         });
         this.spliceData();
         this.TotalPrice1 = 0;
+        this.marryall = 0;
         this.DataList.forEach((item1) => {
           this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+          this.marryall += item1.proPrice;
         });
       }
     },
@@ -1674,9 +1787,11 @@
       this.DataList.forEach((item, index) => {
         if (item.proId == row.proId) {
           this.DataList.splice(index, 1);
+          this.marryall = 0;
           this.TotalPrice1 = 0;
           this.DataList.forEach((item1) => {
             this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+            this.marryall += item1.proPrice;
           });
         }
       });

--
Gitblit v1.8.0