loan_change_create_entrance.lview 6.11 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="loan_change_modify_link" url="${/request/@context_path}/modules/lon/LON120/loan_change_modify.lview"/>
        <a:link id="loan_change_req_modify_link1_id"
                url="${/request/@context_path}/modules/lon/LON120/loan_change_req_modify.lview"/>
        <a:link id="${/parameter/@layout_code}get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel"
                modelaction="update"/>
        <a:link id="loan_change_create_entrance1_link_id"
                url="${/request/@context_path}/modules/lon/LON120/loan_change_create_entrance.lview"/>
        <script type="text/javascript"><![CDATA[
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_change_req');
                var param = {};
                param['function_code'] = 'LON120E';
                param['function_usage'] = 'CREATE';
                param['url_title'] = '融资合同变更';
                param['winid'] = 'lon120_loan_change_create_winid';
                hls_doc_get_layout_code('${/parameter/@layout_code}get_layout_code_link_id', param, 'loan_change_modify_link', ds_id);
            };

        window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_change_req');
            var record = $(ds_id).getSelected();
            var param = {};
            param['function_code'] = 'LON120Q';
            param['function_usage'] = 'QUERY';
            param['loan_change_req_id'] = record[0].get('loan_change_req_id');
            param['url_title'] = '融资合同变更';
            param['winid'] = 'lon120_loan_change_create_winid';
            hls_doc_get_layout_code('${/parameter/@layout_code}get_layout_code_link_id', param, 'loan_change_modify_link', ds_id);
        };

        window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
            window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_con_change_req');
            var record = $(ds_id).getSelected();
            var loan_contract_id = record[0].get('loan_contract_id');
            var loan_change_req_id = record[0].get('loan_change_req_id');
            Leaf.request({
                url: $('tre_loan_contact_cancel_change_link_id').getUrl(),
                para: {
                    loan_contract_id: loan_contract_id,
                    loan_change_req_id:loan_change_req_id
                },
                success: function () {
                    Leaf.SideBar.show({
                        msg: '撤销成功!',
                        duration: 2000
                    });
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    var url = $('loan_change_create_entrance1_link_id').getUrl() + '?layout_code=TRE_CONTRACT_CHANGE_ENTRANCE&function_code=LON120';
                    Leaf.go(url);
                },
                failure: function () {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                },
                error: function () {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                },
                scope: this
            });
        };

        function open_change_req_num_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            if(record.get('change_req_status')=='NEW' || record.get('change_req_status')=='REJECT'){
                param['function_usage'] = 'MODIFY';
                param['function_code'] = 'LON120N';
            }else{
                param['function_usage'] = 'QUERY';
                param['function_code'] = 'LON120A';
            }
            param['loan_contract_id'] = record.get('loan_change_req_id');
            param['loan_change_req_id'] = record.get('loan_change_req_id');
            param['url_title'] =  '融资合同变更';
            param['winid'] = 'lon120_open_change_req_winid';
            hls_doc_get_layout_code('${/parameter/@layout_code}get_layout_code_link_id', param, 'loan_change_req_modify_link1_id', ds_id);

        }
        function open_change_req_num_history_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;

            param['function_usage'] = 'QUERY';
            param['function_code'] = 'LON120A';
            param['loan_contract_id'] = record.get('history_document_id');
            param['loan_change_req_id'] = record.get('loan_change_req_id');
            param['url_title'] =  '融资合同变更';
            param['winid'] = 'lon120_open_change_req_winid';
            hls_doc_get_layout_code('${/parameter/@layout_code}get_layout_code_link_id', param, 'loan_change_req_modify_link1_id', ds_id);

        }


        window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
            if (name == 'change_req_num' && value) {
                return '<a href="javascript:open_change_req_num_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
            }
            if(name == 'history_document_id' ){
                if(value){
                return '<a href="javascript:open_change_req_num_history_win(\'' + record.ds.id + '\',\'' + record.id + '\')">历史信息</a>';
                }
            }
            return value;
        };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>