fnd_operation_units.lview 5.51 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ouyangzhaochang2663 $
    $Date: 2010/11/22 01:49:25 $
    $Revision: 1.3 $
    $Purpose: 经营单位定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="fnd_op_unit_hierarchy_link" url="${/request/@context_path}/modules/fnd/FND2030/fnd_op_unit_hierarchy.lview"/>
        <script type="text/javascript"><![CDATA[
            function queryOperationUnits(){
                $('fnd_operation_units_result_ds').query();
            }
            function resetOperationUnits(){
            	$('fnd_operation_units_query_ds').reset();
            }
            function setOpUnitHierarchy(value, record, name){
                if(!record.isNew && record.get('summary_flag') == 'Y'){
                    var operationUnitId = record.get('operation_unit_id');
                    var unitCode = record.get('operation_unit_code');
                    var desc = record.get('description');
                    return '<a href="javascript:setOpUnitHierarchyInfo('+operationUnitId+ ',\'' + unitCode + '\',\'' + desc + '\'' + ')">${l:FND_OPERATION_UNITS.SUB_OP_UNITS}</a>';
                }
            }
            
            function setOpUnitHierarchyInfo(operationUnitId,unitCode,desc){
                new Leaf.Window({id:'fnd_operation_units_window', url:/*fnd_op_unit_hierarchy.screen*/$('fnd_op_unit_hierarchy_link').getUrl()+'?operation_unit_id='+operationUnitId + '&operation_unit_code=' + unitCode + '&description=' + encodeURIComponent(desc), title:'${l:FND_OPERATION_UNITS.SUB_OP_UNITS}', height:440,width:530});
            }
            
            function summaryEdit(record,name){
                if(record.isNew){
                    return 'fnd_operation_units_summary_cb';
                }else{
                    return '';
                }
            }
            
            function summaryRenderer(value,record, name){
                if(!record.isNew && value == 'Y'){
                    return '${l:HAP_YES}';
                }
                if(!record.isNew && value == 'N'){
                    return '${l:HAP_NO}';
                }
            }
            
            function unitCodeEditorFunction(record,name){
            	if(record.isNew){
            		return 'operation_unit_code_grid_tf';
            	}
            	return '';
            }
            
        ]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_operation_units_query_ds" model="fnd.fnd_operation_units"/>
            <a:dataSet id="fnd_operation_units_result_ds" autoQuery="true" fetchAll="false" model="fnd.fnd_operation_units" queryDataSet="fnd_operation_units_query_ds" selectable="true">
                <a:fields>
                    <a:field name="operation_unit_code" required="true"/>
                    <a:field name="description" required="true"/>
                    <a:field name="company_id" defaultValue="${/session/@company_id}"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="summary_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form column="2" labelWidth="90" title="FND_OPERATION_UNITS.OPERATION_UNITS_QUERY" width="510">
                <a:textField name="operation_unit_code" bindTarget="fnd_operation_units_query_ds" typeCase="upper">
                    <a:events>
                        <a:event name="enterdown" handler="queryOperationUnits"/>
                    </a:events>
                </a:textField>
                <a:textField name="description" bindTarget="fnd_operation_units_query_ds">
                    <a:events>
                        <a:event name="enterdown" handler="queryOperationUnits"/>
                    </a:events>
                </a:textField>
            </a:form>
            <a:hBox>
                <a:button click="queryOperationUnits" text="HAP_QUERY"/>
                <a:button click="resetOperationUnits" text="HAP_RESET"/>
            </a:hBox>
            <a:grid id="fnd_operation_units_grid" bindTarget="fnd_operation_units_result_ds" height="340" navBar="true" width="830">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button TYPE="clear"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="operation_unit_code" align="left" editorFunction="unitCodeEditorFunction" sortable="true" width="200"/>
                    <a:column name="description" align="center" editor="description_grid_tf" width="270"/>
                    <a:column name="summary_flag" align="center" editorFunction="summaryEdit" renderer="summaryRenderer" sortable="true"/>
                    <a:column name="enabled_flag" editor="fnd_operation_units_enabled_cb" sortable="true"/>
                    <a:column name="op_unit_hierarchy" align="center" prompt="FND_OPERATION_UNITS.SUB_OP_UNITS" renderer="setOpUnitHierarchy"/>
                </a:columns>
                <a:editors>
                    <a:textField id="operation_unit_code_grid_tf" typeCase="upper"/>
                    <a:textField id="description_grid_tf"/>
                    <a:checkBox id="fnd_operation_units_summary_cb"/>
                    <a:checkBox id="fnd_operation_units_enabled_cb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>