changeCards.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. debugger
  51. if(Request.pre=="paymentList"){ //跳到缴费查询页面
  52. window.location.href='../../payment/html/paymentList.html?id='+id;
  53. }else{
  54. }
  55. },
  56. //判断是否验证登录通过
  57. checkType:function(){
  58. var vm=this
  59. var timer = setInterval(function(){
  60. if(checktype){
  61. clearInterval(timer);
  62. vm.getData()
  63. }
  64. },10);
  65. },
  66. },
  67. })
  68. })()
  69. function queryInit(){
  70. checktype=true
  71. }