From b073f3e8cda65ee489b7ef520279a9c3a7533793 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 4 Jan 2021 21:38:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editSpecialPuPool.html | 67 ++++++++++++++----- 1 file changed, 49 insertions(+), 18 deletions(-) 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