new Vue({ el: '#app', data: { isAgent: false, innerTabs: [{title:'咨询',href:'../html/consultation.html'}, {title:'随访',href:'../../followup/html/follow-up.html'}, {title:'代预约',href:'../html/toBeReserved.html'}, {title:'健康指导',href:'../html/guidance.html'}, {title:'健康教育',href:'../html/education.html'}, {title:'统计',href:'../html/census.html'} ], teamName:null, patientCode:"", // patientCode:"ec7572875d27446cb4f067b13a85d72a", activeidx: "" }, mounted: function(){ var vm = this; var Request = GetRequest(); vm.patientCode = Request["patient"] recordAPI.teamInfo({patient:vm.patientCode}).then(function(res){ if(res.status == 200){ var data = res.data,teams = []; // 是否有签约关系 1:有 0:无 此时jtTeam与ssTeam都没有 if(data.hasSign=="1") { data.ssTeam && (function() { var team = data.ssTeam.team; team.hasSign = data.ssTeam.hasSign; // 医生与患者是否有签约关系 team.isLeader = data.ssTeam.isLeader; // 是否是团队长 teams.push(team) })(); data.jtTeam && (function() { var team = data.jtTeam.team; team.hasSign = data.jtTeam.hasSign; // 医生与患者是否有签约关系 team.isLeader = data.jtTeam.isLeader; // 是否是团队长 teams.push(team) })(); //保存患者的团队信息 vm.teamName = teams[0].name; window.localStorage.setItem("severPatientTeam",JSON.stringify(teams[0])) //缓存结束后才触发事件 var query = GetRequest(); vm.activeidx = query.tabIdex || "0" }else if(data.hasSign=="0"){ toastr.warning("与居民无签约关系,无法查看") } }else{ toastr.error(res.msg) } }) //保存患者code window.localStorage.setItem("severPatientCode",vm.patientCode) //获取医生信息 recordAPI.docInfo().then(function(res){ if(res.status == 200){ window.localStorage.setItem("severDocInfo",JSON.stringify(res.data)) } }) }, methods:{ } })