Ajax两层嵌套限制按钮不能提交

function upZT(ZYLL_ID,ID,XM){
		 bootbox.confirm("确定要归档吗?", function(result) {
		 if(result) {
			 $.ajax({//查询类型
				 url:"<%=basePath%>blck/listLX.do", 
				 type:"post",
				 async : false,
				 cache:false,
				 dataType: 'json',
				 data:{
//						"ZYLL_ID":ZYLL_ID,
						"ID":ID						
				},
				success:function(v){
// 					alert(v.listLX);
                    var s=v.listLX;
                    var ss=["1","3","4","40"];
                    var c=isContained(s,ss);
                    if(c){
            			$.ajax({
        				url:"<%=basePath%>cyll/upZT.do",
        				type:"post",
        				async : false,
        				data:{
        						"ZYLL_ID":ZYLL_ID,
        						"ID":ID						
        				},
        				success:function(v){

        					if(v.result=="1")
        					{
        						alert("首页未保存文件,无法提交操作");
        					}else{												 
        						window.location.href = "<%=basePath%>cyll/up.do?ZYLL_ID="+ZYLL_ID+"&ID="+ID+"&XM="+encodeURI(encodeURI(XM));					
        					}	 
        				       
        			    }
        			});	
                    	
                    }else{
                    	alert("缺失记录单");
                    }
				}
			 });
			 
			 

		 }
		});			
	   }
		
		function isContained (a, b){
		    if(!(a instanceof Array) || !(b instanceof Array)) return false;
		    if(a.length < b.length) return false;
		    var aStr = a.toString();
		    for(var i = 0, len = b.length; i < len; i++){
		      if(aStr.indexOf(b[i]) == -1) return false;
		    }
		    return true;
		  }

 


版权声明:本文为Z865785437029原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。