From 5c828fee58fd8e90a451175471d8268ac24aadf9 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 9 Jul 2018 18:08:54 +0800 Subject: [PATCH] =?UTF-8?q?ajax=E8=B0=83=E7=94=A8tag=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E6=8F=90=E5=87=BA=E4=B8=BA=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/report/list.jsp | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 977e2c269..515d02eeb 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -18,19 +18,9 @@ $("#searchForm")[0].reset(); }); if(!"${bean.reportBusinessType}"){ - $.ajax({ - type:'post', - async:false, - url:'${ctx}/report/ajaxNtcTagReport', - data:{ - "action":$('select[name="action"]').val(), - "reportType":$('input[name="reportType"]:checked').val() - }, - dataType:"html", - success:function(data){ - $("#label").html(data); - } - }); + ajaxGetLabelReport(); + }else if("${bean.reportBusinessType}"=="label_report"){ + ajaxGetLabelReport(); } $("input[name='reportType']").each(function(){ var type='${bean.reportType}'; @@ -45,24 +35,26 @@ var reportBusinessType=$("#reportBusinessType").val(); var reportType=$('input[name="reportType"]:checked').val(); if($(this).data("bussiness")=="label_report"){ - $.ajax({ - type:'post', - async:false, - url:'${ctx}/report/ajaxNtcTagReport', - data:{ - "action":action, - "reportType":reportType - }, - dataType:"html", - success:function(data){ - $("#label").html(data); - } - }); + ajaxGetLabelReport(); } } }); }); - +var ajaxGetLabelReport=function(){ + $.ajax({ + type:'post', + async:false, + url:'${ctx}/report/ajaxNtcTagReport', + data:{ + "action":$('select[name="action"]').val(), + "reportType":$('input[name="reportType"]:checked').val() + }, + dataType:"html", + success:function(data){ + $("#label").html(data); + } + }); +}