hls_cashflow_item.lview 7.5 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: cashflowItemScreen
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="v.code=&apos;HLS005_CF_STATUS&apos; and v.code_value=&apos;RELEASE&apos;" model="basic.sys_code_default_value" rootPath="cf_status_default_record"/>
    </a:init-procedure>
    <a:view>
        <a:link id="pageLink_cashflowItemScreen_welcome" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
        
	        function cashflowItemScreen_forward() {
	            history.go(1);
	        }
	        
	        function cashflowItemScreen_back() {
	            history.go(-1);
	        }
	        
	        function cashflowItemScreen_add() {
	            $('cashflowItemDs_grid').showEditorByRecord($('cashflowItemDs').create());
	        }
	        
	        function cashflowItemScreen_clear(){
	            $('cashflowItemDs_grid').clear();
	        }
	        
	        function cashflowItemScreen_query() {
	            $('cashflowItemDs').query();
	        }
	        
	        function cashflowItemScreen_save() {
	            var ds = $('cashflowItemDs');
	            if (ds.validate()) {
	                ds.submit();
	            }
	        }
	        
	        function cashflowItemScreen_quit() {
	            location.href = $('pageLink_cashflowItemScreen_welcome').getUrl();
	            parent.shMenu('show');
	        }
	        
	        function editorFunction_cashflowItemDs_grid(record,name){
			    if(record.isNew){
			        if(name=='cf_item')
			        {
			            return 'cashflowItemDs_grid_nf_integer';
			        }
			        if(name=='cf_type')
			        {
			            return 'cashflowItemDs_grid_lov';
			        }
			        if(name=='cf_direction_desc')
			        {
			            if(record.get('temp_cf_direction')=='MIXED')
			            {
			                return 'cashflowItemDs_grid_cb';
			            }
			            else
			            {
			                return '';
			            }
	                	
			        }
	                
	            }
	            else
	            {
	                return '';
	            }
			}
			
			function validate_cashflowItemDs(record,name,value){
			    if(record.isNew && name=='cf_item')
			    {
			        if(value<=-100 ||value>=100){
			        	return '${l:HLS005.VALIDATOR.CF_ITEM}';
			    	}
			    }
			    return true;
			}
		  
			function onUpdate_cashflowItemDs(dataSet, record, name, value, oldValue)
			{
			    if(name=='cf_type')
			    {
			        if(record.get('temp_cf_direction')=='MIXED')
			        {
			            record.set('cf_direction_desc','');
		            	record.set('cf_direction','');
			        }
			        else
			        {
			            record.set('cf_direction_desc',record.get('temp_cf_direction_desc'));
		            	record.set('cf_direction',record.get('temp_cf_direction'));
			        }
		            
			    }
			}
        ]]></script>
        <a:dataSets>
            <a:dataSet id="nc_cf_item_ds" lookupCode="NC_CF_ITEM"/>
            <a:dataSet id="cf_direction_ds" loadData="true" model="hls.HLS005.hls_cashflow_item_cf_direction"/>
            <a:dataSet id="cashflowItemDs" autoQuery="true" model="hls.HLS005.hls_cashflow_item" pageSize="20" selectable="true">
                <a:fields>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="calc_penalty" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="temp_cf_direction_desc"/>
                    <a:field name="temp_cf_direction"/>
                    <a:field name="cf_type" lovGridHeight="340" lovHeight="500" lovService="hls.HLS005.hls_cashflow_type_v_lov" lovWidth="500" required="true" title="AUT_AUTHORITY_GROUP.AUTHORITY_GROUP">
                        <a:mapping>
                            <a:map from="description" to="cf_type_desc"/>
                            <a:map from="cf_direction_desc" to="temp_cf_direction_desc"/>
                            <a:map from="cf_direction" to="temp_cf_direction"/>
                            <a:map from="cf_type" to="cf_type"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="cf_direction_desc" displayField="code_value_name" options="cf_direction_ds" required="true" returnField="cf_direction" valueField="code_value"/>
                    <a:field name="description" required="true"/>
                    <a:field name="cf_item" required="true"/>
                    <a:field name="ref_v01_n" displayField="code_value_name" options="nc_cf_item_ds" returnField="ref_v01" valueField="code_value"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="onUpdate_cashflowItemDs"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="cashflowItemScreen_back" text="HLS.BACK"/>
                <a:gridButton click="cashflowItemScreen_forward" text="HLS.FORWARD"/>
                <a:gridButton click="cashflowItemScreen_quit" text="HLS.EXIT"/>
                <a:gridButton click="cashflowItemScreen_add" text="HLS.NEW"/>
                <a:gridButton click="cashflowItemScreen_save" text="HLS.SAVE"/>
                <a:gridButton click="cashflowItemScreen_clear" text="HLS.CLEAR"/>
                <a:gridButton click="cashflowItemScreen_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:grid id="cashflowItemDs_grid" autoFocus="true" bindTarget="cashflowItemDs" marginHeight="110" marginWidth="30" navBar="true" style="border:none">
                <a:columns>
                    <a:column name="cf_item" align="right" editor="cashflowItemDs_grid_nf_integer" editorFunction="editorFunction_cashflowItemDs_grid" width="80"/>
                    <a:column name="description" editor="cashflowItemDs_grid_tf" width="150"/>
                    <a:column name="cf_type" align="right" editor="cashflowItemDs_grid_lov" editorFunction="editorFunction_cashflowItemDs_grid" width="80"/>
                    <a:column name="cf_type_desc" width="150"/>
                    <a:column name="cf_direction_desc" editor="cashflowItemDs_grid_cb" editorFunction="editorFunction_cashflowItemDs_grid" width="100"/>
                    <a:column name="write_off_order" align="right" editor="cashflowItemDs_grid_nf_integer"/>
                    <a:column name="calc_penalty" editor="cashflowItemDs_grid_check"/>
                    <a:column name="billing_desc" editor="cashflowItemDs_grid_tf" width="150"/>
                    <a:column name="enabled_flag" editor="cashflowItemDs_grid_check" width="80"/>
                    <!-- <a:column name="ref_v01_n" editor="nc_cf_item_com" prompt="NC现金流量项目" width="200"/> -->
                </a:columns>
                <a:editors>
                    <a:textField id="cashflowItemDs_grid_tf"/>
                    <a:lov id="cashflowItemDs_grid_lov"/>
                    <a:checkBox id="cashflowItemDs_grid_check"/>
                    <a:numberField id="cashflowItemDs_grid_nf_integer" allowDecimals="false"/>
                    <a:comboBox id="cashflowItemDs_grid_cb"/>
                    <a:comboBox id="nc_cf_item_com"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>