<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-5-9 下午7:37:46  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="con_information_query_link" url="${/request/@context_path}/modules/cont/CON556/con_contract_storage_apply.lview"/>
        <script type="text/javascript"><![CDATA[
			function query_con_information_query_lv_result_ds(){
				$('con_information_query_lv_result_ds').query();
			}
			function reset_con_information_query_lv_query_ds(){
				$('con_information_query_lv_query_ds').reset();
			}
			
			function contract_number_renderers(value, record, name){
			    if(name == 'contract_number'){
			        var contract_id=record.get('contract_id');
			        return '<a href="javascript:con_information_query(' + contract_id + ');">' + value + '</a>';
			    }
			}
			function con_information_query(contract_id){
			     var add_win = new Leaf.Window({
			        id:'con_infotmation_query_win',
			        params:{
			            'winid':'con_infotmation_query_win',
			            contract_id:contract_id
			        },
			        url: $('con_information_query_link').getUrl(),
                    fullScreen: true
			    });
			}
			function archive_remind_n_renderer(value, record, name) {
                if (value == '延迟催促') {
                    return "<font color='red'>" + value + "</font>";
                }
                return value;
            
            }
		]]></script>
        <a:dataSets>
            <a:dataSet id="archive_status_ds" lookupCode="ARCHIVE_STATUS"/>
            <a:dataSet id="reg_status_ds" lookupCode="REG_STATUS"/>
            <a:dataSet id="division_desc_ds" autoQuery="true" model="cont.CON555A.hls_division"/>
            <a:dataSet id="con_information_query_lv_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="project_number"/>
                    <a:field name="bp_name"/>
                    <a:field name="invoice_agent_desc"/>
                    <a:field name="invoice_agent"/>
                    <a:field name="invoice_agent_desc" lovHeight="400" lovService="cont.CON555A.hls_bp_master" lovWidth="600">
                        <a:mapping>
                            <a:map from="bp_id" to="invoice_agent"/>
                            <a:map from="bp_name" to="invoice_agent_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="division_desc"/>
                    <a:field name="division_desc_n" displayField="description" options="division_desc_ds" returnField="division_desc" valueField="division"/>
                    <a:field name="archive_status_n" displayField="code_value_name" options="archive_status_ds" returnField="archive_status" valueField="code_value"/>
                    <a:field name="archive_status"/>
                    <a:field name="reg_status_n" displayField="code_value_name" options="reg_status_ds" returnField="reg_status" valueField="code_value"/>
                    <a:field name="reg_status"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_information_query_lv_result_ds" autoQuery="true" model="cont.CON556.con_information_query_lv" queryDataSet="con_information_query_lv_query_ds">
                <a:fields>
                    <a:field name="contract_id"/>
                    <a:field name="contract_number"/>
                    <a:field name="project_number"/>
                    <a:field name="bp_name"/>
                    <a:field name="lease_item_amount"/>
                    <a:field name="invoice_agent_desc"/>
                    <a:field name="business_type_desc"/>
                    <a:field name="division_desc"/>
                    <a:field name="bp_class_desc"/>
                    <a:field name="full_write_off_date"/>
                    <a:field name="archive_remind_n"/>
                    <a:field name="archive_status_n"/>
                    <a:field name="reg_status_n"/>
                    <a:field name="chest_number_reg"/>
                    <a:field name="chest_number_archive"/>
                    <a:field name="docu_number_reg"/>
                    <a:field name="docu_number_archive"/>
                    <a:field name="storage_date_reg"/>
                    <a:field name="storage_date_archive"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query_con_information_query_lv_result_ds" text="查询"/>
                <a:gridButton click="reset_con_information_query_lv_query_ds" text="重置"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="100" marginWidth="30" title="贷后资料清单查询">
                <a:textField name="contract_number" bindTarget="con_information_query_lv_query_ds" prompt="合同编号"/>
                <a:textField name="project_number" bindTarget="con_information_query_lv_query_ds" prompt="项目编号"/>
                <a:textField name="bp_name" bindTarget="con_information_query_lv_query_ds" prompt="承租人"/>
                <a:textField name="id_card_no" bindTarget="con_information_query_lv_query_ds" prompt="承租人身份证"/>
                <a:lov name="invoice_agent_desc" bindTarget="con_information_query_lv_query_ds" prompt="代理商"/>
                <a:comboBox name="division_desc_n" bindTarget="con_information_query_lv_query_ds" prompt="产品线"/>
                <a:comboBox name="archive_status_n" bindTarget="con_information_query_lv_query_ds" prompt="合同归档状态"/>
                <a:comboBox name="reg_status_n" bindTarget="con_information_query_lv_query_ds" prompt="登记证归档"/>
            </a:form>
            <a:grid id="grid_id" bindTarget="con_information_query_lv_result_ds" marginHeight="180" marginWidth="30" navBar="true">
                <a:toolBar>
                    <a:button type="excel"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" renderer="contract_number_renderers" width="160"/>
                    <a:column name="project_number" prompt="项目编号" width="70"/>
                    <a:column name="bp_name" prompt="承租人" width="70"/>
                    <a:column name="invoice_agent_desc" prompt="代理商" width="70"/>
                    <a:column name="full_write_off_date" prompt="放款日期" renderer="Leaf.formatDate" width="80"/>
                    <a:column name="archive_remind_n" prompt="归档提醒" renderer="archive_remind_n_renderer" width="70"/>
                    <a:column name="archive_status_n" prompt="合同状态" width="70"/>
                    <a:column name="docu_number_reg" prompt="合同档案编号" width="90"/>
                    <a:column name="storage_date_reg" prompt="合同文本归档时间" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="reg_status_n" prompt="登记证状态" width="80"/>
                    <!--  <a:column name="chest_number_reg" prompt="登记证文本箱号" width="100"/>
                    <a:column name="chest_number_archive" prompt="合同文本箱号" width="100"/> -->
                    <a:column name="docu_number_archive" prompt="登记证档案编号" width="100"/>
                    <a:column name="storage_date_archive" prompt="登记证归档时间" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="lease_item_amount" prompt="租赁物总价" width="70"/>
                    <a:column name="business_type_desc" prompt="业务类型" width="70"/>
                    <a:column name="division_desc" prompt="产品线" width="65"/>
                    <a:column name="bp_class_desc" prompt="客户类别" width="70"/>
                </a:columns>
            </a:grid>
            <a:hBox/>
        </a:screenBody>
    </a:view>
</a:screen>
