Xiao_yanpeng 7 anni fa
parent
commit
652e703591

+ 28 - 2
api/http-request.js

@ -1,6 +1,7 @@
(function(exports) {
    var publish_version = false,
	server,
	imgUrlDomain,
	agentName = "wlyyAgentForDoc",
	userInfo = "userInfoForPay",
	userAgent = window.localStorage.getItem(agentName);//获取pcIM缓存
@ -11,12 +12,12 @@
	sendHead.imei = localStorage.getItem('WLYY_IMEI')
	sendHead.platform = 4
	sendHead.token= userObj.token
	console.log(sendHead)
	
    if(publish_version) { //生产环境配置
        server = ""  
    } else { //测试环境配置
        server = "http://172.19.103.88:9092/wlyy/"
        server = "http://172.19.103.88:9092/wlyy/";
        imgUrlDomain = "http://172.19.103.54/";
    }
    function httpGet(url, options) {
@ -58,6 +59,28 @@
                }, options));
        })
    }
    
    /*
	 * 获取图片路径
	 */
	function getImgUrl(str){
		if(typeof str != 'string'){
		    return "";
		}
		if(str.length == 0){
	        return "";
	    }else{
	        if(str.indexOf("../")>-1){
	            //访问本地路径
	            return str;
	        }else if((str.indexOf("http://")>-1) || (str.indexOf("https://")>-1)){
	            return str;
	        }else{
	            //服务器上的图片路径
	            return imgUrlDomain + str;
	        }
	    }
	}
    httpRequest = {
    	server: server,
@ -69,6 +92,9 @@
        },
        post: function(url, options) {
        	return httpPost(url, options)
        },
        getImgUrl:function(url){
        	return getImgUrl(url)
        }
    }
    exports.httpRequest = httpRequest;

+ 5 - 5
api/record-api.js

