From 683b2620e0fbfba24787046e2630cbfed0337484 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期四, 04 七月 2024 17:32:44 +0800
Subject: [PATCH] qxtj

---
 src/views/system/tijian/index.vue |  217 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 157 insertions(+), 60 deletions(-)

diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index fe73944..01a76ae 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -1381,7 +1381,8 @@
   getByTjNum,
 } from "@/api/hosp/customer";
 import { getPrintSetUp } from "@/api/system/examcharge";
-
+import axios from "axios";
+import { getIp } from '@/utils/auth'
 import {
   deptTreeSelect,
   projectGetList,
@@ -1398,6 +1399,7 @@
   getIsRequired,
   getconfigKey,
   getHistryTjOrderProByCusIdCard,
+  readCertCardInfos,
 } from "@/api/system/tijian";
 import Packages from "@/components/Packages";
 import { MessageBox } from "element-ui";
@@ -1591,6 +1593,8 @@
         pacRemark: null,
       },
       valueUrl: "ws://127.0.0.1:18890",
+      valueUrls: "ws://127.0.0.1:6789/websocket",
+      // valueUrls: "ws://"+getIp() +":6789/websocket",
       WebSocket: null,
       // 韬唤璇侀渶瑕�
       // socket: null,
@@ -1655,11 +1659,12 @@
   },
   created() {
     this.getCurrentDateTime();
-
     this.startTimer();
     this.getList1();
     // this.getData();
   },
+ 
+
   methods: {
     getCurrentDateTime() {
       const currentDate = new Date();
@@ -2350,6 +2355,91 @@
               this.$refs.aaa.open = true;
               this.$refs.aaa.getAllList();
               this.$refs.aaa.title = "璇佷欢瀛楀吀";
+            } else if (res.msg == "S") {
+              var websocket = null;
+              var url = this.valueUrls;
+              // var url = 'ws://'+ getIp() +':6789/websocket'
+              console.log(url)
+              if ("WebSocket" in window) {
+                websocket = new WebSocket(url);
+              } else if ("MozWebSocket" in window) {
+                websocket = new MozWebSocket(url);
+              } else {
+                // console.log("SockJS");
+              }
+              if (websocket == null) {
+                alert("11111");
+              }
+              websocket.onopen = function () {
+                try {
+                websocket.send("鍙戦��");
+              } catch (err) {
+                var tryTime = 0;
+                // 閲嶈瘯10娆★紝姣忔涔嬮棿闂撮殧3绉�
+                if (tryTime < 1) {
+                  var t1 = setTimeout(function () {
+                    tryTime++;
+                  
+                websocket.send("鍙戦��");
+              
+                  }, 1 * 1000);
+                } else {
+                  console.error("閲嶈繛澶辫触.");
+                }
+              }
+              };
+              websocket.onclose = function () {
+                alert("璇诲崱鍣ㄨ繛鎺ュ叧闂�");
+              };
+              websocket.onmessage = function (event) {
+              
+                var resultObj =JSON.parse(event.data);
+               _this.form.cusName = resultObj.data.name;
+                    _this.form.cusSex =
+                    resultObj.data.sex;
+                    _this.form.cusNational =resultObj.data.mz;
+                    _this.form.cusBrithday = resultObj.data.csrq;
+                    if (_this.form.cusBrithday) {
+                      _this.form.cusBrithday = _this.form.cusBrithday.replace(
+                        /^(\d{4})(\d{2})(\d{2})$/,
+                        "$1-$2-$3"
+                      );
+                    }
+                    _this.form.cusAddr = resultObj.data.addres;
+                    _this.form.cusIdcard = resultObj.data.card;
+              };
+
+              //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉�
+              websocket.onerror = function () {
+                alert("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父");
+              };
+            
+              // let url = window.location.protocol + "//" + window.location.host;
+              // console.log(url);
+              // axios
+              //   .get("http://localhost:81/dev-api/readCertCardInfos")
+              //   .then((res) => {
+              //     console.log(res);
+              //   })
+              //   .catch((err) => {
+              //     console.log(err);
+              //   });
+
+              // readCertCardInfos().then((res) => {
+              //   _this.form.cusName = res.data.name;
+              //       _this.form.cusSex =
+              //       res.data.sex;
+              //       _this.form.cusNational = res.data.mz;
+              //       _this.form.cusBrithday = res.data.csrq;
+              //       if (_this.form.cusBrithday) {
+              //         _this.form.cusBrithday = _this.form.cusBrithday.replace(
+              //           /^(\d{4})(\d{2})(\d{2})$/,
+              //           "$1-$2-$3"
+              //         );
+              //       }
+              //       _this.form.cusAddr = res.data.addres;
+              //       _this.form.cusIdcard = res.data.card;
+              // });
             }
           }
         });
@@ -2549,8 +2639,6 @@
     // 鐐瑰嚮澶氶�夋鑾峰彇閫変腑鏁版嵁
     handleSelectionChange(selection, row) {
       this.tableData = selection;
-      console.log(this.tableData);
-      console.log(this.tableData1);
       if (selection.length > 1) {
         let del_row = selection.shift();
         this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
@@ -2561,7 +2649,8 @@
         this.tableData.forEach((item) => {
           this.tableData1.forEach((item1) => {
             item.tjProjectList.forEach((item2) => {
-              if (item2.proId == item1.proPrantId) {
+              console.log(item1);
+              if (item2.proId == item1.proPrantId && item1.pacName == "鍗曢」") {
                 this.$confirm(
                   "璇ュ椁愬寘鍚簡宸查�夊崟椤癸紝鏄惁纭閫夋嫨璇ュ椁愶紵",
                   "纭淇℃伅",
@@ -2573,14 +2662,14 @@
                 )
                   .then(() => {
                     this.$message({
-                        type: "success",
-                        message: "璇锋敞鎰忔煡鐪嬩环鏍�",
-                      });
+                      type: "success",
+                      message: "璇锋敞鎰忔煡鐪嬩环鏍�",
+                    });
                   })
                   .catch((action) => {
                     if (action === "cancel") {
                       let del_row = selection.shift();
-                      this.$refs.tb.toggleRowSelection(del_row, false); 
+                      this.$refs.tb.toggleRowSelection(del_row, false);
                       this.$message({
                         type: "warning",
                         message: "宸插彇娑�",
@@ -2633,39 +2722,41 @@
     handleClick(tab, event) {
       if (this.activeNames == "second") {
         this.DataList = [];
+        this.checkedkey = [];
         this.getDataList();
       } else if (this.activeNames == "third") {
         this.DataLists = [];
+        this.checkedkeys = [];
         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.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;
         });
@@ -2701,27 +2792,27 @@
         //     });
         //   });
         // }
-        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.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;
       });
     },
@@ -3414,11 +3505,17 @@
   width: 100%;
   display: flex;
 }
-
 .tab3 {
-  max-height: 400px;
+  border: 1px solid #dcdfe6;
+}
+
+.filter-tree {
+  /* max-height: 360px;
   overflow-y: auto;
-  border: 1px solid #d9d9d9;
+  border: 1px solid #d9d9d9; */
+  overflow: auto;
+  flex: 1;
+  height: 350px;
 }
 
 .tab2 {

--
Gitblit v1.8.0