<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2015-11-13 下午03:23:39  
    $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="con_flt_int_rate_batch_hand_execute_link_id" model="cont.CON771.con_flt_int_rate_batch_hand_execute" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            function con_flt_int_rate_batch_add_back() {
                $('${/parameter/@winid}').close();
            }
            
            function lock_batch_hand_execute_window() {
                Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
            }
            
            function unlock_batch_hand_execute_window() {
                Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
            }
            
            function con_flt_int_rate_batch_add_save() {
                if ($('con_flt_int_rate_batch_add_ds').validate()) {
                    var record = $('con_flt_int_rate_batch_add_ds').getCurrentRecord();
                    lock_batch_hand_execute_window();
                    Leaf.request({
                        url: $('con_flt_int_rate_batch_hand_execute_link_id').getUrl(),
                        para: {
                            batch_id: '${/parameter/@batch_id}',
                            contract_id: record.get('contract_id')
                        },
                        success: function(res) {
                            Leaf.SideBar.enable = true;
                            Leaf.SideBar.show({
                                msg: '保存成功',
                                duration: 2000
                            });
                            $('${/parameter/@ds_id}').query();
                            unlock_batch_hand_execute_window();
                        },
                        failure: function() {
                            unlock_batch_hand_execute_window();
                        },
                        error: function() {
                            unlock_batch_hand_execute_window();
                        },
                        scope: this
                    });
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="con_flt_int_rate_batch_add_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_number" lovGridHeight="350" lovHeight="500" lovService="cont.CON771.con_flt_int_rate_choose_contract" lovWidth="550" required="true" title="合同选择">
                        <a:mapping>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_number" to="contract_number"/>
                            <a:map from="contract_name" to="contract_name"/>
                            <a:map from="bp_name" to="bp_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="contract_name" readOnly="true"/>
                    <a:field name="bp_name" readOnly="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="con_flt_int_rate_batch_add_back" text="返回"/>
                <a:gridButton click="con_flt_int_rate_batch_add_save" text="保存"/>
            </a:screenTopToolbar>
            <a:form column="2" title=" " width="550">
                <a:lov name="contract_number" bindTarget="con_flt_int_rate_batch_add_ds" prompt="合同编码"/>
                <a:textField name="contract_name" bindTarget="con_flt_int_rate_batch_add_ds" prompt="合同名称"/>
                <a:textField name="bp_name" bindTarget="con_flt_int_rate_batch_add_ds" prompt="承租人名称"/>
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>
