fnd_base_rate_set.lview 6.82 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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
<?xml version="1.0" encoding="UTF-8"?>
<!--
	&author:DJ
	$date:2013/05/08
	$purpose:银行定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="pageLink_rate_detail" url="${/request/@context_path}/modules/fnd/FND251/fnd_base_rate.lview"/>
        <a:link id="pageLink_rateSet_copy" url="${/request/@context_path}/modules/fnd/FND251/fnd_base_rate_set_copy.lview"/>
        <script type="text/javascript"><![CDATA[
        	function rateSetScreen_forward() {
	            history.go(1);
	        }
	        
	        function rateSetScreen_back() {
	            history.go(-1);
	        }
	        
	        function rateSetScreen_quit() {
	            location.href = $('sys_service_welcome_link').getUrl();
	        }
        	
	        function rateSetDs_grid_query() {
	            $('rateSetDs').query();
	        }
	        
	        function rateSetDs_grid_add() {
	            $('rateSetDs_grid').showEditorByRecord($('rateSetDs').create());
	        }
	        
	        function rateSetDs_grid_clear() {
	            $('rateSetDs_grid').clear();
	        }
	        
	        function rateSetDs_grid_save() {
	            var result_ds = $('rateSetDs');
	            if (result_ds.validate()) {
	                result_ds.submit();
	            }
	        }
	        
			function editorFunction_rateSetDs_grid(record,name){
				if(record.isNew){
					if(name=='base_rate_set'){
						return 'rateSetDs_grid_editor_tf_upper';
					}
					else if(name=='currency')
					{
					    return 'rateSetDs_grid_editor_comb';
					}
					else if(name=='valid_from')
					{
					    return 'rateSetDs_grid_editor_dp';
					}
					return '';
				}
				return '';
			}
			
			function winOpen_rate_detail(base_rate_set,currency)
			{
			    new Leaf.Window({
	                id: 'fnd_base_rate',
	                url: $('pageLink_rate_detail').getUrl(),
	                params:{
	                	base_rate_set:base_rate_set,
	                	currency:currency
	                },
	                title: '${l:FND251.LINK.RATE_DETAIL}',
	                width:800,
	                height:400
	            });
			}
			
			function render_rateSetDs_grid(value,record,name){
				if(!record.isNew){
				    var base_rate_set=record.get('base_rate_set');
				    if(name=='rate_detail')
				    {
				        var currency=record.get('currency');
				        if(Ext.isEmpty(currency))
				        {
				            currency='';
				        }
						return '<a href="javascript:winOpen_rate_detail(\'' + base_rate_set + '\',\'' + currency + '\')">${l:FND251.LINK.RATE_DETAIL}</a>';
				    }
				}
			}
			
			function onSubmitSuccess_rateSetDs(ds,res)
			{
			    ds.query(ds.currentPage);
			}
			
			function rateSet_copy()
			{
			    var records=$('rateSetDs').getSelected();
			    if(records.length>1)
			    {
			        Leaf.showMessage('${l:HLS.PROMPT}', '只能选择一条记录');
			        return;
			    }
			    else if(records.length==0)
			    {
			        return;
			    }
			    new Leaf.Window({
	                id: 'fnd_base_rate_set_copy',
	                url: $('pageLink_rateSet_copy').getUrl(),
	                params:{
	                	base_rate_set:records[0].get('base_rate_set')
	                },
	                title: '复制',
	                width:730,
	                height:150
	            });
			}
			
			
		]]></script>
        <a:dataSets>
            <a:dataSet id="rateSetScreen_currencyDs" loadData="true" model="gld.gld_currency_vl"/>
            <a:dataSet id="rateSetScreen_rateTypeDs" loadData="true" model="fnd.FND250.fnd_base_rate_type"/>
            <a:dataSet id="rateSetDs" autoQuery="true" model="fnd.FND251.fnd_base_rate_set" selectable="true">
                <a:fields>
                    <a:field name="valid_from" required="true"/>
                    <a:field name="base_rate_set" required="true"/>
                    <a:field name="base_rate_type" displayField="base_rate_type" options="rateSetScreen_rateTypeDs" required="true" returnField="base_rate_type" valueField="base_rate_type"/>
                    <a:field name="description" required="true"/>
                    <a:field name="currency" displayField="currency_code" options="rateSetScreen_currencyDs" returnField="currency" valueField="currency_code"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="onSubmitSuccess_rateSetDs"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="rateSetScreen_forward" text="HLS.FORWARD"/>
                <a:gridButton click="rateSetScreen_back" text="HLS.BACK"/>
                <a:gridButton click="rateSetScreen_quit" text="HLS.EXIT"/>
                <a:gridButton click="rateSetDs_grid_query" text="HLS.QUERY"/>
                <a:gridButton click="rateSetDs_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="rateSetDs_grid_save" text="HLS.SAVE"/>
                <a:gridButton click="rateSet_copy" text="复制"/>
            </a:screenTopToolbar>
            <a:grid id="rateSetDs_grid" bindTarget="rateSetDs" marginHeight="100" marginWidth="30">
                <a:columns>
                    <a:column name="base_rate_set" editorFunction="editorFunction_rateSetDs_grid" width="150"/>
                    <a:column name="description" editor="rateSetDs_grid_editor_tf" width="250"/>
                    <a:column name="base_rate_type" width="150"/>
                    <a:column name="currency" editorFunction="editorFunction_rateSetDs_grid"/>
                    <a:column name="valid_from" editorFunction="editorFunction_rateSetDs_grid" renderer="Leaf.formatDate" width="120"/>
                    <a:column name="valid_to" renderer="Leaf.formatDate" width="120"/>
                    <a:column name="enabled_flag" align="center" editor="rateSetDs_grid_editor_check" width="100"/>
                    <a:column name="rate_detail" align="center" prompt="FND251.LINK.RATE_DETAIL" renderer="render_rateSetDs_grid"/>
                </a:columns>
                <a:editors>
                    <a:textField id="rateSetDs_grid_editor_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="rateSetDs_grid_editor_tf"/>
                    <a:comboBox id="rateSetDs_grid_editor_comb"/>
                    <a:checkBox id="rateSetDs_grid_editor_check"/>
                    <a:datePicker id="rateSetDs_grid_editor_dp"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>