record.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. new Vue({
  2. el: '#app',
  3. data: {
  4. isAgent: false,
  5. innerTabs: [{title:'咨询',href:'../html/consultation.html'},
  6. {title:'随访',href:'../../followup/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:"",
  14. // patientCode:"ec7572875d27446cb4f067b13a85d72a",
  15. activeidx: ""
  16. },
  17. mounted: function(){
  18. var vm = this;
  19. var Request = GetRequest();
  20. vm.patientCode = Request["patient"]
  21. recordAPI.teamInfo({patient:vm.patientCode}).then(function(res){
  22. if(res.status == 200){
  23. var data = res.data,teams = [];
  24. // 是否有签约关系 1:有 0:无 此时jtTeam与ssTeam都没有
  25. if(data.hasSign=="1") {
  26. data.ssTeam && (function() {
  27. var team = data.ssTeam.team;
  28. team.hasSign = data.ssTeam.hasSign; // 医生与患者是否有签约关系
  29. team.isLeader = data.ssTeam.isLeader; // 是否是团队长
  30. teams.push(team)
  31. })();
  32. data.jtTeam && (function() {
  33. var team = data.jtTeam.team;
  34. team.hasSign = data.jtTeam.hasSign; // 医生与患者是否有签约关系
  35. team.isLeader = data.jtTeam.isLeader; // 是否是团队长
  36. teams.push(team)
  37. })();
  38. //保存患者的团队信息
  39. vm.teamName = teams[0].name;
  40. window.localStorage.setItem("severPatientTeam",JSON.stringify(teams[0]))
  41. //缓存结束后才触发事件
  42. var query = GetRequest();
  43. vm.activeidx = query.tabIdex || "0"
  44. }else if(data.hasSign=="0"){
  45. toastr.warning("与居民无签约关系,无法查看")
  46. }
  47. }else{
  48. toastr.error(res.msg)
  49. }
  50. })
  51. //保存患者code
  52. window.localStorage.setItem("severPatientCode",vm.patientCode)
  53. //获取医生信息
  54. recordAPI.docInfo().then(function(res){
  55. if(res.status == 200){
  56. window.localStorage.setItem("severDocInfo",JSON.stringify(res.data))
  57. }
  58. })
  59. },
  60. methods:{
  61. }
  62. })