waitingDoctorList.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.data.cardNo="1111"
  50. vm.getList()
  51. }else{
  52. vm.gotoCards()
  53. }
  54. }else{
  55. loading.close();
  56. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  57. }
  58. })
  59. },
  60. //获取列表数据
  61. getList:function(){
  62. var vm=this
  63. sendPost("patient/diag/waitVisit", {cardNo:vm.data.cardNo}, "json", "get",function(){
  64. loading.close();
  65. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  66. }, function(res){
  67. loading.close();
  68. if(res.status == 200){
  69. if(res.data.code=="0"){
  70. vm.dataList=res.data
  71. vm.length=vm.dataList.length
  72. }else{
  73. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.data.message}).show();
  74. }
  75. }else{
  76. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  77. }
  78. })
  79. },
  80. //跳转切换就诊卡
  81. changeCards:function(){
  82. // window.location.href='../../payment/html/changeCards.html?pre=waitingDoctorList';
  83. var vm=this
  84. if(vm.data.cardNo=="1111"){
  85. vm.data.cardNo="2222"
  86. }else{
  87. vm.data.cardNo="1111"
  88. }
  89. vm.getList()
  90. },
  91. //判断是否验证登录通过
  92. checkType:function(){
  93. var vm=this
  94. var timer = setInterval(function(){
  95. if(checktype){
  96. clearInterval(timer);
  97. vm.getData()
  98. }
  99. },10);
  100. },
  101. },
  102. })
  103. })()
  104. function queryInit(){
  105. checktype=true
  106. }