reportList.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. var Request = GetRequest();
  2. var checktype=false;
  3. var loading = dialog({
  4. contentType: 'load',
  5. skin: 'bk-popup',
  6. });
  7. mui.init()
  8. var iscrollState='';//判断滑动方向
  9. (function() {
  10. var myVue=new Vue({
  11. el: "#app",
  12. data: {
  13. data:{},
  14. dataList:[],
  15. length:1,
  16. cardlenght:0,
  17. cardId:"",
  18. queryList:{
  19. patientCardNo:"",
  20. startDate:"",
  21. endDate:""
  22. },
  23. code:"",
  24. healthType:["","门诊充值","住院充值"],
  25. isUPsuccess:true, //上拉锁,搜索成功则释放
  26. },
  27. mounted: function() {
  28. var vm = this
  29. checkUserAgent();
  30. vm.checkType()
  31. vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
  32. vm.queryList.startDate=new Date().getFullYear()+"0101"
  33. vm.queryList.endDate=new Date().getFullYear()+"1231"
  34. vm.eventClick()
  35. var deceleration = mui.os.ios ? 0.003 : 0.0009;
  36. mui('.mui-scroll-wrapper').scroll({
  37. bounce: false,
  38. indicators: true, //是否显示滚动条
  39. deceleration: deceleration,
  40. });
  41. },
  42. methods: {
  43. //获取就诊卡
  44. getData:function(){
  45. var vm=this
  46. loading.showModal();
  47. sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
  48. loading.close();
  49. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  50. }, function(res){
  51. if(res.status == 200){
  52. if(res.data.length>0){
  53. vm.cardlenght=res.data.length
  54. if(Request.id){
  55. vm.data=res.data.filter(function(item){
  56. return item.id==Request.id
  57. })[0]
  58. if(!vm.data){
  59. vm.data=res.data.filter(function(item){
  60. return item.isDefault==1
  61. })[0]
  62. }
  63. }else{
  64. vm.data=res.data.filter(function(item){
  65. return item.isDefault==1
  66. })[0]
  67. }
  68. if(!vm.data){
  69. vm.data=res.data[0]
  70. }
  71. vm.cardId=vm.data.id
  72. vm.queryList.patientCardNo=vm.data.cardNo
  73. if(vm.data.type=="2"){
  74. vm.data.cardNo=vm.data.cardNo.substr(0,1)+"*******"+vm.data.cardNo.substr(vm.data.cardNo.length-4,4)
  75. }
  76. vm.getList()
  77. }else{
  78. dialog({
  79. content: "请先绑定就诊卡,再查看检验检查报告!",
  80. okValue: '确定',
  81. ok: function(){
  82. window.location.href='../../payment/html/patientIDCards.html';
  83. },
  84. }).showModal()
  85. }
  86. }else{
  87. loading.close();
  88. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  89. }
  90. })
  91. },
  92. //获取列表数据
  93. getList:function(){
  94. var vm=this
  95. loading.showModal();
  96. vm.dataList=[]
  97. sendPost("third/hy/lie/getWxGetRportList", vm.queryList, "json", "get",function(){
  98. loading.close();
  99. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  100. }, function(res){
  101. loading.close();
  102. if(res.status == 200){
  103. vm.dataList = _.map(res.data,function(item,index){
  104. var data=item.Table
  105. if(data.cdrq&&data.cdrq.indexOf("T")>-1){
  106. data.cdrq=new Date(data.cdrq).Format("yyyy-MM-dd HH:mm:ss")
  107. }
  108. return data
  109. })
  110. vm.dataList=_.sortBy(vm.dataList,function(o){
  111. return -new Date(o.cdrq).getTime()
  112. })
  113. vm.length = vm.dataList.length
  114. }else{
  115. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  116. }
  117. })
  118. },
  119. //跳转到订单结果页
  120. gotoResult:function(item){
  121. var vm=this
  122. window.location.href='../../informationSearch/html/reportInfo.html?yid='+item.yid
  123. },
  124. //跳转切换就诊卡
  125. changeCards:function(){
  126. window.location.href='../../payment/html/changeCards.html?pre=reportList';
  127. },
  128. //绑定事件-时间
  129. eventClick:function(){
  130. var vm=this
  131. $('.date-icon').mobiscroll({
  132. preset: 'date',
  133. dateOrder: 'yy',
  134. dateFormat: 'yy',
  135. theme: 'ios',
  136. lang:'zh',
  137. minDate: new Date(2015),
  138. maxDate: new Date(),
  139. onSelect: function(valueText, inst){
  140. if(vm.queryList.startDate.substr(0,4)!=valueText){
  141. vm.queryList.startDate=valueText+"0101"
  142. vm.queryList.endDate=valueText+"1231"
  143. vm.getList()
  144. }
  145. },
  146. });
  147. },
  148. //判断是否验证登录通过
  149. checkType:function(){
  150. var vm=this
  151. var timer = setInterval(function(){
  152. if(checktype){
  153. clearInterval(timer);
  154. vm.getData()
  155. }
  156. },10);
  157. },
  158. },
  159. })
  160. })()
  161. function queryInit(){
  162. checktype=true
  163. }