<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-11-27 下午04:18:59  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="hls.HLS214.hls_bp_credit_info_req_query" rootPath="hls_bp_credit_info_req_rp"/>
    </a:init-procedure>
    <a:view>
        <a:link id="hld214_bp_credit_upload_link" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="hld214_bp_credit_download_link" url="${/request/@context_path}/downloadFile.lview"/>
        <script type="text/javascript"><![CDATA[
            function hls_bp_credit_info_req_upload_ren(value, record, name) {
                if (record.get('credit_info_req_id')) {
                    return '<a href="javascript:upload_win(' + record.get('credit_info_req_id') + ')">' + '${l:HLS.ATTACHMENT}' + '</a>';
                }
            }
            
            function hls_bp_credit_info_req_download_ren(value, record, name) {
                if (record.get('credit_info_req_id')) {
                    return '<a href="javascript:download_win(' + record.get('credit_info_req_id') + ')">' + '${l:HLS.ATTACHMENT}' + '</a>';
                }
            }
            
            function upload_win(credit_info_req_id) {
                new Leaf.Window({
                    id: 'credit_info_req_win_upload',
                    url: $('hld214_bp_credit_upload_link').getUrl() + '?header_id=' + credit_info_req_id + '&table_name=HLS_BP_CREDIT_INFO_REQ_FINANCE',
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    width: 850,
                    height: 400
                });
            }
            
            function download_win(credit_info_req_id) {
                new Leaf.Window({
                    id: 'credit_info_req_win_download',
                    url: $('hld214_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 hls_bp_credit_info_req_result_ds_save() {
                if ($('hls_bp_credit_info_req_result_ds').validate()) {
                    zjwfl5110_approvePage_mask();
                    $('hls_bp_credit_info_req_result_ds').submit();
                }
            }
            
            function hls_bp_credit_info_req_result_ds_submit_failed() {
                zjwfl5110_approvePage_noMask();
            }
            
            
            var success_flag = 'N';
            
            function hls_bp_credit_info_req_result_ds_submit_success(ds) {
                zjwfl5110_approvePage_noMask();
                success_flag = 'Y';
            }
            
            function hls_bp_credit_info_req_result_ds_update(ds) {
                success_flag = 'N';
            }
            function zjwfl5110_approveCheck(type) {
                if (success_flag == 'N') {
                    if (type == 'refuse') {
                        return true;
                    } else {
                            Leaf.showMessage('${l:PROMPT}', '请先保存数据');
                            return false;
                    }
                } else {
                    return true;
                }
            }
        ]]></script>
        <style><![CDATA[
			.item-label{
				font-size:14px;
				text-decoration:underline;
			}
		]]></style>
        <a:dataSets>
            <a:dataSet id="hls_bp_credit_info_req_result_ds" fetchAll="true" loadData="true" model="hls.HLS214.hls_bp_credit_info_req_query">
                <a:fields>
                    <a:field name="query_date" required="true"/>
                    <a:field name="hls_bp_credit_apply_attach" defaultValue="HLS.ATTACHMENT"/>
                    <a:field name="hls_bp_credit_apply_req_attach" defaultValue="附件"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="hls_bp_credit_info_req_result_ds_submit_success"/>
                    <a:event name="submitfailed" handler="hls_bp_credit_info_req_result_ds_submit_failed"/>
                    <a:event name="update" handler="hls_bp_credit_info_req_result_ds_update"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form title="HLS212.REQUEST_INFO">
                <a:placeHolder id="hls_bp_credit_info_req_ph"/>
                <a:fieldSet column="3" labelWidth="120" title="CON305.SEARCH_RESULT">
                    <a:datePicker name="query_date" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS212.QUERY_DATE"/>
                    <a:textField name="description" bindTarget="hls_bp_credit_info_req_result_ds" colspan="2" prompt="HLS.COMMENT" width="400"/>
                    <a:label name="hls_bp_credit_apply_req_attach" bindTarget="hls_bp_credit_info_req_result_ds" prompt="" renderer="hls_bp_credit_info_req_upload_ren"/>
                </a:fieldSet>
            </a:form>
            <a:button click="hls_bp_credit_info_req_result_ds_save" text="HLS.SAVE"/>
        </a:screenBody>
    </a:view>
    <a:view-config>
        <c:create-config targetId="hls_bp_credit_info_req_ph">
            <p:switch test="/model/hls_bp_credit_info_req_rp/record/@bp_class">
                <p:case value="ORG">
                    <c:process-config>
                        <a:fieldSet column="3" labelWidth="120" title="HLS212.REQUEST_INFO">
                            <a:textField name="bp_code" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS.BP_CODE" readOnly="true"/>
                            <a:textField name="bp_name" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS.BP_NAME" readOnly="true"/>
                            <a:textField name="bp_class_desc" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS.BP_CLASS" readOnly="true"/>
                            <a:textField name="loan_card_num" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS212.LOAN_CARD_NUM" readOnly="true"/>
                            <a:textField name="loan_card_num_pwd" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS212.LOAN_CARD_PWD" readOnly="true"/>
                            <a:textField name="organization_code" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS212.ORGANIZATION_CODE" readOnly="true"/>
                        </a:fieldSet>
                    </c:process-config>
                </p:case>
                <p:case value="NP">
                    <c:process-config>
                        <a:fieldSet column="3" labelWidth="120" title="HLS212.REQUEST_INFO">
                            <a:textField name="bp_code" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS.BP_CODE" readOnly="true"/>
                            <a:textField name="bp_name" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS.BP_NAME" readOnly="true"/>
                            <a:textField name="bp_class_desc" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS.BP_CLASS" readOnly="true"/>
                            <a:textField name="id_card_no" bindTarget="hls_bp_credit_info_req_result_ds" prompt="HLS212.LEGAL_ID_NO" readOnly="true"/>
                            <a:label name="hls_bp_credit_apply_attach" bindTarget="hls_bp_credit_info_req_result_ds" prompt="" renderer="hls_bp_credit_info_req_download_ren"/>
                        </a:fieldSet>
                    </c:process-config>
                </p:case>
            </p:switch>
        </c:create-config>
    </a:view-config>
</a:screen>
