Commit 73addde4 authored by xishifeng's avatar xishifeng

业绩搜索日期限制

parent 14be0b53
......@@ -7,6 +7,7 @@ require(['vue', 'css!style/achieve_temp.css', 'jquery0325', 'common'], function(
token: '',
startDate: '',
endDate: '',
nowDate: backNowDate(),
headerTitle: '',
ywyId: getUrlParam('ywyId'),
userLevel: '',
......@@ -135,8 +136,21 @@ require(['vue', 'css!style/achieve_temp.css', 'jquery0325', 'common'], function(
var _this = this;
_this.resetSomeData(1);
if(type =='today'){
_this.startDate = backNowDate();
_this.endDate = _this.startDate;
_this.endDate = _this.startDate = _this.nowDate;
}else{
var _tempTimeNow = new Date(_this.nowDate).getTime(),
_tempTimeStart = new Date(_this.startDate).getTime(),
_tempTimeEnd = new Date(_this.endDate).getTime();
if(_tempTimeStart > _tempTimeEnd || _tempTimeEnd >= _tempTimeNow){
layer.open({
content: '开始时间不能大于结束时间,且搜索日期需要小于今天。请重新选择日期',
btn: ['确定', '取消'],
yes: function(_index){
layer.close(_index);
}
});
return false;
};
};
sessionStorage.setItem('achieve_search_start_date', _this.startDate);
sessionStorage.setItem('achieve_search_end_date', _this.endDate);
......
......@@ -7,6 +7,7 @@ require(['vue', 'css!style/achieve_tonglian_ac.css', 'jquery0325', 'common'], fu
testBtn: null,
startDate: '',
endDate: '',
nowDate: backNowDate(),
tabsMain: [{
'title': '经纪人',
'token': '',
......@@ -231,11 +232,24 @@ require(['vue', 'css!style/achieve_tonglian_ac.css', 'jquery0325', 'common'], fu
},
search: function(type) {
var _this = this;
_this.resetSomeData(1);
if(type =='today'){
_this.startDate = backNowDate();
_this.endDate = _this.startDate;
_this.endDate = _this.startDate = _this.nowDate;
}else{
var _tempTimeNow = new Date(_this.nowDate).getTime(),
_tempTimeStart = new Date(_this.startDate).getTime(),
_tempTimeEnd = new Date(_this.endDate).getTime();
if(_tempTimeStart > _tempTimeEnd || _tempTimeEnd >= _tempTimeNow){
layer.open({
content: '开始时间不能大于结束时间,且搜索日期需要小于今天。请重新选择日期',
btn: ['确定', '取消'],
yes: function(_index){
layer.close(_index);
}
});
return false;
};
};
_this.resetSomeData(1);
_this.ajaxMainNum(function(){
sessionStorage.setItem('achieve_search_start_date', _this.startDate);
sessionStorage.setItem('achieve_search_end_date', _this.endDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment