finance_standing_book.lview 10.9 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2016-1-19 上午11:33:21  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="basic.gld_currency_v" rootPath="currency_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="tre_factoring_contract_modify_detail_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_factoring_contract_add.lview"/>
        <a:link id="tre_loan_contract_withdraw_query_detail_link_id" url="${/request/@context_path}/modules/tre/TRE312/tre_loan_contract_widthdraw_query_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function tre630_loan_contract_number(id) {
            
                var loan_contract_ds_id = 'tre630_finance_standing_book_result_ds';
                var record = $(loan_contract_ds_id).findById(id);
                var param = {};
                param['loan_contract_id'] = record.get('loan_contract_id');
                param['function_code'] = 'TRE503D_QUERY';
                param['function_usage'] = 'QUERY';
                param['cond_para2'] = record.get('way_of_increasing_trust');
                param['document_category'] = record.get('document_category');
                param['document_type'] = record.get('document_type');
                param['document_type_2nd'] = record.get('document_type');
                param['url_title'] = '借款明细';
                param['winid'] = 'tre503d_tre_loan_contract_modify_winid';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'tre_factoring_contract_modify_detail_link_id', loan_contract_ds_id);
            }
            
            function tre630_withdraw_link(id) {
            
                var loan_contract_ds_id = 'tre630_finance_standing_book_result_ds';
                var record = $(loan_contract_ds_id).findById(id);
                var param = {};
                param['loan_contract_id'] = record.get('loan_contract_id');
                param['function_code'] = 'TRE630D';
                param['layout_debugger_flag'] = 'Y';
                param['function_usage'] = 'QUERY';
                param['winid'] = 'tre505_loan_contract_withdraw_review_win_link_id';
                param['url_title'] = '提款查询';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'tre_loan_contract_withdraw_query_detail_link_id', loan_contract_ds_id);
            }
            
            //超链接渲染
            
            function tre630_renderer(value, record, name) {
                if (name == 'loan_contract_number' && !record.isNew) {
                    return '<a href="javascript:tre630_loan_contract_number(' + record.id + ');">' + value + '</a>';
                } else if (name == 'loan_contract_id' && !record.isNew) {
                    return '<a href="javascript:tre630_withdraw_link(' + record.id + ');">提款信息</a>';
                }
            }
             function foot_sum(data,name){
                if(name=='loan_contract_number'){
                    return '<font color=red>' + '合计:' + '</font>';
                }
                    return colum_caculateTotal(data, name);
               
            }
            
            function colum_caculateTotal(data, name) {
                var total = 0;
                var length = data.length;
                var value = 0;
                for (var i = 0;i < length;i++) {
                    if (Ext.isEmpty(data[i].get(name))) {
                        value = 0;
                    } else {
                        value = data[i].get(name);
                    }
                    total = plus(total, value);
                }
                return '<font >' + Leaf.formatMoney(total) + '</font>';
            }
            
            function tre630_export() {
                $('tre630_finance_standing_book_gird')._export();
            
            }
            function tre630_query(){
                $('tre630_finance_standing_book_result_ds').query();
            }
            function tre630_reset(){
                $('tre630_finance_standing_book_query_ds').reset();
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
            <a:dataSet id="tre630_loan_con_bp_ds">
                <a:datas dataSource="/model/loan_con_bp_path"/>
            </a:dataSet>
            <a:dataSet id="tre630_currency_ds">
                <a:datas dataSource="/model/currency_path"/>
            </a:dataSet>
            <a:dataSet id="tre630_loan_con_fin_way_ds" lookupCode="LOAN_CON_FIN_WAY"/>
            <a:dataSet id="tre630_hls500_pay_isbefore_type_ds" lookupCode="HLS500_PAY_ISBEFORE_TYPE"/>
            <a:dataSet id="tre630_sdic_loan_con_terms_ds" lookupCode="SDIC_LOAN_CON_TERMS"/>
            <a:dataSet id="tre630_loan_amount_status_ds">
                <a:datas>
                    <a:record value="已结清"/>
                    <a:record value="使用"/>
                </a:datas>
            </a:dataSet>
            <a:dataSet id="tre630_finance_standing_book_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="loan_con_bp_n" lovHeight="500" lovLabelWidth="120" lovService="basic.hls_bp_master_v_all_lov?status_check_flag=Y" lovWidth="600">
                        <a:mapping>
                            <a:map from="bp_id" to="loan_con_bp"/>
                            <a:map from="bp_name" to="loan_con_bp_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="loan_con_terms_n" displayField="code_value_name" options="tre630_sdic_loan_con_terms_ds" returnField="loan_con_terms" valueField="code_value"/>
                    <a:field name="loan_amount_status_n" displayField="value" options="tre630_loan_amount_status_ds" returnField="loan_amount_status" valueField="value"/>
                    <a:field name="within_the_group_n" displayField="code_value_name" options="tre630_hls500_pay_isbefore_type_ds" returnField="within_the_group" valueField="code_value"/>
                    <a:field name="loan_con_type_detail_n" displayField="code_value_name" options="tre630_loan_con_fin_way_ds" returnField="loan_con_type_detail" valueField="code_value"/>
                    <a:field name="currency_n" displayField="currency_name" options="tre630_currency_ds" returnField="currency" valueField="currency_code"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="tre630_finance_standing_book_result_ds" autoPageSize="true" autoQuery="true" model="tre.TRE630.finance_standing_book" queryDataSet="tre630_finance_standing_book_query_ds" selectable="true" selectionModel="single"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="tre630_query" text="查询"/>
                <a:gridButton click="tre630_reset" text="重置"/>
                <a:gridButton click="tre630_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="30" title="查询条件">
                <a:textField name="loan_contract_number" bindTarget="tre630_finance_standing_book_query_ds" prompt="合同编号" width="180"/>
                <a:textField name="original_con_num" bindTarget="tre630_finance_standing_book_query_ds" prompt="原始合同号" width="180"/>
                <a:lov name="loan_con_bp_n" bindTarget="tre630_finance_standing_book_query_ds" prompt="债权人" width="180"/>
                <a:comboBox name="within_the_group_n" bindTarget="tre630_finance_standing_book_query_ds" prompt="是否集团内" width="180"/>
                <a:comboBox name="loan_con_type_detail_n" bindTarget="tre630_finance_standing_book_query_ds" prompt="融资方式" width="180"/>
                <a:comboBox name="loan_amount_status_n" bindTarget="tre630_finance_standing_book_query_ds" prompt="状态" width="180"/>
                <a:comboBox name="loan_con_terms_n" bindTarget="tre630_finance_standing_book_query_ds" prompt="期限" width="180"/>
                <a:comboBox name="currency_n" bindTarget="tre630_finance_standing_book_query_ds" prompt="币种" width="180"/>
                <a:datePicker name="end_date" bindTarget="tre630_finance_standing_book_query_ds" prompt="截止日期" width="180"/>
            </a:form>
            <a:grid id="tre630_finance_standing_book_gird" bindTarget="tre630_finance_standing_book_result_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="loan_contract_number" footerRenderer="foot_sum" prompt="合同编号"/>
                    <a:column name="loan_con_bp_n" prompt="债权人"/>
                    <a:column name="original_con_num" prompt="原始合同号"/>
                    <a:column name="loan_amount_type_n" prompt="借款合同类型"/>
                    <a:column name="currency_n" prompt="币种" width="80"/>
                    <a:column name="loan_amount" align="right" footerRenderer="foot_sum" prompt="合同金额" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="withdraw_amount" align="right" footerRenderer="foot_sum" prompt="已提款金额" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="remaining_amount" align="right" footerRenderer="foot_sum" prompt="待提款金额" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="received_principal" align="right" footerRenderer="foot_sum" prompt="已还金额" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="no_received_principal" align="right" footerRenderer="foot_sum" prompt="借款余额" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="first_withdraw_date" align="right" prompt="首次提款日" renderer="Leaf.formatDate"/>
                    <a:column name="loan_con_terms_n" prompt="期限"/>
                    <a:column name="specific_loan_terms" prompt="具体期限"/>
                    <a:column name="interest_desc" prompt="利率"/>
                    <a:column name="loan_amount_status" prompt="状态"/>
                    <a:column name="loan_con_type_detail_n" prompt="融资方式"/>
                    <a:column name="within_the_group_n" prompt="是否集团内"/>
                    <a:column name="way_of_increasing_trust_n" prompt="增信方式"/>
                    <a:column name="loan_contract_id" prompt="提款信息" renderer="tre630_renderer"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>