hn_asset_lease_query.lview 14.4 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wujun  
    $Date: 2017-1-20 16:07:09  
    $Revision: 1.0  
    $Purpose: 资产租赁物查询报表
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query model="rpt.rpt_now_date" rootPath="sysdate_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="hn5070_lease_detail_leb_link" url="${/request/@context_path}/modules/hn/HN5070/hn_lease_list_query_detail.lview"/>
        <a:link id="hn5070_estate_lease_detail_link" url="${/request/@context_path}/modules/hn/HN5070/hn_estate_lease_list_detail.lview"/>
        <a:link id="hn5070_statistics_of_major_lease_detail_link" url="${/request/@context_path}/modules/hn/HN5070/hn_statistics_of_major_leases_detail.lview"/>
        <a:link id="hn5070_statistics_chattel_major_lease_detail_link" url="${/request/@context_path}/modules/hn/HN5070/hn_statistics_chattel_major_lease_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function hn5070_asset_lease_query() {
                $('hn5070_prj_project_result_ds').query();
            }
            
            function hn5070_asset_lease_reset() {
                $('hn5070_prj_project_query_ds').reset();
            }
            
            function hn5070_asset_lease_export() {
                $('hn5070_prj_project_result_grid_id')._export();
            }
            
            function open_lease_detail_leb_window(project_id) {
                var record = $('hn5070_prj_project_query_ds').getCurrentRecord();
                var win = new Leaf.Window({
                    id: 'hn5070_lease_detail_leb_win_id',
                    url: $('hn5070_lease_detail_leb_link').getUrl(),
                    params: {
                        project_id: project_id,
                        query_date: record.get('query_date'),
                        winid: 'hn5070_lease_detail_leb_win_id'
                    },
                    title: '租赁物清单(动产)',
                    fullScreen: true
                });
            }
            
            function lease_detail_leb(value, record, name) {
                if (name == 'lease_detail_leb') {
                    return '<a href="javascript:open_lease_detail_leb_window(' + record.get('project_id') + ');">明细</a>';
                }
            }
            
            function open_estate_lease_detail_window(project_id) {
                var record = $('hn5070_prj_project_query_ds').getCurrentRecord();
                var win = new Leaf.Window({
                    id: 'hn5070_estate_lease_detail_win_id',
                    url: $('hn5070_estate_lease_detail_link').getUrl(),
                    params: {
                        project_id: project_id,
                        query_date: record.get('query_date'),
                        winid: 'hn5070_estate_lease_detail_win_id'
                    },
                    title: '租赁物清单(不动产)',
                    fullScreen: true
                });
            }
            
            function lease_detail(value, record, name) {
                if (name == 'lease_detail') {
                    return '<a href="javascript:open_estate_lease_detail_window(' + record.get('project_id') + ');">明细</a>';
                }
            }
            
            function open_statistics_of_major_lease_detail_window(project_id, binary_classification) {
                var record = $('hn5070_prj_project_query_ds').getCurrentRecord();
                if (binary_classification == 'CENTRALIZED_PHOTOELECTRIC' || binary_classification == 'FULL_PHOTOELECTRIC' || binary_classification == 'SELF_PHOTOELECTRIC') {
                    hn_industry_classification = 'LIGHT_POWER';
                } else if (binary_classification == 'PHOTOELECTRIC') {
                    binary_classification = 'WIND_POWER';
                }
                
                var win = new Leaf.Window({
                    id: 'hn5070_statistics_of_major_lease_detail_win_id',
                    url: $('hn5070_statistics_of_major_lease_detail_link').getUrl(),
                    params: {
                        project_id: project_id,
                        binary_classification: binary_classification,
                        query_date: record.get('query_date'),
                        winid: 'hn5070_statistics_of_major_lease_detail_win_id'
                    },
                    title: '主要租赁物统计表(动产)',
                    fullScreen: true
                });
            }
            
            function lease_statistics_leb(value, record, name) {
                if (name == 'lease_statistics_leb') {
                    return '<a href="javascript:open_statistics_of_major_lease_detail_window(' + record.get('project_id') + ',\'' + record.get('binary_classification') + '\');">明细</a>';
                }
            }
            
            function open_statistics_chattel_major_lease_detail_window(project_id) {
                var record = $('hn5070_prj_project_query_ds').getCurrentRecord();
                var win = new Leaf.Window({
                    id: 'hn5070_statistics_chattel_major_lease_detail_win_id',
                    url: $('hn5070_statistics_chattel_major_lease_detail_link').getUrl(),
                    params: {
                        project_id: project_id,
                        query_date: record.get('query_date'),
                        winid: 'hn5070_statistics_chattel_major_lease_detail_win_id'
                    },
                    title: '主要租赁物统计表(不动产)',
                    fullScreen: true
                });
            }
            
            function lease_statistics(value, record, name) {
                if (name == 'lease_statistics') {
                    return '<a href="javascript:open_statistics_chattel_major_lease_detail_window(' + record.get('project_id') + ');">明细</a>';
                }
            }
            
            function sum_foot(data, name) {
                if (name == 'virtual_con_number') {
                    return '<font color=red>' + '合计' + '</font>';
                } else if (name == 'amount_principal') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'surplus_amount') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'original_asset_value_leb') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'lease_transfer_price_leb') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'sur_transfer_price_leb') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'original_asset_value') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'lease_transfer_price') {
                    return colum_caculateTotal(data, name);
                } else if (name == 'sur_transfer_price') {
                    return colum_caculateTotal(data, name);
                }
            
            }
            
            function colum_caculateTotal(data, name) {
                var total = 0;
                var length = data.length;
                var value = 0;
                for (var i = 0;i < length;i++) {
                    if (Ext.isEmpty(data[i].get(name))) {
                        value = 0;
                    } else {
                        value = data[i].get(name);
                    }
                    total = plus(total, value);
                }
                return '<font color=red>' + Leaf.formatMoney(total) + '</font>';
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hn_industry_classification_ds" lookupCode="HN_INDUSTRY_CLASSIFICATION"/>
            <a:dataSet id="business_type_ds" autoQuery="true" model="rpt.RPT5010.rpt5010_business_type"/>
            <a:dataSet id="hn5070_prj_project_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="virtual_con_number" typeCase="Upper"/>
                    <a:field name="hn_industry_classification_n" displayField="code_value_name" options="hn_industry_classification_ds" returnField="hn_industry_classification" valueField="code_value"/>
                    <a:field name="business_type_n" displayField="description" options="business_type_ds" returnField="business_type" valueField="business_type"/>
                    <a:field name="query_date" defaultValue="${/model/sysdate_path/record/@now_date}" required="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hn5070_prj_project_result_ds" autoPageSize="true" autoQuery="true" model="hn.HN5070.hn_asset_lease_query" queryDataSet="hn5070_prj_project_query_ds" selectable="true">
                <a:fields>
                    <a:field name="hn_industry_classification_n" displayField="code_value_name" options="hn_industry_classification_ds" returnField="hn_industry_classification" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hn5070_asset_lease_query" text="HLS.QUERY"/>
                <a:gridButton click="hn5070_asset_lease_reset" text="重置"/>
                <a:gridButton click="hn5070_asset_lease_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="150" marginWidth="30" title="查询条件">
                <a:textField name="virtual_con_number" bindTarget="hn5070_prj_project_query_ds" prompt="合同号"/>
                <a:textField name="virtual_con_name" bindTarget="hn5070_prj_project_query_ds" prompt="合同名称"/>
                <a:textField name="project_name" bindTarget="hn5070_prj_project_query_ds" prompt="项目名称"/>
                <a:comboBox name="hn_industry_classification_n" bindTarget="hn5070_prj_project_query_ds" prompt="行业分类"/>
                <a:textField name="binary_classification_n" bindTarget="hn5070_prj_project_query_ds" prompt="行业细分"/>
                <a:comboBox name="business_type_n" bindTarget="hn5070_prj_project_query_ds" prompt="租赁形式"/>
                <a:numberField name="amount_principal_from" bindTarget="hn5070_prj_project_query_ds" prompt="投资总额从"/>
                <a:numberField name="amount_principal_to" bindTarget="hn5070_prj_project_query_ds" prompt="投资总额到"/>
                <a:numberField name="surplus_amount_from" bindTarget="hn5070_prj_project_query_ds" prompt="剩余本金从"/>
                <a:numberField name="surplus_amount_to" bindTarget="hn5070_prj_project_query_ds" prompt="剩余本金到"/>
                <a:numberField name="sur_transfer_price_leb_from" bindTarget="hn5070_prj_project_query_ds" prompt="租赁物账面净值从"/>
                <a:numberField name="sur_transfer_price_leb_to" bindTarget="hn5070_prj_project_query_ds" prompt="租赁物账面净值到"/>
                <a:datePicker name="query_date" bindTarget="hn5070_prj_project_query_ds" prompt="查询日期"/>
            </a:form>
            <a:grid id="hn5070_prj_project_result_grid_id" bindTarget="hn5070_prj_project_result_ds" marginHeight="255" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="virtual_con_number" align="center" footerRenderer="sum_foot" prompt="合同号" width="130"/>
                    <a:column name="virtual_con_name" prompt="合同名称" width="200"/>
                    <a:column name="project_name" prompt="项目名称" width="200"/>
                    <a:column name="hn_industry_classification_n" align="center" prompt="行业分类" width="80"/>
                    <a:column name="binary_classification_n" prompt="行业细分" width="100"/>
                    <a:column name="lease_form" align="center" prompt="租赁形式" width="100"/>
                    <a:column name="lease_term" align="center" prompt="租期(年)" width="80"/>
                    <a:column name="amount_principal" align="right" footerRenderer="sum_foot" prompt="投资总额" renderer="Leaf.formatMoney" width="130"/>
                    <a:column name="surplus_amount" align="right" footerRenderer="sum_foot" prompt="剩余本金" renderer="Leaf.formatMoney" width="130"/>
                    <a:column prompt="动产租赁物信息">
                        <a:column name="full_name_leb" prompt="租赁物名称" width="150"/>
                        <a:column name="original_asset_value_leb" align="right" footerRenderer="sum_foot" prompt="采购总价格" renderer="Leaf.formatMoney" width="130"/>
                        <a:column name="lease_transfer_price_leb" align="right" footerRenderer="sum_foot" prompt="投放前租赁物账面净值" renderer="Leaf.formatMoney" width="150"/>
                        <a:column name="sur_transfer_price_leb" align="right" footerRenderer="sum_foot" prompt="租赁物账面净值" renderer="Leaf.formatMoney" width="150"/>
                        <a:column name="lease_statistics_leb" align="center" prompt="主要租赁物统计表" renderer="lease_statistics_leb" width="120"/>
                        <a:column name="lease_detail_leb" align="center" prompt="租赁物清单" renderer="lease_detail_leb" width="100"/>
                    </a:column>
                    <a:column prompt="不动产租赁物信息">
                        <a:column name="full_name" prompt="租赁物名称" width="150"/>
                        <a:column name="original_asset_value" align="right" footerRenderer="sum_foot" prompt="采购总价格" renderer="Leaf.formatMoney" width="130"/>
                        <a:column name="lease_transfer_price" align="right" footerRenderer="sum_foot" prompt="投放前租赁物账面净值" renderer="Leaf.formatMoney" width="150"/>
                        <a:column name="sur_transfer_price" align="right" footerRenderer="sum_foot" prompt="租赁物账面净值" renderer="Leaf.formatMoney" width="150"/>
                        <a:column name="lease_statistics" align="center" prompt="主要租赁物统计表" renderer="lease_statistics" width="120"/>
                        <a:column name="lease_detail" align="center" prompt="租赁物清单" renderer="lease_detail" width="100"/>
                    </a:column>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>