|
@ -622,15 +622,46 @@ Vue.component('server-items-detail', {
|
|
|
}
|
|
|
rehaAPI.calendarPlanDetailList(params).then(function(res){
|
|
|
if(res.status==200){
|
|
|
var _currentTimeStamp=+new Date(new Date().setHours(0, 0, 0, 0))
|
|
|
vm.timeAxisData=_.map(res.data||{},function(o){
|
|
|
// var _currentTimeStamp=+new Date(new Date().setHours(0, 0, 0, 0))
|
|
|
var list=_.map(res.data||{},function(o){
|
|
|
// var _time=o.executeTime.split(' ');
|
|
|
// var thatTime=+new Date(_time[0]);
|
|
|
// var future=_currentTimeStamp>thatTime?0:(_currentTimeStamp==thatTime?1:2);
|
|
|
// (o.status==0 && _currentTimeStamp>thatTime) && (future=-1)
|
|
|
// var _html=o.status==2?'预':(future==-1?'逾':'');
|
|
|
// _html=future==1?'今':_html;
|
|
|
// if(_html=='预') future=3;
|
|
|
var _time=o.executeTime.split(' ');
|
|
|
var thatTime=+new Date(_time[0]);
|
|
|
var future=_currentTimeStamp>thatTime?0:(_currentTimeStamp==thatTime?1:2);
|
|
|
(o.status==0 && _currentTimeStamp>thatTime) && (future=-1)
|
|
|
var _html=o.status==2?'预':(future==-1?'逾':'');
|
|
|
_html=future==1?'今':_html;
|
|
|
if(_html=='预') future=3;
|
|
|
var _html = ''
|
|
|
var d = new Date(o.execute_time);
|
|
|
if(d.format("yyyy-MM-dd") == new Date().format("yyyy-MM-dd")) {
|
|
|
o.firstSort = '1'
|
|
|
future = 1
|
|
|
_html = '今'
|
|
|
if(o.status) {
|
|
|
o.secondSort = '2'
|
|
|
} else {
|
|
|
o.secondSort = '1'
|
|
|
}
|
|
|
} else if(d > new Date()) {
|
|
|
o.firstSort = '3'
|
|
|
future = 2
|
|
|
if(o.status) {
|
|
|
o.secondSort = '2'
|
|
|
} else {
|
|
|
o.secondSort = '1'
|
|
|
}
|
|
|
} else {
|
|
|
o.firstSort = '2'
|
|
|
future = 0
|
|
|
if(o.status == 0) {
|
|
|
future = -1
|
|
|
_html = '逾'
|
|
|
o.secondSort = '1'
|
|
|
} else {
|
|
|
o.secondSort = '2'
|
|
|
}
|
|
|
}
|
|
|
o.html=_html
|
|
|
o.date=_time[0];
|
|
|
o.time=_time[1];
|
|
@ -639,6 +670,10 @@ Vue.component('server-items-detail', {
|
|
|
o.hospitalName = o.hospital_name
|
|
|
return o;
|
|
|
})||[];
|
|
|
var nowTime = new Date().getTime()
|
|
|
vm.timeAxisData = _.sortBy(list, function(o) {
|
|
|
return o.firstSort + o.secondSort + (nowTime/o.execute_time)
|
|
|
});
|
|
|
} else {
|
|
|
showErrorMessage(res.msg)
|
|
|
}
|
|
@ -654,28 +689,50 @@ Vue.component('server-items-detail', {
|
|
|
pagesize: 10000
|
|
|
}
|
|
|
rehaAPI.selectByPlanDetaiId(params).then(function(res){
|
|
|
if(res.status == 200){
|
|
|
var arr = []
|
|
|
if(res.data.list&&res.data.list.length>0){
|
|
|
var list = res.data.list
|
|
|
var _currentTimeStamp=+new Date(new Date().setHours(0, 0, 0, 0))
|
|
|
console.log('_currentTimeStamp=======', _currentTimeStamp)
|
|
|
arr=_.map(list||[],function(o){
|
|
|
var _time=o.completeTime.split(' ');
|
|
|
var thatTime=+new Date(_time[0]);
|
|
|
var future=_currentTimeStamp>thatTime?0:(_currentTimeStamp==thatTime?1:2);
|
|
|
(o.status==0 && _currentTimeStamp>thatTime) && (future=-1)
|
|
|
var _html=o.status==2?'预':(future==-1?'逾':'');
|
|
|
_html=future==1?'今':_html;
|
|
|
if(_html=='预') future=3;
|
|
|
o.html=_html
|
|
|
o.date=_time[0];
|
|
|
o.time=_time[1];
|
|
|
o.future=future;
|
|
|
return o;
|
|
|
})||[];
|
|
|
}
|
|
|
vm.timeAxisData = arr
|
|
|
if(res.status==200){
|
|
|
var list=_.map(res.data.list||{},function(o){
|
|
|
var _time=o.completeTime.split(' ');
|
|
|
var _html = ''
|
|
|
var d = new Date(o.completeTime);
|
|
|
if(d.format("yyyy-MM-dd") == new Date().format("yyyy-MM-dd")) {
|
|
|
o.firstSort = '1'
|
|
|
future = 1
|
|
|
_html = '今'
|
|
|
if(o.status) {
|
|
|
o.secondSort = '2'
|
|
|
} else {
|
|
|
o.secondSort = '1'
|
|
|
}
|
|
|
} else if(d > new Date()) {
|
|
|
o.firstSort = '3'
|
|
|
future = 2
|
|
|
if(o.status) {
|
|
|
o.secondSort = '2'
|
|
|
} else {
|
|
|
o.secondSort = '1'
|
|
|
}
|
|
|
} else {
|
|
|
o.firstSort = '2'
|
|
|
future = 0
|
|
|
if(o.status == 0) {
|
|
|
future = -1
|
|
|
_html = '逾'
|
|
|
o.secondSort = '1'
|
|
|
} else {
|
|
|
o.secondSort = '2'
|
|
|
}
|
|
|
}
|
|
|
o.html=_html
|
|
|
o.date=_time[0];
|
|
|
o.time=_time[1];
|
|
|
o.future=future;
|
|
|
o.hospitalName = o.hosiptalName
|
|
|
return o;
|
|
|
})||[];
|
|
|
var nowTime = new Date().getTime()
|
|
|
vm.timeAxisData = _.sortBy(list, function(o) {
|
|
|
return o.firstSort + o.secondSort + (nowTime/o.execute_time)
|
|
|
});
|
|
|
} else {
|
|
|
showErrorMessage(res.msg)
|
|
|
}
|