微回執(4)當處理完一張單後,如何繼續處理其餘單

微回執3裏已經展現了主流程,當用戶處理完一張單後,會繼續問其餘的單服務器

// 是否還有其餘回執
function noAndOther(){
   receiptPolicyNum = receiptPolicyNum - 1 ;    //剩餘數量
   if(receiptPolicyNum>0){ //還有要處理的
        var tempReceiptPolicy = null;
        tempReceiptPolicy = getNextReceiptPolicy();   //將要處理的下一張微回執拿出來
        tipsWindown("提示信息","text3:<center>您名下還有保單待簽收回執,是否須要同時進行簽收</center>");
        //text3是一個控件,會觸發下一張微回執進行初始化
   }else{
        if(uploadNum!=0){
	        $("#windownbg").remove();
		$("#windown-box").fadeOut("slow",function(){$(this).remove();});
		$("#all_top_select").show();
		$(".td_select_center").show();
		$(".td_select_center_four").show();
		$("#changeType").show();
                toUpload();  //上傳服務器
		return false;
        }else{
        	window.location.href='。。。/listIndex.jsp';
		return false;
        }
   }
}


// 是否還有其餘回執IsOrNotOther
function yesAndOther(){
   //剩餘的數量
   if(receiptPolicyNum > 0){ //還有要處理的
        var tempReceiptPolicy = null;
        tempReceiptPolicy = getNextReceiptPolicy();
        tipsWindown("提示信息","text4:<center>您名下還有保單待簽收回執,是否須要同時進行簽收</center>");
   }else{
        //提交
        toUpload();
        $("#windownbg").remove();
		$("#windown-box").fadeOut("slow",function(){$(this).remove();});
		$("#all_top_select").show();
		$(".td_select_center").show();
		$(".td_select_center_four").show();
		$("#changeType").show();
		return false;
		//提交
   }
}

//控件會調用這個函數進行初始化頁面
function toNewPolicy(){
        //重複拿
	var tempReceiptPolicy2 = getNextReceiptPolicy();
	showReceiptPage(tempReceiptPolicy2);
	//close popup window
	$("#windownbg").remove();
	$("#windown-box").fadeOut("slow",function(){$(this).remove();});
	$("#all_top_select").show();
	$(".td_select_center").show();
	$(".td_select_center_four").show();
	$("#changeType").show();
	//back to top
	this.scrollTo(0,0);
}


// 遍歷找出最大的生效日期單
function getNextReceiptPolicy(){
	for (var i = receiptPolicyListArray.length-1; i>=0; i--) {   // 遍歷找出最大的生效日期單
		if(receiptPolicyListArray[i].isOrNotSigned==0){
			var tempReceiptPolicy=receiptPolicyListArray[i];
			return tempReceiptPolicy;
}}}
相關文章
相關標籤/搜索