patientIDCards-pay.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. var Request = GetRequest();
  2. var checktype=false;
  3. (function() {
  4. new Vue({
  5. el: "#app",
  6. data: {
  7. dataList:[],
  8. cardId:Request.id,
  9. code:"",
  10. data:{
  11. "id": "",
  12. "patient": "",
  13. "hisId": "",
  14. "cardNo": "",
  15. "name": "",
  16. "idCard": "",
  17. "mobile": "",
  18. "inpCardNo": "",
  19. "isDefault": 0,
  20. "createDate": "",
  21. "cardMoney": "",
  22. "cardInpMoney": null
  23. },
  24. BtnClass:"p-fix-bottom-0",
  25. length:1,
  26. },
  27. mounted:function(){
  28. var vm = this
  29. checkUserAgent();
  30. vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
  31. vm.checkType()
  32. },
  33. methods: {
  34. //获取列表数据
  35. getData:function(){
  36. var vm=this
  37. var loading = dialog({
  38. contentType: 'load',
  39. skin: 'bk-popup'
  40. });
  41. loading.showModal();
  42. sendPost("patient/card/getCardInfo", {id:vm.cardId}, "json", "get",function(){
  43. loading.close();
  44. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  45. }, function(res){
  46. loading.close();
  47. if(res.status == 200){
  48. vm.data=res.data
  49. if(vm.length>0){
  50. vm.$nextTick(function(){
  51. vm.setBtnClass()
  52. });
  53. }
  54. }else{
  55. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  56. }
  57. })
  58. },
  59. //解绑就诊卡
  60. untieCard:function(){
  61. var vm=this
  62. dialog({title:'解绑提示', content:'是否确定解绑就诊卡?',okValue: '确定', ok: function (){vm.setuntieCard();}, cancelValue: '取消',cancel: function () {} }).showModal();
  63. },
  64. setuntieCard:function(){
  65. var vm=this
  66. sendPost("patient/card/unBindCard", {_method:"DELETE",id:vm.cardId}, "json", "post",function(){
  67. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  68. }, function(res){
  69. if(res.status == 200){
  70. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  71. vm.backtoCards()
  72. }else{
  73. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  74. }
  75. })
  76. },
  77. //跳转去支付
  78. gotoPay:function(paytype){ //paytype 1为门诊缴费 2为住院缴费
  79. var vm=this
  80. window.location.href='../../payment/html/payment.html?id='+vm.cardId+'&paytype='+paytype;
  81. },
  82. //跳转去缴费查询列表
  83. gotoList:function(){
  84. var vm=this
  85. window.location.href='../../payment/html/paymentList.html?id='+vm.cardId;
  86. },
  87. //返回我的卡包页面
  88. backtoCards:function(){
  89. setTimeout(function(){
  90. window.location.href='../../payment/html/patientIDCards.html';
  91. },500)
  92. },
  93. //屏幕高度太矮,下方按钮随页面滚动,反之固定底部
  94. setBtnClass:function(){
  95. var vm = this
  96. var screemH=window.screen.availHeight;
  97. var bodyH=document.body.clientHeight;
  98. if(screemH-bodyH<160){
  99. vm.BtnClass="mt20"
  100. }
  101. },
  102. //判断是否验证登录通过
  103. checkType:function(){
  104. var vm=this
  105. var timer = setInterval(function(){
  106. if(checktype){
  107. clearInterval(timer);
  108. vm.getData()
  109. }
  110. },10);
  111. },
  112. },
  113. })
  114. })()
  115. function queryInit(){
  116. checktype=true
  117. }