diff --git a/wwwroot/billing.ui b/wwwroot/billing.ui index 43579e9..1700d12 100644 --- a/wwwroot/billing.ui +++ b/wwwroot/billing.ui @@ -61,9 +61,17 @@ "widgettype": "Button", "id": "billing_download_btn", "options": { - "text": "下载Excel", - "css": "display: none; background-color: #52c41a; color: white; padding: 5px 15px; border-radius: 4px; cursor: pointer;" - } + "label": "下载Excel", + "css": "background-color: #52c41a; color: white; padding: 5px 15px; border-radius: 4px; cursor: pointer;" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "script", + "script": "var f=bricks.getWidgetById('billing_form');if(!f)return;var v=f.values||{};if(!v.start_date||!v.end_date){bricks.show_error({title:'提示',message:'请先选择日期范围'});return;}var u='{{download_url}}?start_date='+encodeURIComponent(v.start_date)+'&end_date='+encodeURIComponent(v.end_date);fetch(u,{credentials:'include'}).then(function(r){return r.json()}).then(function(d){if(d.status!=='ok'){bricks.show_error({title:'下载失败',message:d.data.message});return;}var b=atob(d.data.content),n=b.length,arr=new Uint8Array(n);for(var i=0;i= ${start_date}$ and d.acc_date <= ${end_date}$