ast_car_license.lview 5.05 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qm  
    $Date: 2014-4-21 上午10:05:13  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="license_attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <script type="text/javascript"><![CDATA[
        	function licenseUpdateHandler(ds,rec,name,val,oldVal){
        	    if('license_number' == name ){
        	        if('沪' == val.substring(0,1)){
        	            $('ast_car_license_result_ds').getCurrentRecord().set('shh_license_flag','Y');
        	        }
        	        else{
        	            $('ast_car_license_result_ds').getCurrentRecord().set('shh_license_flag','N');
        	        }
        	        
        	    }else if('shh_license_flag' == name){
        	        rec.getField('purchase_date').setReadOnly(val == 'N');
        	        rec.getField('purchase_price').setReadOnly(val == 'N');
        	        rec.getField('license_end_date').setReadOnly(val == 'N');
        	    }
        	}
        	
        	function receipt_attachment_upload(val,rec,name){
        	    return '<a href=javascript:open_upload_window('+rec.get('ast_car_license_id')+')>附件</a>';
        	}
        	
        	function open_upload_window(record_id){
        	    var url = $('license_attachment_uploadFile_id').getUrl() + '?table_name=AST_CAR_LICENSE&header_id=' + record_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'license_uploadFile_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {
                });
        	}
        	
        	function my_date_func(val,rec,name){
        	    var flag = rec.get('shh_license_flag');
        	    rec.getField('purchase_date').setReadOnly(flag == 'N');
        	    rec.getField('purchase_price').setReadOnly(flag == 'N');
        	    rec.getField('license_end_date').setReadOnly(flag == 'N');
        	    
        	    return Leaf.formatDate(val,rec,name);
        	}
		]]></script>
        <a:dataSets>
            <a:dataSet id="ast_car_license_result_ds" model="ast.AST301.ast_car_license" selectable="true">
                <a:fields>
                    <a:field name="ast_car_license_id"/>
                    <a:field name="item_detail_id"/>
                    <a:field name="license_number"/>
                    <a:field name="on_car_date"/>
                    <a:field name="license_fee" required="true"/>
                    <a:field name="license_attach_fee"/>
                    <a:field name="shh_license_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="purchase_date" readOnly="true"/>
                    <a:field name="purchase_price" readOnly="true"/>
                    <a:field name="license_end_date" readOnly="true"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="licenseUpdateHandler"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:grid id="ast_car_license_grid_id" bindTarget="ast_car_license_result_ds" height="200" marginWidth="42" navBar="true">
            <a:columns>
                <a:column name="license_number" prompt="牌照" width="120"/>
                <a:column name="on_car_date" prompt="上牌日期" renderer="Leaf.formatDate" width="105"/>
                <a:column name="license_fee" align="right" prompt="上牌费用" renderer="Leaf.formatMoney" width="105"/>
                <a:column name="license_attach_fee" align="right" prompt="上牌杂费" renderer="Leaf.formatMoney" width="105"/>
                <a:column name="mortgage_date" prompt="抵押日期" renderer="Leaf.formatDate" width="105"/>
                <a:column name="shh_license_flag" prompt="是否上海牌照" width="105"/>
                <a:column name="purchase_date" prompt="收购日" renderer="my_date_func" width="105"/>
                <a:column name="purchase_price" align="right" prompt="收购价格" renderer="Leaf.formatMoney" width="105"/>
                <!-- <a:column prompt="上牌日" width="105" name="on_car_date"  renderer="Leaf.formatDate"/> -->
                <a:column name="license_end_date" prompt="下牌日" renderer="Leaf.formatDate" width="105"/>
                <a:column name="enabled_flag" prompt="是否启用" width="80"/>
                <a:column align="center" prompt="发票附件" renderer="receipt_attachment_upload" width="105"/>
            </a:columns>
            <a:editors>
                <a:numberField id="ast_car_license_nf"/>
                <a:textField id="ast_car_license_tf"/>
                <a:datePicker id="ast_car_license_dp"/>
                <a:checkBox id="ast_car_license_cb"/>
            </a:editors>
        </a:grid>
        <a:hBox/>
    </a:view>
</a:screen>