From 28c6d5eb9efddc2aa7c603327374dca81063878e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 20 Oct 2020 16:17:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=8F=E9=9A=90=E6=82=A3=E5=AF=BC=E5=87=BA=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=86=85=E5=AD=98=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- safesite/export.py | 4 ++++ safesite/templates/trouble.html | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/safesite/export.py b/safesite/export.py index 69f9800a..58ec0a7a 100644 --- a/safesite/export.py +++ b/safesite/export.py @@ -265,6 +265,10 @@ def exportxlsx(a,objs): row_height = 70 #查询数据 yhobjs = objs.order_by('-troubleid') + if yhobjs.count()>100: + res = HttpResponse() + res.write('数量超过100,请查询后导出!') + return res vl = yhobjs.values('yhnum','fxr__name','yhms','yhzt','fxsj','tbsj','yhlb__dickeyname','yhpg__dickeyname','yhdd','fxbm__partname','yhdj__dickeyname','yhpg__dickeyname', 'jclx__dickeyname','yhlx__dicname','yyfx','zgcs','yhtp','zghtp','zgms','zgbm__partname','zgr__name','zgqx','shr__name','fcr__name') vl=list(vl) diff --git a/safesite/templates/trouble.html b/safesite/templates/trouble.html index 9709d54a..07e74310 100644 --- a/safesite/templates/trouble.html +++ b/safesite/templates/trouble.html @@ -310,7 +310,8 @@ function exportyhexcel() { var querydata = $('#searchyhff').serializeJSON(); let url = 'troublehandle?a=exportexcel&' + parseParams(querydata) - $('
').appendTo('body').submit().remove(); + window.open(url); + // $('
').appendTo('body').submit().remove(); } function delyh() { var row = $('#yhtable').datagrid('getSelected');