<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-4-2 上午09:14:18  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="hls_lease_item_create_id" url="${/request/@context_path}/modules/hls/HLS201/hls_lease_item_create.lview"/>
        <a:link id="hls201_lease_item_update_id" url="${/request/@context_path}/modules/hls/HLS201/hls_lease_item_update.lview"/>
        <a:link id="hls201_hls_lease_item_detail_id" url="${/request/@context_path}/modules/hls/HLS201/hls_lease_item_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function hls_hls201_query() {
                $('hls_lease_item_result_ds').query();
            }
            
            function hls_hls201_reset() {
                $('hls_lease_item_query_ds').reset();
            }
            
            function hls_hls201_next() {
                history.go(1);
            }
            
            function hls_hls201_back() {
                history.go(-1);
            }
            
            function hls_hls201_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
                parent.shMenu('show');
            }
            
            function hls_hls201_add() {
                var url = $('hls_lease_item_create_id').getUrl();
                new Leaf.Window({
                    url: url,
                    title: '${l:HLS_LEASE_ITEM.LEASE_ITEM_UPDATE}',
                    id: 'hls_lease_item_create_winId',
                    width: 1000,
                    height: 540
                });
            }
            
            function hls_hls201_clear() {
                $('hls_lease_item_grid_ds').clear();
            }
            
            function seedetail(value, record, name) {
                if (record.get('lease_item_id')) {
                    var url = $('hls201_lease_item_update_id').getUrl() + '?lease_item_id=' + record.get('lease_item_id');
                    return '<a href="javascript:openWindow(\'' + url + '\');">' + value + '</a>';
                }
            }
            
            function seedetail_lease_item(value, record, name) {
                if (record.get('lease_item_id')) {
                    var url = $('hls201_hls_lease_item_detail_id').getUrl() + '?lease_item_id=' + record.get('lease_item_id')+'&li_list_type='+record.get('li_list_type');
                    return '<a href="javascript:openWindow_detail(\'' + url + '\');">' + '${l:HLS201.HLS_LEASE_ITEM_LIST}' + '</a>';
                }
            }
            
            function openWindow_detail(url){
                new Leaf.Window({
                    url: url,
                    params:{
                        winId:'hls_lease_item_detail_winId'
                    },
                    title: '${l:HLS201.HLS_LEASE_ITEM_LIST}',
                    id: 'hls_lease_item_detail_winId',
                    width: 900,
                    height: 480
                });
            }
            function openWindow(url) {
                new Leaf.Window({
                    url: url,
                    title: '${l:HLS_LEASE_ITEM.LEASE_ITEM_UPDATE}',
                    id: 'hls_lease_item_update',
                    width: 1000,
                    height: 540
                });
            }
            function hls_hls201_tplt_down(){
			    var url = $('uploadFile_id').getUrl()+'?table_name=HLS_LEASE_ITEM_LIST&header_id=1';
                new Leaf.Window({
                    url: url,
                    title: '${l:HLS201.HLS_LEASE_ITEM_LIST_TPLT_IPT}',
                    id: 'hls_lease_item_list_winId',
                    width: 850,
                    height: 400
                });
			}
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_lease_item_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="lease_item_code" lovGridHeight="350" lovHeight="500" lovService="basic.hls_lease_item_v_for_lov" lovWidth="500" prompt="HLS.LEASE_ITEM_CODE" title="HLS.LEASE_ITEM">
                        <a:mapping>
                            <a:map from="lease_item_id" to="lease_item_id"/>
                            <a:map from="lease_item_code" to="lease_item_code"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="short_name"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls_lease_item_result_ds" autoQuery="true" model="hls.HLS201.hls_lease_item" queryDataSet="hls_lease_item_query_ds" selectable="true">
                <a:fields>
                    <a:field name="enabled_flag" checkedValue="Y" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="hls_hls201_back" text="HLS.BACK"/>
                <a:gridButton click="hls_hls201_next" text="HLS.FORWARD"/>
                <a:gridButton click="hls_hls201_quit" text="HLS.EXIT"/>
                <a:gridButton click="hls_hls201_add" text="HLS.NEW"/>
                <a:gridButton click="hls_hls201_clear" text="HLS.CLEAR"/>
                <a:gridButton click="hls_hls201_query" text="HLS.QUERY"/>
                <a:gridButton click="hls_hls201_reset" text="HLS.RESET"/>
                <a:gridButton click="hls_hls201_tplt_down" text="HLS201.HLS_LEASE_ITEM_LIST_TPLT_IPT"/>
            </a:screenTopToolbar>
            <a:form column="2" title="HLS_LEASE_ITEM.LEASE_ITEM_QUERY" width="600">
                <a:lov name="lease_item_code" bindTarget="hls_lease_item_query_ds" prompt="HLS.LEASE_ITEM_CODE">
                    <a:events>
                        <a:event name="enterdown" handler="hls_hls201_query"/>
                    </a:events>
                </a:lov>
                <a:textField name="short_name" bindTarget="hls_lease_item_query_ds" prompt="HLS_LEASE_ITEM.SHORT_NAME">
                    <a:events>
                        <a:event name="enterdown" handler="hls_hls201_query"/>
                    </a:events>
                </a:textField>
            </a:form>
            <a:grid id="hls_lease_item_grid_ds" bindTarget="hls_lease_item_result_ds" marginHeight="170" marginWidth="30" navBar="true">
                <a:columns>
                    <!-- <a:column name="lease_item_type_desc" align="center"/> -->
                    <a:column name="lease_item_code" align="center" renderer="seedetail"/>
                    <a:column name="short_name" align="center"/>
                    <a:column name="full_name" align="center"/>
                    <!-- <a:column name="search_term" align="center"/> -->
                    <a:column name="pattern" align="center"/>
                    <a:column name="specification" align="center"/>
                    <a:column name="manufacturer_name" align="center"/>
                    <!-- <a:column name="manufacturing_date" align="center"/> -->
                    <a:column name="vender_name" align="center"/>
                    <!-- <a:column name="installation_site" align="center"/>
                    <a:column name="fixed_assets_site" align="center"/>
                    <a:column name="price" align="center" renderer="Leaf.formatMoney"/>
                    <a:column name="original_asset_value" align="center"/>
                    <a:column name="net_asset_value" align="center"/>
                    <a:column name="accumulated_depreciation" align="center"/>
                    <a:column name="detention" align="center"/>
                    <a:column name="currency" align="center"/>-->
                    <a:column name="enabled_flag" align="center"/>
                    <a:column name="lease_item_id" align="center" prompt="HLS201.HLS_LEASE_ITEM_LIST" renderer="seedetail_lease_item"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>