Browse Source

康复计划快速查找优化

linehang 5 years ago
parent
commit
cc235df3d3

+ 3 - 2
api/http-request.js

@ -1,5 +1,5 @@
(function($) {
    var publish_version = true;
    var publish_version = false;
    var isInner = false; //发布线上后有内外网的配置
    var docInfo = "app_storage";
    var agentName = "wlyyAgentForDoc";
@ -31,7 +31,7 @@
//      server = "http://192.168.131.154:8080/"
        articleServer="http://172.26.0.118:9092/wlyy/"
//   server = "http://192.168.131.130:8080/";
//		server = "http://192.168.131.123:8080/"; // 明芬
//		server = "http://192.168.131.118:8080/"; // 明芬
//      server = "http://192.168.131.127:8060/"; //逸祥
//      server = "http://192.168.131.24:8080/"; //仕杰
//		server = "http://192.168.131.143:8080/"; // 志南
@ -41,6 +41,7 @@
        loginUrl = "../../login/login.html";
//      loginUrl = "/PC-prescription/login.html"; //自己本地测试时的路径
        imgServer = "http://172.19.103.54/";
        imgServer = "http://172.26.0.110:8888/";
    }
    var baseInfo = window.localStorage.getItem(docInfo);

+ 37 - 2
app/rehabilitation/html/rehabilitation_management.html

@ -49,6 +49,7 @@
				resize: none;
				line-height: 28px;
			}
			.bgc-2dbe55 {background-color: #2dbe55;}
		</style>
	</head>
@ -151,7 +152,7 @@
						<iframe id="framePage" src="" style="width: 100%;height: 100%;border: 0;"></iframe>
					</div>
					<div class="nav-content-center bgc-fff c-position-r c-h100 div-right ui-col-1" style="margin-left: 460px;" v-show="tabStatus!=3">
						<span style="position: absolute;top: 15px;left: 101px;">
						<span v-if="!isFastSearch" style="position: absolute;top: 15px;left: 101px;">
						<i class="icon icon-prev icon-20" @click="preMonth"></i>
						<span class="currentDay">{{currentDay}}</span>
						<i class="icon icon-next icon-20" @click="nextMonth"></i></span>
@ -159,7 +160,41 @@
							<div class="calendar-descript">
								<span>图例注释: </span><i class="icon icon-blue"></i> <span>专科团队</span>&emsp;<i class="icon icon-green"></i> <span>家医团队</span>&emsp; <i class="icon icon-flag"></i> <span>我的任务</span>
							</div>
							<div class="ui-col-1" style="overflow: hidden; overflow-y: scroll;">
							<!--快速查找-->
							<div class="ui-col-1" style="overflow: hidden; overflow-y: scroll;" v-if="isFastSearch">
								<div class="calendar-days" v-for="searchData1 in searchData">
                                    <div v-for="items in searchData1" class="flex-box clearfix">
                                    	<div class="fl flex-box calendar-day c-fff c-f28 bgc-2dbe55">
                                    		<p class="p0">{{items[0].mounth}}月</p>
                                    	</div>
										<div class="fl calendar-day" v-for="item in items" @click="viewDetail(item.planDetailIds)" :is-future="item.future">
		                                    <span class="day-number">{{item.day}}</span>
		                                    <div class="task-icon">
		                                        <i v-if="item.myTaskFlag" class="icon icon-flag icon-20"></i>
		                                        <i v-if="item.finishFlag" class="icon icon-check"></i>
		                                    </div>
		                                    <div class="coloured-box">
		                                        <span v-if="item.specialist" class="coloured-ribbon coloured-ribbon-blue">专<br />科</span>
		                                        <span v-if="item.family" class="coloured-ribbon coloured-ribbon-green">家<br />医</span>
		                                    </div>
		                                    <div class="progress-box">
		                                        <div class="progress" :style="{opacity:item.specialist?'1':'0'}">
		                                            <span>{{(item.specialist && item.specialist.finish)+'/'+(item.specialist && item.specialist.all)}}</span>
		                                            <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" :style="{width: (item.specialist?(item.specialist.finish/item.specialist.all):0)*100+'%'}"></div>
		                                        </div>
		                                        <div class="progress" :style="{opacity:item.family?'1':'0'}">
		                                            <span>{{(item.family && item.family.finish)+'/'+(item.family && item.family.all)}}</span>
		                                            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" :style="{width: (item.family?(item.family.finish/item.family.all):0)*100+'%'}"></div>
		                                        </div>
		                                        <p v-if="!item.noService" class="mb0 f12" :class="{'visibility-hide':!curTask}" style="line-height: 1;">{{curTaskName || '&emsp;'}}</p>
		                                    </div>
		                                    <p v-if="item.noService" class="no-server">无服务项</p>
		                                </div>
		                            </div>
		                       </div>
							</div>
							<!--无快速查找-->
							<div class="ui-col-1" style="overflow: hidden; overflow-y: scroll;" v-if="!isFastSearch">
							    <div class="calendar-week">
                                    <div class="flex-box text-center">
                                        <div class="flex-box-item">

+ 101 - 24
app/rehabilitation/js/rehabilitation_management.js

@ -13,6 +13,7 @@
			timeAxisData:[],//时间轴数据
			__Data:[],//当前的年月(日历)
			__xData:[],//当前的年月(时间轴)
			isFastSearch: false, // 是否是快速查找任务
			status:null,//任务状态(0未完成,1已完成,2已预约)
			searchTask:null,//快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)
			searchTaskName:null,//快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)
@ -35,7 +36,8 @@
			tabStatus:null,
			planInfo:{},
			docList:[],
			diagnosisInformation: null
			diagnosisInformation: null,
			searchData: [], // 搜索计划安排(去年、今年、明年)
		},
		mounted:function(){
			if(!this.planId){
@ -286,15 +288,46 @@
			  this.monDetail();
			  this.calenderPlanDetail();
			},
			// 日历有计划数据处理
			planHandleData: function(data, day, mounth) {
				var item = data;
				item.day = day;
				if(mounth) {item.mounth = mounth}
				var finishFlag=false
				var sFlag=false;
				var fFlag=false;
				if(item.specialist){
					if(item.specialist.all==item.specialist.finish){
						sFlag=true;
					}
				}else{
					sFlag = true;
				}
				if(item.family){
					if(item.family.all==item.family.finish){
						fFlag = true;
					}
				}else{
					fFlag = true;
				}
				finishFlag = sFlag && fFlag;
				item.finishFlag=finishFlag;
				return item
			},
//						日历请求
			calenderPlanDetail:function(){
				var vm=this;
				var __days=vm.__Data;
				var lastDay=(__days.concat()).pop().day;
				lastDay=lastDay>9?lastDay:'0'+lastDay;
				if(vm.searchTask || vm.status || vm.status == 0) {
					vm.isFastSearch = true
				} else {
					vm.isFastSearch = false
				}
				var params={
					executeStartTime:__days[0].date+'-'+__days[0].day+' 00:00:00',//日历开始时间(格式:yyyy-MM-dd HH:mm:ss)
					executeEndTime:(__days.concat()).pop().date+'-'+lastDay+' 23:59:59',//日历结束时间(格式:yyyy-MM-dd HH:mm:ss)
					executeStartTime: vm.isFastSearch ? '' : __days[0].date+'-'+__days[0].day+' 00:00:00',//日历开始时间(格式:yyyy-MM-dd HH:mm:ss)
					executeEndTime: vm.isFastSearch ? '' : (__days.concat()).pop().date+'-'+lastDay+' 23:59:59',//日历结束时间(格式:yyyy-MM-dd HH:mm:ss)
					planId:vm.planId,//计划id
					searchTask:vm.searchTask,//快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访)
					status:vm.status,//任务状态(0未完成,1已完成,2已预约)
@ -306,6 +339,70 @@
					var list = [];
					if(res.status==200){
						var data=res.data
						// 快速查找
						if(vm.isFastSearch) {
							var searchData0 = [],
								searchData1 = [],
								searchData2 = [];
							for(var setM = 1; setM <= 12; setM++) {
								var _setM = setM > 9 ? setM : '0' + setM,
									_setY = new Date().getFullYear();
								var data0 = [],
									data1 = [],
									data2 = [];
								for(var i in data) {
									var getY = i.split("-")[0],
										getM = i.split("-")[1],
										getD = i.split("-")[2];
									// 去年
									if(_setY - 1 == getY && _setM == getM) {
										var item = vm.planHandleData(data[i], getD, getM)
										data0.push(item)
										data.length && data.splice(i,1);
									} else if(_setY == getY && _setM == getM) { // 今年
										var item = vm.planHandleData(data[i], getD, getM)
										data1.push(item)
										data.length && data.splice(i,1);
									} else if(_setY + 1 == getY && _setM == getM) { // 明年
										var item = vm.planHandleData(data[i], getD, getM)
										data2.push(item)
										data.length && data.splice(i,1);
									}
								}
								if(data0.length) {
									var addlen = (data0.length + 1) % 7 ? (data0.length + 1) % 7 : 7
									for(var i = 0; i < 7 - addlen; i++) {
										data0.push({
											noService:true
										})	
									}
									searchData0.push(data0)
								}
								if(data1.length) {
									var addlen = (data1.length + 1) % 7 ? (data1.length + 1) % 7 : 7
									for(var i = 0; i < 7 - addlen; i++) {
										data1.push({
											noService:true
										})	
									}
									searchData1.push(data1)
								}
								if(data2.length) {
									var addlen = (data2.length + 1) % 7 ? (data2.length + 1) % 7 : 7
									for(var i = 0; i < 7 - addlen; i++) {
										data2.push({
											noService:true
										})	
									}
									searchData2.push(data2)
								}
							}
							if(searchData0.length) {vm.searchData.push(searchData0)}
							if(searchData1.length) {vm.searchData.push(searchData1)}
							if(searchData2.length) {vm.searchData.push(searchData2)}
							return false;
						}
						// 正常日历
						var _currentTimeStamp=+new Date(new Date().setHours(0, 0, 0, 0));
						for(var i in __days){
							var _key=__days[i].date+'-'+(__days[i].day>9?__days[i].day:'0'+__days[i].day);
@ -315,27 +412,7 @@
								};
							for(var j in data){
								if(_key==j){
									item=data[j];
									item.day=__days[i].day;
									var finishFlag=false
									var sFlag=false;
									var fFlag=false;
									if(item.specialist){
										if(item.specialist.all==item.specialist.finish){
											sFlag=true;
										}
									}else{
										sFlag = true;
									}
									if(item.family){
										if(item.family.all==item.family.finish){
											fFlag = true;
										}
									}else{
										fFlag = true;
									}
									finishFlag = sFlag && fFlag;
									item.finishFlag=finishFlag;
									item = vm.planHandleData(data[j], __days[i].day)
									data.length && data.splice(j,1);
									break;
								}