record.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. new Vue({
  2. el: '#app',
  3. data: {
  4. isAgent: false,
  5. innerTabs: [{title:'咨询',href:'../html/consultation.html'},
  6. {title:'随访',href:'../html/follow-up.html'},
  7. {title:'代预约',href:'../html/toBeReserved.html'},
  8. {title:'健康指导',href:'../html/guidance.html'},
  9. {title:'健康教育',href:'../html/education.html'},
  10. {title:'统计',href:'../html/census.html'}
  11. ],
  12. teamName:null,
  13. patientCode:"ec7572875d27446cb4f067b13a85d72a",
  14. activeidx: ""
  15. },
  16. mounted: function() {
  17. var vm = this;
  18. recordAPI.teamInfo({patient:vm.patientCode}).then(function(res){
  19. if(res.status == 200){
  20. var data = res.data,teams = [];
  21. // 是否有签约关系 1:有 0:无 此时jtTeam与ssTeam都没有
  22. if(data.hasSign=="1") {
  23. data.ssTeam && (function() {
  24. var team = data.ssTeam.team;
  25. team.hasSign = data.ssTeam.hasSign; // 医生与患者是否有签约关系
  26. team.isLeader = data.ssTeam.isLeader; // 是否是团队长
  27. teams.push(team)
  28. })();
  29. data.jtTeam && (function() {
  30. var team = data.jtTeam.team;
  31. team.hasSign = data.jtTeam.hasSign; // 医生与患者是否有签约关系
  32. team.isLeader = data.jtTeam.isLeader; // 是否是团队长
  33. teams.push(team)
  34. })();
  35. }
  36. //保存患者的团队信息
  37. vm.teamName = teams[0].name;
  38. window.localStorage.setItem("severPatientTeam",JSON.stringify(teams[0]))
  39. //保存患者code
  40. window.localStorage.setItem("severPatientCode",vm.patientCode)
  41. }else{
  42. toastr.Error("获取团队信息失败")
  43. }
  44. })
  45. var query = GetRequest();
  46. this.activeidx = query.tabIdex || "0"
  47. },
  48. methods:{
  49. }
  50. })