<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangyu  
    $Date: 2015-12-19 下午19:17:13  
    $Revision: 1.0  
    $Purpose: 资金计划平衡头表(季度)
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="sdic2020_attach_download_link" url="${/request/@context_path}/downloadFile.lview"/>
        <script type="text/javascript"><![CDATA[
            
            function atm_download_renderer(value, record, name) {
                if (!Ext.isEmpty(record.get('hd_id'))) {
                    return '<a href="javascript:atm_download_win(' + record.get('hd_id') + ')">' + '报表下载' + '</a>';
                }
            }
            
            function atm_download_win(hd_id) {
                var url = $('sdic2020_attach_download_link').getUrl() + '?table_name=SDIC_FIN_PLAN_RPT_QUARTER_HD&header_id=' + hd_id;
                new Leaf.Window({
                    url: url,
                    title: '${l:TRE510.ATTACHMENT_UPLOAD}',
                    id: 'sdic2020_fin_plan_rpt_quarter_win',
                    width: 850,
                    height: 400
                });
            }
           
        ]]></script>
        <a:dataSets>
            <a:dataSet id="sdic2020_query_hd_ds" autoCreate="true">
                <a:fields>
                    <a:field name="hd_id" defaultValue="${/parameter/@hd_id}"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="sdic2020_result_hd_ds" autoPageSize="true" autoQuery="true" model="sdic.SDIC2020.sdic_fin_plan_rpt_quarter_hd" queryDataSet="sdic2020_query_hd_ds" selectable="true">
                <a:fields>
                    <a:field name="plan_year_n" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="tre.TRE1010.sdic_fin_plan_base_data_lov?plan_frequency=QUARTERLY" lovWidth="500" required="true" title="基础数据">
                        <a:mapping>
                            <a:map from="data_id" to="data_id"/>
                            <a:map from="plan_year" to="plan_year"/>
                            <a:map from="plan_year_n" to="plan_year_n"/>
                            <a:map from="plan_month" to="plan_month"/>
                            <a:map from="plan_month_n" to="plan_month_n"/>
                            <a:map from="plan_frequency" to="plan_frequency"/>
                            <a:map from="plan_frequency_n" to="plan_frequency_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="plan_month_n" readOnly="true"/>
                    <a:field name="plan_frequency_n" readOnly="true"/>
                    <a:field name="status" defaultValue="NEW"/>
                    <a:field name="status_n" defaultValue="新建" displayField="code_value_name" options="status_ds" returnField="status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:grid id="sdic2020_result_hd_grid_id" bindTarget="sdic2020_result_hd_ds" marginHeight="200" marginWidth="200" navBar="true">
                <a:columns>
                    <a:column name="plan_year_n" align="center" prompt="年份" width="100"/>
                    <a:column name="plan_month_n" align="center" prompt="月份" width="100"/>
                    <a:column name="plan_frequency_n" align="center" prompt="频率" width="100"/>
                    <a:column name="description" prompt="说明" width="300"/>
                    <!-- <a:column name="status_n" align="center" prompt="状态" width="100"/> -->
                    <!-- <a:column name="hd_id" align="center" renderer="ln_detail" prompt="生成报表" width="100"/> -->
                    <a:column name="attachment_id" align="center" prompt="报表下载" renderer="atm_download_renderer" width="100"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
