rpt_con630.lview 4.75 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
<?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_con630_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_name" prompt="合同名称"/>
                    <a:column name="search_term_1" prompt="合同号"/>
                    <a:column name="bp_id_tenant" 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':'CON630'},
                    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>