<?xml version="1.0" encoding="UTF-8"?> <a:screen xmlns:a="http://www.leaf-framework.org/application"> <a:view> <a:link id="eg_rpt100_submit_link" model="db.cus_rpt_con_dunning_enter_pkg.submit_rpt" modelaction="execute"/> <a:link id="eg_rpt100_get_control_id_link" model="db.rpt_report_control_pkg.checkin_rpt" modelaction="execute"/> <a:link id="eg_rpt100_refresh_link" model="db.rpt_report_control_pkg.refresh_rpt" modelaction="execute"/> <script type="text/javascript"><![CDATA[ function eg_rpt100_status_find(control_id){ Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); Leaf.request({ url: $('eg_rpt100_refresh_link').getUrl(), para: {'control_id':control_id}, success: function(res) { Leaf.Masker.unmask(Ext.getBody()); if (res.result.job_stauts == 'FINISH'){ $('eg_rpt100_result_ds').query(); } eg_rpt100_head_query(); }, failure: function() { Leaf.Masker.unmask(Ext.getBody()); }, error: function() { Leaf.Masker.unmask(Ext.getBody()); }, scope: this }); } function eg_rpt100_query(){ var control_id = $('eg_rpt100_head_ds').getAt(0).get('control_id'); var status = $('eg_rpt100_head_ds').getAt(0).get('status'); if (status == 'FINISH'){ $('eg_rpt100_result_ds').query(); }else{ eg_rpt100_status_find(control_id); } } function eg_rpt100_submit(){ var control_id = $('eg_rpt100_head_ds').getAt(0).get('control_id'); Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); Leaf.request({ url: $('eg_rpt100_submit_link').getUrl(), para: {'control_id':control_id}, success: function(res) { Leaf.Masker.unmask(Ext.getBody()); eg_rpt100_head_query(); }, failure: function() { Leaf.Masker.unmask(Ext.getBody()); }, error: function() { Leaf.Masker.unmask(Ext.getBody()); }, scope: this }); } function eg_rpt100_head_query(){ $('eg_rpt100_head_ds').query(); } ]]></script> <a:dataSets> <a:dataSet id="eg_rpt100_head_ds" model="example.eg_rpt100.rpt_report_control"/> <a:dataSet id="eg_rpt100_result_ds" model="example.eg_rpt100.cus_rpt_con_dunning_enter_o"/> </a:dataSets> <a:screenBody> <a:screenTopToolbar> <a:toolbarButton click="eg_rpt100_query" text="HLS.QUERY"/> <a:toolbarButton click="eg_rpt100_submit" text="计算"/> </a:screenTopToolbar> <a:hBox labelWidth="120"> <a:label name="last_submit_date" bindTarget="eg_rpt100_head_ds" prompt="上次刷新时间" renderer="Leaf.formatDate"/> <a:label name="status" bindTarget="eg_rpt100_head_ds" prompt="状态"/> </a:hBox> <a:grid id="eg_rpt100_result_gd" bindTarget="eg_rpt100_result_ds" marginHeight="200" marginWidth="100" navBar="true"> <a:columns> <a:column name="contract_number" prompt="合同序号"/> <a:column name="search_term_1" prompt="合同号"/> </a:columns> </a:grid> </a:screenBody> <script type="text/javascript"><![CDATA[ Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); Leaf.request({ url: $('eg_rpt100_get_control_id_link').getUrl(), para: {'report_name':'haha_test'}, success: function(res) { Leaf.Masker.unmask(Ext.getBody()); $('eg_rpt100_head_ds').setQueryParameter('control_id',res.result.control_id); $('eg_rpt100_result_ds').setQueryParameter('control_id',res.result.control_id); eg_rpt100_status_find(res.result.control_id); }, failure: function() { Leaf.Masker.unmask(Ext.getBody()); }, error: function() { Leaf.Masker.unmask(Ext.getBody()); }, scope: this }); ]]></script> </a:view> </a:screen>