diff --git a/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html b/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html index 6952a47c4..63feb87f7 100644 --- a/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html @@ -375,27 +375,58 @@ }); $(".no_statement").on("click",function(){ - var id = $(this).data('id'); - $.ajax({ - type: "POST", - url: "{:U('cancelStatement')}", - dataType: 'json', - async: false, - data: {id:id}, - success:function(data){ + var id = $(this).data('id'); + saveForm(id); + }); + var return_data = ""; + + function saveForm(id) { + var options = { + url:"{:U('editCompanyStatementPool')}", //同action + type:'post', + beforeSend:function(xhr){ + }, + success:function(data) + { + return_data = data; + }, + + complete:function(data){ + if(return_data.status==1){ + + $.ajax({ + type: "POST", + url: "{:U('cancelStatement')}", + dataType: 'json', + async: false, + data: {id:id}, + success:function(data){ if(data.status==1){ - layer.msg("" + data.info + ""); - setTimeout(function(){ - window.location.reload(); - },1500); + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); }else{ - layer.msg("" + data.info + ""); - return false; + layer.msg("" + data.info + ""); + return false; } - } - }); - }); - var return_data = ""; + } + }); + return; + }else{ + layer.msg("" + 保存数据失败 + ""); + return false; + } + }, + error: function(xhr,status,msg){ + //alert("状态码"+status+"; "+msg) + layer.msg('玩命加载中..'); + + } + }; + $("#form").ajaxSubmit(options); + } + $("#submit").click(function(){ var options = { url:"{:U('editCompanyStatementPool')}", //同action