reportList.js 5.2 KB

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