陈少旭 il y a 1 an
Parent
révision
8754457b48

+ 223 - 44
src/xt_pages/outpatientCharges/components/registerDialog.vue Voir le fichier

@@ -632,55 +632,234 @@
632 632
           'admin_user_id': this.$store.getters.xt_user.user.id,
633 633
           'certificates':this.form.certificates,
634 634
         }
635
-        axios.defaults.retry = 0
636
-        axios.get('http://127.0.0.1:9532/api/readcard', {
637
-          params: params
638
-        })
639
-          .then(function(response) {
640
-            if (response.data.state == 0) {
641
-              that.$message.error(response.data.msg)
642
-              return false
643
-            } else {
644
-              var patient = response.data.data.patient
645
-
646
-              if (that.form.id_card_type == 1) {
647
-                that.form.id = patient.id
648
-                that.form.name = patient.name
649
-                that.form.gender = patient.gender
650
-                that.form.age = patient.age
651
-                that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
652
-                that.form.phone = patient.phone
653
-                that.form.id_card = patient.id_card_no
654
-                that.form.medical_insurance_card = response.data.data.number
655
-                that.form.social_type = parseInt(response.data.data.insutype)
656
-
657
-
658
-              } else if (that.form.id_card_type == 2) {
659
-                that.form.id = patient.id
660
-                that.form.name = patient.name
661
-                that.form.gender = patient.gender
662
-                that.form.age = patient.age
663
-                that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
664
-                that.form.phone = patient.phone
665
-                that.form.id_card = patient.id_card_no
666
-              } else {
667
-                that.form.id = patient.id
668
-                that.form.name = patient.name
669
-                that.form.gender = patient.gender
670
-                that.form.age = patient.age
671
-                that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
672
-                that.form.phone = patient.phone
673
-                that.form.id_card = patient.id_card_no
674
-                that.form.social_type = parseInt(response.data.data.insutype)
675 635
 
676
-              }
677
-              that.$message({ message: '读卡成功', type: 'success' })
636
+        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) ){
637
+          try {
638
+            //检测当前浏览器是否支持websocket模式
639
+            window.WebSocket = window.WebSocket || window.MozWebSocket;
640
+            if (!window.WebSocket){
641
+              alert("WebSocket not supported by this browser");
642
+              return;
678 643
             }
679
-          })
680
-          .catch(function(error) {
644
+            this.ws = new WebSocket("ws://127.0.0.1:8899");//连接服务器
645
+            var that = this
646
+            this.ws.onopen = function(event){
647
+              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\"}}");
648
+
649
+            };
650
+
651
+            this.ws.onmessage = function(event){
652
+              // alert("接收到服务器发送的数据:\r\n"+event.data);
653
+              var newParams =  JSON.parse(event.data)
654
+              console.log(newParams)
655
+
656
+              console.log(newParams.data)
657
+              console.log(newParams.data)
658
+              console.log(newParams.data.ecToken)
659
+              console.log(newParams.data.idNo)
660
+              console.log(newParams.data.userName)
661
+              console.log(newParams.data.insuOrg)
662
+
663
+              newParams['ecToken'] = newParams.data.ecToken
664
+              newParams['idNo'] = newParams.data.idNo
665
+              newParams['userName'] = newParams.data.userName
666
+              newParams['insuOrg'] = newParams.data.insuOrg
667
+
668
+              newParams['id_card_type'] =  that.form.id_card_type
669
+              newParams['admin_user_id'] = that.$store.getters.xt_user.user.id
670
+              newParams['certificates'] = that.form.certificates
671
+              axios.get('http://127.0.0.1:9532/api/readcard', {
672
+                params: newParams
673
+              })
674
+                .then(function(response) {
675
+                  if (response.data.state == 0) {
676
+                    that.$message.error(response.data.msg)
677
+                    return false
678
+                  } else {
679
+                    var patient = response.data.data.patient
680
+
681
+                    if (that.form.id_card_type == 1) {
682
+                      that.form.id = patient.id
683
+                      that.form.name = patient.name
684
+                      that.form.gender = patient.gender
685
+                      that.form.age = patient.age
686
+                      that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
687
+                      that.form.phone = patient.phone
688
+                      that.form.id_card = patient.id_card_no
689
+                      that.form.medical_insurance_card = response.data.data.number
690
+                      that.form.social_type = parseInt(response.data.data.insutype)
691
+
692
+
693
+                    } else if (that.form.id_card_type == 2) {
694
+                      that.form.id = patient.id
695
+                      that.form.name = patient.name
696
+                      that.form.gender = patient.gender
697
+                      that.form.age = patient.age
698
+                      that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
699
+                      that.form.phone = patient.phone
700
+                      that.form.id_card = patient.id_card_no
701
+                    } else {
702
+                      that.form.id = patient.id
703
+                      that.form.name = patient.name
704
+                      that.form.gender = patient.gender
705
+                      that.form.age = patient.age
706
+                      that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
707
+                      that.form.phone = patient.phone
708
+                      that.form.id_card = patient.id_card_no
709
+                      that.form.social_type = parseInt(response.data.data.insutype)
710
+
711
+                    }
712
+                    that.$message({ message: '读卡成功', type: 'success' })
713
+                  }
714
+                })
715
+                .catch(function(error) {
716
+
717
+                })
681 718
 
719
+
720
+            };
721
+            this.ws.onclose = function(event){
722
+              alert("已经与服务器断开连接\r\n当前连接状态:"+this.readyState);
723
+            };
724
+            this.ws.onerror = function(event){
725
+              if (this.flag!=1)
726
+                alert("WebSocket接收异常!");
727
+            };
728
+          } catch (ex) {
729
+            alert(ex.message);
730
+          }
731
+
732
+        }else{
733
+          axios.get('http://127.0.0.1:9532/api/readcard', {
734
+            params: params
682 735
           })
736
+            .then(function(response) {
737
+              if (response.data.state == 0) {
738
+                that.$message.error(response.data.msg)
739
+                return false
740
+              } else {
741
+                var patient = response.data.data.patient
742
+
743
+                if (that.form.id_card_type == 1) {
744
+                  that.form.id = patient.id
745
+                  that.form.name = patient.name
746
+                  that.form.gender = patient.gender
747
+                  that.form.age = patient.age
748
+                  that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
749
+                  that.form.phone = patient.phone
750
+                  that.form.id_card = patient.id_card_no
751
+                  that.form.medical_insurance_card = response.data.data.number
752
+                  that.form.social_type = parseInt(response.data.data.insutype)
753
+
754
+
755
+                } else if (that.form.id_card_type == 2) {
756
+                  that.form.id = patient.id
757
+                  that.form.name = patient.name
758
+                  that.form.gender = patient.gender
759
+                  that.form.age = patient.age
760
+                  that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
761
+                  that.form.phone = patient.phone
762
+                  that.form.id_card = patient.id_card_no
763
+                } else {
764
+                  that.form.id = patient.id
765
+                  that.form.name = patient.name
766
+                  that.form.gender = patient.gender
767
+                  that.form.age = patient.age
768
+                  that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
769
+                  that.form.phone = patient.phone
770
+                  that.form.id_card = patient.id_card_no
771
+                  that.form.social_type = parseInt(response.data.data.insutype)
772
+
773
+                }
774
+                that.$message({ message: '读卡成功', type: 'success' })
775
+              }
776
+            })
777
+            .catch(function(error) {
778
+
779
+            })
780
+        }
683 781
       },
