123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>扫码下转</title>
- <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
- <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
- <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
- <link rel="stylesheet" type="text/css" href="../css/common.css" />
- <style>
- body{height: auto}
- .c-t-center{text-align: center;}
- .teamGroupImg{}
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <div class="qrcode-wrap">
- <div class="qrcode-inner c-t-center">
- <div>
- <img :src="getTeamPhoto(photo)" class="teamGroupImg" width="60px" height="60px" style="border-radius: 100%"/>
- <div class="c-333 mt20">{{name}}</div>
- </div>
- <div class="mt20">
- <img :src="qrCodeImg" width="250px" height="250px"/>
- </div>
- </div>
- </div>
- </div>
- <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-2.2.4.js"></script>
- <script src="../../../plugins/layer/layer.min.js"></script>
- <script src="../../../plugins/toastr/toastr.min.js"></script>
- <script type="text/javascript" src="../../../plugins/element-ui/element-ui.js"></script>
- <script src="../../../js/bootstrap.min.js"></script>
- <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../api/http-request.js" type="text/javascript"></script>
- <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
- <script type="text/javascript" src="../../../api/recover_api.js"></script>
- <script type="text/javascript">
- var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType
- var httpData=GetRequest()
- var docInfo = JSON.parse(window.localStorage.getItem("wlyyAgent"));
- function showSuccessMessage(msg) {
- layer.msg(msg, {
- icon: 1
- })
- }
-
- function showErrorMessage(msg) {
- layer.msg(msg, {
- icon: 5
- })
- }
-
- function showWarningMessage(msg) {
- layer.msg(msg, {
- icon: 2
- })
- }
-
- function showInfoMessage(msg) {
- layer.msg(msg, {
- icon: 6
- })
- }
- selectVue = new Vue({
- el: "#app",
- data: {
- id: httpData['id'], // 专科团队code
- name: decodeURI(httpData['name']), // 专科团队名称
- photo: httpData['photo'], // 专科团队头像
- qrCodeImg: '',
- is_sign_specialist: false,
- is_sign_my: false,
- signTeamInfo: {}
- },
- mounted: function() {
- var vm = this
- vm.loadSocket()
- vm.createSpecialDoctorQrCode()
- },
- methods: {
- loadSocket:function(){
- var vm =this;
- var imurl = httpRequest.socketUrl;
- jQuery.getScript(imurl+"/socket.io/socket.io.js").done(function() {
- var socket = io.connect(imurl);
- var sessionId = 'system';
- socket.emit('login', {userId: docInfo.uid, password: docInfo.uid,sessionId:sessionId,clientType:"doctor"});
- socket.on('message', function (data) {
- var content=JSON.parse(data.content)
- if(content.teamCode){
- vm.dialogShow(content)
- }else{
- layer.alert('居民签约授权失败,请重新扫描下转二维码或选择手动下转', {icon: 5, title: '授权失败'});
- }
- });
- socket.on('error', function (data) {
- console.log(data);
- });
-
- socket.on('ack', function (data) {
- console.log(data);
- });
- })
- .fail(function() {
- layer.msg('医生实时对话连接失败!',{icon:5});
- });
- },
- dialogShow: function(data){
- var vm = this
- if(data.is_sign){ //已家签,要判断居民是否签约该专医团队
- var text = "请问您是否确认为"+data.patient_name+"患者进行康复下转?"
- var current=layer.confirm(text, {
- btn: ['确定', '取消'],
- title: "提示"
- }, function (index) {
- vm.findPatientTeamList(data)
- layer.close(current); //再执行关闭
- })
- } else {
- var text = data.patient_name+"患者暂未家签,请先提醒居民签约家庭医生"
- var current=layer.confirm(text, {
- btn: ['好, 我知道了', '取消'],
- title: "提示"
- }, function (index) {
- top.addRecoveryDownVue.isSignSpecialist(false)
- layer.close(current); //再执行关闭
- })
- }
- },
- getTeamPhoto: function(photo){
- return httpRequest.getImgUrl(photo);
- },
- //获取团队二维码
- createSpecialDoctorQrCode:function(){
- var vm=this
- var params = {
- doctorCode: docInfo.uid,
- teamName: vm.name,
- teamCode: vm.id,
- };
- rehaAPI.createSpecialDoctorQrCode(params).then(function(res){
- if(res.status == 200) {
- vm.qrCodeImg = res.data
- } else {
- showErrorMessage(res.msg)
- }
- });
- },
- // 获取居民签约的专科团队
- findPatientTeamList: function(data){
- var vm = this,
- params = {
- patient: data.patient_code
- }
- rehaAPI.findPatientTeamList(params).then(function(res){
- if(res.status == 200) {
- var num=0;
- $.each(res.data, function(index,item){
- if(Number(item.teamCode)==Number(vm.id)){ //签约团队与二维码团队一致
- num++
- vm.signTeamInfo = item
- }
-
- })
- if(num>0){//签约团队与二维码团队一致
- if(vm.signTeamInfo&&vm.signTeamInfo.doctor != docInfo.uid){
- vm.is_sign_specialist = true
- vm.is_sign_my = true
- } else {
- var text = vm.signTeamInfo.patientName+"已签约该专科团队【"+vm.signTeamInfo.doctorName+"】医生,请通过原医生创建康复计划"
- layer.alert(text, {icon: 5, title: '提示'});
- vm.is_sign_specialist = true
- vm.is_sign_my = false
- }
- top.addRecoveryDownVue.signSpecialist(vm.is_sign_specialist, vm.is_sign_my, data.patient_code)
- } else {
- vm.createPatientInSpeciaRelation(data)
- }
- } else {
- showErrorMessage(res.msg)
- }
- })
- },
- //居民签约专科医生
- createPatientInSpeciaRelation:function(data){
- var vm = this,
- params = {
- patient: data.patient_code,
- doctor: docInfo.uid,
- patientName: data.patient_name,
- doctorName: docInfo.name,
- teamCode:data.teamCode
- }
- rehaAPI.createPatientInSpeciaRelation({jsonData:JSON.stringify(params)}).then(function(res){
- if(res.status == 200) {
- vm.is_sign_specialist = true
- vm.is_sign_my = true
- top.addRecoveryDownVue.signSpecialist(vm.is_sign_specialist,vm.is_sign_my,data.patient_code)
- } else {
- showErrorMessage(res.msg);
- }
- })
-
- },
- }
- })
- </script>
- </body>
- </html>
|