record.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. patientCode:"d2e1e4334485476391300f43ab69f8f7",
  15. activeidx: ""
  16. },
  17. mounted: function() {
  18. var vm = this;
  19. recordAPI.teamInfo({patient:vm.patientCode}).then(function(res){
  20. if(res.status == 200){
  21. var data = res.data,teams = [];
  22. // 是否有签约关系 1:有 0:无 此时jtTeam与ssTeam都没有
  23. if(data.hasSign=="1") {
  24. data.ssTeam && (function() {
  25. var team = data.ssTeam.team;
  26. team.hasSign = data.ssTeam.hasSign; // 医生与患者是否有签约关系
  27. team.isLeader = data.ssTeam.isLeader; // 是否是团队长
  28. teams.push(team)
  29. })();
  30. data.jtTeam && (function() {
  31. var team = data.jtTeam.team;
  32. team.hasSign = data.jtTeam.hasSign; // 医生与患者是否有签约关系
  33. team.isLeader = data.jtTeam.isLeader; // 是否是团队长
  34. teams.push(team)
  35. })();
  36. }
  37. //保存患者的团队信息
  38. vm.teamName = teams[0].name;
  39. window.localStorage.setItem("severPatientTeam",JSON.stringify(teams[0]))
  40. //缓存结束后才触发事件
  41. var query = GetRequest();
  42. vm.activeidx = query.tabIdex || "0"
  43. }else{
  44. toastr.error(res.msg)
  45. }
  46. })
  47. //保存患者code
  48. window.localStorage.setItem("severPatientCode",vm.patientCode)
  49. //获取医生信息
  50. recordAPI.docInfo().then(function(res){
  51. if(res.status == 200){
  52. window.localStorage.setItem("severDocInfo",JSON.stringify(res.data))
  53. }
  54. })
  55. },
  56. methods:{
  57. }
  58. })