//重置按钮
function doSubmit(){
	$("#claimNo").val("");
	$("#pid").val("");
	$("#startDate").val('');
	$("#endDate").val('');
	$("#status").val("");
}


//查询核查清单
function queryProofreadList(){
	var startDate = $("#startDate").val();
	var endDate = $("#endDate").val();
	
	if((startDate != null && endDate == null  ) || (startDate != '' && endDate == '')){
		alert('结束日期不能为空');
		return false;
	}
	
	if((startDate == null && endDate != null  ) || (startDate == '' && endDate != '')){
		alert('开始日期不能为空');
		return false;
	}
	
	if(startDate > endDate){
		alert('结束日期不能小于开始日期');
		return false;
	}
	var url = getRootPath() + "/claimChecklist/queryClaimChecklist.do";
	document.forms["form"].action = url;
	document.forms["form"].submit();
}

//导出
function exportExcel(){
	var url = getRootPath() + "/claimChecklist/exportClaimChecklist.do";
	document.forms["form"].action = url;
	document.forms["form"].submit();
}

//翻页
function cur_skip(s,e){
	
	var pn = $(e).find("span").html();
	var claimNo = $("#claimNo").val();
	var pid = $("#pid").val();
	var proofreadDate = $("#proofreadDate").val();
	var status = $("#status").val();
	
	if(s=="1"){
		SkipByPost("queryClaimChecklist.do", {
			pageNo : pn,
			claimNo : claimNo,
			pid : pid,
			proofreadDate : proofreadDate,
			status : status
			
		});
	}
	else if(s=="2"){
		SkipByPost("queryClaimChecklist.do",{pageNo:pn});
	}
	$(".turn_cur").removeAttr("class");
	$(e).find("span").attr("class","turn_cur");
}

//前一页
function pre(s,e){
	var cur = $("#nav").find(".turn_cur").html();
	var claimNo = $("#claimNo").val();
	var pid = $("#pid").val();
	var proofreadDate = $("#proofreadDate").val();
	var status = $("#status").val();
	
	if(cur==1){
		return;
	}		
	if(cur>1){
	var pre = Number(cur)-Number(1);
	if(s=="1"){
		SkipByPost("queryClaimChecklist.do", {
			
			pageNo : pre,
			claimNo : claimNo,
			pid : pid,
			proofreadDate : proofreadDate,
			status : status
			
		});
	}
		else if(s=="2"){
		SkipByPost("queryClaimChecklist.do",{pageNo:pre});
		}
	}
}
//下一页

function next(s,e){
	var cur = $("#nav").find(".turn_cur").html();
	var next = Number(cur)+Number(1);
	var maxPage = $("#max").val();
	var claimNo = $("#claimNo").val();
	var pid = $("#pid").val();
	var proofreadDate = $("#proofreadDate").val();
	var status = $("#status").val();
	
	
	if(parseInt(cur)==parseInt(maxPage)){			
		return;
	}
	
	if(parseInt(cur)<parseInt(maxPage)){
		if(s=="1"){
			SkipByPost("queryClaimChecklist.do",{
				pageNo:next,
				claimNo : claimNo,
				pid : pid,
				proofreadDate : proofreadDate,
				status : status

				});
			}
			else if(s=="2"){
			SkipByPost("queryClaimChecklist.do",{pageNo:next});
			}
	}
}

//跳转至
function custom(s){		
	
	var maxPage = $("#max").val();
	var pn = $.trim($("#turn_inp").val());
	var claimNo = $("#claimNo").val();
	var pid = $("#pid").val();
	var proofreadDate = $("#proofreadDate").val();
	var status = $("#status").val(); 
	
	if(isNaN(pn)){
		return ;
	}
	if(pn == "") {
		return;
	}
	if(Number(pn)==0){
		return;
	}	
	if(Number(pn) > Number(maxPage)){
		return;
	}	
	if(s=="1"){
		SkipByPost("queryClaimChecklist.do",{
			pageNo:Number(pn),
			claimNo : claimNo,
			pid : pid,
			proofreadDate : proofreadDate,
			status : status
			});
		}
		else if(s=="2"){
		SkipByPost("queryClaimChecklist.do",{pageNo:Number(pn)});
		}
}