<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-5-18 下午2:11:40  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <script type="text/javascript"><![CDATA[
			function submit_doc_contract_tmpt_clause_result_ds(){
				$('doc_contract_tmpt_clause_result_ds').submit();
			}
			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="contract_status_ds" lookupCode="CON390_CONTRACT_STATUS"/>
            <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="doc_contract_tmpt_clause_result_ds" autoQuery="true" model="cont.CON202.doc_contract_tmpt_clause" queryUrl="${/request/@context_path}/autocrud/cont.CON202.doc_contract_tmpt_clause/query?tmpt_id=${/parameter/@tmpt_id}" selectable="true">
                <a:fields>
                    <a:field name="clause_id"/>
                    <a:field name="tmpt_id"/>
                    <a:field name="contract_status"/>
                    <a:field name="contract_status_n" displayField="code_value_name" options="contract_status_ds" returnField="contract_status" valueField="code_value"/>
                    <a:field name="contract_id"/>
                    <a:field name="document_table"/>
                    <a:field name="ref_v01"/>
                    <a:field name="ref_v02"/>
                    <a:field name="ref_v03"/>
                    <a:field name="ref_v04"/>
                    <a:field name="ref_v05"/>
                    <a:field name="ref_n01"/>
                    <a:field name="ref_n02"/>
                    <a:field name="ref_n03"/>
                    <a:field name="ref_n04"/>
                    <a:field name="ref_n05"/>
                    <a:field name="ref_d01"/>
                    <a:field name="ref_d02"/>
                    <a:field name="ref_d03"/>
                    <a:field name="ref_d04"/>
                    <a:field name="ref_d05"/>
                </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="doc_contract_tmpt_clause_result_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_status_n" editor="cb" prompt="合同状态" width="100"/>
                </a:columns>
                <a:editors>
                    <a:lov id="lov"/>
                    <a:comboBox id="cb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
