followup-tabs.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var request = getRequest();
  2. var selectedTab = 0;
  3. //设定一个变量,控制其他tab是否可以点击
  4. parent.clickOtherTab = false;
  5. //初始tab的链接
  6. var links = [{
  7. url: 'followup-register.html'+location.search,
  8. name: '随访登记',
  9. class: 'active'
  10. },{
  11. url: 'questionaires.html'+location.search+'&pro_id=1&title=症状',
  12. name: '症状',
  13. class: ''
  14. },{
  15. url: 'questionaires.html'+location.search+'&pro_id=2&title=体征',
  16. name: '体征',
  17. class: '',
  18. },{
  19. url: 'questionaires.html'+location.search+'&pro_id=3&title=实验室检查',
  20. name: '实验室检查',
  21. class: ''
  22. },{
  23. url: 'questionaires.html'+location.search+'&pro_id=4&title=生活方式指导',
  24. name: '生活方式指导',
  25. class: ''
  26. },{
  27. url: 'questionaires.html'+location.search+'&pro_id=5&title=评价',
  28. name: '评价',
  29. class: ''
  30. },{
  31. url: 'drugs.html'+location.search+'&pro_id=6&title=用药情况',
  32. name: '用药情况',
  33. class: ''
  34. },{
  35. url: 'questionaires.html'+location.search+'&pro_id=7&title=控制目标',
  36. name: '控制目标',
  37. class: ''
  38. },{
  39. url: 'questionaires.html'+location.search+'&pro_id=8&title=健康教育',
  40. name: '健康教育',
  41. class: ''
  42. },{
  43. url: 'questionaires.html'+location.search+'&pro_id=9&title=转诊',
  44. name: '转诊',
  45. class: ''
  46. }];
  47. $(function(){
  48. var html = template("fv_tab_tmp", {list: links});
  49. $("#fv_tabs").empty().append(html);
  50. // parent.document.getElementById('fv_main').src = links[0].url;
  51. $("#fv_tabs").on('click', 'a', function(){
  52. var $this = $(this),
  53. $li = $this.parent(),
  54. index = $li.index();
  55. if(parent.clickOtherTab){
  56. $li.siblings().removeClass("active");
  57. $li.addClass("active");
  58. selectedTab = $this.data('index');
  59. // reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx);
  60. var url = links[selectedTab].url;
  61. parent.document.getElementById('fv_main').src = url;
  62. }else{
  63. return false;
  64. }
  65. })
  66. })
  67. parent.goFollowupNextQuestionaire = function(){
  68. selectedTab ++;
  69. $("#fv_tabs a").eq(selectedTab).trigger('click');
  70. }