chenyue 6 years ago
parent
commit
46b9321c60
2 changed files with 123 additions and 87 deletions
  1. 113 77
      html/informationSearch/js/waitingDoctorList.js
  2. 10 10
      html/payment/js/paymentList.js

+ 113 - 77
html/informationSearch/js/waitingDoctorList.js

@ -1,5 +1,5 @@
var Request = GetRequest();
var checktype=false;
var checktype = false;
var loading = dialog({
	contentType: 'load',
	skin: 'bk-popup',
@ -8,106 +8,142 @@ var loading = dialog({
	new Vue({
		el: "#app",
		data: {
			data:{},
			dataList:[],
			length:0,
			code:"",
			cardlenght:0,
			TypeList:[{},{type:"jiuzhen",text:"门诊",pretext:"候诊"},{type:"jiancha",text:"检查检验",pretext:"候检"}],
			data: {},
			dataList: [],
			length: 0,
			code: "",
			cardlenght: 0,
			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
			vm.code = JSON.parse(localStorage.getItem("wlyyAgent")).uid
		},
		methods: {
			//获取就诊卡
			getData:function(){
				var vm=this
			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){
			        		vm.cardlenght=res.data.length			        		
							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]
				        		}
				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) {
							vm.cardlenght = res.data.length
							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.getList()
			        	}else{
			        		vm.gotoCards()
			        	}
			        }else{
				 	  loading.close();
			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
			        }
			    })
							vm.getList()
						} else {
							dialog({
								content: "请先绑定就诊卡,再查看候诊信息!",
								okValue: '确定',
								ok: function() {
									window.location.href = '../../payment/html/patientIDCards.html';
								},
								//						            cancelValue: '我再看看',
								//						            cancel: function(){}
							}).showModal()
						}
					} else {
						loading.close();
						dialog({
							contentType: 'tipsbox',
							bottom: true,
							skin: 'bk-popup',
							content: '数据获取失败'
						}).show();
					}
				})
			},
			//获取列表数据
			getList:function(){
				var vm=this
				 sendPost("patient/diag/waitVisit", {cardNo:vm.data.cardNo}, "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.code=="0"){
			        		vm.dataList=res.data.data
			        		vm.length=vm.dataList.length
			        	}else{
			        		 dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.data.message}).show();
			        	}
			        }else{
			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
			        }
			    })
			getList: function() {
				var vm = this
				sendPost("patient/diag/waitVisit", {
					cardNo: vm.data.cardNo
				}, "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.code == "0") {
							vm.dataList = res.data.data
							vm.length = vm.dataList.length
						} else {
							dialog({
								contentType: 'tipsbox',
								bottom: true,
								skin: 'bk-popup',
								content: res.data.message
							}).show();
						}
					} else {
						dialog({
							contentType: 'tipsbox',
							bottom: true,
							skin: 'bk-popup',
							content: '数据获取失败'
						}).show();
					}
				})
			},
			//跳转我的就诊卡页面
			gotoCards:function(){
				dialog({
		            content: "请先绑定就诊卡,再查看候诊信息!", 
		            okValue: '确定',
		            ok: function(){
						window.location.href='../../payment/html/patientIDCards.html';
		            },
//						            cancelValue: '我再看看',
//						            cancel: function(){}
		        }).showModal()
			gotoCards: function() {
				window.location.href = '../../payment/html/patientIDCards.html';
			},
			//跳转切换就诊卡
			changeCards:function(){
				window.location.href='../../payment/html/changeCards.html?pre=waitingDoctorList';				
			changeCards: function() {
				window.location.href = '../../payment/html/changeCards.html?pre=waitingDoctorList';
			},
			//判断是否验证登录通过
			checkType:function(){
				var vm=this
				var timer = setInterval(function(){
					if(checktype){
			checkType: function() {
				var vm = this
				var timer = setInterval(function() {
					if(checktype) {
						clearInterval(timer);
						vm.getData()
					}
				},10);
				}, 10);
			},
		},
	})
})()
function queryInit(){
	checktype=true
}
function queryInit() {
	checktype = true
}

+ 10 - 10
html/payment/js/paymentList.js

@ -86,7 +86,15 @@ var iscrollState='';//判断滑动方向
			        		vm.queryList.healthNo=vm.data.cardNo
			        		vm.getList()
			        	}else{
			        		vm.gotoCards()
			        		dialog({
					            content: "请先绑定就诊卡,再查看就诊缴费信息!", 
					            okValue: '确定',
					            ok: function(){
									window.location.href='../../payment/html/patientIDCards.html';
					            },
			//						            cancelValue: '我再看看',
			//						            cancel: function(){}
					        }).showModal()
			        	}
			        }else{
				 	  loading.close();
@ -139,15 +147,7 @@ var iscrollState='';//判断滑动方向
			},
			//跳转我的就诊卡页面
			gotoCards:function(){
				dialog({
		            content: "请先绑定就诊卡,再查看就诊缴费信息!", 
		            okValue: '确定',
		            ok: function(){
						window.location.href='../../payment/html/patientIDCards.html';
		            },
//						            cancelValue: '我再看看',
//						            cancel: function(){}
		        }).showModal()
				window.location.href='../../payment/html/patientIDCards.html';
			},
			//判断是否验证登录通过
			checkType:function(){