From 2d44c32e5781a315d97752d7a4a43e2492635ae8 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期四, 05 十二月 2024 18:11:16 +0800 Subject: [PATCH] 0000 --- src/views/system/tijianall/index.vue | 191 ++++++++++++++++++++++++++++------------------- 1 files changed, 115 insertions(+), 76 deletions(-) diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue index cdb2c5c..5df77de 100644 --- a/src/views/system/tijianall/index.vue +++ b/src/views/system/tijianall/index.vue @@ -227,7 +227,7 @@ v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label" - :value="parseInt(dict.value)" + :value="dict.value" ></el-option> </el-select> </el-form-item> @@ -308,6 +308,7 @@ :visible.sync="taocan" width="80%" height="700px" + :close-on-click-modal="false" > <el-tabs type="border-card" @@ -649,9 +650,7 @@ </el-collapse-item> </div> </el-collapse> --> - <h3 style="font-weight: 600"> - 鍚堣锛歿{ marryall }}鍏� - </h3> + <h3 style="font-weight: 600">鍚堣锛歿{ marryall }}鍏�</h3> </div> </el-col> </el-row> @@ -990,7 +989,8 @@ getTransitionList, getProParentIdDxList, getProSonDxList, - getaddTj,getconfigKey, + getaddTj, + getconfigKey, getHistryTjOrderProByCusIdCard, delTbBycusCardIdAndProId, } from "@/api/system/tijian"; @@ -999,7 +999,8 @@ export default { components: { VTreeTransfer, - historyTj,Packages + historyTj, + Packages, }, dicts: [ "dict_user_national", @@ -1059,11 +1060,12 @@ tableDatas: [], packageList: [], checkedkeys: [], - valueUrl: "ws://127.0.0.1:18890", + // valueUrl: "ws://127.0.0.1:18890", + valueUrl: "ws://127.0.0.1:6789/websocket", valueUrls: "ws://127.0.0.1:6789/websocket", dialogVisiblese: false, cardreader: false, - cardreaderradio:3, + cardreaderradio: 3, inputSSS: "", lishi: false, table: false, @@ -1211,12 +1213,12 @@ // 琛ㄥ崟鍙傛暟 form: { cusIdcard: "", - tjType: 2, + tjType: "3", category: "01", cusSex: 1, cusNational: "1", timeRegion: "1", - cusMarryStatus: "1", + cusMarryStatus: "5", idType: "1", ageUnit: "0", }, @@ -1276,6 +1278,7 @@ }, created() { this.getList1(); + console.log(this.dict.type.dict_team, 999); }, methods: { inputChange() { @@ -1651,72 +1654,28 @@ this.websocket = websocket; // 杩炴帴璁惧 var jsonObj = { - name: "connect", + type: "1", }; var jStr = JSON.stringify(jsonObj); this.websocket.send(jStr); - alert("璇锋斁韬唤璇佸啀鐐圭‘璁�"); + // alert("璇锋斁韬唤璇佸啀鐐圭‘璁�"); var jsonObj = { - name: "readCert", + // name: "readCert", }; - var jStr = JSON.stringify(jsonObj); - this.websocket.send(jStr); + // var jStr = JSON.stringify(jsonObj); + // this.websocket.send(jStr); this.dialogVisible = false; }; //鎺ユ敹鍒版秷鎭殑鍥炶皟鏂规硶 - websocket.onmessage = function (event) { + websocket.onmessage = (event) => { var resultObj = eval("(" + event.data + ")"); //resultFlag涓�0浠h〃璇诲崱鎴愬姛 - if ( - resultObj.name == "readCard" || - resultObj.name == "readCert" || - resultObj.name == "PushWithImg" || - resultObj.name == "PushWithOutImg" - ) { - if (resultObj.resultFlag == "0") { - //鍥炴樉鐩稿叧鏁版嵁 - _this.form.cusName = resultObj.resultContent.partyName; - _this.form.cusSex = - resultObj.resultContent.gender == "0" ? "濂�" : "鐢�"; - _this.form.cusNational = resultObj.resultContent.nation; - _this.form.cusBrithday = resultObj.resultContent.bornDay; - if (_this.form.cusBrithday) { - _this.form.cusBrithday = _this.form.cusBrithday.replace( - /^(\d{4})(\d{2})(\d{2})$/, - "$1-$2-$3" - ); - } - _this.form.cusAddr = resultObj.resultContent.certAddress; - _this.form.cusIdcard = resultObj.resultContent.certNumber; - _this.imageUrl = - "data:image/jpeg;base64," + - resultObj.resultContent.identityPic; - if ( - resultObj.name == "readCert" || - resultObj.name == "PushWithImg" - ) { - this.imageUrl = - "data:image/jpeg;base64," + - resultObj.resultContent.identityPrintPic; - } - } else if (resultObj.resultFlag == "-1") { - if (resultObj.errorMsg == "绔彛鎵撳紑澶辫触") { - //alert("璇诲崱鍣ㄦ湭杩炴帴"); - } else { - //alert(resultObj.errorMsg); - } - } else if (resultObj.resultFlag == "-2") { - //alert(resultObj.errorMsg); - } - } else if (resultObj.name == "getStatus") { - if (resultObj.resultFlag == "0") { - if (resultObj.status == "0") { - } else { - alert("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴"); - } - } - } + + // TODO 浠ヤ笅浠g爜鍙兘鏄尘宸濅娇鐢ㄧ殑 + console.log(resultObj); + // this.jingChuanHandlerWebSocketResult(resultObj) + this.readCardWebSocket(resultObj); }; //杩炴帴鍏抽棴鐨勫洖璋冩柟娉� @@ -1762,7 +1721,89 @@ }); } }, - + // 鏈�鏂颁娇鐢╳ebSocket閫氫俊 + readCardWebSocket(resultObj) { + let _this = this; + if (resultObj.code === 200 && resultObj.data.name != null) { + //鍥炴樉鐩稿叧鏁版嵁 + _this.form.cusName = resultObj.data.name; + _this.form.cusSex = resultObj.data.sex == "0" ? "濂�" : "鐢�"; + _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; + _this.imageUrl = "data:image/jpeg;base64," + resultObj.data.img; + if (resultObj.name == "readCert" || resultObj.name == "PushWithImg") { + this.imageUrl = "data:image/jpeg;base64," + resultObj.data.img; + } + } else { + this.$message.warning("鏈煡鍒扮敤鎴蜂俊鎭�"); + } + /* else if (resultObj.resultFlag == "-1") { + if (resultObj.errorMsg == "绔彛鎵撳紑澶辫触") { + //alert("璇诲崱鍣ㄦ湭杩炴帴"); + } else { + //alert(resultObj.errorMsg); + } + } else if (resultObj.resultFlag == "-2") { + //alert(resultObj.errorMsg); + } */ + }, + // TODO 浠ヤ笅浠g爜鍙兘鏄尘宸濅娇鐢ㄧ殑 + jingChuanHandlerWebSocketResult(resultObj) { + let _this = this; + if ( + resultObj.name == "readCard" || + resultObj.name == "readCert" || + resultObj.name == "PushWithImg" || + resultObj.name == "PushWithOutImg" + ) { + if (resultObj.resultFlag == "0") { + //鍥炴樉鐩稿叧鏁版嵁 + _this.form.cusName = resultObj.resultContent.partyName; + _this.form.cusSex = + resultObj.resultContent.gender == "0" ? "濂�" : "鐢�"; + _this.form.cusNational = resultObj.resultContent.nation; + _this.form.cusBrithday = resultObj.resultContent.bornDay; + if (_this.form.cusBrithday) { + _this.form.cusBrithday = _this.form.cusBrithday.replace( + /^(\d{4})(\d{2})(\d{2})$/, + "$1-$2-$3" + ); + } + _this.form.cusAddr = resultObj.resultContent.certAddress; + _this.form.cusIdcard = resultObj.resultContent.certNumber; + _this.imageUrl = + "data:image/jpeg;base64," + resultObj.resultContent.identityPic; + if (resultObj.name == "readCert" || resultObj.name == "PushWithImg") { + this.imageUrl = + "data:image/jpeg;base64," + + resultObj.resultContent.identityPrintPic; + } + } else if (resultObj.resultFlag == "-1") { + if (resultObj.errorMsg == "绔彛鎵撳紑澶辫触") { + //alert("璇诲崱鍣ㄦ湭杩炴帴"); + } else { + //alert(resultObj.errorMsg); + } + } else if (resultObj.resultFlag == "-2") { + //alert(resultObj.errorMsg); + } + } else if (resultObj.name == "getStatus") { + if (resultObj.resultFlag == "0") { + if (resultObj.status == "0") { + } else { + alert("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴"); + } + } + } + }, handleChanges(param1) { if (this.form.pacCode == "涓嶈") { this.form.cusIdcard = param1[0].xh; @@ -1773,7 +1814,6 @@ // this.form.cusName = param1[0].pacName; // this.form.cusPhone = param1[0].pacRemark; }, - changeradio() { if (this.cardreaderradio != 3) { @@ -1803,8 +1843,8 @@ try { // 杩炴帴璁惧 var jsonObjs = { - type: 1, - data: {}, + type: "1", + // data: {}, }; var jStrs = JSON.stringify(jsonObjs); websocket.send(jStrs); @@ -1868,7 +1908,7 @@ } } _this.form.cusAddr = resultObj.data.addres; - + _this.cardreader = false; }; @@ -1941,13 +1981,13 @@ websocket.onmessage = function (event) { var resultObj = JSON.parse(event.data); _this.form.cusName = resultObj.data.name; - - if( resultObj.data.nation == "姹夋棌"){ - _this.form.cusNational ="1"; + + if (resultObj.data.nation == "姹夋棌") { + _this.form.cusNational = "1"; } - if(resultObj.data.gender == "鐢�"){ + if (resultObj.data.gender == "鐢�") { _this.form.cusSex = 0; - }else{ + } else { _this.form.cusSex = 1; } _this.form.cusBrithday = resultObj.data.birthday; @@ -1993,7 +2033,6 @@ }; } }, - // checkSelectable(row, index) { // if (!row) { -- Gitblit v1.8.0