//循环复制
$(".forExecute").click(function(){
var tableSign = $("#tableSign").val();
if(!(tableSign > 0)){
layer.msg("请选择要复制的数据");
return;
}
var forNum = $("#forNum").val();
for(var i = 1; i <= forNum; i++){
var data = {
"tableSign":tableSign,
"pageNo":i,
"pageSize":$(".pageSize").val(),
"startDate":$(".startDate").val()
};
setTimeout(executeDataCopy(data),5000);
}
})
function executeDataCopy(data){
$.ajax({
type: "get",
url: "executeCopyData.do",
data:data,
dataType: 'json',
success: function(data){
if(data != null && data.success != null){
layer.alert(data.msg);
} else {
layer.alert("系统繁忙,请稍后再试");
}
}
});
}
这样就可以了