<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: yuminhui  
    $Date: 2015-10-28 下午03:35:35  
    $Revision: 1.0  
    $Purpose: 租赁合同账龄分析表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query model="cont.CON307C.con_aging_schedule_today_query" rootPath="current_date"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        	function con_contract_return() {
                history.go(-1);
            }
            function con_contract_query() {
                var record = $('con_financing_aging_schedule_query_ds').getCurrentRecord();
                if(record.get('analysis_date') == '' || record.get('analysis_date') == null){
                    Leaf.showMessage('${l:PROMPT}','请输入分析日期，<font color="red">分析日期不能为空！</font>');
                }else{
                $('con_financing_aging_schedule_result_ds').query();
            		}
            }
            function con_contract_reset() {
                $('con_financing_aging_schedule_query_ds').reset();
            }
            
            function con_contract_aging_budget_export() {
                $('con_financing_aging_schedule_result_grid')._export();
            }
            function con_loan_contract_query(){
                 $('con_financing_aging_schedule_result_ds').query();
            }
            function con_analys_date_query(){
                 $('con_financing_aging_schedule_result_ds').query();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="con_financing_aging_schedule_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="loan_contract_name" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON307C.con_loan_contract_number_lov" lovWidth="600" title="HLS.CONTRACT_NUMBER">
                        <a:mapping>
                            <a:map from="loan_contract_number" to="loan_contract_number"/>
                            <a:map from="loan_contract_name" to="loan_contract_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="loan_contract_number"/>
                    <a:field name="loan_con_bp_n" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="tre.TRE110.tre_loan_con_bp_query" lovWidth="500" title="借款行">
                        <a:mapping>
                            <a:map from="loan_con_bp" to="loan_con_bp"/>
                            <a:map from="loan_con_bp_n" to="loan_con_bp_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="analysis_date" defaultValue="${/model/current_date/record/@today}" required="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_financing_aging_schedule_result_ds" autoPageSize="true" autoQuery="true" model="cont.CON307C.con_financing_aging_schedule_query" queryDataSet="con_financing_aging_schedule_query_ds" queryUrl="${/request/@context_path}/autocrud/cont.CON307C.con_financing_aging_schedule_query/query"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <!-- <a:gridButton click="con_contract_return" text="HLS.RETURN"/> -->
                <a:gridButton click="con_contract_query" text="HLS.QUERY"/>
                <a:gridButton click="con_contract_reset" text="HLS.RESET"/>
                <a:gridButton click="con_contract_aging_budget_export" text="HLS.EXPORT"/>
            </a:screenTopToolbar>
            <a:form column="3" labelWidth="120" marginWidth="30" title="查询条件">
                <a:datePicker name="analysis_date" bindTarget="con_financing_aging_schedule_query_ds" emptyText="分析日期例如：2015-1-1" prompt="分析日期" viewSize="2">
                    <a:events>
                        <a:event name="enterdown" handler="con_analys_date_query"/>
                    </a:events>
                </a:datePicker>
                <a:lov name="loan_contract_name" bindTarget="con_financing_aging_schedule_query_ds" prompt="融资合同">
                    <a:events>
                        <a:event name="enterdown" handler="con_loan_contract_query"/>
                    </a:events>
                </a:lov>
                <a:lov name="loan_con_bp_n" bindTarget="con_financing_aging_schedule_query_ds" prompt="借款行">
                    <a:events>
                        <a:event name="enterdown" handler="con_loan_contract_query"/>
                    </a:events>
                </a:lov>
            </a:form>
            <a:grid id="con_financing_aging_schedule_result_grid" bindTarget="con_financing_aging_schedule_result_ds" marginHeight="185" marginWidth="20" navBar="true">
                <a:columns>
                    <a:column name="row_num" align="center" lock="true" prompt="HLS.CONTRACT_SEQ" width="40"/>
                    <a:column name="loan_contract_number" prompt="融资合同号" width="180"/>
                    <a:column name="original_con_num" prompt="原始合同号" width="200"/>
                    <a:column name="loan_contract_name" prompt="融资合同" width="180"/>
                    <a:column prompt="负债">
                        <a:column name="amount_one" align="right" prompt="1年内" renderer="Leaf.formatMoney" width="130"/>
                        <a:column name="amount_one_two" align="right" prompt="1-2年" renderer="Leaf.formatMoney" width="130"/>
                        <a:column name="amount_two_three" align="right" prompt="2-3年" renderer="Leaf.formatMoney" width="130"/>
                        <a:column name="amount_upper_three" align="right" prompt="3年以上" renderer="Leaf.formatMoney" width="130"/>
                        <a:column name="amount_sum" align="right" prompt="合计" renderer="Leaf.formatMoney" width="150"/>
                    </a:column>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
