ast_car_inspection.lview 3.14 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Icon  
    $Date: 2014-10-15 上午11:22:08  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="inspection_attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <script type="text/javascript"><![CDATA[
    	function receipt_attachment_upload(val,rec,name){
    	   return '<a href=javascript:open_upload_window('+rec.get('inspection_id')+')>附件上传</a>';
    	}
        	
		function open_upload_window(record_id){
		    	if(Leaf.isEmpty(record_id)) {
		    	    Leaf.showMessage('提示','请先保存再上传附件!');
		    	    return;
		    	}
        	    var url = $('inspection_attachment_uploadFile_id').getUrl() + '?table_name=AST_CAR_INSPECTION&header_id=' + record_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'inspection_uploadFile_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {
                });
        }    
        
        function inspectionSubmitsuccess(ds) {
            ds.query();
        }
        
		]]></script>
        <a:dataSets>
            <a:dataSet id="ast_car_inspection_result_ds" model="ast.AST508.ast_car_inspection" selectable="true">
                <a:fields>
                    <a:field name="inspection_id"/>
                    <a:field name="item_detail_id"/>
                    <a:field name="inspection_date"/>
                    <a:field name="inspected_date"/>
                    <a:field name="inspection_result"/>
                    <a:field name="description"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="inspectionSubmitsuccess"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:grid id="ast_car_inspection_grid_id" bindTarget="ast_car_inspection_result_ds" height="210" marginWidth="30" navBar="true">
            <a:toolBar>
                <a:button type="add"/>
                <a:button type="delete"/>
            </a:toolBar>
            <a:columns>
                <a:column name="inspection_date" editor="ast_car_inspection_dp" prompt="应年检日期" renderer="Leaf.formatDate" width="100"/>
                <a:column name="inspected_date" editor="ast_car_inspection_dp" prompt="实际年检日期" renderer="Leaf.formatDate" width="200"/>
                <a:column name="inspection_result" editor="ast_car_inspection_tf" prompt="年检结果" width="100"/>
                <a:column name="description" editor="ast_car_inspection_tf" prompt="描述" width="284"/>
                <a:column align="center" prompt="附件上传" renderer="receipt_attachment_upload" width="80"/>
            </a:columns>
            <a:editors>
                <a:textField id="ast_car_inspection_tf"/>
                <a:datePicker id="ast_car_inspection_dp"/>
            </a:editors>
        </a:grid>
        <a:hBox/>
    </a:view>
</a:screen>