@ -1,16 +1,16 @@
(function(exports) {
    var recordAPI = {
		//获取团队信息
		//根据患者获取团队信息
		teamInfo: function(data) {
			return httpRequest.post("doctor/admin-teams/team/"+data.uid+"/teams", {})
			return httpRequest.get("doctor/family_contract/patient_doctor_teams", {data: data})
		},
		//获取医生信息
		docInfo:function(data) {
			return httpRequest.post("doctor/baseinfo", {data: data})
		docInfo:function(data){
			return httpRequest.get("doctor/baseinfo", {data: data})
		},
		//获取患者信息
		patientInfo:function(data) {
			return httpRequest.post("doctor/patient_label_info/patient", {data: data})
			return httpRequest.get("doctor/patient_label_info/patient", {data: data})
		},
		//咨询列表
		consultList: function(data) {

+ 4 - 3
app/record/css/consultation.css

@ -1,4 +1,4 @@
.consultation-list{padding: 10px 20px;margin: 0;}
.consultation-list{padding: 10px 20px;margin: 0;overflow: hidden;height: calc(100% - 50px);}
.consultation-list-item{list-style: none;border: 1px solid #d7dce6;margin-top: 17px;min-height: 72px;border-radius: 8px;overflow: hidden;position: relative;}
.con-user-info{padding: 10px 15px;position: relative;overflow: hidden;}
.con-avatar{width: 40px;height: 40px;border-radius: 100%;position: absolute;top: 15px;left: 17px;}
@ -7,9 +7,10 @@
.guidance-status,.con-status{position: absolute;right: 10px;top: -1px;}
.guidance-status:before,.con-status:before{content: '进行中';background: #ff9630;width: 26px;height: 58px;color: #fff;display: inline-block;line-height: 1.2;font-size: 13px;text-align: center;padding: 5px 5px 8px;border-bottom-left-radius: 13px;border-bottom-right-radius: 13px;}
.guidance-status:before{padding-top: 12px;}
.con-status[data-status="2"]:before{content: '已结束';background: #c8c8c8;}
.con-status[data-status="1"]:before{content: '已结束';background: #c8c8c8;}
.guidance-status[data-status="1"]:before{content: "未读";background: #fca701;}
.guidance-status[data-status="2"]:before{content: "已读";background: #12b7f5;}
.start-time{font-weight: 100;font-size: 14px;}
.con-time{margin-left: 20px;}
.user-problem{margin-bottom: 0;font-size: 13px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.user-problem{margin-bottom: 0;font-size: 13px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.pagination{margin: 20px 0px 15px;}

+ 3 - 1
app/record/css/record.css

@ -2,4 +2,6 @@
.service-nav-tabs li a{background: #f5f5fa;border-color:#d7dce6;color: #666666;margin-left: 10px;padding: 8px 20px;}
.service-nav-tabs li.active a{color: #12b7f5;}
.re-title .name{font-size: 18px;font-weight: bold;color: #333;height: 40px;line-height: 40px;display: inline-block;padding: 0px 20px;}
.re-title .select{display: inline-block;       }
.re-title .team{font-size: 14px;color: #333;display: inline-block;}
.no-select{-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select:none}
.re-title{border-bottom:solid 1px #ededed;}

+ 1 - 0
app/record/html/consultation.html

@ -13,6 +13,7 @@
		</div>
		<script type="text/javascript" src="../../../js/vue.js"></script>
		<script type="text/javascript" src="../../../js/jquery-2.2.4.js" ></script>
		<script src="../../../plugins/slimscroll/jquery.slimscroll.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../js/es6-promise.js"></script>
		<script src="../../../api/http-request.js"></script>
		<script src="../../../api/record-api.js"></script>

+ 5 - 8
app/record/html/record.html

@ -3,19 +3,16 @@
	<head>
		<meta charset="UTF-8">
		<title>服务记录</title>
		<link rel="shortcut icon" href="../../../favicon.ico">
		<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css"/>
		<link rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
		<link rel="stylesheet" href="../../record/css/record.css" />
	</head>
	<body>
		<div id="app">
			<div class="re-title">
			<div class="re-title no-select">
				<div class="name">服务记录</div>
				<div class="select">
					<select name="team" class="">
                    	<option value="">所有状态</option>
        			</select>
				</div>
				<div class="team" v-text="teamName"></div>
			</div>
			<inner-tabs :tabs="innerTabs" :activeidx="activeidx"></inner-tabs>
		</div>
@ -25,8 +22,8 @@
		<script src="../../../plugins/toastr/toastr.min.js"></script>
		<script src="../../../js/util.js"></script>
		<script src="../../../api/http-request.js"></script>
		<script src="../../../api/record-api.js"></script>
		<script src="../../../component/record/inner-tabs.js"></script>
		<script src="../js/record-tabs.js"></script>
		
		<script src="../js/record.js"></script>
	</body>
</html>

+ 14 - 7
app/record/js/consultation.js

@ -1,26 +1,30 @@
new Vue({
  el: '#app',
  data: {
  	total:1,//总页数
  	total:20,//总页数
  	currentPage:1,//当前页数
  	list:[]//列表集合
  	list:[],//列表集合
  	patient:null,
  	teamCode:null
  },
  methods:{
  	msgListView: function(page){
  		var vm=this;
  		if(page){
  			vm.currentPage=page;
  			var data = {patientCode:'fca8c658ffda42afa5be91e54e0268c8',
					patient:'fca8c658ffda42afa5be91e54e0268c8',
					teamCode:646,
  			var data = {
					patient:vm.patient,
					teamCode:vm.teamCode,
					page:page,
					pagesize:10}
					pagesize:10
  			}
  			recordAPI.consultList(data).then(function(res){
  				if(res.status==200){ 
						if(res.data.length){  						
  						vm.list=res.data;
  						$(".consultation-list").animate({scrollTop:0},0);//滚回顶部
  					}else{
  							top.toastr.info("啊喔!没有更多内容了");
  						top.toastr.info("没有更多内容了");
  					}
  				}else{
  					top.toastr.error(res.msg);
@ -30,5 +34,8 @@ new Vue({
  	}
  },
  mounted(){
  	this.patient = localStorage.getItem("severPatientCode");
  	this.teamCode = JSON.parse(localStorage.getItem("severPatientTeam")).id;
  	this.msgListView(this.currentPage);
  },
})

+ 0 - 18
app/record/js/record-tabs.js

@ -1,18 +0,0 @@
new Vue({
  el: '#app',
  data: {
  	isAgent: false,
    innerTabs: [{title:'咨询',href:'../html/consultation.html'},
    			{title:'随访',href:'../html/follow-up.html'},
    			{title:'代预约',href:'../html/toBeReserved.html'},
    			{title:'健康指导',href:'../html/guidance.html'},
    			{title:'健康教育',href:'../html/education.html'},
    			{title:'统计',href:'../html/census.html'}
    ],
    activeidx: ""
  },
  mounted: function() {
  	var query = GetRequest();
  	this.activeidx = query.tabIdex || "0"
  }  
})

+ 51 - 0
app/record/js/record.js

@ -0,0 +1,51 @@
new Vue({
  el: '#app',
	data: {
  	isAgent: false,
    innerTabs: [{title:'咨询',href:'../html/consultation.html'},
			{title:'随访',href:'../html/follow-up.html'},
			{title:'代预约',href:'../html/toBeReserved.html'},
			{title:'健康指导',href:'../html/guidance.html'},
			{title:'健康教育',href:'../html/education.html'},
			{title:'统计',href:'../html/census.html'}
    ],
    teamName:null,
    patientCode:"ec7572875d27446cb4f067b13a85d72a",
    activeidx: ""
  },
  mounted: function() {
  	var vm = this;
  	recordAPI.teamInfo({patient:vm.patientCode}).then(function(res){
  		if(res.status == 200){
  			var data = res.data,teams = [];
				 // 是否有签约关系 1:有   0:无 此时jtTeam与ssTeam都没有
				if(data.hasSign=="1") {
					data.ssTeam && (function() {
						var team = data.ssTeam.team;
						team.hasSign = data.ssTeam.hasSign; // 医生与患者是否有签约关系
						team.isLeader = data.ssTeam.isLeader; // 是否是团队长
						teams.push(team)
					})();
					data.jtTeam && (function() {
						var team = data.jtTeam.team;
						team.hasSign = data.jtTeam.hasSign; // 医生与患者是否有签约关系
						team.isLeader = data.jtTeam.isLeader; // 是否是团队长
						teams.push(team)
					})();
				}
				//保存患者的团队信息
				vm.teamName = teams[0].name;
				window.localStorage.setItem("severPatientTeam",JSON.stringify(teams[0]))
				//保存患者code
				window.localStorage.setItem("severPatientCode",vm.patientCode)
  		}else{
  			toastr.Error("获取团队信息失败")
  		}
  	})
  	var query = GetRequest();
  	this.activeidx = query.tabIdex || "0"
  },
  methods:{
  	
  }
})

+ 10 - 5
component/record/consultation-list.js

@ -1,10 +1,10 @@
Vue.component('consultation-list', {
	template: `<ul class="consultation-list">
				<li class="consultation-list-item" @click="viewDetail(1)" v-for="(list,index) in chatList">
					<img class="con-avatar" :src="list.patientPhoto" alt="" onerror="onerror=null;src=\'http://www.yihu.com/v3/images/default-female-doc.jpg\'" />
					<img class="con-avatar" :src="httpRequest.getImgUrl(list.patientPhoto)" alt="" onerror="onerror=null;src=\'../../../images/p-female.png\'" />
					<div class="con-user-info">
						<span class="con-status" :data-status="list.status" desc="1进行2结束"></span>
						<p><span class="con-user-name">{{list.patientName}}</span><span class="small con-time">{{list.czrq}}</span></p>
						<span class="con-status" :data-status="list.status" desc="0进行1结束"></span>
						<p><span class="con-user-name">{{list.patientName}}</span><span class="small con-time">{{list.czrq.substring(0,list.czrq.length-2)}}</span></p>
						<p class="user-problem">咨询问题:{{list.symptoms}}</p>
					</div>
				</li>
@ -21,11 +21,14 @@ Vue.component('consultation-list', {
			top.layer.open({
		      type: 2,
		      maxmin: true,
		      area: ['600px', '360px'],
		      area: ['1000px', '600px'],
		      shadeClose: true,
		      content: 'ddd'
		    });
		}
	},
	computed:{
		
	},
	watch:{
		consultaData:function(val){
@ -33,6 +36,8 @@ Vue.component('consultation-list', {
		}
	},
	mounted: function() {
		this.$emit('init-data', this.curPage);
		var divH = $("#tab-iframe",parent.document).height() - 75;
		$(".consultation-list").slimScroll({ height: divH,color: '#666'});
//		this.$emit('init-data', this.curPage);
	}
})

+ 15 - 17
component/record/inner-tabs.js

@ -1,30 +1,28 @@
Vue.component('inner-tabs', {
	template: '<div>\
				<ul class="nav nav-tabs service-nav-tabs">\
			  		<li v-for="(tab,index) in tabs" role="presentation" :class="{active: (activeidx == index)}">\
			  			<a @click="load(tab, index)">{{tab.title}}</a>\
			  		</li>\
				</ul>\
				<div class="inner-main" style="height: calc(100% - 40px);overflow:hidden;">\
					<iframe :src="url" width="100%" height="500" frameborder="0" seamless style="display: inline"></iframe>\
				</div>\
			</div>',
	template: `<div>
				<ul class="nav nav-tabs service-nav-tabs no-select">
			  		<li v-for="(tab,index) in tabs" role="presentation" :class="{active: (activeidx == index)}">
			  			<a @click="load(tab, index)">{{tab.title}}</a>
			  		</li>
				</ul>
				<div class="inner-main" style="overflow:hidden;">
					<iframe id="tab-iframe" :src="url" width="100%" :height="height" frameborder="0" seamless style="display: inline;"></iframe>
				</div>
			</div>`,
	props: ["tabs","activeidx"],
	data: function() {
		return {
			url: ""
			url: "",
			height:function(){
				var winH = document.documentElement.clientHeight;
				return winH - 104; 
			}(),
		}
	},
	methods: {
		load: function(tab, index) {
//			top.GlobalEventBus.$emit("active-inner-tabs."+this.namespce, tab)
			this.url = tab.href
			this.activeidx = index
		},
		activeTab: function(index) {
//			this.activeidx = index
//			this.url = this.tabs[this.activeidx].href
//			this.load(this.tabs[index], index)
		}
	},
	mounted: function() {

+ 1 - 1
js/util.js

@ -56,4 +56,4 @@ function GetRequest() {
   }
   return theRequest;
}
}