<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ouyangzhaochang2663 $
    $Date: 2010/11/22 01:49:17 $
    $Revision: 1.2 $
    $Purpose: 子经营单位定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[     
    ]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function closeOpUnitHierarchyWindow(){
                $('fnd_operation_units_window').close();
            }
            
            function canEdit(record){
              if(record.isNew)return "operation_unit_code_grid_lov";
              else return "";
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_parent_operation_unit_ds" autoCreate="true">
                <a:fields>
                    <a:field name="operation_unit_code" defaultValue="${/parameter/@operation_unit_code}" readOnly="true"/>
                    <a:field name="description" defaultValue="${/parameter/@description}" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="fnd_op_unit_hierarchy_result_ds" autoQuery="true" fetchAll="false" model="fnd.FND2030.fnd_op_unit_hierarchy" queryUrl="${/request/@context_path}/autocrud/fnd.FND2030.fnd_op_unit_hierarchy/query?parent_op_unit_id=${/parameter/@operation_unit_id}" selectable="true">
                <a:fields>
                    <a:field name="operation_unit_code" lovGridHeight="300" lovHeight="460" lovService="fnd.FND2030.fnd_operation_units_hierarchy_lov" lovWidth="400" required="true" title="FND_OPERATION_UNITS.SUB_OP_UNITS">
                        <a:mapping>
                            <a:map from="operation_unit_id" to="operation_unit_id"/>
                            <a:map from="operation_unit_code" to="operation_unit_code"/>
                            <a:map from="description" to="description"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="parent_operation_unit_id" defaultValue="${/parameter/@operation_unit_id}"/>
                    <a:field name="operation_unit_code" required="true"/>
                    <a:field name="description" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:fieldSet column="2" labelWidth="90" title="FND_OPERATION_UNITS.SUB_OP_UNITS" width="510">
                <a:textField name="operation_unit_code" bindTarget="fnd_parent_operation_unit_ds"/>
                <a:textField name="description" bindTarget="fnd_parent_operation_unit_ds"/>
            </a:fieldSet>
            <!-- marginHeight="240" marginWidth="50"-->
            <a:grid id="fnd_op_unit_hierarchy_grid" bindTarget="fnd_op_unit_hierarchy_result_ds" height="350" navBar="true" width="510">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="operation_unit_code" align="center" editorFunction="canEdit" sortable="true" width="190"/>
                    <a:column name="description" align="left" prompt="FND_OPERATION_UNITS.DESCRIPTION" width="290"/>
                </a:columns>
                <a:editors>
                    <a:lov id="operation_unit_code_grid_lov"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>