<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wujun  
    $Date: 2016-11-27 17:10:33  
    $Revision: 1.0  
    $Purpose: 还款审批表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="hn7010_payment_approval_detail_link" url="${/request/@context_path}/modules/hn/HN7010/hn_payment_approval_detail.lview"/>
        <script type="text/javascript"><![CDATA[
    		function hn7010_payment_approval_table_query() {
    		    $('hn7010_tre_loan_con_batch_interface_result_ds').query();
    		}
    		function hn7010_payment_approval_table_reset() {
    		    $('hn7010_tre_loan_con_batch_interface_query_ds').reset();
    		}
    		function hn7010_payment_approval_table_export() {
    		    $('hn7010_tre_loan_con_batch_interface_result_grid_id')._export();
    		}
    		function open_payment_approval_detail_window(batch_id) {
    		    var win = new Leaf.Window({
    		        id: 'hn7010_payment_approval_detail_win_id',
    		        url: $('hn7010_payment_approval_detail_link').getUrl(),
    		        params: {
    		            batch_id: batch_id,
    		            winid: 'hn7010_payment_approval_detail_win_id'
    		        },
    		        title: '还款明细',
    		        fullScreen: true
    		    });
    		}
    		function cost_detail(value, record, name) {
    		    if (name == 'cost_detail'  && !record.isNew) {
    		        link_function = 'cost_detail';
    		        return '<a href="javascript:open_payment_approval_detail_window(' + record.get('batch_id') + ');">明细</a>';
    		    }
    		}
    		function hn7010_payment_approval_table_print() {
    		    var records = $('hn7010_tre_loan_con_batch_interface_result_ds').getSelected();
    		    var repayment_plan_id = records[0].get('repayment_plan_id');
    		}
		]]></script>
        <a:dataSets>
            <a:dataSet id="hn7010_payment_approval_table_inside_outside_ds" lookupCode="LOAN_CON_TYPE"/>
            <a:dataSet id="hn7010_tre_loan_con_batch_interface_query_ds">
                <a:fields>
                    <a:field name="inside_or_outside_n" displayField="code_value_name" options="hn7010_payment_approval_table_inside_outside_ds" returnField="inside_or_outside" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hn7010_tre_loan_con_batch_interface_result_ds" autoPageSize="true" autoQuery="true" model="hn.HN7010.hn_payment_approval_table" queryDataSet="hn7010_tre_loan_con_batch_interface_query_ds" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="inside_or_outside_n" displayField="code_value_name" options="hn7010_payment_approval_table_inside_outside_ds" returnField="inside_or_outside" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hn7010_payment_approval_table_query" text="HLS.QUERY"/>
                <a:gridButton click="hn7010_payment_approval_table_reset" text="重置"/>
                <a:gridButton click="hn7010_payment_approval_table_export" text="导出"/>
                <a:gridButton click="hn7010_payment_approval_table_print" text="还款审批表打印"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="30" title="查询条件">
                <a:textField name="loan_contract_number" bindTarget="hn7010_tre_loan_con_batch_interface_query_ds" prompt="合同编号"/>
                <a:textField name="original_con_num" bindTarget="hn7010_tre_loan_con_batch_interface_query_ds" prompt="原始合同号"/>
                <a:textField name="loan_bp_name" bindTarget="hn7010_tre_loan_con_batch_interface_query_ds" prompt="债权人"/>
                <a:comboBox name="inside_or_outside_n" bindTarget="hn7010_tre_loan_con_batch_interface_query_ds" prompt="境内境外"/>
            </a:form>
            <a:grid id="hn7010_tre_loan_con_batch_interface_result_grid_id" bindTarget="hn7010_tre_loan_con_batch_interface_result_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="loan_contract_number" align="center" prompt="合同编号" width="150"/>
                    <a:column name="original_con_num" prompt="原始合同号" width="300"/>
                    <a:column name="loan_bp_name" prompt="债权人" width="300"/>
                    <a:column name="inside_or_outside_n" align="center" prompt="境内境外" width="100"/>
                    <a:column name="payment_actual_amount" align="right" prompt="实付金额(含税)" renderer="Leaf.formatMoney" width="110"/>
                    <a:column name="cost_amount" align="right" prompt="费用(含税)" renderer="Leaf.formatMoney" width="110"/>
                    <a:column name="cost_detail" align="center" prompt="费用明细" renderer="cost_detail" width="100"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>