<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2014-1-23 下午2:19:07  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:c="leaf.application.action" xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" customizationEnabled="true" trace="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <style><![CDATA[
		.item-options{
		    background:#ffffff;
		}
		.cell-editor{
    		border:none;
    		margin-left:3px;
    	}
        ]]></style>
        <script type="text/javascript"><![CDATA[
            function con515_con_contract_query() {
                var ds = $('con515_contract_query_ds'),
                    record = $('con515_contract_query_ds').getAt(0);
                    
                if (ds.validate()) {
                    $('C_ATTCH_con_contract_ds').setQueryParameter('base_table_pk', record.get('contract_id'));
                    $('C_ATTCH_con_contract_ds').query();
                }
            }
            
            function con515_con_contract_return() {
                history.go(-1);
            }
            
            
            function con515_con_contract_reset() {
                $('con515_contract_query_ds').reset();
            }
            
            function con515_con_contract_save() {
                $('C_ATTCH_con_contract_ds').submit();
            }
            
            function C_ATTCH_Onupdate(ds, record, name, value, oldVlaue){
                var hrecord = $('con515_contract_query_ds').getAt(0);
                record.set('contract_id',hrecord.get('contract_id'));
                
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=con515"/>
        <a:dataSets>
            <a:dataSet id="con515_contract_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON500.con_contract_number_lov" lovWidth="500" required="true" title="HLS.CONTRACT_NUMBER">
                        <a:mapping>
                            <a:map from="contract_number" to="contract_number"/>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_name" to="contract_name"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="C_ATTCH_con_contract_ds" autoPageSize="true" model="cont.CON515.con_contract_payment_terms_check" queryDataSet="con515_contract_query_ds" queryUrl="${/request/@context_path}/autocrud/cont.CON515.con_contract_payment_terms_check/query" selectable="true">
                <a:fields>
                    <a:field name="paper_required" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                    <a:field name="payment_terms_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                    <a:field name="confirm_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="sys_flag" defaultValue="N"/>
                    <a:field name="document_id"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="C_ATTCH_Onupdate"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="con515_con_contract_return" text="HLS.RETURN"/>
                <a:gridButton click="con515_con_contract_query" text="HLS.QUERY"/>
                <a:gridButton click="con515_con_contract_reset" text="HLS.RESET"/>
                <a:gridButton click="con515_con_contract_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="2" title="CON301.CONTRACT_QUERY">
                <a:lov name="contract_number" bindTarget="con515_contract_query_ds" prompt="HLS.CONTRACT_NUMBER" width="200">
                    <a:events>
                        <a:event name="focus" handler="function(object){on_std_focus(object,&apos;CONTRACT&apos;)}"/>
                    </a:events>
                </a:lov>
                <a:textField name="contract_name" bindTarget="con515_contract_query_ds" prompt="HLS.CONTRACT_NAME" readOnly="true" width="200"/>
            </a:form>
            <a:grid id="C_ATTCH_con_cdd_grid_id" bindTarget="C_ATTCH_con_contract_ds" marginHeight="180" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="description" prompt="HLS.DOCUMENT_NAME" showTitle="true" width="250"/>
                    <a:column name="payment_terms_flag" prompt="CON210.CON_CONTRACT_PAYMENT_PRECONDITION" showTitle="true" width="80"/>
                    <a:column name="paper_required" prompt="已提交" showTitle="true" width="80"/>
                    <a:column name="confirm_flag" editor="C_ATTCH_con500_cdd_ck_id" prompt="HLS.CONFIRM" showTitle="true" width="80"/>
                    <a:column name="note" prompt="HLS.COMMENT" showTitle="true" width="290"/>
                    <a:column name="confirm_note" editor="C_ATTCH_con500_cdd_tf_id" prompt="确认说明" showTitle="true" width="290"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="C_ATTCH_con500_cdd_ck_id"/>
                    <a:textField id="C_ATTCH_con500_cdd_tf_id"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