782
+      // reading() {
783
+      //   var that = this
784
+      //   if (this.form.id_card_type.length == 0 || this.form.id_card_type == 0) {
785
+      //     this.$message.error('请先选择读卡类型')
786
+      //     return
787
+      //   }
788
+      //   let params = {
789
+      //     'id_card_type': this.form.id_card_type,
790
+      //     'admin_user_id': this.$store.getters.xt_user.user.id,
791
+      //     'certificates':this.form.certificates,
792
+      //   }
793
+      //   axios.defaults.retry = 0
794
+      //
795
+      //   if(this.$store.getters.xt_user.org_id == 10387){
796
+      //
797
+      //     // 创建WebSocket实例并指定服务器地址
798
+      //     this.socket = new WebSocket("ws://localhost:8899");
799
+      //
800
+      //     // 监听WebSocket事件
801
+      //     this.socket.onopen = () => {
802
+      //       console.log("WebSocket连接已建立");
803
+      //     };
804
+      //
805
+      //     this.socket.onmessage = (event) => {
806
+      //       console.log("收到消息:", event.data);
807
+      //     };
808
+      //
809
+      //     this.socket.onclose = () => {
810
+      //       console.log("WebSocket连接已关闭");
811
+      //     };
812
+      //   }
813
+      //
814
+      //
815
+      //   axios.get('http://127.0.0.1:9532/api/readcard', {
816
+      //     params: params
817
+      //   })
818
+      //     .then(function(response) {
819
+      //       if (response.data.state == 0) {
820
+      //         that.$message.error(response.data.msg)
821
+      //         return false
822
+      //       } else {
823
+      //         var patient = response.data.data.patient
824
+      //
825
+      //         if (that.form.id_card_type == 1) {
826
+      //           that.form.id = patient.id
827
+      //           that.form.name = patient.name
828
+      //           that.form.gender = patient.gender
829
+      //           that.form.age = patient.age
830
+      //           that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
831
+      //           that.form.phone = patient.phone
832
+      //           that.form.id_card = patient.id_card_no
833
+      //           that.form.medical_insurance_card = response.data.data.number
834
+      //           that.form.social_type = parseInt(response.data.data.insutype)
835
+      //
836
+      //
837
+      //         } else if (that.form.id_card_type == 2) {
838
+      //           that.form.id = patient.id
839
+      //           that.form.name = patient.name
840
+      //           that.form.gender = patient.gender
841
+      //           that.form.age = patient.age
842
+      //           that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
843
+      //           that.form.phone = patient.phone
844
+      //           that.form.id_card = patient.id_card_no
845
+      //         } else {
846
+      //           that.form.id = patient.id
847
+      //           that.form.name = patient.name
848
+      //           that.form.gender = patient.gender
849
+      //           that.form.age = patient.age
850
+      //           that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
851
+      //           that.form.phone = patient.phone
852
+      //           that.form.id_card = patient.id_card_no
853
+      //           that.form.social_type = parseInt(response.data.data.insutype)
854
+      //
855
+      //         }
856
+      //         that.$message({ message: '读卡成功', type: 'success' })
857
+      //       }
858
+      //     })
859
+      //     .catch(function(error) {
860
+      //
861
+      //     })
862
+      // },
684 863
       getDictionaryDataConfig(module, filed_name) {
685 864
         return getDictionaryDataConfig(module, filed_name)
686 865
       },

