changeCards.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. $(document).attr('title','选择住院号');
  41. }
  42. }else{
  43. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  44. }
  45. })
  46. },
  47. //设置默认就诊卡
  48. setDefault:function(id,isDefault){
  49. var vm=this
  50. sendPost("/patient/card/defaultOpe", {id:id,isDefault:isDefault}, "json", "post",function(){
  51. }, function(res){
  52. if(res.status == 200){
  53. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  54. vm.getData()
  55. }else{
  56. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  57. }
  58. })
  59. },
  60. gotoPage:function(id){
  61. if(Request.pre=="paymentList"){ //跳到缴费查询页面
  62. window.location.href='../../payment/html/paymentList.html?id='+id;
  63. }else if(Request.pre=="waitingDoctorList"){ //跳到候诊查询页面
  64. window.location.href='../../informationSearch/html/waitingDoctorList.html?id='+id;
  65. }else if(Request.pre=="payment"){ //跳到支付页面
  66. window.location.href='../../payment/html/payment.html?id='+id+"&paytype="+Request.paytype;
  67. }else{ //默认跳转缴费查询页面
  68. window.location.href='../../payment/html/paymentList.html?id='+id;
  69. }
  70. },
  71. //判断是否验证登录通过
  72. checkType:function(){
  73. var vm=this
  74. var timer = setInterval(function(){
  75. if(checktype){
  76. clearInterval(timer);
  77. vm.getData()
  78. }
  79. },10);
  80. },
  81. },
  82. })
  83. })()
  84. function queryInit(){
  85. checktype=true
  86. }