changeCards.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. var Request = GetRequest();
  2. var checktype=false;
  3. (function() {
  4. myvue=new Vue({
  5. el: "#app",
  6. data: {
  7. dataList:[],
  8. code:"",
  9. divClass:"jiuzhen",
  10. divName:"就诊"
  11. },
  12. mounted:function(){
  13. var vm = this
  14. checkUserAgent();
  15. vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
  16. vm.checkType()
  17. },
  18. methods: {
  19. //获取列表数据
  20. getData:function(){
  21. var vm=this
  22. var loading = dialog({
  23. contentType: 'load',
  24. skin: 'bk-popup'
  25. });
  26. sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
  27. loading.close();
  28. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  29. }, function(res){
  30. loading.close();
  31. if(res.status == 200){
  32. vm.dataList=res.data
  33. if(Request.paytype==2){
  34. vm.divClass="zhuyuan"
  35. vm.divName="住院"
  36. vm.dataList=res.data.filter(function(item){
  37. item.cardNo=item.inpCardNo
  38. return item.inpCardNo
  39. })
  40. }
  41. }else{
  42. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  43. }
  44. })
  45. },
  46. //设置默认就诊卡
  47. setDefault:function(id,isDefault){
  48. var vm=this
  49. sendPost("/patient/card/defaultOpe", {id:id,isDefault:isDefault}, "json", "post",function(){
  50. }, function(res){
  51. if(res.status == 200){
  52. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  53. vm.getData()
  54. }else{
  55. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  56. }
  57. })
  58. },
  59. gotoPage:function(id){
  60. if(Request.pre=="paymentList"){ //跳到缴费查询页面
  61. window.location.href='../../payment/html/paymentList.html?id='+id;
  62. }else if(Request.pre=="waitingDoctorList"){ //跳到候诊查询页面
  63. window.location.href='../../informationSearch/html/waitingDoctorList.html?id='+id;
  64. }else if(Request.pre=="payment"){ //跳到支付页面
  65. window.location.href='../../payment/html/payment.html?id='+id+"&paytype="+Request.paytype;
  66. }else{ //默认跳转缴费查询页面
  67. window.location.href='../../payment/html/paymentList.html?id='+id;
  68. }
  69. },
  70. //判断是否验证登录通过
  71. checkType:function(){
  72. var vm=this
  73. var timer = setInterval(function(){
  74. if(checktype){
  75. clearInterval(timer);
  76. vm.getData()
  77. }
  78. },10);
  79. },
  80. },
  81. })
  82. })()
  83. function queryInit(){
  84. checktype=true
  85. }