var Request = GetRequest(); var checktype=false; var loading = dialog({ contentType: 'load', skin: 'bk-popup', }); mui.init() var iscrollState='';//判断滑动方向 (function() { var myVue=new Vue({ el: "#app", data: { data:{}, dataList:[], length:1, cardlenght:0, cardId:"", queryList:{ patientCardNo:"", startDate:"", endDate:"" }, code:"", healthType:["","门诊充值","住院充值"], isUPsuccess:true, //上拉锁,搜索成功则释放 }, mounted: function() { var vm = this checkUserAgent(); vm.checkType() vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid vm.queryList.startDate=new Date().getFullYear()+"0101" vm.queryList.endDate=new Date().getFullYear()+"1231" vm.eventClick() var deceleration = mui.os.ios ? 0.003 : 0.0009; mui('.mui-scroll-wrapper').scroll({ bounce: false, indicators: true, //是否显示滚动条 deceleration: deceleration, }); }, methods: { //获取就诊卡 getData:function(){ var vm=this loading.showModal(); sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){ loading.close(); dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show(); }, function(res){ if(res.status == 200){ if(res.data.length>0){ vm.cardlenght=res.data.length if(Request.id){ vm.data=res.data.filter(function(item){ return item.id==Request.id })[0] if(!vm.data){ vm.data=res.data.filter(function(item){ return item.isDefault==1 })[0] } }else{ vm.data=res.data.filter(function(item){ return item.isDefault==1 })[0] } if(!vm.data){ vm.data=res.data[0] } vm.cardId=vm.data.id vm.queryList.patientCardNo=vm.data.cardNo if(vm.data.type=="2"){ vm.data.cardNo=vm.data.cardNo.substr(0,1)+"*******"+vm.data.cardNo.substr(vm.data.cardNo.length-4,4) } vm.getList() }else{ dialog({ content: "请先绑定就诊卡,再查看检验检查报告!", okValue: '确定', ok: function(){ if(Request.origin){ if(Request.origin == "hesuanYuyue"){ window.location.href = '../../hesuanYuyue/html/selPatient.html'; } }else{ window.location.href = '../../payment/html/patientIDCards.html'; } }, }).showModal() } }else{ loading.close(); dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show(); } }) }, //获取列表数据 getList:function(){ var vm=this loading.showModal(); vm.dataList=[] sendPost("third/hy/lie/getWxGetRportList", vm.queryList, "json", "get",function(){ loading.close(); dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show(); }, function(res){ loading.close(); if(res.status == 200){ vm.dataList = _.map(res.data,function(item,index){ var data=item.Table if(data.cdrq&&data.cdrq.indexOf("T")>-1){ data.cdrq=new Date(data.cdrq).Format("yyyy-MM-dd HH:mm:ss") } return data }) vm.dataList=_.sortBy(vm.dataList,function(o){ return -new Date(o.cdrq.replace(/\-/g,'/')).getTime() }) vm.length = vm.dataList.length }else{ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show(); } }) }, //跳转到订单结果页 gotoResult:function(item){ var vm=this window.location.href='../../informationSearch/html/reportInfo.html?yid='+item.yid }, //跳转切换就诊卡 changeCards:function(){ window.location.href='../../payment/html/changeCards.html?pre=reportList'; }, //绑定事件-时间 eventClick:function(){ var vm=this $('.date-icon').mobiscroll({ preset: 'date', dateOrder: 'yy', dateFormat: 'yy', theme: 'ios', lang:'zh', minDate: new Date(2015), maxDate: new Date(), onSelect: function(valueText, inst){ if(vm.queryList.startDate.substr(0,4)!=valueText){ vm.queryList.startDate=valueText+"0101" vm.queryList.endDate=valueText+"1231" vm.getList() } }, }); }, //判断是否验证登录通过 checkType:function(){ var vm=this var timer = setInterval(function(){ if(checktype){ clearInterval(timer); vm.getData() } },10); }, }, }) })() function queryInit(){ checktype=true }