+ 71 - 4
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue Voir le fichier

@@ -3359,7 +3359,7 @@ export default {
3359 3359
           })
3360 3360
         }
3361 3361
       } else if (index == 6) {
3362
-        if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10088 || this.$store.getters.xt_user.org_id == 10278) {
3362
+        if (this.$store.getters.xt_user.org_id == 0 || this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10088 || this.$store.getters.xt_user.org_id == 10278) {
3363 3363
           this.$refs.register9504.show()
3364 3364
         } else {
3365 3365
           this.$refs.register.show(this.doctors, this.department)
@@ -3645,9 +3645,75 @@ export default {
3645 3645
           "admin_user_id":this.$store.getters.xt_user.user.id,
3646 3646
           'his_patient_id': this.hisPatientInfo.id,
3647 3647
         }
3648
-        axios.get('http://127.0.0.1:9532/api/readele', {
3649
-          params: params
3650
-        })
3648
+        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) ){
3649
+          try {
3650
+            //检测当前浏览器是否支持websocket模式
3651
+            window.WebSocket = window.WebSocket || window.MozWebSocket;
3652
+            if (!window.WebSocket){
3653
+              alert("WebSocket not supported by this browser");
3654
+              return;
3655
+            }
3656
+            this.ws = new WebSocket("ws://127.0.0.1:8899");//连接服务器
3657
+            var that = this
3658
+            this.ws.onopen = function(event){
3659
+              that.ws.send("{\"url\":\"http://10.93.33.243:20001/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01301\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"罗佳菊\",\"orgId\":\"H43082200408\"},\"orgId\":\"H43082200408\",\"transType\":\"ec.query\"}}");
3660
+
3661
+            };
3662
+
3663
+            this.ws.onmessage = function(event){
3664
+              // alert("接收到服务器发送的数据:\r\n"+event.data);
3665
+              var newParams =  JSON.parse(event.data)
3666
+              newParams['ecToken'] = newParams.data.ecToken
3667
+              newParams['idNo'] = newParams.data.idNo
3668
+              newParams['userName'] = newParams.data.userName
3669
+              newParams['insuOrg'] = newParams.data.insuOrg
3670
+              newParams['id_card_type'] =  that.form.id_card_type
3671
+              newParams['admin_user_id'] = that.$store.getters.xt_user.user.id
3672
+              newParams['certificates'] = that.form.certificates
3673
+              axios.get('http://127.0.0.1:9532/api/readele', {
3674
+                params: newParams
3675
+              })
3676
+                .then(function(response) {
3677
+                  if (response.data.state == 0) {
3678
+                    that.$message.error(response.data.msg)
3679
+                    return false
3680
+                  } else {
3681
+                    if (response.data.data.failed_code == -10) {
3682
+                      // that.$message.error(response.data.data.msg)
3683
+                      that.$confirm(response.data.data.msg, '医保错误信息', {
3684
+                        confirmButtonText: '确 定',
3685
+                        type: 'warning'
3686
+                      }).then(() => {
3687
+
3688
+                      }).catch(() => {
3689
+                      })
3690
+                    }else{
3691
+                      that.$message({ message: response.data.data.msg, type: 'success', duration: 5000 })
3692
+                    }
3693
+                  }
3694
+                })
3695
+                .catch(function(error) {
3696
+
3697
+                })
3698
+
3699
+
3700
+            };
3701
+            this.ws.onclose = function(event){
3702
+              alert("已经与服务器断开连接\r\n当前连接状态:"+this.readyState);
3703
+            };
3704
+            this.ws.onerror = function(event){
3705
+              if (this.flag!=1)
3706
+                alert("WebSocket接收异常!");
3707
+            };
3708
+          } catch (ex) {
3709
+            alert(ex.message);
3710
+          }
3711
+
3712
+        }else{
3713
+
3714
+          axios.get('http://127.0.0.1:9532/api/readele', {
3715
+            params: params
3716
+          })
3651 3717
             .then(function(response) {
3652 3718
               if (response.data.state == 0) {
3653 3719
                 that.$message.error(response.data.msg)
@@ -3669,6 +3735,7 @@ export default {
3669 3735
             })
3670 3736
             .catch(function(error) {
3671 3737
             })
3738
+        }
3672 3739
       }
3673 3740
     },
3674 3741
      getName(admin_user_id) {