waitingDoctorList.js 3.6 KB

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