<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: syj  
    $Date: 2015年7月13日15:57:57
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:view>
        <a:link id="con733_submit_link" model="cont.CON733.submit_contingent_rental_req" modelaction="execute"/>
        <a:link id="con733_cancle_link" model="cont.CON733.delete_contingent_rental_req" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
            function con733_save() {
                $('con733_rental_from_ds').submit();
            }
            
            function con733_submit() {
                Leaf.Masker.mask(Ext.getBody(), '提交中。。');
                Leaf.request({
                    url: $('con733_submit_link').getUrl(),
                    para: {
                        req_id: ${/parameter/@req_id}
                    },
                    success: function(res) {
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        Leaf.Masker.unmask(Ext.getBody());
            
                        $('con733_create_window_id').close();
                        con731con_contract_query();
                    },
                    failure: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
            
            }
            
            /*  function con733_cancle(){
             Leaf.request({
             url: $('con733_cancle_link').getUrl(),
             para: {
             req_id: ${/parameter/@req_id}
             },
             success: function(res) {
             $('con733_create_window_id').close();
             con731con_contract_query();
             },
             failure: function() {
             },
             error: function() {
             },
             scope: this
             });
             } */
            
            function con733_close() {
                Leaf.request({
                    url: $('con733_cancle_link').getUrl(),
                    para: {
                        req_id: ${/parameter/@req_id}
                    },
                    success: function(res) {
                        $('con733_create_window_id').close();
                        con731con_contract_query();
                    },
                    failure: function() {},
                    error: function() {},
                    scope: this
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="con733contract_from_ds" autoQuery="true" fetchAll="true" model="cont.CON733.con_contract_from" queryUrl="${/request/@context_path}/autocrud/cont.CON733.con_contract_from/query?contract_id=${/parameter/@contract_id}">
                <a:fields>
                    <a:field name="project_id_n" readOnly="true"/>
                    <a:field name="contract_number" readOnly="true"/>
                    <a:field name="company_id_n" readOnly="true"/>
                    <a:field name="contract_name" readOnly="true"/>
                    <a:field name="document_type_n" readOnly="true"/>
                    <a:field name="lease_organization_n" readOnly="true"/>
                    <a:field name="bp_id_tenant_n" readOnly="true"/>
                    <a:field name="currency_n" readOnly="true"/>
                    <a:field name="business_type_n" readOnly="true"/>
                    <a:field name="lease_channel_n" readOnly="true"/>
                    <a:field name="employee_id_n" readOnly="true"/>
                    <a:field name="total_rental" readOnly="true"/>
                    <a:field name="lease_start_date" readOnly="true"/>
                    <a:field name="division_n" readOnly="true"/>
                    <a:field name="employee_id_of_manager_n" readOnly="true"/>
                    <a:field name="total_interest" readOnly="true"/>
                    <a:field name="lease_times" readOnly="true"/>
                    <a:field name="contract_status_n" readOnly="true"/>
                    <a:field name="total_fee" readOnly="true"/>
                    <a:field name="annual_pay_times_n" readOnly="true"/>
                    <a:field name="lease_term" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con733_rental_from_ds" autoQuery="true" fetchAll="true" model="cont.CON733.con_contingent_rental_req" queryUrl="${/request/@context_path}/autocrud/cont.CON733.con_contingent_rental_req/query?req_id=${/parameter/@req_id}">
                <a:fields>
                    <a:field name="due_date" required="true"/>
                    <a:field name="due_amount" required="true"/>
                    <a:field name="bp_id" required="true"/>
                    <a:field name="bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="cont.CON541.hls_bp_master_v_for_lov" lovWidth="520" required="true" title="收款对象">
                        <a:mapping>
                            <a:map from="bp_name" to="bp_name"/>
                            <a:map from="bp_id" to="bp_id"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="con733_close" text="HLS.CLOSE"/>
                <a:gridButton click="con733_save" text="HLS.SAVE"/>
                <a:gridButton click="con733_submit" text="HLS.SUBMIT"/>
                <!-- <a:gridButton click="con733_cancle" text="HLS.CANCLE"/> -->
            </a:screenTopToolbar>
            <a:form column="4" labelSeparator=" " labelWidth="100" marginWidth="30" title="合同基本信息">
                <a:textField name="project_id_n" bindtarget="con733contract_from_ds" prompt="项目名称"/>
                <a:textField name="contract_number" bindTarget="con733contract_from_ds" prompt="合同号"/>
                <a:textField name="company_id_n" bindTarget="con733contract_from_ds" prompt="公司名称"/>
                <a:textField name="contract_name" bindtarget="con733contract_from_ds" prompt="合同名称"/>
                <a:textField name="document_type_n" bindtarget="con733contract_from_ds" prompt="合同类型"/>
                <a:textField name="lease_organization_n" bindtarget="con733contract_from_ds" prompt="业务部"/>
                <a:textField name="bp_id_tenant_n" bindtarget="con733contract_from_ds" prompt="主承租人"/>
                <a:textField name="currency_n" bindtarget="con733contract_from_ds" prompt="币种"/>
                <a:textField name="business_type_n" bindTarget="con733contract_from_ds" prompt="业务类型"/>
                <a:textField name="lease_channel_n" bindtarget="con733contract_from_ds" prompt="商业模式"/>
                <a:textField name="employee_id_n" bindtarget="con733contract_from_ds" prompt="业务员"/>
                <a:numberField name="total_rental" bindtarget="con733contract_from_ds" prompt="租金总额" renderer="Leaf.formatMoney"/>
                <a:datePicker name="lease_start_date" bindTarget="con733contract_from_ds" prompt="租赁期开始日" renderer="Leaf.formatDate"/>
                <a:textField name="division_n" bindtarget="con733contract_from_ds" prompt="产品线"/>
                <a:textField name="employee_id_of_manager_n" bindTarget="con733contract_from_ds" prompt="部门负责人"/>
                <a:numberField name="total_interest" bindTarget="con733contract_from_ds" prompt="利息总额" renderer="Leaf.formatMoney"/>
                <a:textField name="lease_times" bindtarget="con733contract_from_ds" prompt="租赁期数"/>
                <a:textField name="contract_status_n" bindTarget="con733contract_from_ds" prompt="合同状态"/>
                <a:numberField name="total_fee" bindTarget="con733contract_from_ds" prompt="手续费/管理费" renderer="Leaf.formatMoney"/>
                <a:textField name="annual_pay_times_n" bindtarget="con733contract_from_ds" prompt="支付频率"/>
                <a:textField name="lease_term" bindTarget="con733contract_from_ds" prompt="租赁期(年)"/>
            </a:form>
            <a:form column="1" labelSeparator=" " labelWidth="100" marginWidth="30" title="或有租金">
                <a:hBox>
                    <a:datePicker name="due_date" bindTarget="con733_rental_from_ds" prompt="收款日期" renderer="Leaf.formatDate"/>
                    <a:numberField name="due_amount" bindTarget="con733_rental_from_ds" prompt="收款金额" renderer="Leaf.formatMoney"/>
                    <a:lov name="bp_name" bindTarget="con733_rental_from_ds" prompt="收款对象"/>
                </a:hBox>
                <a:hBox>
                    <a:textArea name="comments" bindTarget="con733_rental_from_ds" height="200" prompt="概要说明" width="800"/>
                </a:hBox>
            </a:form>
            <a:screen-include screen="atm_upload.lview?document_id=${/parameter/@req_id}&amp;document_table=con_contingent_rental_req&amp;showflag=N"/>
        </a:screenBody>
    </a:view>
</a:screen>