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 | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 108 insertions(+), 12 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index a77240f..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; + // }); } } }); @@ -2559,7 +2649,7 @@ this.tableData.forEach((item) => { this.tableData1.forEach((item1) => { item.tjProjectList.forEach((item2) => { - console.log(item1) + console.log(item1); if (item2.proId == item1.proPrantId && item1.pacName == "鍗曢」") { this.$confirm( "璇ュ椁愬寘鍚簡宸查�夊崟椤癸紝鏄惁纭閫夋嫨璇ュ椁愶紵", @@ -2572,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: "宸插彇娑�", @@ -2632,11 +2722,11 @@ handleClick(tab, event) { if (this.activeNames == "second") { this.DataList = []; - this.checkedkey= []; + this.checkedkey = []; this.getDataList(); } else if (this.activeNames == "third") { this.DataLists = []; - this.checkedkeys= []; + this.checkedkeys = []; getZhList().then((response) => { if (response.data) { this.packageList = response.data; @@ -3415,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