changeCards.js 2.1 KB

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