From af5aad352a18b2ce26d422a9c9c90007e668a38b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 9 Dec 2020 11:30:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E6=B3=A8bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/CompanyStatementPool/editPuPool.html | 65 ++++++++++++++----- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index e97a16f7d..cb44a615d 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -375,27 +375,60 @@ }); $(".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){ - if(data.status==1){ - layer.msg("" + data.info + ""); - setTimeout(function(){ - window.location.reload(); - },1500); + 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); + }else{ + layer.msg("" + data.info + ""); + return false; + } + } + }); + return; }else{ - layer.msg("" + data.info + ""); + layer.msg("" + 保存数据失败 + ""); return false; } + }, + error: function(xhr,status,msg){ + //alert("状态码"+status+"; "+msg) + layer.msg('玩命加载中..'); + } - }); - }); - var return_data = ""; + }; + $("#form").ajaxSubmit(options); + } + $("#submit").click(function(){ var options = { url:"{:U('editCompanyStatementPool')}", //同action