hls_notice_defintion.lview 3.51 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zyx 
    $Date: 2016-12-13 下午3:12:06
    $Revision: 1.0  
    $Purpose: 公告定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
    <a:init-procedure><![CDATA[
	]]></a:init-procedure>
    <a:view>
        <a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <script type="text/javascript"><![CDATA[
	        //新增时调用(grid,table,gridBox)
	        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) {
	            if ((ds.id).indexOf('hls_notice_definition') != -1) {
	                //开始时间校验

	                if (ds.fields.start_date) {
	                    ds.fields.start_date.pro.validator = start_date_validate;
	                }
	                //结束时间校验
	                if (ds.fields.end_date) {
	                    ds.fields.end_date.pro.validator = end_date_validate;
	                }
	            }
	        };
	        
	        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
            	if ((ds.id).indexOf('hls_notice_definition') != -1) {
	                //开始时间校验

	                if (ds.fields.start_date) {
	                    ds.fields.start_date.pro.validator = start_date_validate;
	                }
	                //结束时间校验
	                if (ds.fields.end_date) {
	                    ds.fields.end_date.pro.validator = end_date_validate;
	                }
	            }
         	};
	        
	        function start_date_validate(record, name, value) {
				var end_date = record.get('end_date');
				if(value > end_date){
				    return '开始时间不能晚于结束时间';
				}     
	            return true;
	        }
	            
	        function end_date_validate(record, name, value) {
				var start_date = record.get('start_date');   
				if(start_date > value){
				    return '开始时间不能晚于结束时间';
				}     
	            return true;
	        }
           window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record, bp_seq) {
                var link_function = '';
                var hls_notice_definition_id = record.get('hls_notice_definition_id');
                window['${/parameter/@bp_seq}${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
                if (name == 'attachment') {
                    return '<a href="javascript:attachment_window_open(\'' + hls_notice_definition_id + '\',\'' + record.id + '\',\'' + record.ds.id + '\');">' + '附件' + '</a>';
                }
            };
            
            function attachment_window_open(hls_notice_definition_id,record_id,ds_id){

            	url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=HLS_NOTICE_DEFINITION&header_id=' + hls_notice_definition_id;
            	wd = new Leaf.Window({
                	id: 'attachment_up_window',
                	url: url,
                	title: '附件上传',
                	height: 350,
                	width: 850
            	});
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>