|  | @ -1,16 +1,96 @@
 | 
	
		
			
				|  |  | var Request = GetRequest();
 | 
	
		
			
				|  |  | var checktype=false;
 | 
	
		
			
				|  |  | var loading = dialog({
 | 
	
		
			
				|  |  | 	contentType: 'load',
 | 
	
		
			
				|  |  | 	skin: 'bk-popup',
 | 
	
		
			
				|  |  | });
 | 
	
		
			
				|  |  | (function() {
 | 
	
		
			
				|  |  | 	new Vue({
 | 
	
		
			
				|  |  | 		el: "#app",
 | 
	
		
			
				|  |  | 		data: {
 | 
	
		
			
				|  |  | 			data:{},
 | 
	
		
			
				|  |  | 			dataList:[],
 | 
	
		
			
				|  |  | 			length:1,
 | 
	
		
			
				|  |  | 			code:"",
 | 
	
		
			
				|  |  | 			TypeList:[{},{type:"jiuzhen",text:"门诊",pretext:"候诊"},{type:"jiancha",text:"检查检验",pretext:"候检"}],
 | 
	
		
			
				|  |  | 		},
 | 
	
		
			
				|  |  | 		mounted: function() {
 | 
	
		
			
				|  |  | 			var vm = this
 | 
	
		
			
				|  |  | 			checkUserAgent();
 | 
	
		
			
				|  |  | 			vm.checkType()
 | 
	
		
			
				|  |  | 			vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
 | 
	
		
			
				|  |  | 		},
 | 
	
		
			
				|  |  | 		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){
 | 
	
		
			
				|  |  | 				 	loading.close();
 | 
	
		
			
				|  |  | 			        if(res.status == 200){ 
 | 
	
		
			
				|  |  | 			        	if(res.data.length>0){			        		
 | 
	
		
			
				|  |  | 							if(Request.id){																
 | 
	
		
			
				|  |  | 				        		vm.data=res.data.filter(function(item){
 | 
	
		
			
				|  |  | 				        			return item.id==Request.id
 | 
	
		
			
				|  |  | 				        		})[0]
 | 
	
		
			
				|  |  | 							}else{								
 | 
	
		
			
				|  |  | 				        		vm.data=res.data.filter(function(item){
 | 
	
		
			
				|  |  | 				        			return item.isDefault==1
 | 
	
		
			
				|  |  | 				        		})[0]
 | 
	
		
			
				|  |  | 				        		if(!vm.data){
 | 
	
		
			
				|  |  | 				        			vm.data=res.data[0]
 | 
	
		
			
				|  |  | 				        		}
 | 
	
		
			
				|  |  | 							}
 | 
	
		
			
				|  |  | //			        		vm.queryList.healthNo=vm.data.cardNo
 | 
	
		
			
				|  |  | //			        		vm.getList()
 | 
	
		
			
				|  |  | 			        	}else{
 | 
	
		
			
				|  |  | 			        		vm.gotoCards()
 | 
	
		
			
				|  |  | 			        	}
 | 
	
		
			
				|  |  | 			        }else{
 | 
	
		
			
				|  |  | 				 	  loading.close();
 | 
	
		
			
				|  |  | 			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
 | 
	
		
			
				|  |  | 			        }
 | 
	
		
			
				|  |  | 			    })
 | 
	
		
			
				|  |  | 			},
 | 
	
		
			
				|  |  | 			//获取列表数据
 | 
	
		
			
				|  |  | 			getList:function(){
 | 
	
		
			
				|  |  | 				var vm=this
 | 
	
		
			
				|  |  | 				 sendPost("third/hy/pay/gerPayOrderList", 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=JSON.parse(res.data)
 | 
	
		
			
				|  |  | 			        	vm.length=vm.dataList.length
 | 
	
		
			
				|  |  | 			        }else{
 | 
	
		
			
				|  |  | 			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
 | 
	
		
			
				|  |  | 			        }
 | 
	
		
			
				|  |  | 			    })
 | 
	
		
			
				|  |  | 			},
 | 
	
		
			
				|  |  | 			//跳转切换就诊卡
 | 
	
		
			
				|  |  | 			changeCards:function(){
 | 
	
		
			
				|  |  | 				window.location.href='../../payment/html/changeCards.html?pre=waitingDoctorList';
 | 
	
		
			
				|  |  | 			},
 | 
	
		
			
				|  |  | 			//判断是否验证登录通过
 | 
	
		
			
				|  |  | 			checkType:function(){
 | 
	
		
			
				|  |  | 				var vm=this
 | 
	
		
			
				|  |  | 				var timer = setInterval(function(){
 | 
	
		
			
				|  |  | 					if(checktype){
 | 
	
		
			
				|  |  | 						clearInterval(timer);
 | 
	
		
			
				|  |  | 						vm.getData()
 | 
	
		
			
				|  |  | 					}
 | 
	
		
			
				|  |  | 				},10);
 | 
	
		
			
				|  |  | 			},
 | 
	
		
			
				|  |  | 		},
 | 
	
		
			
				|  |  | 	})
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | })()
 | 
	
		
			
				|  |  | })()
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | function queryInit(){
 | 
	
		
			
				|  |  | 	checktype=true
 | 
	
		
			
				|  |  | }
 |