con_contract_bp_add.lview 5.45 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2016-12-23 上午10:10:58  
    $Revision: 1.0  
    $Purpose: 债权增加担保人
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="con_collction_add_guar_link_id" model="cont.CON640.con_collection_tool" modelaction="execute"/>
        <a:link id="con640_function_page_link" url="${/request/@context_path}/modules/cont/CON640/con_collection_tool_entrance.lview"/>
        <a:link id="${/parameter/@layout_code}_con640_add_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="${/parameter/@layout_code}_con640_add_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.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'], 'con_collection');
                Leaf.showConfirm('提示','确认增加当前担保信息吗?',function(){
        	        window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
        	        Leaf.request({
		                url: $('con_collction_add_guar_link_id').getUrl(),
		                para: {
		                    col_id :'${/parameter/@col_id}',
		                    contract_id:'${/parameter/@contract_id}'
		                },
		                success: function(res) {
		                    
		    	            Leaf.SideBar.show({
		    	            	msg:'操作成功!',
		    	            	duration:2000
		    	            });
		    	            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
		                    location.href = $('con640_function_page_link').getUrl()+'?function_code=CON640';
                            parent.shMenu('show');
		                },
		                failure:function(){
		                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
		                },
		                error:function(){
		                   window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
		                },
		                scope: this
	            	}); 
        	    });
            };
            
            
                //超链接渲染
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
               if (name == 'attachment') {
                    link_function = '${/parameter/@layout_code}_con640_add_guar_cdd_attachtment_upload';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
                }else if (name == 'attach_file_name') {
                    //附件名称
                    if (value != null) {
                        var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
                        var str = value.split(';;');
                        var url = '';
                        for (var i = 0;i < str.length;i++) {
                            var temp = str[i].split('--');
                            if (!Leaf.isEmpty(temp[0])) {
            
                                var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase();
                                if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
                                    url = url + '<a ref="img" href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
                                } else {
                                    url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
                                }
                            }
                        }
                        return url;
                    }
                    
                } 
            };
        
         //附件上传
            window['${/parameter/@layout_code}_con640_add_guar_cdd_attachtment_upload'] = function(ds_id, id, name, query_only) {
                var record = $(ds_id).findById(id);

                if (record.get('check_id')) {
                    var url;
                    if (query_only == 'Y') {
                        url = $('${/parameter/@layout_code}_con640_add_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
                    } else {
                        url = $('${/parameter/@layout_code}_con640_add_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
                    }
                    var win = new Leaf.Window({
                        url: url,
                        title: '${l:HLS.SUPPORTING_DOCUMENT}',
                        id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id',
                        width: 850,
                        height: 400
                    });
            
                    win.on('close', function() {
                        record.ds.query();
                    });
                } else {
                    Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
                }
            }; 
  ]]></script>
    </a:view>
</a:screen>