tre_loan_contract_maintain.lview 11.8 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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei5743  
    $Date: 2015-11-18 下午3:43:19  
    $Revision: 1.0  
    $Purpose: 借款合同查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <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_interbank_borrowing_maintain_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_interbank_borrowing_maintain.lview"/>
        <a:link id="tre_working_capital_loan_maintain_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_working_capital_loan_add.lview"/>
        <a:link id="tre_factoring_contract_maintain_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_factoring_contract_maintain.lview"/>
        <a:link id="tre_entrustment_loan_contract_maintain_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_entrustment_loan_contract_maintain.lview"/>
        <a:link id="tre_other_contract_maintain_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_other_contract_maintain.lview"/>
        <a:link id="tre_loan_contract_add_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_loan_contract_add.lview"/>
        <a:link id="tre_factoring_contract_add_maintain_lind_id" url="${/request/@context_path}/modules/tre/tre503/tre_factoring_contract_add.lview"/>
        <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="tre503_closed_link" model="tre.tre503.tre503_closed_active" modelaction="update"/>
        <a:link id="tre503_active_link" model="tre.tre503.tre503_closed_active" modelaction="execute"/>
        <a:link id="tre_loan_contract_status_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_loan_contract_open.lview"/>
        <a:link id="tre_get_status_id" url="${/request/@context_path}/modules/tre/tre503/tre_get_status.lview"/>
        <script type="text/javascript"><![CDATA[
            
            function open_loan_contract_create_win(ds_id) {
                var param = {};
                param['function_code'] = 'TRE503F';
                // param['default_value_dsid'] = ds_id;
                // param['pre_layout_code'] = '${/parameter/@layout_code}';
                param['function_usage'] = 'CREATE';
                param['url_title'] = '借款合同明细';
                param['winid'] = 'tre503d_create_loan_contract_detail_winid';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'tre_loan_contract_add_link_id', ds_id);
            }
            
            //新增按钮
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                //var record = $(ds_id).getAt(0);
                open_loan_contract_create_win(ds_id);
            
            };
            
            //关闭按钮
            window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                var record = $(ds_id).getCurrentRecord();
                if (!$(ds_id).getSelected().length) {
                    Leaf.showMessage('${l:HLS.PROMPT}', '请选择数据!');
                    return;
                }
                Leaf.Masker.mask(Ext.getBody());
                if (record.get('loan_con_wfl_status') == 'WFL_NEW') {
                    Leaf.showConfirm('${l:PROMPT}', '确认关闭?', function() {
                        Leaf.request({
                            url: $('tre503_closed_link').getUrl(),
                            para: {
                                loan_contract_id: record.get('loan_contract_id')
                            },
                            success: function(res) {
                                Leaf.SideBar.show({
                                    msg: '${l:HLS.SUBMIT_SUCCESS}',
                                    duration: 2000
                                });
                                $(ds_id).query();
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            failure: function() {
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            error: function() {
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            scope: this
                        });
                    }, function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    });
                } else {
                    Leaf.showMessage('提示', '只有新建的单据才能关闭!');
                    Leaf.Masker.unmask(Ext.getBody());
                    return;
                }
            };
            
            //激活按钮
            window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                var record = $(ds_id).getCurrentRecord();
                if (!$(ds_id).getSelected().length) {
                    Leaf.showMessage('${l:HLS.PROMPT}', '请选择数据!');
                    return;
                }
                Leaf.Masker.mask(Ext.getBody());
                if (record.get('loan_con_wfl_status') == 'CLOSED') {
                    Leaf.showConfirm('${l:PROMPT}', '确认激活?', function() {
                        Leaf.request({
                            url: $('tre503_active_link').getUrl(),
                            para: {
                                loan_contract_id: record.get('loan_contract_id')
                            },
                            success: function(res) {
                                Leaf.SideBar.show({
                                    msg: '${l:HLS.SUBMIT_SUCCESS}',
                                    duration: 2000
                                });
                                $(ds_id).query();
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            failure: function() {
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            error: function() {
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            scope: this
                        });
                    }, function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    });
                } else {
                    Leaf.showMessage('提示', '只有关闭的单据才能激活!');
                    Leaf.Masker.unmask(Ext.getBody());
                    return;
                }
            };
            
            function loan_contract_number(id, name, query_only) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var loan_contract_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                var param = {};
                if (record.get('loan_contract_status') == 'COMPLETED') {
                    param['loan_contract_id'] = record.get('loan_contract_id');
                    param['function_code'] = 'TRE503F';
                    param['function_usage'] = 'QUERY';
                } else {
                    param['function_code'] = 'TRE503F';
                    param['loan_contract_id'] = record.get('loan_contract_id');
                    param['function_usage'] = 'MODIFY';
                }
                //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_loan_contract_add_link_id', loan_contract_id);
            }
            
            //超链接渲染
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                var link_function = '';
                window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
                if (name == 'loan_contract_number' && !record.isNew) {
                    link_function = 'loan_contract_number';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value + '</a>';
                }
            };
            
            window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) { //查询权限
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                if (ds == $(ds_id)) {
                    aut_authority_list_validate_query(ds, qpara);
                }
            };
            //融资合同维护按钮
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                var record = $(ds_id).getCurrentRecord();
                var param = {};
                param['loan_contract_id'] = record.get('loan_contract_id');
                param['function_code'] = 'TRE503P';
                param['function_usage'] = 'UPDATE';
                param['url_title'] = '融资合同维护';
                param['screen_width'] = 400;
                param['screen_height'] = 300;
                //param['pre_layout_code'] = '${/parameter/@layout_code}';
                param['winid'] = 'tre503p_loan_contract_status_winid';
                //param['pre_layout_code'] = '${/parameter/@layout_code}';
                //param['document_category'] = record.get('document_category');
                //param['document_type'] = record.get('document_type');
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'tre_loan_contract_status_link_id', ds_id);
            };
            
            //合同状态更改记录
            window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                var record = $(ds_id).getSelected()[0];
                var param = {};
                param['function_code'] = 'TRE503Q';
                param['function_usage'] = 'QUERY';
                param['url_title'] = '借款合同状态更改记录';
                param['loan_contract_id'] = record.get('loan_contract_id');
                param['winid'] = 'tre503q_tre_loan_contract_modify_winid';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'tre_get_status_id', ds_id);
            
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=LOAN_CONTRACT&amp;function_code=TRE503"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>