<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-8-15 下午5:52:46  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="con_contrac_et_check_link" url="${/request/@context_path}/modules/cont/CON370/con_contract_et_check.lview"/>
        <script type="text/javascript"><![CDATA[
            function contractQueryScreen_forward() {
                history.go(1);
            }
            
            function contractQueryScreen_back() {
                history.go(-1);
            }
            
            function contractQueryScreen_reset() {
                $('contract_et_Screen_paraDs').reset();
            }
            
            function contractQueryScreen_query() {
                $('contract_et_Screen_mainDs').query();
            }
            
            function render_et_agreement_number(value, record, name){
                if (!record.isNew) {
                    return '<a href="javascript:winOpen_update(' + record.get('et_agreement_id') +','+record.get('contract_id')+')">'+value+'</a>';
                }
                
            }
            
            function winOpen_update(et_agreement_id,contract_id) {
                var win = new Leaf.Window({
                    id: 'con_contrac_et_check_window',
                    url: $('con_contrac_et_check_link').getUrl(),
                    params:{
                        
	                	et_agreement_id:et_agreement_id,
	                	contract_id:contract_id,
	                	action_type:'QUERY',
	                	winId:'con_contrac_et_check_window'
	                },
                    title: '提前结清信息',
                    fullScreen: true
                });
                win.on('close',function(){
                     $('contract_et_Screen_mainDs').query();
                });
            }
            
            function opwn_window(){
                winOpen_update($('contract_et_Screen_mainDs').getCurrentRecord().get('et_agreement_id'));
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT_ET&amp;function_code=CON370"/>
        <a:dataSets>
            <a:dataSet id="et_agreement_status_ds" lookupCode="CON_ET_STATUS"/>
            <a:dataSet id="con501_status_name_ds" lookupCode="CON500_CONTRACT_STATUS"/>
            <a:dataSet id="con501_lease_organization_name_ds" loadData="true" model="basic.hls_lease_organization_for_lov"/>
            <a:dataSet id="et_profile_ds">
                <a:datas dataSource="/model/et_profile"/>
            </a:dataSet>
            <a:dataSet id="contract_et_Screen_paraDs">
                <a:fields>
                    <a:field name="contract_status_desc" displayField="code_value_name" options="con501_status_name_ds" returnField="contract_status" valueField="code_value"/>
                    <a:field name="et_agreement_status_desc" displayField="code_value_name" options="et_agreement_status_ds" returnField="et_agreement_status" valueField="code_value"/>
                    <a:field name="lease_organization_name" displayField="description" options="con501_lease_organization_name_ds" returnField="lease_organization" valueField="lease_organization"/>
                    <a:field name="contract_number"/>
                    <a:field name="project_number"/>
                    <a:field name="guarantor_id"/>
                    <a:field name="guarantor_name" lovGridHeight="330" lovHeight="470" lovLabelWidth="120" lovService="cont.CON370.hls_bp_master_v_all_lov?bp_category=GUARANTOR" lovWidth="700" title="担保人">
                        <a:mapping>
                            <a:map from="bp_id" to="guarantor_id"/>
                            <a:map from="bp_name" to="guarantor_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_id"/>
                    <a:field name="bp_name" lovGridHeight="330" lovHeight="470" lovLabelWidth="120" lovService="cont.CON370.hls_bp_master_v_all_lov?bp_category=TENANT" lovWidth="700" title="承租人">
                        <a:mapping>
                            <a:map from="bp_id" to="bp_id"/>
                            <a:map from="bp_name" to="bp_name"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="contract_et_Screen_mainDs" autoCount="true" autoPageSize="true" autoQuery="true" model="cont.CON370.con_contract_et_hd_maintain_query" queryDataSet="contract_et_Screen_paraDs" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="document_type_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON701.hls_document_type_for_et_lov" lovWidth="500" prompt="提前结清类型" required="true">
                        <a:mapping>
                            <a:map from="document_type" to="document_type"/>
                            <a:map from="document_type_desc" to="document_type_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="termination_date"/>
                    <a:field name="et_profile_desc" displayField="description" options="et_profile_ds" returnField="et_profile" valueField="et_profile"/>
                    <a:field name="et_ratio"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="contractQueryScreen_query" text="HLS.QUERY"/>
                <a:gridButton click="contractQueryScreen_reset" text="HLS.RESET"/>
                <a:gridButton click="opwn_window" text="查看"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="110" marginWidth="30" title="HLS.QUERY_TITLE">
                <a:textField name="et_agreement_number" bindTarget="contract_et_Screen_paraDs" prompt="提前结清编号" typeCase="upper"/>
                <a:textField name="contract_number" bindTarget="contract_et_Screen_paraDs" prompt="合同编号" typeCase="upper"/>
                <a:textField name="contract_name" bindTarget="contract_et_Screen_paraDs" prompt="合同名称"/>
                <a:textField name="project_number" bindTarget="contract_et_Screen_paraDs" prompt="项目编号" typeCase="upper"/>
                <a:lov name="bp_name" bindTarget="contract_et_Screen_paraDs" prompt="承租人"/>
                <a:lov name="guarantor_name" bindTarget="contract_et_Screen_paraDs" prompt="担保人"/>
                <a:textField name="license_number" bindTarget="contract_et_Screen_paraDs" prompt="车牌号" typeCase="upper"/>
                <a:comboBox name="et_agreement_status_desc" bindTarget="contract_et_Screen_paraDs" prompt="提前结清状态"/>
                <a:datePicker name="termination_date_from" bindTarget="contract_et_Screen_paraDs" prompt="提前结清日从"/>
                <a:datePicker name="termination_date_to" bindTarget="contract_et_Screen_paraDs" prompt="提前结清日至"/>
                <a:datePicker name="creation_date_from" bindTarget="contract_et_Screen_paraDs" prompt="创建日期从"/>
                <a:datePicker name="creation_date_to" bindTarget="contract_et_Screen_paraDs" prompt="创建日期到"/>
                <a:datePicker name="date_from" bindTarget="contract_et_Screen_paraDs" prompt="起租日期从"/>
                <a:datePicker name="date_to" bindTarget="contract_et_Screen_paraDs" prompt="起租日期到"/>
                <a:datePicker name="lease_end_date_from" bindTarget="contract_et_Screen_paraDs" prompt="到期日从"/>
                <a:datePicker name="lease_end_date_to" bindTarget="contract_et_Screen_paraDs" prompt="到期日至"/>
            </a:form>
            <a:grid id="contract_et_Screen_mainDs_grid" bindTarget="contract_et_Screen_mainDs" marginHeight="240" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="et_agreement_number" lock="true" prompt="提前结清编号" renderer="render_et_agreement_number" width="100"/>
                    <a:column name="contract_number" lock="true" prompt="合同编号" width="120"/>
                    <a:column name="contract_name" prompt="合同名称" showTitle="true" width="200"/>
                    <a:column name="project_number" prompt="项目编号" width="120"/>
                    <a:column name="bp_name" prompt="承租人名称" showTitle="true" width="200"/>
                    <a:column name="license_number" align="center" prompt="车牌号" width="80"/>
                    <a:column name="termination_date" align="center" prompt="提前结清日" renderer="Leaf.formatDate" width="80"/>
                    <a:column name="creation_date" align="center" prompt="创建日期" renderer="Leaf.formatDate" width="80"/>
                    <a:column name="inception_of_lease" align="center" prompt="起租日" renderer="Leaf.formatDate" width="80"/>
                    <a:column name="lease_end_date" align="center" prompt="到期日" renderer="Leaf.formatDate" width="80"/>
                    <a:column name="et_agreement_status_desc" align="center" prompt="提前结清状态" width="80"/>
                    <a:column name="et_profile_desc" align="center" prompt="结清规则" width="90"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>