$(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("对不起,你选择的时间大于当前时间");
}
}