changeCards.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. if(Request.paytype==2){
  32. vm.dataList=res.data.filter(function(item){
  33. item.cardNo=item.inpCardNo
  34. return item.inpCardNo
  35. })
  36. }
  37. }else{
  38. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  39. }
  40. })
  41. },
  42. //设置默认就诊卡
  43. setDefault:function(id,isDefault){
  44. var vm=this
  45. sendPost("/patient/card/defaultOpe", {id:id,isDefault:isDefault}, "json", "post",function(){
  46. }, function(res){
  47. if(res.status == 200){
  48. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  49. vm.getData()
  50. }else{
  51. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  52. }
  53. })
  54. },
  55. gotoPage:function(id){
  56. if(Request.pre=="paymentList"){ //跳到缴费查询页面
  57. window.location.href='../../payment/html/paymentList.html?id='+id;
  58. }else if(Request.pre=="waitingDoctorList"){ //跳到候诊查询页面
  59. window.location.href='../../informationSearch/html/waitingDoctorList.html?id='+id;
  60. }else if(Request.pre=="payment"){ //跳到候诊查询页面
  61. window.location.href='../../payment/html/payment.html?id='+id+"&paytype="+Request.paytype;
  62. }else{
  63. }
  64. },
  65. //判断是否验证登录通过
  66. checkType:function(){
  67. var vm=this
  68. var timer = setInterval(function(){
  69. if(checktype){
  70. clearInterval(timer);
  71. vm.getData()
  72. }
  73. },10);
  74. },
  75. },
  76. })
  77. })()
  78. function queryInit(){
  79. checktype=true
  80. }