waitingDoctorList.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. var Request = GetRequest();
  2. var checktype = false;
  3. var loading = dialog({
  4. contentType: 'load',
  5. skin: 'bk-popup',
  6. });
  7. (function() {
  8. new Vue({
  9. el: "#app",
  10. data: {
  11. data: {},
  12. dataList: [],
  13. length: 0,
  14. code: "",
  15. cardlenght: 0,
  16. TypeList: [{}, {
  17. type: "jiuzhen",
  18. text: "门诊",
  19. pretext: "候诊"
  20. }, {
  21. type: "jiancha",
  22. text: "检查检验",
  23. pretext: "候检"
  24. }],
  25. },
  26. mounted: function() {
  27. var vm = this
  28. checkUserAgent();
  29. vm.checkType()
  30. vm.code = JSON.parse(localStorage.getItem("wlyyAgent")).uid
  31. },
  32. methods: {
  33. //获取就诊卡
  34. getData: function() {
  35. var vm = this
  36. loading.showModal();
  37. sendPost("patient/card/getCardList", {
  38. patient: vm.code
  39. }, "json", "get", function() {
  40. loading.close();
  41. dialog({
  42. contentType: 'tipsbox',
  43. bottom: true,
  44. skin: 'bk-popup',
  45. content: '请求失败'
  46. }).show();
  47. }, function(res) {
  48. loading.close();
  49. if(res.status == 200) {
  50. if(res.data.length > 0) {
  51. vm.cardlenght = res.data.length
  52. if(Request.id) {
  53. vm.data = res.data.filter(function(item) {
  54. return item.id == Request.id
  55. })[0]
  56. } else {
  57. vm.data = res.data.filter(function(item) {
  58. return item.isDefault == 1
  59. })[0]
  60. if(!vm.data) {
  61. vm.data = res.data[0]
  62. }
  63. }
  64. vm.getList()
  65. } else {
  66. dialog({
  67. content: "请先绑定就诊卡,再查看候诊信息!",
  68. okValue: '确定',
  69. ok: function() {
  70. window.location.href = '../../payment/html/patientIDCards.html';
  71. },
  72. // cancelValue: '我再看看',
  73. // cancel: function(){}
  74. }).showModal()
  75. }
  76. } else {
  77. loading.close();
  78. dialog({
  79. contentType: 'tipsbox',
  80. bottom: true,
  81. skin: 'bk-popup',
  82. content: '数据获取失败'
  83. }).show();
  84. }
  85. })
  86. },
  87. //获取列表数据
  88. getList: function() {
  89. var vm = this
  90. sendPost("patient/diag/it", {
  91. cardNo: vm.data.cardNo
  92. }, "json", "get", function() {
  93. loading.close();
  94. dialog({
  95. contentType: 'tipsbox',
  96. bottom: true,
  97. skin: 'bk-popup',
  98. content: '请求失败'
  99. }).show();
  100. }, function(res) {
  101. loading.close();
  102. if(res.status == 200) {
  103. if(res.data.code == "0") {
  104. vm.dataList = res.data.data
  105. vm.length = vm.dataList.length
  106. } else {
  107. dialog({
  108. contentType: 'tipsbox',
  109. bottom: true,
  110. skin: 'bk-popup',
  111. content: res.data.message
  112. }).show();
  113. }
  114. } else {
  115. dialog({
  116. contentType: 'tipsbox',
  117. bottom: true,
  118. skin: 'bk-popup',
  119. content: '数据获取失败'
  120. }).show();
  121. }
  122. })
  123. },
  124. //跳转我的就诊卡页面
  125. gotoCards: function() {
  126. window.location.href = '../../payment/html/patientIDCards.html';
  127. },
  128. //跳转切换就诊卡
  129. changeCards: function() {
  130. window.location.href = '../../payment/html/changeCards.html?pre=waitingDoctorList';
  131. },
  132. //判断是否验证登录通过
  133. checkType: function() {
  134. var vm = this
  135. var timer = setInterval(function() {
  136. if(checktype) {
  137. clearInterval(timer);
  138. vm.getData()
  139. }
  140. }, 10);
  141. },
  142. },
  143. })
  144. })()
  145. function queryInit() {
  146. checktype = true
  147. }