waitingDoctorList.js 3.2 KB

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