From e4aa2d49ae837e46258c42909c10661da903ee0f Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期四, 05 十二月 2024 17:18:52 +0800 Subject: [PATCH] 222 --- src/views/system/tijian/index.vue | 148 +++++++++++++++--------- src/views/system/tijianall/index.vue | 155 ++++++++++++++++--------- src/views/sampling/sampling/index.vue | 9 - 3 files changed, 192 insertions(+), 120 deletions(-) diff --git a/src/views/sampling/sampling/index.vue b/src/views/sampling/sampling/index.vue index 7fe2876..c7bdd2e 100644 --- a/src/views/sampling/sampling/index.vue +++ b/src/views/sampling/sampling/index.vue @@ -959,18 +959,11 @@ handleChange(selection) { // console.log(selection); - // this.selectList = selection; + this.selectList = selection; // console.log(this.selectList, 5555); var array = selection; this.ids = array.map((item) => item.id); - }, - selectAllRows() { - this.$nextTick(() => { - if (this.$refs.tab1) { - this.$refs.tab1.toggleAllSelection(); - } - }); }, // 绂侀�� diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index 65631ab..40d2274 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -1620,7 +1620,7 @@ pacRemark: null, }, // valueUrl: "ws://127.0.0.1:18890", - valueUrl: "ws://127.0.0.1:6789/websocket", + valueUrl: "ws://127.0.0.1::6789/websocket", valueUrls: "ws://127.0.0.1:6789/websocket", // valueUrls: "ws://"+getIp() +":6789/websocket", webSocket: null, @@ -1692,9 +1692,8 @@ this.getList1(); // this.getData(); }, - mounted(){ - console.log(this.dict.type.dict_user_marry,555); - + mounted() { + console.log(this.dict.type.dict_user_marry, 555); }, methods: { @@ -2327,59 +2326,14 @@ }; //鎺ユ敹鍒版秷鎭殑鍥炶皟鏂规硶 - websocket.onmessage = function (event) { + websocket.onmessage = (event)=> { + console.log(event, "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("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴"); - } - } - } + console.log(resultObj); + // TODO 浠ヤ笅浠g爜鍙兘鏄尘宸濅娇鐢ㄧ殑 + // this.jingChuanHandlerWebSocketResult(resultObj) + this.readCardWebSocket(resultObj) }; //杩炴帴鍏抽棴鐨勫洖璋冩柟娉� @@ -2425,6 +2379,90 @@ }); } }, + // 鏈�鏂颁娇鐢╳ebSocket閫氫俊 + readCardWebSocket(resultObj){ + let _this = this; + if (resultObj.code === 200) { + //鍥炴樉鐩稿叧鏁版嵁 + _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 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("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴"); + } + } + } + }, changeradio() { if (this.cardreaderradio != 3) { this.$nextTick(() => { diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue index 8c1c7e8..4ac24cb 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> @@ -1213,7 +1213,7 @@ // 琛ㄥ崟鍙傛暟 form: { cusIdcard: "", - tjType: 2, + tjType: '3', category: "01", cusSex: 1, cusNational: "1", @@ -1278,6 +1278,8 @@ }, created() { this.getList1(); + console.log(this.dict.type.dict_team,999); + }, methods: { inputChange() { @@ -1653,72 +1655,28 @@ this.websocket = websocket; // 杩炴帴璁惧 var jsonObj = { - name: "connect", + type: "1", }; var jStr = JSON.stringify(jsonObj); this.websocket.send(jStr); 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) }; //杩炴帴鍏抽棴鐨勫洖璋冩柟娉� @@ -1764,7 +1722,90 @@ }); } }, - +// 鏈�鏂颁娇鐢╳ebSocket閫氫俊 +readCardWebSocket(resultObj){ + let _this = this; + if (resultObj.code === 200) { + //鍥炴樉鐩稿叧鏁版嵁 + _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 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; -- Gitblit v1.8.0