<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2014-10-9 下午2:53:22  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
	]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            
            function lease_result_beforesubmit(ds) {
                var length=ds.getAll().length;
                for(var i=0;i<length;i++){
                    if(Leaf.isEmpty(ds.getAt(i).get("lease_organization")) && Leaf.isEmpty(ds.getAt(i).get("lease_org_unit"))){
                       Leaf.showMessage('提示','条件值定义不完全，请完善');
                       return false;                        
                    }
                }
                return true;
            }
    		    
			function lease_result_grid_editorFunction(record,name) {
			    if (record.isNew) {
                    return 'lease_result_grid_lov';
                } else {
                    return '';
                }
			}
		]]></script>
        <a:dataSets>
            <a:dataSet id="lease_query_ds">
                <a:fields>
                    <a:field name="price_list" defaultValue="${/parameter/@price_list}"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="lease_result_ds" autoQuery="true" model="hls.HLS052.hls_price_list_conds_lease" queryDataSet="lease_query_ds" selectable="true">
                <a:fields>
                    <a:field name="price_list" defaultValue="${/parameter/@price_list}"/>
                    <a:field name="lease_organization"/>
                    <a:field name="lease_organization_description" lovGridHeight="300" lovHeight="460" lovLabelWidth="150" lovService="hls.HLS052.hls_car_organization" lovWidth="500" title="事业部">
                        <a:mapping>
                            <a:map from="organization_code" to="lease_organization"/>
                            <a:map from="organization_name" to="lease_organization_description"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="lease_org_unit"/>
                    <a:field name="lease_org_unit_description" lovGridHeight="300" lovHeight="460" lovLabelWidth="150" lovService="hls.HLS052.exp_org_unit_vl" lovWidth="500" title="4S店">
                        <a:mapping>
                            <a:map from="unit_id" to="lease_org_unit"/>
                            <a:map from="description" to="lease_org_unit_description"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="beforesubmit" handler="lease_result_beforesubmit"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:grid id="lease_result_grid" bindTarget="lease_result_ds" height="350" navBar="true" width="320">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="lease_organization_description" align="center" autoAdjust="true" editorFunction="lease_result_grid_editorFunction" prompt="品牌事业部" width="120"/>
                    <a:column name="lease_org_unit_description" align="center" autoAdjust="true" editorFunction="lease_result_grid_editorFunction" prompt="4s店" width="150"/>
                </a:columns>
                <a:editors>
                    <a:lov id="lease_result_grid_lov"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
