<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Foreinyel  
    $Date: 2014-5-14 下午2:17:18  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <script type="text/javascript"><![CDATA[
    		function add_handler(ds,rec,index){
    		    var tmpt_id = '${/parameter/@tmpt_id}';
    		    if(rec.isNew){
    		        rec.set('tmpt_id',tmpt_id);
    		    }
    		}
    	]]></script>
        <a:dataSets>
            <a:dataSet id="pay_methods_ds" lookupCode="PAY_METHODS"/>
            <a:dataSet id="con202_withway_ds" lookupCode="WITHHOLD_WAYS"/>
            <a:dataSet id="secondary_lease_ds" lookupCode="SECONDARY_LEASE"/>
            <a:dataSet id="is_buyout_ds" lookupCode="YES_OR_NO"/>
            <a:dataSet id="con202_finance_type" lookupCode="FINANCE_TYPE"/>
            <a:dataSet id="hls_bp_class_ds" lookupCode="HLS211_BP_CLASS"/>
            <a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/>
            <a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/>
            <a:dataSet id="marital_status_flag_ds" lookupCode="EXIST_OR_NOT"/>
            <a:dataSet id="sp_sign_flag_ds" lookupCode="YES_NO"/>
            <a:dataSet id="clause_basinfo" autoCreate="true">
                <a:fields>
                    <a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/>
                    <a:field name="template_desc" defaultValue="${/parameter/@tmpt_desc}" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_basic_clause_detail_ds" autoQuery="true" model="cont.CON202.con_contract_tmpt_clause_main" queryUrl="${/request/@context_path}/autocrud/cont.CON202.con_contract_tmpt_clause_main/query?tmpt_id=${/parameter/@tmpt_id}" selectable="true">
                <a:fields>
                    <a:field name="withhold_way_n" displayField="code_value_name" options="con202_withway_ds" returnField="withhold_way" valueField="code_value"/>
                    <a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
                    <a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/>

                    <a:field name="is_buyout_n" displayField="code_value_name" options="is_buyout_ds" returnField="is_buyout" valueField="code_value"/>
                    <a:field name="is_constru_unit_n" displayField="code_value_name" options="is_buyout_ds" returnField="is_constru_unit" valueField="code_value"/>
                    <a:field name="marital_status_flag_n" displayField="code_value_name" options="marital_status_flag_ds" returnField="marital_status_flag" valueField="code_value"/>
                    <a:field name="sp_sign_flag_n" displayField="code_value_name" options="sp_sign_flag_ds" returnField="sp_sign_flag" valueField="code_value"/>
                    <a:field name="finance_type"/>
                    <a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/>
                    <a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680">
                        <a:mapping>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_number" to="contract_number"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_category_n" lovGridHeight="300" lovHeight="480" lovService="basic.hls_bp_category_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="bp_category" to="bp_category"/>
                            <a:map from="description" to="bp_category_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="vender_id_n" lovGridHeight="300" lovHeight="480" lovService="basic.hls_bp_agent_vender_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="bp_name" to="vender_id_n"/>
                            <a:map from="bp_id" to="vender_id"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_class_n" displayField="code_value_name" options="hls_bp_class_ds" returnField="bp_class" valueField="code_value"/>
                    <a:field name="business_type_n" lovGridHeight="300" lovHeight="480" lovService="basic.hls_business_type_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="business_type" to="business_type"/>
                            <a:map from="description" to="business_type_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="document_type_n" lovGridHeight="300" lovHeight="480" lovService="basic.hls_document_type_for_lov?document_category=CONTRACT" lovWidth="500">
                        <a:mapping>
                            <a:map from="document_type" to="document_type"/>
                            <a:map from="description" to="document_type_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="division_n" lovGridHeight="300" lovHeight="480" lovService="basic.hls_division_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="division" to="division"/>
                            <a:map from="description" to="division_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="lease_channel_n" lovGridHeight="260" lovHeight="480" lovService="basic.hls_lease_channel_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="lease_channel" to="lease_channel"/>
                            <a:map from="description" to="lease_channel_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="lease_organization_n" lovGridHeight="260" lovHeight="480" lovService="basic.hls_lease_organization_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="lease_organization" to="lease_organization"/>
                            <a:map from="description" to="lease_organization_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="price_list_n" lovGridHeight="260" lovHeight="480" lovService="hls.HLS050.hls_price_list_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="price_list" to="price_list"/>
                            <a:map from="description" to="price_list_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="other_tmpt_clause_n" displayField="code_value_name" options="other_tmpt_clause_ds" returnField="other_tmpt_clause" valueField="code_value"/>
                    <a:field name="other_tmpt_clause"/>
                    <a:field name="district_n" displayField="code_value_name" options="district_ds" returnField="district" valueField="code_value"/>
                    <a:field name="district"/>
                    <a:field name="first_contract_flag" checkedValue="Y"/>
                </a:fields>
                <a:events>
                    <a:event name="add" handler="add_handler"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form column="2" title="模板信息">
                <a:textField name="template_code" bindTarget="clause_basinfo" prompt="模板编码"/>
                <a:textField name="template_desc" bindTarget="clause_basinfo" prompt="模板描述"/>
            </a:form>
            <a:grid bindTarget="con_basic_clause_detail_ds" height="300" width="1030">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                    <a:button type="clear"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="contract_number" editor="lov" prompt="合同编号" width="100"/>
                    <a:column name="clause_id" editor="lov" prompt="合同编号" width="100"/>
<!--                    <a:column name="withhold_way_n" editor="cb" prompt="代扣方式"/>-->
                    <a:column name="pay_method_n" editor="cb" prompt="支付方式"/>

                    <a:column name="bp_category_n" editor="lov" prompt="商业伙伴类型" width="100"/>
                    <a:column name="vender_id_n" editor="lov" prompt="厂商" width="100"/>
                    <a:column name="secondary_lease_n" editor="cb" prompt="二次租赁" width="100"/>
                    <a:column name="is_buyout_n" editor="cb" prompt="是否买断机" width="100"/>
                    <a:column name="is_constru_unit_n" editor="cb" prompt="宏菱建机部" width="100"/>
                    <a:column name="bp_class_n" editor="cb" prompt="商业伙伴分类" width="100"/>
                    <a:column name="business_type_n" editor="lov" prompt="业务类型" width="80"/>
                    <a:column name="business_type" editor="lov" prompt="业务类型" width="80"/>
                    <a:column name="document_type_n" editor="lov" prompt="单据类型" width="80"/>
                    <a:column name="finance_type_n" editor="cb" prompt="融资业务类型" width="80"/>
                    <a:column name="division_n" editor="lov" prompt="产品线" width="100"/>
                    <a:column name="lease_channel_n" editor="lov" prompt="商业模式" width="100"/>
                    <a:column name="lease_organization_n" editor="lov" prompt="事业部" width="100"/>
                    <a:column name="district_n" editor="cb" prompt="区域" width="120"/>
                    <!--  <a:column name="car_brand_n" editor="lov" prompt="汽车品牌" width="100"/> -->
                    <a:column name="price_list_n" editor="lov" prompt="报价方案" width="120"/>
                    <a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/>
                    <!--add by 24976-->
                    <a:column name="marital_status_flag_n" editor="cb" prompt="有无配偶" width="100"/>
                    <a:column name="sp_sign_flag_n" editor="cb" prompt="配偶是否签署" width="100"/>
                    <a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/>

                </a:columns>
                <a:editors>
                    <a:lov id="lov"/>
                    <a:comboBox id="cb"/>
                    <a:checkBox id="check"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
