<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-5-13 上午10:52:55  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="problem_flag_update_link" model="cont.CON557.reg_settlement_lv" modelaction="update"/>
        <a:link id="con_settle_list_link" url="${/request/@context_path}/modules/cont/CON557/con_settle_list.lview"/>
        <script type="text/javascript"><![CDATA[
            function query_reg_settlement_lv_result_ds() {
                $('reg_settlement_lv_result_ds').query();
            }
            
            function reset_reg_settlement_lv_query_ds() {
                $('reg_settlement_lv_query_ds').reset();
            }
            
            function problem_data_operation() {
                var reg_settlement_lv_record = $('reg_settlement_lv_result_ds').getCurrentRecord();
                var contract_id = reg_settlement_lv_record.get('contract_id');
                Leaf.request({
                    url: $('problem_flag_update_link').getUrl(),
                    para: {
                        'contract_id': contract_id
                    },
                    success: function(data) {
                        $('reg_settlement_lv_result_ds').query();
                    },
                    sync: true
                });
            }
            
            function settle_operation() {
                var reg_settlement_lv_record = $('reg_settlement_lv_result_ds').getCurrentRecord();
                var contract_id = reg_settlement_lv_record.get('contract_id');
                var url = $('con_settle_list_link').getUrl();
                var win = new Leaf.Window({
                    id: 'con_settle_list_window',
                    url: url,
                    params: {
                        'contract_id': contract_id
                    },
                    title: '结清',
                    fullScreen: true
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="archive_status_ds" lookupCode="ARCHIVE_STATUS"/>
            <a:dataSet id="reg_status_ds" lookupCode="REG_STATUS"/>
            <a:dataSet id="contract_status_ds" lookupCode="CONTRACT_STATUS_CON557"/>
            <a:dataSet id="problem_flag_ds" lookupCode="FINISH_FLAG"/>
            <a:dataSet id="reg_settlement_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"/>
                    <a:field name="invoice_agent_n" 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_n"/>
                        </a:mapping>
                    </a:field>
                    <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:field name="contract_status"/>
                    <a:field name="contract_status_n" displayField="code_value_name" options="contract_status_ds" returnField="contract_status" valueField="code_value"/>
                    <a:field name="problem_flag"/>
                    <a:field name="problem_flag_n" displayField="code_value_name" options="problem_flag_ds" returnField="problem_flag" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="reg_settlement_lv_result_ds" autoQuery="true" model="cont.CON557.reg_settlement_lv" queryDataSet="reg_settlement_lv_query_ds" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="project_number"/>
                    <a:field name="contract_id"/>
                    <a:field name="project_id"/>
                    <a:field name="contract_name"/>
                    <a:field name="bp_name"/>
                    <a:field name="business_type"/>
                    <a:field name="business_type_desc"/>
                    <a:field name="invoice_agent"/>
                    <a:field name="invoice_agent_desc"/>
                    <a:field name="division"/>
                    <a:field name="division_desc"/>
                    <a:field name="bp_class_desc"/>
                    <a:field name="contract_status"/>
                    <a:field name="contract_status_n"/>
                    <a:field name="archive_status"/>
                    <a:field name="archive_status_n"/>
                    <a:field name="reg_status"/>
                    <a:field name="reg_status_n"/>
                    <a:field name="docu_number_reg"/>
                    <a:field name="docu_number_archive"/>
                    <a:field name="storage_archive"/>
                    <a:field name="storage_reg"/>
                    <a:field name="problem_flag"/>
                    <a:field name="problem_flag_n"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query_reg_settlement_lv_result_ds" text="查询"/>
                <a:gridButton click="reset_reg_settlement_lv_query_ds" text="重置"/>
                <a:gridButton click="settle_operation" text="结清"/>
                <a:gridButton click="problem_data_operation" text="问题件"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="100" marginWidth="30" title="贷后资料管理查询">
                <a:textField name="contract_number" bindTarget="reg_settlement_lv_query_ds" prompt="合同编号"/>
                <a:textField name="project_number" bindTarget="reg_settlement_lv_query_ds" prompt="项目编号"/>
                <a:textField name="bp_name" bindTarget="reg_settlement_lv_query_ds" prompt="承租人"/>
                <a:textField name="id_card_no" bindTarget="reg_settlement_lv_query_ds" prompt="承租人身份证"/>
                <a:lov name="invoice_agent_n" bindTarget="reg_settlement_lv_query_ds" prompt="经销商"/>
                <a:comboBox name="archive_status_n" bindTarget="reg_settlement_lv_query_ds" prompt="合同归档状态"/>
                <a:comboBox name="reg_status_n" bindTarget="reg_settlement_lv_query_ds" prompt="登记证归档状态"/>
                <a:comboBox name="contract_status_n" bindTarget="reg_settlement_lv_query_ds" prompt="合同状态"/>
                <a:comboBox name="problem_flag_n" bindTarget="reg_settlement_lv_query_ds" prompt="问题件"/>
            </a:form>
            <a:grid id="grid_id" bindTarget="reg_settlement_lv_result_ds" marginHeight="230" marginWidth="30" navBar="true">
                <a:toolBar>
                    <a:button type="excel"/>
                    <!--   <a:button type="clear"/> -->
                </a:toolBar>
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="150"/>
                    <a:column name="project_number" prompt="项目编号" width="100"/>
                    <a:column name="bp_name" prompt="承租人" width="80"/>
                    <a:column name="business_type_desc" prompt="业务类型" width="80"/>
                    <a:column name="invoice_agent_desc" prompt="代理商" width="80"/>
                    <a:column name="division_desc" prompt="产品线" width="80"/>
                    <a:column name="bp_class_desc" prompt="客户类别" width="80"/>
                    <a:column name="contract_status_n" prompt="合同状态" width="80"/>
                    <a:column name="archive_status_n" prompt="合同归档" width="80"/>
                    <a:column name="docu_number_archive" prompt="合同归档编号" width="100"/>
                    <a:column name="storage_archive" prompt="仓库" width="60"/>
                    <a:column name="reg_status_n" prompt="登记证归档" width="100"/>
                    <a:column name="docu_number_reg" prompt="登记证归档编号" width="100"/>
                    <a:column name="storage_reg" prompt="仓库" width="60"/>
                    <a:column name="problem_flag_n" prompt="问题件" width="80"/>
                </a:columns>
            </a:grid>
            <a:hBox/>
        </a:screenBody>
    </a:view>
</a:screen>
