gld_account_hierarchy.lview 6.98 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangyi2652 $
    $Date: 2010/11/01 01:45:18 $
    $Revision: 1.2 $
    $Purpose: “科目层次定义”模块的页面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:view>
        <a:link id="gld_account_hierarchy_details_link" url="${/request/@context_path}/modules/gld/public/gld_account_hierarchy_details.lview"/>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
            
            function fnd_2150_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
            }
            
            function query_accHierarchyDs() {
                if($('para_accHierarchyDs').validate)
                {
                    $('accHierarchyDs').query();
                }
            }
            
            function reset_para_accHierarchyDs() {
                $('para_accHierarchyDs').reset();
            }
            
            function onUpdate_para_accHierarchyDs(ds, record, name, value) {
                if (name == 'account_set_id') {
                    record.set('account_code_from', null);
                    record.set('account_name_from', null);
                    record.set('account_code_to', null);
                    record.set('account_name_to', null);
            
                    record.getField('account_code_from').setLovPara('account_set_id', record.get('account_set_id'));
                    record.getField('account_code_to').setLovPara('account_set_id', record.get('account_set_id'));
                }
            }
            
            function detailRenderer(value, record, name) {
                if (!record.isNew)
                {
                    return '<a href=\"javascript:winOpen_hierarchDetail(' + record.get('account_set_id') + ',' + value + ')\">${l:GLD_ACCOUNT_HIERARCHY.SUB_ACCOUNT_CODE}</a>';
                }
                return '';
            }
            
            function winOpen_hierarchDetail(account_set_id, account_id) {
                new Leaf.Window({
                    id: 'handleWindow',
                    url: $('gld_account_hierarchy_details_link').getUrl(),
                    params:{
                    	account_set_id:account_set_id,
                    	account_id:account_id
                    },
                    title: '${l:GLD_ACCOUNT_HIERARCHY.SUB_ACCOUNT_CODE}',
                    height: 500,
                    width: 600
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="para_accHierarchyDs" autoCreate="true" model="gld.FND2150.gld_account_hierarchy_query">
                <a:fields>
                    <a:field name="account_set_id"/>
                    <a:field name="account_set_name" prompt="GLD_ACCOUNT_SETS.ACCOUNT_SET_DESC" readonly="true"/>
                    <a:field name="account_set_code" lovGridHeight="300" lovHeight="450" lovService="gld.FND2150.gld_account_set_lov" lovWidth="500" prompt="GLD_ACCOUNT_SETS.ACCOUNT_CODE" required="true" title="GLD_ACCOUNT_SETS.ACCOUNT_CODE">
                        <a:mapping>
                            <a:map from="account_set_id" to="account_set_id"/>
                            <a:map from="account_set_code" to="account_set_code"/>
                            <a:map from="account_set_name" to="account_set_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="account_name_from" prompt="FND_CALENDAR.DESCRIPTION" readonly="true"/>
                    <a:field name="account_code_from" lovGridHeight="300" lovHeight="450" lovService="gld.FND2140.gld_accounts_vl_lov" lovWidth="550" prompt="GLD_ACCOUNT_SETS.ACCOUNT_CODE_FROM" title="GLD_ACCOUNT_SETS.ACCOUNT_CODE_FROM">
                        <a:mapping>
                            <a:map from="account_code" to="account_code_from"/>
                            <a:map from="description" to="account_name_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="account_name_to" prompt="FND_CALENDAR.DESCRIPTION" readonly="true"/>
                    <a:field name="account_code_to" lovGridHeight="300" lovHeight="450" lovService="gld.FND2140.gld_accounts_vl_lov" lovWidth="550" prompt="GLD_ACCOUNT_SETS.ACCOUNT_CODE_TO" title="GLD_ACCOUNT_SETS.ACCOUNT_CODE_TO">
                        <a:mapping>
                            <a:map from="account_code" to="account_code_to"/>
                            <a:map from="description" to="account_name_to"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="onUpdate_para_accHierarchyDs"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="accHierarchyDs" autoCount="true" autoPageSize="true" fetchAll="false" model="gld.FND2150.gld_account_hierarchy_query" queryDataSet="para_accHierarchyDs" queryUrl="${/request/@context_path}/autocrud/gld.FND2150.gld_account_hierarchy_query/query"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="fnd_2150_quit" text="HLS.EXIT"/>
                <a:gridButton click="query_accHierarchyDs" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="2" title="HAP_QUERY_TITLE">
                <a:lov name="account_set_code" bindTarget="para_accHierarchyDs">
                    <a:events>
                        <a:event name="enterdown" handler="query_accHierarchyDs"/>
                    </a:events>
                </a:lov>
                <a:textField name="account_set_name" bindTarget="para_accHierarchyDs"/>
                <a:lov name="account_code_from" bindTarget="para_accHierarchyDs">
                    <a:events>
                        <a:event name="enterdown" handler="query_accHierarchyDs"/>
                    </a:events>
                </a:lov>
                <a:textField name="account_name_from" bindTarget="para_accHierarchyDs"/>
                <a:lov name="account_code_to" bindTarget="para_accHierarchyDs">
                    <a:events>
                        <a:event name="enterdown" handler="query_accHierarchyDs"/>
                    </a:events>
                </a:lov>
                <a:textField name="account_name_to" bindTarget="para_accHierarchyDs"/>
            </a:form>
            <a:grid id="accHierarchyDs_grid" bindTarget="accHierarchyDs" marginHeight="250" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="account_code" sortable="true" width="300"/>
                    <a:column name="account_description" width="300"/>
                    <a:column name="account_id" align="center" prompt="GLD_ACCOUNTS.SUB_ACCOUNT" renderer="detailRenderer" width="100"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>