| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 | 
							- var Request = GetRequest();
 
- var checktype=false;
 
- (function() {
 
- 	myvue=new Vue({
 
- 		el: "#app",
 
- 		data: {
 
- 			dataList:[],
 
- 			code:"",
 
- 			divClass:"jiuzhen",
 
- 			divName:"就诊"
 
- 		},
 
- 		mounted:function(){
 
- 			var vm = this
 
- 			checkUserAgent();
 
- 			vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
 
- 			vm.checkType()
 
- 		},
 
- 		methods: {
 
- 			//获取列表数据
 
- 			getData:function(){
 
- 				var vm=this
 
- 				var loading = dialog({
 
- 					contentType: 'load',
 
- 					skin: 'bk-popup'
 
- 				});
 
- 				 sendPost("patient/card/getCardList", {patient:vm.code}, "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=res.data
 
- 			        	if(Request.paytype==2){			        		
 
- 			        		vm.dataList=res.data.filter(function(item){
 
- 			        			item.cardNo=item.inpCardNo
 
- 			        			var isInpStatus=item.HospitalizationStatus==0||item.HospitalizationStatus==1    //
 
- 			        			return item.inpCardNo && isInpStatus
 
- 			        		})
 
- 			        		_.each(vm.dataList,function(item){
 
- 			        		    item.divClass="zhuyuan"
 
-                                 item.divName="住院"
 
- 			        		})
 
- 			        		$(document).attr('title','选择住院号');
 
- 			        	}else{
 
- 			        	    vm.dataList=res.data.map(function(item){
 
- 			        	        if(item.type=="1"){
 
-                                     item.divClass="jiuzhen"
 
-                                     item.divName="门诊"			        	            
 
- 			        	        }else{
 
-                                     item.cardNo=item.cardNo.substr(0,1)+"*************"+item.cardNo.substr(item.cardNo.length-4,4)
 
- 			        	            item.divClass="electronic"
 
-                                     item.divName="健康卡"
 
- 			        	        }
 
-                                 return item
 
-                             })
 
-                         }
 
- 			        }else{
 
- 			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
 
- 			        }
 
- 			    })
 
- 			},
 
- 			//设置默认就诊卡
 
- 			setDefault:function(id,isDefault){
 
- 				var vm=this
 
- 				sendPost("/patient/card/defaultOpe", {id:id,isDefault:isDefault}, "json", "post",function(){
 
- 		          }, function(res){
 
- 	                if(res.status == 200){
 
- 	                  dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
 
- 					  vm.getData()
 
- 	                }else{
 
- 	                  dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
 
- 	                }
 
- 	            })				
 
- 			},
 
- 			gotoPage:function(id){
 
- 				if(Request.pre=="paymentList"){   //跳到充值查询页面
 
- 					window.location.href='../../payment/html/paymentList.html?id='+id;
 
- 				}else if(Request.pre=="waitingDoctorList"){   //跳到候诊查询页面
 
- 					window.location.href='../../informationSearch/html/waitingDoctorList.html?id='+id;
 
- 				}else if(Request.pre=="payment"){   //跳到支付页面
 
- 					window.location.href='../../payment/html/payment.html?id='+id+"&paytype="+Request.paytype;
 
- 				}else if(Request.pre=="repayment"){   //跳到缴费结算页面
 
- 					window.location.href='../../payment/html/repayment.html?id='+id;
 
- 				}else{  //默认跳转充值查询页面
 
- 					window.location.href='../../payment/html/paymentList.html?id='+id;
 
- 				}
 
- 			},
 
- 			//判断是否验证登录通过
 
- 			checkType:function(){
 
- 				var vm=this
 
- 				var timer = setInterval(function(){
 
- 					if(checktype){
 
- 						clearInterval(timer);
 
- 						vm.getData()
 
- 					}
 
- 				},10);
 
- 			},
 
- 		},
 
- 	})
 
- })()
 
- function queryInit(){
 
- 	checktype=true
 
- }
 
 
  |