當微回執頁面展現了後
html
var receiptPolicyNum = receiptPolicyListArray.length ; //會逐步減少,小於receiptPolicyListArray時表明 //已處理 function sendSubmit(){ //var submit = true; //是否收到合同 start var dealval=$('input:radio[name="rdoconfirm"]:checked').val(); if(dealval==null){ tipsWindown(...); return false; } //1 沒收到單 if(dealval=="no"){ setPolicySignedFlag(); //該回執的相應處理標誌位,表明處理完該回執 //判斷剩餘數量是否等於全部回執的數量,相等表明是第一張微回執,須要判斷驗證碼 if(receiptPolicyNum==receiptPolicyListArray.length){ if(!setMobileCodeView()){ //驗證碼是否正確 return false; } } tipsWindown(...); //選擇no的提示, 裏面是會促發 noandother() return false; } //2 收到單 if(dealval=="yes"){ setPolicySignedFlag(); /該回執的相應處理標誌位,表明處理完該回執 //判斷剩餘數量是否等於全部回執的數量,相等表明是第一張微回執,須要判斷驗證碼 if(receiptPolicyNum==receiptPolicyListArray.length){ if(!setMobileCodeView()){ return false; } } //減1表明處理完一張回執 receiptPolicyNum = receiptPolicyNum - 1 ; //剩餘數量 //還有跳到下一張 if(receiptPolicyNum>0){ yesAndOther(); } //沒有表明處理完了,能夠提交服務器 if(receiptPolicyNum<=0){ // toUpload(); //提交全部的JsonObject $("#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; } }// end sendsubmit //設置jsonobject是否簽署標誌位 function setPolicySignedFlag(){ var policyNum = $("#policyNoId").text(); var dealval=$('input:radio[name="rdoconfirm"]:checked').val(); for ( p in receiptPolicyListArray) { if(receiptPolicyListArray[p].policyNo.toString() == policyNum){ if(dealval == "yes"){ receiptPolicyListArray[p].isOrNotSigned=1; uploadNum++; } if(dealval == "no"){ receiptPolicyListArray[p].isOrNotSigned=2; } if(dealval == null){ receiptPolicyListArray[p].isOrNotSigned=0; } } } } //全部結果弄成字符串 function uploadData(){ var policyString =""; var customerid = <%=lasId%>; for (var i = receiptPolicyListArray.length-1; i>=0; i--) { if(receiptPolicyListArray[i].isOrNotSigned==1){ // var tempReceiptPolicy=receiptPolicyListArray[i]; policyString +=customerid; 。。。。 policyString +="|"; } } return escape(policyString); //轉義 } function toUpload(){ //var submit = true; var submitNum = 0; var callBackStatus = 0; //只要有一張須要回訪,都回訪 for (var i = receiptPolicyListArray.length-1; i>=0; i--) { if(receiptPolicyListArray[i].isOrNotSigned==1){ submitNum++; //在有回執的前提下 ,才須要回訪 if(receiptPolicyListArray[i].callBackImmde==1){ callBackStatus = 1; //只要有一張須要回訪,都回訪 } } } //submitNum不等於0 if(submitNum!=0){ $.ajax({ type:'post', url:'aa.jsp', data:{"結果字符串":this.uploadData()}, async:false, dataType:"text", timeout : 60000, contentType: "application/x-www-form-urlencoded; charset=utf-8", success:function(data){ var temp=eval(data); var status=temp[0].status; var failSeason=temp[0].failSeason; $("#sub").text("申請成功"); unloadBlockUI(); if(status != '1'){ tipsWindown("失敗提示信息"); }else{ $("#error_msg").html(""); linkurl = "。。。/index.jsp"; //相應處理 if (callBackStatus==1){ if ('N'=='<%=isWorkTime%>') { dealResult("1","Tips1",linkurl); }else { dealResult("1","Tips2",linkurl); } }else{ dealResult("1","Tips3",linkurl); } } }, error:function(data){ alert("error:"+data); } }); // end ajax }else{ //沒有須要處理的回到主頁 window.location.href='。。。listIndex.jsp'; return false; }//end if }