优化操作时间判断

master
chenzhi 4 years ago
parent 8de452c8f7
commit b9604c162a

@ -30,7 +30,6 @@
height:26px;line-height:26px;font-size:12px; height:26px;line-height:26px;font-size:12px;
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;} .butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;} .butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;} .butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
@ -240,6 +239,15 @@ highlight_subnav("{:U('index')}");
$(function(){ $(function(){
//搜索功能 //搜索功能
$("#search").click(function(){ $("#search").click(function(){
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
var url = $(this).attr('url'); var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize(); var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize(); query += "&"+$('.jssearch').find('select').serialize();

@ -30,7 +30,7 @@
height:26px;line-height:26px;font-size:12px; height:26px;line-height:26px;font-size:12px;
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red} /* .layui-layer-dialog .layui-layer-content{color:red} */
.butnbox {padding:10px 0 10px;} .butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;} .butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;} .butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
@ -283,6 +283,14 @@ highlight_subnav("{:U('index')}");
$(function(){ $(function(){
//搜索功能 //搜索功能
$("#search").click(function(){ $("#search").click(function(){
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
var url = $(this).attr('url'); var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize(); var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize(); query += "&"+$('.jssearch').find('select').serialize();

@ -30,7 +30,6 @@
height:26px;line-height:26px;font-size:12px; height:26px;line-height:26px;font-size:12px;
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;} .butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;} .butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;} .butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
@ -694,7 +693,15 @@
var end = $("#time_end").val(); var end = $("#time_end").val();
if(start !='' && end != ''){ if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){ if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间'); layer.msg('结算开始时间必须小于等于结束时间');
return false;
}
}
var start2 = $("#time_start2").val();
var end2 = $("#time_end2").val();
if(start2 !='' && end2 != ''){
if (Date.parse(start2) > Date.parse(end2)){
layer.msg('操作开始时间必须小于等于结束时间');
return false; return false;
} }
} }

@ -30,7 +30,6 @@
height:26px;line-height:26px;font-size:12px; height:26px;line-height:26px;font-size:12px;
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;} .butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;} .butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;} .butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}

@ -30,7 +30,6 @@
height:26px;line-height:26px;font-size:12px; height:26px;line-height:26px;font-size:12px;
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;} .butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;} .butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;} .butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
@ -592,7 +591,16 @@
var end = $("#time_end").val(); var end = $("#time_end").val();
if(start !='' && end != ''){ if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){ if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间'); layer.msg('结算开始时间必须小于等于结束时间');
return false;
}
}
var start2 = $("#time_start2").val();
var end2 = $("#time_end2").val();
if(start2 !='' && end2 != ''){
if (Date.parse(start2) > Date.parse(end2)){
layer.msg('操作开始时间必须小于等于结束时间');
return false; return false;
} }
} }

Loading…
Cancel
Save