prj_fsn_equity_tab.lview 19.3 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 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-10-15 上午10:46:15  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="is_show =&apos;Y&apos;" fetchAll="true" model="prj.PRJ509.prj_fsn_config" queryOrderBy="order_seq" rootPath="equity_rp"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
    	function share_capt_ef(record, name) {
                if (name == 'item_detail_desc') {
                    if (record.get('item_detail')) {
                        return '';
                    } else {
                        return 'share_capt_tf';
                    }
                } else if (name == 'balance') {
                    if (record.get('item_detail') == 'TOTAL') {
                        return '';
                    } else {
                        return 'share_capt_nf';
                    }
                }
            }
            function capt_resv_ef(record, name) {
                if (name == 'item_detail_desc') {
                    if (record.get('item_detail')) {
                        return '';
                    } else {
                        return 'capt_resv_tf';
                    }
                } else if (name == 'balance') {
                    if (record.get('item_detail') == 'TOTAL') {
                        return '';
                    } else {
                        return 'capt_resv_nf';
                    }
                }
            }
            function tre_stock_ef(record, name) {
                if (name == 'item_detail_desc') {
                    if (record.get('item_detail')) {
                        return '';
                    } else {
                        return 'tre_stock_tf';
                    }
                } else if (name == 'balance') {
                    if (record.get('item_detail') == 'TOTAL') {
                        return '';
                    } else {
                        return 'tre_stock_nf';
                    }
                }
            }
            function surp_resv_ef(record, name) {
                if (name == 'item_detail_desc') {
                    if (record.get('item_detail')) {
                        return '';
                    } else {
                        return 'surp_resv_tf';
                    }
                } else if (name == 'balance') {
                    if (record.get('item_detail') == 'TOTAL') {
                        return '';
                    } else {
                        return 'surp_resv_nf';
                    }
                }
            }
            function retned_earnings_ef(record, name) {
                if (name == 'item_detail_desc') {
                    if (record.get('item_detail')) {
                        return '';
                    } else {
                        return 'retned_earnings_tf';
                    }
                } else if (name == 'balance') {
                    if (record.get('item_detail') == 'TOTAL') {
                        return '';
                    } else {
                        return 'retned_earnings_nf';
                    }
                }
            }
            
            
            function equity_footrender(data,name)
            {
                if(name=='item_detail_desc'){
                    return '${l:PRJ509.TOTAL}';
                }else if(name=='ratio'){
                    return '1.00';
                }else if(name=='balance'){
                    return equity_caculateTotal(data,name);
                }
            }
            
            //单独计算为分配利润
            function caculate_retned_earnings_fr(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;
                        total=minus(total,value);
                    }else if(data[i].get('item_detail')=='STATUTORY_SURPLUS_RESERVE'){
                        value=data[i].get(name);
                        total=minus(total,value);
                    }else {
                        value=data[i].get(name);
                        total=plus(total,value);
                    }
                }
                 return total.toFixed(2);
            }
            
            //求和计算
            function equity_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 total.toFixed(2);
            }
        ]]></script>
        <a:dataSets>
            <a:placeHolder id="equity_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:placeHolder id="equity_grid"/>
        </a:screenBody>
    </a:view>
    <a:view-config>
        <c:create-config targetId="equity_ds">
            <p:loop source="/model/equity_rp">
                <!-- 实收资本 -->
                <p:switch test="@fsn_item">
                    <p:case value="SHARE_CAPT">
                        <c:process-config>
                            <a:dataSet id="share_capt_ds" autoQuery="true" bindName="prj_fsn_share_capt" bindTarget="QueryScreen_paraDs" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_share_capt/query?config_id=${@config_id}" selectable="true" submitUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_share_capt/batch_update">
                                <a:events>
                                    <a:event name="update" handler="onUpdate_item_detail_common"/>
                                    <a:event name="remove" handler="remove_item_detail_common"/>
                                </a:events>
                            </a:dataSet>
                        </c:process-config>
                    </p:case>
                    <!-- 资本公积 -->
                    <p:case value="CAPT_RESV">
                        <c:process-config>
                            <a:dataSet id="capt_resv_ds" autoQuery="true" bindName="prj_fsn_capt_resv" bindTarget="QueryScreen_paraDs" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_capt_resv/query?config_id=${@config_id}" selectable="true" submitUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_capt_resv/batch_update">
                                <a:events>
                                    <a:event name="update" handler="onUpdate_item_detail_common"/>
                                    <a:event name="remove" handler="remove_item_detail_common"/>
                                </a:events>
                            </a:dataSet>
                        </c:process-config>
                    </p:case>
                    <!-- 库存股 -->
                    <p:case value="TRE_STOCK">
                        <c:process-config>
                            <a:dataSet id="tre_stock_ds" autoQuery="true" bindName="prj_fsn_tre_stock" bindTarget="QueryScreen_paraDs" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_tre_stock/query?config_id=${@config_id}" selectable="true" submitUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_tre_stock/batch_update">
                                <a:events>
                                    <a:event name="update" handler="onUpdate_item_detail_common"/>
                                    <a:event name="remove" handler="remove_item_detail_common"/>
                                </a:events>
                            </a:dataSet>
                        </c:process-config>
                    </p:case>
                    <!-- 盈余公积 -->
                    <p:case value="SURP_RESV">
                        <c:process-config>
                            <a:dataSet id="surp_resv_ds" autoQuery="true" bindName="prj_fsn_surp_resv" bindTarget="QueryScreen_paraDs" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_surp_resv/query?config_id=${@config_id}" selectable="true" submitUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_surp_resv/batch_update">
                                <a:events>
                                    <a:event name="update" handler="onUpdate_item_detail_common"/>
                                    <a:event name="remove" handler="remove_item_detail_common"/>
                                </a:events>
                            </a:dataSet>
                        </c:process-config>
                    </p:case>
                    <!-- 未分配利润 -->
                    <p:case value="RETNED_EARNINGS">
                        <c:process-config>
                            <a:dataSet id="retned_earnings_ds" autoQuery="true" bindName="prj_fsn_retned_earnings" bindTarget="QueryScreen_paraDs" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_retned_earnings/query?config_id=${@config_id}" selectable="true" submitUrl="${/request/@context_path}/autocrud/prj.PRJ509.prj_fsn_retned_earnings/batch_update">
                                <a:events>
                                    <a:event name="update" handler="onUpdate_item_detail_common"/>
                                    <a:event name="remove" handler="remove_item_detail_common"/>
                                </a:events>
                            </a:dataSet>
                        </c:process-config>
                    </p:case>
                </p:switch>
            </p:loop>
        </c:create-config>
        <c:create-config targetId="equity_grid">
            <p:loop source="/model/equity_rp">
                <p:switch test="@fsn_item">
                    <!-- 实收资本 -->
                    <p:case value="SHARE_CAPT">
                        <c:process-config>
                            <h3 style="color:black; text-align:left;font-weight:bold;font-size:14px;margin-left:10px;"><![CDATA[实收资本]]></h3>
                            <a:grid id="prj_fsn_share_capt_gr" bindTarget="share_capt_ds" height="200" navBar="true" width="770">
                                <a:toolBar>
                                    <a:button click="function(){grid_add(&apos;prj_fsn_share_capt_gr&apos;,&apos;share_capt_ds&apos;)}" icon="${/request/@context_path}/images/add.gif" text="HLS.NEW"/>
                                    <a:button click="function(){grid_remove(&apos;prj_fsn_share_capt_gr&apos;,&apos;share_capt_ds&apos;)}" icon="${/request/@context_path}/images/remove.gif" text="HLS.REMOVE"/>
                                    <a:button type="save"/>
                                </a:toolBar>
                                <a:columns>
                                    <a:column name="item_detail_desc" editorFunction="share_capt_ef" footerRenderer="equity_footrender" prompt="PRJ509.SHAREHOLDER_NAME"/>
                                    <a:column name="balance" align="right" editor="share_capt_nf" footerRenderer="equity_footrender" prompt="PRJ509.BALANCE" renderer="Leaf.formatMoney"/>
                                    <a:column name="ratio" align="right" footerRenderer="equity_footrender" prompt="PRJ509.RATIO" renderer="Leaf.formatMoney"/>
                                    <a:column name="description" editor="share_capt_tf" prompt="PRJ509.DESCRIPTION"/>
                                </a:columns>
                                <a:editors>
                                    <a:numberField id="share_capt_nf"/>
                                    <a:textField id="share_capt_tf"/>
                                </a:editors>
                            </a:grid>
                        </c:process-config>
                    </p:case>
                    <!-- 资本公积 -->
                    <p:case value="CAPT_RESV">
                        <c:process-config>
                            <h3 style="color:black; text-align:left;font-weight:bold;font-size:14px;margin-left:10px;"><![CDATA[资本公积]]></h3>
                            <a:grid id="prj_fsn_capt_resv_gr" bindTarget="capt_resv_ds" height="200" navBar="true" width="770">
                                <a:toolBar>
                                    <a:button click="function(){grid_add(&apos;prj_fsn_capt_resv_gr&apos;,&apos;capt_resv_ds&apos;)}" icon="${/request/@context_path}/images/add.gif" text="HLS.NEW"/>
                                    <a:button click="function(){grid_remove(&apos;prj_fsn_capt_resv_gr&apos;,&apos;capt_resv_ds&apos;)}" icon="${/request/@context_path}/images/remove.gif" text="HLS.REMOVE"/>
                                    <a:button type="save"/>
                                </a:toolBar>
                                <a:columns>
                                    <a:column name="item_detail_desc" editorFunction="capt_resv_ef" footerRenderer="equity_footrender" prompt="PRJ509.PROJECT"/>
                                    <a:column name="balance" align="right" editor="capt_resv_nf" footerRenderer="equity_footrender" prompt="PRJ509.BALANCE" renderer="Leaf.formatMoney"/>
                                    <a:column name="description" editor="capt_resv_tf" prompt="PRJ509.DESCRIPTION"/>
                                </a:columns>
                                <a:editors>
                                    <a:numberField id="capt_resv_nf"/>
                                    <a:textField id="capt_resv_tf"/>
                                </a:editors>
                            </a:grid>
                        </c:process-config>
                    </p:case>
                    <!-- 库存股 -->
                    <p:case value="TRE_STOCK">
                        <c:process-config>
                            <h3 style="color:black; text-align:left;font-weight:bold;font-size:14px;margin-left:10px;"><![CDATA[库存股]]></h3>
                            <a:grid id="prj_fsn_tre_stock_gr" bindTarget="tre_stock_ds" height="200" navBar="true" width="770">
                                <a:toolBar>
                                    <a:button click="function(){grid_add(&apos;prj_fsn_tre_stock_gr&apos;,&apos;tre_stock_ds&apos;)}" icon="${/request/@context_path}/images/add.gif" text="HLS.NEW"/>
                                    <a:button click="function(){grid_remove(&apos;prj_fsn_tre_stock_gr&apos;,&apos;tre_stock_ds&apos;)}" icon="${/request/@context_path}/images/remove.gif" text="HLS.REMOVE"/>
                                    <a:button type="save"/>
                                </a:toolBar>
                                <a:columns>
                                    <a:column name="item_detail_desc" editorFunction="tre_stock_ef" footerRenderer="equity_footrender" prompt="PRJ509.PROJECT"/>
                                    <a:column name="balance" align="right" editor="tre_stock_nf" footerRenderer="equity_footrender" prompt="PRJ509.BALANCE" renderer="Leaf.formatMoney"/>
                                    <a:column name="description" editor="tre_stock_tf" prompt="PRJ509.DESCRIPTION"/>
                                </a:columns>
                                <a:editors>
                                    <a:numberField id="tre_stock_nf"/>
                                    <a:textField id="tre_stock_tf"/>
                                </a:editors>
                            </a:grid>
                        </c:process-config>
                    </p:case>
                    <!-- 盈余公积 -->
                    <p:case value="SURP_RESV">
                        <c:process-config>
                            <h3 style="color:black; text-align:left;font-weight:bold;font-size:14px;margin-left:10px;"><![CDATA[盈余公积]]></h3>
                            <a:grid id="prj_fsn_surp_resv_gr" bindTarget="surp_resv_ds" height="200" navBar="true" width="770">
                                <a:toolBar>
                                    <a:button click="function(){grid_add(&apos;prj_fsn_surp_resv_gr&apos;,&apos;surp_resv_ds&apos;)}" icon="${/request/@context_path}/images/add.gif" text="HLS.NEW"/>
                                    <a:button click="function(){grid_remove(&apos;prj_fsn_surp_resv_gr&apos;,&apos;surp_resv_ds&apos;)}" icon="${/request/@context_path}/images/remove.gif" text="HLS.REMOVE"/>
                                    <a:button type="save"/>
                                </a:toolBar>
                                <a:columns>
                                    <a:column name="item_detail_desc" editorFunction="surp_resv_ef" footerRenderer="equity_footrender" prompt="PRJ509.PROJECT"/>
                                    <a:column name="balance" align="right" editor="surp_resv_nf" footerRenderer="equity_footrender" prompt="PRJ509.BALANCE" renderer="Leaf.formatMoney"/>
                                    <a:column name="description" editor="surp_resv_tf" prompt="PRJ509.DESCRIPTION"/>
                                </a:columns>
                                <a:editors>
                                    <a:numberField id="surp_resv_nf"/>
                                    <a:textField id="surp_resv_tf"/>
                                </a:editors>
                            </a:grid>
                        </c:process-config>
                    </p:case>
                    <!-- 未分配利润 -->
                    <p:case value="RETNED_EARNINGS">
                        <c:process-config>
                            <h3 style="color:black; text-align:left;font-weight:bold;font-size:14px;margin-left:10px;"><![CDATA[未分配利润]]></h3>
                            <a:grid id="prj_fsn_retned_earnings_gr" bindTarget="retned_earnings_ds" height="200" navBar="true" width="770">
                                <a:toolBar>
                                    <a:button click="function(){grid_add(&apos;prj_fsn_retned_earnings_gr&apos;,&apos;retned_earnings_ds&apos;)}" icon="${/request/@context_path}/images/add.gif" text="HLS.NEW"/>
                                    <a:button click="function(){grid_remove(&apos;prj_fsn_retned_earnings_gr&apos;,&apos;retned_earnings_ds&apos;)}" icon="${/request/@context_path}/images/remove.gif" text="HLS.REMOVE"/>
                                    <a:button type="save"/>
                                </a:toolBar>
                                <a:columns>
                                    <a:column name="item_detail_desc" editorFunction="retned_earnings_ef" footerRenderer="equity_footrender" prompt="PRJ509.PROJECT" width="200"/>
                                    <a:column name="balance" align="right" editor="retned_earnings_nf" footerRenderer="caculate_retned_earnings_fr" prompt="PRJ509.BALANCE" renderer="Leaf.formatMoney"/>
                                </a:columns>
                                <a:editors>
                                    <a:numberField id="retned_earnings_nf"/>
                                    <a:textField id="retned_earnings_tf"/>
                                </a:editors>
                            </a:grid>
                        </c:process-config>
                    </p:case>
                </p:switch>
            </p:loop>
        </c:create-config>
    </a:view-config>
</a:screen>