function addcompanyFinalBalance(){ var currentDate = new Date(); var currentYear = date.getFullYear();// 当前年份 var previousMonth = date.getMonth();// 当前上一月份 //==================================================================================== var yearAndTime = $("#companyTime").find("td:last").find("label").text(); var yearindex = yearAndTime.lastIndexOf("年"); var myYear=yearAndTime.substring(0,yearindex); var monthindex=yearAndTime.lastIndexOf("月"); var myMonth=yearAndTime.substring(yearindex+1,monthindex); myMonth= parseInt(myMonth)+1; if (myMonth>=12) { myMonth=1; myYear++; } /*if(myYear>=currentYear&&myMonth>previousMonth){ $.messager.alert("提示","已达到最大期值,无法再增加!","info"); return; }*/ //==================================================================================== var rows =$("#balance").find("tr"); rows.each( function(index,element){ var idvalue=$(element).attr("id"); if(index==0){ var neddAppend=""; $(element).append(neddAppend); }else if(index==rows.length-1){ var neddAppend="0"; $(element).append(neddAppend); }else if(idvalue=='a_1000'){ //noithing }else{ //拿到当前tr 最后一个td 内input 的标识 myflag var index=$(element).find("td:last").find("[myid='closeinfoserialid']").attr("myflag"); var mBankname=$(element).find("td:last").find("[id='gongsitype']").attr("value"); var myFristAddAccountNum=$(element).find("td:last").find("[myFristAddAccountNumId='myFristAddAccountNumId']").attr("value"); var myBalanceSerialIdValue=$(element).find("td:last").find("[mybalanceserialid='mybalanceserialid']").attr("mybalanceserialidvalue"); var myBankNameValue=$(element).find("td:last").find("[mybanknameid='mybanknameid']").attr("mybanknamevalue"); var myAccountNumbValue=$(element).find("td:last").find("[myaccountnumb='accountnumb']").attr("value"); if(typeof(index)=="undefined"){ if(typeof(myAccountNumbValue)=="undefined"){ myAccountNumbValue=myFristAddAccountNum; } var htmlcontent=""; $(element).append(htmlcontent); return; } index=parseInt(index)+1; var htmlcontent=""; $(element).append(htmlcontent); } }); }