<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-11-28 上午09:31:22  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="hls311_bp_credit_info_req_query_result_link" url="${/request/@context_path}/modules/hls/HLS311/hls_bp_credit_info_req_query_result.lview"/>
        <a:link id="hls311_bp_credit_download_link" url="${/request/@context_path}/downloadFile.lview"/>
        <script type="text/javascript"><![CDATA[
            function hls311_credit_info_req_query() {
                $('hls_bp_credit_org_result_ds').query();
                $('hls_bp_credit_np_result_ds').query();
            }
            
            function attachment_renderer(value, record, name) {
                var credit_info_req_id = record.get('credit_info_req_id');
                return '<a href="javascript:open_attach_win(' + credit_info_req_id + ')">' + '${l:HLS.ATTACHMENT}' + '</a>';
            }
            
            function open_attach_win(credit_info_req_id) {
                new Leaf.Window({
                    id: 'credit_info_req_win_download',
                    url: $('hls311_bp_credit_download_link').getUrl() + '?header_id=' + credit_info_req_id + '&table_name=HLS_BP_CREDIT_INFO_REQ',
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    width: 850,
                    height: 400
                });
            }
            
            function query_result_renderer(value, record, name) {
                var bp_class = record.get('bp_class');
                var credit_info_req_id = record.get('credit_info_req_id');
                if (name == 'org_query_result' || name == 'np_query_result') {
                    return '<a href="javascript:open_query_result_win(' + credit_info_req_id + ',\'' + bp_class + '\')">' + '${l:CON305.SEARCH_RESULT}' + '</a>';
                }
            }
            
            function open_query_result_win(credit_info_req_id, bp_class) {
                new Leaf.Window({
                    id: 'hls311_bp_credit_info_req_query_result_win',
                    url: $('hls311_bp_credit_info_req_query_result_link').getUrl() + '?credit_info_req_id=' + credit_info_req_id + '&bp_class=' + bp_class,
                    title: '${l:CON305.SEARCH_RESULT}',
                    width: 850,
                    height: 150
                });
            }
            
            function hls311_credit_info_req_reset() {
                $('hls_bp_credit_query_ds').reset();
                var record = $('hls_bp_credit_query_ds').getCurrentRecord();
                record.set('enabled_flag', '');
                record.set('req_status', '');
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?master_type=BP&amp;function_code=HLS311"/>
        <a:dataSets>
            <a:dataSet id="enabled_flag_ds" lookupCode="ENABLED_STATUS"/>
            <a:dataSet id="bpClassDs" lookupCode="HLS211_BP_CLASS"/>
            <a:dataSet id="req_status_ds" lookupCode="HLS_CREDIT_INFO_REQ_STATUS"/>
            <a:dataSet id="hls_bp_credit_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="bp_type_desc" readOnly="true"/>
                    <a:field name="bp_type" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_type_v_for_lov?enabled_flag=Y" lovWidth="500" prompt="HLS_BP_TYPE.BP_TYPE" title="HLS_BP_TYPE.BP_TYPE">
                        <a:mapping>
                            <a:map from="description" to="bp_type_desc"/>
                            <a:map from="bp_type" to="bp_type"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code_from" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_name"/>
                    <a:field name="bp_project_number" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="600">
                        <a:mapping>
                            <a:map from="project_id" to="bp_project_id"/>
                            <a:map from="project_number" to="bp_project_number"/>
                            <a:map from="project_name" to="bp_project_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_project_id"/>
                    <a:field name="bp_project_name"/>
                    <a:field name="bp_contract_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON500.con_contract_number_lov" lovWidth="500" title="HLS.CONTRACT_NUMBER">
                        <a:mapping>
                            <a:map from="contract_id" to="bp_contract_id"/>
                            <a:map from="contract_number" to="bp_contract_number"/>
                            <a:map from="contract_name" to="bp_contract_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="enabled_flag" defaultValue="Y"/>
                    <a:field name="enabled_flag_desc" displayField="code_value_name" options="enabled_flag_ds" prompt="HLS.ENABLED_FLAG" returnField="enabled_flag" valueField="code_value"/>
                    <a:field name="req_status" defaultValue="APPROVED"/>
                    <a:field name="req_status_desc" displayField="code_value_name" options="req_status_ds" returnField="req_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <!-- 自然人 -->
            <a:dataSet id="hls_bp_credit_np_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS311.hls_bp_credit_info_req_query" queryDataSet="hls_bp_credit_query_ds" queryUrl="${/request/@context_path}/autocrud/hls.HLS311.hls_bp_credit_info_req_query/query?bp_class=NP">
                <a:fields>
                    <a:field name="enabled_flag" checkedValue="Y" readOnly="true" uncheckedValue="N"/>
                    <a:field name="hls_bp_credit_apply_req_attach" defaultValue="附件"/>
                </a:fields>
                <a:events>
                    <a:event name="query" handler="aut_authority_list_validate_query"/>
                </a:events>
            </a:dataSet>
            <!-- 法人 -->
            <a:dataSet id="hls_bp_credit_org_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS311.hls_bp_credit_info_req_query" queryDataSet="hls_bp_credit_query_ds" queryUrl="${/request/@context_path}/autocrud/hls.HLS311.hls_bp_credit_info_req_query/query?bp_class=ORG">
                <a:fields>
                    <a:field name="enabled_flag" checkedValue="Y" readOnly="true" uncheckedValue="N"/>
                    <a:field name="hls_bp_credit_apply_req_attach" defaultValue="附件"/>
                </a:fields>
                <a:events>
                    <a:event name="query" handler="aut_authority_list_validate_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls311_credit_info_req_query" text="HLS.QUERY"/>
                <a:gridButton click="hls311_credit_info_req_reset" text="HLS.RESET"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" marginWidth="30" title="HLS.QUERY_TITLE">
                <a:lov name="bp_code_from" bindTarget="hls_bp_credit_query_ds" prompt="HLS.BP_CODE_FROM">
                    <a:events>
                        <a:event name="focus" handler="on_std_focus"/>
                    </a:events>
                </a:lov>
                <a:lov name="bp_code_to" bindTarget="hls_bp_credit_query_ds" prompt="HLS.BP_CODE_TO">
                    <a:events>
                        <a:event name="focus" handler="on_std_focus"/>
                    </a:events>
                </a:lov>
                <a:textField name="bp_name" bindTarget="hls_bp_credit_query_ds" prompt="HLS.BP_NAME"/>
                <a:textField name="extra_nam" bindTarget="hls_bp_credit_query_ds" prompt="HLS.SHORT_NAME"/>
                <a:lov name="bp_type" bindTarget="hls_bp_credit_query_ds" prompt="HLS.BP_TYPE"/>
                <a:textField name="bp_type_desc" bindTarget="hls_bp_credit_query_ds" prompt="HLS212.BP_TYPE_DESC"/>
                <a:lov name="bp_project_number" bindTarget="hls_bp_credit_query_ds" prompt="HLS.PROJECT_NUMBER">
                    <a:events>
                        <a:event name="focus" handler="function(object){on_std_focus(object,&apos;PROJECT&apos;)}"/>
                    </a:events>
                </a:lov>
                <a:textField name="bp_project_name" bindTarget="hls_bp_credit_query_ds" prompt="HLS.PROJECT_NAME"/>
                <a:lov name="bp_contract_number" bindTarget="hls_bp_credit_query_ds" prompt="HLS.CONTRACT_NUMBER">
                    <a:events>
                        <a:event name="focus" handler="function(object){on_std_focus(object,&apos;CONTRACT&apos;)}"/>
                    </a:events>
                </a:lov>
                <a:textField name="bp_contract_name" bindTarget="hls_bp_credit_query_ds" prompt="HLS.CONTRACT_NAME"/>
                <a:comboBox name="enabled_flag_desc" bindTarget="hls_bp_credit_query_ds"/>
                <a:comboBox name="req_status_desc" bindTarget="hls_bp_credit_query_ds" prompt="HLS.REQ_STATUS_DESC"/>
            </a:form>
            <a:tabPanel marginHeight="210" marginWidth="30">
                <a:tabs>
                    <a:tab prompt="HLS212.ORG_INFO" width="100">
                        <a:grid bindTarget="hls_bp_credit_org_result_ds" marginHeight="240" marginWidth="60" navBar="true">
                            <a:columns>
                                <a:column name="bp_code" prompt="HLS.BP_CODE" width="120"/>
                                <a:column name="bp_name" prompt="HLS.BP_NAME" width="150"/>
                                <a:column name="loan_card_num" prompt="HLS212.LOAN_CARD_NUM"/>
                                <a:column name="ref_v01" prompt="HLS212.LOAN_CARD_PWD"/>
                                <a:column name="req_date" prompt="HLS.REQ_DATE" renderer="Leaf.formatDate"/>
                                <a:column name="employee_name" prompt="HLS.APPLIER"/>
                                <a:column name="query_date" prompt="HLS212.QUERY_DATE" renderer="Leaf.formatDate"/>
                                <a:column name="org_query_result" align="center" prompt="CON305.SEARCH_RESULT" renderer="query_result_renderer"/>
                                <a:column name="description" prompt="HLS.COMMENT"/>
                                <a:column name="req_status_desc" prompt="HLS.STATUS"/>
                                <a:column name="enabled_flag" editor="hls_bp_credit_org_gird_cb" prompt="HLS.ENABLED_FLAG"/>
                            </a:columns>
                            <a:editors>
                                <a:checkBox id="hls_bp_credit_org_gird_cb"/>
                            </a:editors>
                        </a:grid>
                    </a:tab>
                    <a:tab prompt="HLS212.NP_INFO" width="100">
                        <a:grid bindTarget="hls_bp_credit_np_result_ds" marginHeight="240" marginWidth="60" navBar="true">
                            <a:columns>
                                <a:column name="bp_code" prompt="HLS.BP_CODE" width="120"/>
                                <a:column name="bp_name" prompt="HLS.BP_NAME" width="150"/>
                                <a:column name="id_card_no" prompt="HLS212.LEGAL_ID_NO" width="150"/>
                                <a:column align="center" prompt="HLS.ATTACHMENT" renderer="attachment_renderer"/>
                                <a:column name="req_date" prompt="HLS.REQ_DATE" renderer="Leaf.formatDate"/>
                                <a:column name="employee_name" prompt="HLS.APPLIER"/>
                                <a:column name="query_date" prompt="HLS212.QUERY_DATE" renderer="Leaf.formatDate"/>
                                <a:column name="np_query_result" align="center" prompt="CON305.SEARCH_RESULT" renderer="query_result_renderer"/>
                                <a:column name="description" prompt="HLS.COMMENT"/>
                                <a:column name="req_status_desc" prompt="HLS.STATUS"/>
                                <a:column name="enabled_flag" editor="hls_bp_credit_np_gird_cb" prompt="HLS.ENABLED_FLAG"/>
                            </a:columns>
                            <a:editors>
                                <a:checkBox id="hls_bp_credit_np_gird_cb"/>
                            </a:editors>
                        </a:grid>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
    </a:view>
</a:screen>
