jquery的相关方法:

期次的是季度和月度的,然后文本框的值会改变.
$(function(){
$("#qici").bind('change',function(){
var bno = $("#qici").val();
var ag =<%=ag%> ;
if(bno.substring(4,6)!="03"&&bno.substring(4,6)!="06"&&bno.substring(4,6)!="09"&&bno.substring(4,6)!="12"){
$("option[value='1']").remove();

}else{
if(ag==1){
$("option[value='1']").remove();
$("#fanwei").append('<option value="1" selected>季度</option>');
}else{
$("option[value='1']").remove();
$("#fanwei").append('<option value="1">季度</option>');}
}
});
$("#qici").change();

});

select下拉框:
 <select name="batchNo" size="1" id="qici">
          <c:forEach  var="bls" items="${bls}">
 <option value="${bls}">${bls}</option>
    <c:if test="${bno==bls}">
<script>
          var bno="${bno}";
$("#qici").val(bno);
        </script>
</c:if>
</c:forEach>
</select>

请求别的方法:
function daochu(){
var batchNo=$("#batchno").val();
var analysisGranularity=$("#analysisGranularity").val();
window.location.href="/ecicaap/ccrm/ccrar/riskMgrSystemReportAction.do?method=exportReport&wordBatchNo="+batchNo+"&wordAnalysisGranularity="+analysisGranularity;
}
表单提交:
function daochu2(){
var banchNo=document.getElementById("qici").value;
var analysisGranularity=document.getElementById("fanwei").value;
document.getElementById("form2").action='<%=path%>/ccrm/cca/financeInfluenceAnalyseAction.do?method=outPutCustomerExcel&banch_No='+banchNo+'&analysisGranularity='+analysisGranularity;
document.getElementById("form2").submit();
}
点击按钮调用的ajax的方法:
function queding() {
$("#hideCheck").click();
var squeceno = str.substring(0,str.length-1);
var banchNo=document.getElementById("qici").value;
var analysisGranularity=document.getElementById("fanwei").value;
$.ajax({
type:"POST",
dataType:"text",
url:'<%=path%>/ccrm/cca/financeInfluenceAnalyseAction.do?method=updateFinance',
data:{'squeceno':squeceno,'banchNo':banchNo,'analysisGranularity':analysisGranularity},
cache:false,
async:false,
complete:function(xhr){
if('Y'==xhr.responseText){
document.getElementById("form2").action='<%=path%>/ccrm/cca/financeInfluenceAnalyseAction.do?method=queryFinanceInfluence&banchNo='+banchNo+'&analysisGranularity='+analysisGranularity;
document.getElementById("form2").submit();
}else{
}
}
});
 }
弹出一个网页框:
  function tanchu(customerCode,customerName) {
var bno=document.getElementById("qici").value;
var ag=document.getElementById("fanwei").value;
var name = encodeURI(encodeURI(customerName));
url = '<%=path%>/ccrm/cca/customerConcentrationDetailAction.do?method=queryDetail&customerName='+name+'&customerCode='+customerCode+'&analysisGranularity='+ag+'&banchNo='+bno;
window.open(url,"newwindow","height=600, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no");   

一种表单提交:
function query(){
var m=document.getElementById("inmddnumber").value;
if(m==1){
document.getElementById("form1").action="<%=path%>/ccrm/cca/customerConcentrationAnalyseAction.do?method=queryTopTenCustomers";
document.getElementById("form1").submit();
}
if(m==2){
document.getElementById("form1").action="<%=path%>/ccrm/cca/financeInfluenceAnalyseAction.do?method=generateFinanceCustomerReports";
document.getElementById("form1").submit();
}
}


检查时间是否大于当前时间:
// 检查时间是否大于当前时间,是则改为当前日期
function checkCreateTime(time){
// 取出时间框中的日期
var createdTime = $("#"+time).val();
// 当前日期
var a = new Date();
var month = a.getMonth()+1;
if(a.getMonth()<=9){
month="0"+(a.getMonth()+1);
}
var dates = a.getDate();
if(a.getDate()<=9){
dates="0"+a.getDate();
}
var b =a.getFullYear()+ "-"+month+"-"+dates; 
if(createdTime>b){
$("#"+time).val(b);
alert("对不起,你选择的时间大于当前时间");
}
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值