<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2014-11-18 上午9:58:52  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
		
	]]></a:init-procedure>
    <a:view>
        <a:link id="con_contrac_chenge_req_detail_link" url="${/request/@context_path}/modules/cont/CON748/con_contract_change_req_detail.lview"/>
        <a:link id="con_contrac_chenge_req_modify_link" url="${/request/@context_path}/modules/cont/CON748/con_contract_change_req_detail_modify.lview"/>
        <script type="text/javascript"><![CDATA[
            function CON748_reset() {
                $('con_contract_change_req_query_ds').reset();
            }
            
            function CON748_query() {
                $('con_contract_change_req_result_ds').query();
            }
            
            function chenge_req_number_renderer(value, record, name) {
                return '<a href="javascript:winOpen_update(' + record.get('change_req_id') + ',\'' + record.get('req_status') + '\')">' + value + '</a>';
            }
            
            function winOpen_update(change_req_id, req_status) {
                var url;
                if (req_status == 'NEW') {
                    url = $('con_contrac_chenge_req_modify_link').getUrl();
                } else {
                    url = $('con_contrac_chenge_req_detail_link').getUrl();
                }
                var win = new Leaf.Window({
                    id: 'con_contrac_change_req_detail_window',
                    url: url,
                    params: {
                        change_req_id: change_req_id,
                        winId: 'con_contrac_change_req_detail_window'
                    },
                    title: '罚息免除详细信息',
                    fullScreen: true
                });
                win.on('close', function() {
                    $('con_contract_change_req_result_ds').query();
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="contract_change_req_status_ds" lookupCode="CON_CHANGE_REQ_STATUS"/>
            <a:dataSet id="con_contract_change_req_query_ds">
                <a:fields>
                    <a:field name="status_desc" displayField="code_value_name" options="contract_change_req_status_ds" returnField="req_status" valueField="code_value"/>
                    <a:field name="bp_code" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="120" lovService="basic.hls_bp_master_v_all_lov?bp_category=TENANT" lovWidth="520">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code"/>
                            <a:map from="bp_name" to="bp_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="change_req_id"/>
                    <a:field name="contract_id"/>
                    <a:field name="change_req_number"/>
                    <a:field name="contract_number"/>
                    <a:field name="date_from"/>
                    <a:field name="date_to"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_contract_change_req_result_ds" autoQuery="true" model="cont.CON748.con_contract_change_req" queryDataSet="con_contract_change_req_query_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="CON748_reset" text="HLS.RESET"/>
                <a:gridButton click="CON748_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="100" marginWidth="30" title="查询条件">
                <a:lov name="bp_code" bindTarget="con_contract_change_req_query_ds" prompt="承租人代码"/>
                <a:textField name="bp_name" bindTarget="con_contract_change_req_query_ds" prompt="承租人名称" readOnly="true"/>
                <a:textField name="change_req_number" bindTarget="con_contract_change_req_query_ds" prompt="申请编号"/>
                <a:textField name="contract_number" bindTarget="con_contract_change_req_query_ds" prompt="合同编号"/>
                <a:datePicker name="date_from" bindTarget="con_contract_change_req_query_ds" prompt="申请日期从"/>
                <a:datePicker name="date_to" bindTarget="con_contract_change_req_query_ds" prompt="申请日期到"/>
                <a:comboBox name="status_desc" bindTarget="con_contract_change_req_query_ds" prompt="申请状态"/>
            </a:form>
            <a:grid id="con_contract_change_req_result_grid" bindTarget="con_contract_change_req_result_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="change_req_number" align="center" prompt="申请编号" renderer="chenge_req_number_renderer" width="150"/>
                    <a:column name="bp_name" prompt="承租人名称" width="180"/>
                    <a:column name="contract_number" align="center" prompt="合同号" width="150"/>
                    <a:column name="req_date" align="center" prompt="申请日期" renderer="Leaf.formatDate" width="150"/>
                    <a:column name="req_status_desc" align="center" prompt="状态" width="120"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
