<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-7-21 下午05:16:09  
    $Revision: 1.0  
    $Purpose: 新建贷款卡
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <script type="text/javascript"><![CDATA[
            function hls_bp_master_load_card_create_exit() {
                $('${/parameter/@winid}').close();
            }
            
            function hls_bp_master_load_card_create_save() {
                if ($('hls_bp_master_load_card_hd_ds').validate() && $('hls_bp_master_load_card_ln_ds').validate()) {
                    Leaf.Masker.mask($('hls_bp_master_load_card_create_win').wrap, '${l:HLS.EXECUTING}');
                    $('hls_bp_master_load_card_hd_ds').submit();
                }
            }
            
            function hls_bp_master_load_card_hd_ds_submitsuccess(ds) {
                Leaf.Masker.unmask($('hls_bp_master_load_card_create_win').wrap);
            }
            
            function hls_bp_master_load_card_hd_ds_submitfailure(ds) {
                Leaf.Masker.unmask($('hls_bp_master_load_card_create_win').wrap);
            }
            
            function hls_bp_master_load_card_hd_ds_submiterror(ds) {
                Leaf.Masker.unmask($('hls_bp_master_load_card_create_win').wrap);
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_bp_master_load_card_hd_ds" loadData="true" model="hls.HLS100.hls_bp_master_load_card_hd" submitUrl="${/request/@context_path}/modules/hls/HLS100/hls_bp_master_load_card_save.lsc">
                <a:fields>
                    <a:field name="bp_name"/>
                    <a:field name="bp_code" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="600" required="true">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code"/>
                            <a:map from="bp_id" to="bp_id"/>
                            <a:map from="bp_name" to="bp_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="query_method" prompt="查询方式"/>
                    <a:field name="description" prompt="备注"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="hls_bp_master_load_card_hd_ds_submitsuccess"/>
                    <a:event name="submitfailure" handler="hls_bp_master_load_card_hd_ds_submitfailure"/>
                    <a:event name="submiterror" handler="hls_bp_master_load_card_hd_ds_submiterror"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="hls_bp_master_load_card_ln_ds" bindName="ln_ds" bindTarget="hls_bp_master_load_card_hd_ds" fetchAll="true" loadData="true" model="hls.HLS100.hls_bp_master_load_card_ln" selectable="true">
                <a:fields>
                    <a:field name="point_date" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls_bp_master_load_card_create_exit" text="HLS.EXIT"/>
                <a:gridButton click="hls_bp_master_load_card_create_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="3" labelWidth="120" title="商业伙伴信息">
                <a:lov name="bp_code" bindTarget="hls_bp_master_load_card_hd_ds" prompt="商业伙伴编号"/>
                <a:textField name="bp_name" bindTarget="hls_bp_master_load_card_hd_ds" prompt="商业伙伴名称" readOnly="true"/>
                <a:textField name="query_method" bindTarget="hls_bp_master_load_card_hd_ds" prompt="查询方式"/>
                <a:textField name="description" bindTarget="hls_bp_master_load_card_hd_ds" colspan="3" prompt="备注" width="706"/>
            </a:form>
            <a:grid bindTarget="hls_bp_master_load_card_ln_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="loan_amount" align="right" editor="card_ln_nf" prompt="贷款金额" renderer="Leaf.formatMoney"/>
                    <a:column name="note" align="right" editor="card_ln_nf" prompt="银票" renderer="Leaf.formatMoney"/>
                    <a:column name="point_date" align="center" editor="card_ln_dp" prompt="时间点" renderer="Leaf.formatDate"/>
                    <a:column name="bill_amount" align="right" editor="card_ln_nf" prompt="保理金额" renderer="Leaf.formatMoney"/>
                    <a:column name="guarantee_amount" align="right" editor="card_ln_nf" prompt="承兑汇票金额" renderer="Leaf.formatMoney"/>
                    <a:column name="gua_letter_amount" align="right" editor="card_ln_nf" prompt="保函金额" renderer="Leaf.formatMoney"/>
                    <a:column name="factoring_amount" align="right" editor="card_ln_nf" prompt="对外担保金额" renderer="Leaf.formatMoney"/>
                    <a:column name="description" editor="card_ln_tf" prompt="备注" width="200"/>
                </a:columns>
                <a:editors>
                    <a:numberField id="card_ln_nf" allowDecimals="true" allowFormat="true" allowNegative="false"/>
                    <a:datePicker id="card_ln_dp"/>
                    <a:textField id="card_ln_tf"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
        	Leaf.onReady(function(){
        	    if(!'${/parameter/@load_card_hd_id}'){
        	        $('hls_bp_master_load_card_hd_ds').create();
        	    }
        	});
        
        ]]></script>
    </a:view>
</a:screen>
