|
@ -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;
|
|
|
}
|