|
@@ -689,122 +689,6 @@
|
689
|
689
|
'certificates':this.form.certificates,
|
690
|
690
|
}
|
691
|
691
|
|
692
|
|
- if ((this.$store.getters.xt_user.org_id == 10387 && this.form.id_card_type == 4) || (this.$store.getters.xt_user.org_id == 4 && this.form.id_card_type == 4)) {
|
693
|
|
- try {
|
694
|
|
- //检测当前浏览器是否支持websocket模式
|
695
|
|
- window.WebSocket = window.WebSocket || window.MozWebSocket;
|
696
|
|
- if (!window.WebSocket){
|
697
|
|
- alert("WebSocket not supported by this browser");
|
698
|
|
- return;
|
699
|
|
- }
|
700
|
|
- this.ws = new WebSocket("ws://127.0.0.1:8899");//连接服务器
|
701
|
|
- var that = this
|
702
|
|
- this.ws.onopen = function(event){
|
703
|
|
- if (that.$store.getters.xt_user.org_id == 10387){
|
704
|
|
- that.ws.send("{\"url\":\"http://10.93.33.243:20001/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01101\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"罗佳菊\",\"orgId\":\"H43082200408\"},\"orgId\":\"H43082200408\",\"transType\":\"ec.query\"}}");
|
705
|
|
- }else if(that.$store.getters.xt_user.org_id == 10318){
|
706
|
|
- that.ws.send("{\"url\":\"http://igb.hsa.gdgov.cn/prd_nation_eccode/prd_eccode/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01101\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"邹刘阳\",\"orgId\":\"H44011701749\"},\"orgId\":\"H44011701749\",\"transType\":\"ec.query\"}}");
|
707
|
|
- }else if(that.$store.getters.xt_user.org_id == 4){
|
708
|
|
- that.ws.send("{\"url\":\"http://igb.hsa.gdgov.cn/prd_nation_eccode/prd_eccode/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01101\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"邹刘阳\",\"orgId\":\"H44011701749\"},\"orgId\":\"H44011701749\",\"transType\":\"ec.query\"}}");
|
709
|
|
- }
|
710
|
|
- };
|
711
|
|
-
|
712
|
|
- this.ws.onmessage = function(event){
|
713
|
|
- // alert("接收到服务器发送的数据:\r\n"+event.data);
|
714
|
|
- var newParams = JSON.parse(event.data)
|
715
|
|
- console.log(newParams)
|
716
|
|
- console.log(newParams.data)
|
717
|
|
- console.log(newParams.data)
|
718
|
|
- console.log(newParams.data.ecToken)
|
719
|
|
- console.log(newParams.data.idNo)
|
720
|
|
- console.log(newParams.data.userName)
|
721
|
|
- console.log(newParams.data.insuOrg)
|
722
|
|
-
|
723
|
|
- newParams['ecToken'] = newParams.data.ecToken
|
724
|
|
- newParams['idNo'] = newParams.data.idNo
|
725
|
|
- newParams['userName'] = newParams.data.userName
|
726
|
|
- newParams['insuOrg'] = newParams.data.insuOrg
|
727
|
|
-
|
728
|
|
- newParams['id_card_type'] = that.form.id_card_type
|
729
|
|
- newParams['admin_user_id'] = that.$store.getters.xt_user.user.id
|
730
|
|
- newParams['certificates'] = that.form.certificates
|
731
|
|
- axios.get('http://127.0.0.1:9532/api/readcard', {
|
732
|
|
- params: newParams
|
733
|
|
- })
|
734
|
|
- .then(function(response) {
|
735
|
|
- if (response.data.state == 0) {
|
736
|
|
- that.$message.error(response.data.msg)
|
737
|
|
- return false
|
738
|
|
- } else {
|
739
|
|
-
|
740
|
|
- if (response.data.data.failed_code == -10) {
|
741
|
|
- that.$confirm(response.data.data.msg, '医保错误信息', {
|
742
|
|
- confirmButtonText: '确 定',
|
743
|
|
- type: 'warning'
|
744
|
|
- }).then(() => {
|
745
|
|
-
|
746
|
|
- }).catch(() => {
|
747
|
|
- })
|
748
|
|
- } else {
|
749
|
|
-
|
750
|
|
- var patient = response.data.data.patient
|
751
|
|
-
|
752
|
|
- if (that.form.id_card_type == 1) {
|
753
|
|
- that.form.id = patient.id
|
754
|
|
- that.form.name = patient.name
|
755
|
|
- that.form.gender = patient.gender
|
756
|
|
- that.form.age = patient.age
|
757
|
|
- that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
|
758
|
|
- that.form.phone = patient.phone
|
759
|
|
- that.form.id_card = patient.id_card_no
|
760
|
|
- that.form.medical_insurance_card = response.data.data.number
|
761
|
|
- that.form.social_type = parseInt(response.data.data.insutype)
|
762
|
|
-
|
763
|
|
-
|
764
|
|
-
|
765
|
|
- } else if (that.form.id_card_type == 2) {
|
766
|
|
- that.form.id = patient.id
|
767
|
|
- that.form.name = patient.name
|
768
|
|
- that.form.gender = patient.gender
|
769
|
|
- that.form.age = patient.age
|
770
|
|
- that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
|
771
|
|
- that.form.phone = patient.phone
|
772
|
|
- that.form.id_card = patient.id_card_no
|
773
|
|
- that.form.social_type = parseInt(response.data.data.insutype)
|
774
|
|
-
|
775
|
|
- } else {
|
776
|
|
- that.form.id = patient.id
|
777
|
|
- that.form.name = patient.name
|
778
|
|
- that.form.gender = patient.gender
|
779
|
|
- that.form.age = patient.age
|
780
|
|
- that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
|
781
|
|
- that.form.phone = patient.phone
|
782
|
|
- that.form.id_card = patient.id_card_no
|
783
|
|
- that.form.social_type = parseInt(response.data.data.insutype)
|
784
|
|
-
|
785
|
|
- }
|
786
|
|
- that.$message({ message: '读卡成功', type: 'success' })
|
787
|
|
- }
|
788
|
|
- }
|
789
|
|
- })
|
790
|
|
- .catch(function(error) {
|
791
|
|
-
|
792
|
|
- })
|
793
|
|
-
|
794
|
|
-
|
795
|
|
- };
|
796
|
|
- this.ws.onclose = function(event){
|
797
|
|
- // alert("已经与服务器断开连接\r\n当前连接状态:"+this.readyState);
|
798
|
|
- };
|
799
|
|
- this.ws.onerror = function(event){
|
800
|
|
- // if (this.flag!=1)
|
801
|
|
- // alert("WebSocket接收异常!");
|
802
|
|
- };
|
803
|
|
- } catch (ex) {
|
804
|
|
- alert(ex.message);
|
805
|
|
- }
|
806
|
|
-
|
807
|
|
- }else{
|
808
|
692
|
axios.get('http://127.0.0.1:9532/api/readcard', {
|
809
|
693
|
params: params
|
810
|
694
|
})
|
|
@@ -869,8 +753,7 @@
|
869
|
753
|
.catch(function(error) {
|
870
|
754
|
|
871
|
755
|
})
|
872
|
|
- }
|
873
|
|
- },
|
|
756
|
+ },
|
874
|
757
|
// reading() {
|
875
|
758
|
// var that = this
|
876
|
759
|
// if (this.form.id_card_type.length == 0 || this.form.id_card_type == 0) {
|
|
@@ -1045,6 +928,7 @@
|
1045
|
928
|
}
|
1046
|
929
|
}
|
1047
|
930
|
|
|
931
|
+
|
1048
|
932
|
}
|
1049
|
933
|
</script>
|
1050
|
934
|
|