<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-11-27 下午12:41:34  
    $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_legal_info_req_seq" rootPath="hls_bp_legal_info_req_rp"/>
        <a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" fetchAll="true" model="basic.sys_user" rootPath="sys_user_employee_rp"/>
    </a:init-procedure>
    <a:view>
        <a:link id="hls214_bp_legal_apply_submit_link" model="hls.HLS214.hls_bp_legal_info_req_submit" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
          
            function hls_bp_master_legal_apply_back() {
                $('${/parameter/@winId}').close();
            }
            
            //提交申请
            
            function hls_bp_master_legal_apply_ok() {
                Leaf.Masker.mask($('${/parameter/@winId}').wrap, '${l:HLS.EXECUTING}');
                var record = $('bpQueryDs').getCurrentRecord();
                record.set('hls_bp_employee_id', '${/model/sys_user_employee_rp/record/@employee_id}');
                record.set('document_category', 'CREDIT_INFO');
                record.set('document_type', 'PSTE_INFO');
                record.set('legal_info_req_id', '${/model/hls_bp_legal_info_req_rp/record/@legal_info_req_id}');
                var params = record.data;
                Leaf.request({
                    url: $('hls214_bp_legal_apply_submit_link').getUrl(),
                    para: params,
                    success: function(res) {
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                        $('${/parameter/@winId}').close();
                    },
                    failure: function() {
                        Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                    },
                    error: function() {
                        Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
                    },
                    scope: this
                });
            }
        ]]></script>
        <style><![CDATA[
			.item-label{
				font-size:14px;
				text-decoration:underline;
			}
		]]></style>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="hls_bp_master_legal_apply_back" text="HLS.BACK"/>
                <a:gridButton click="hls_bp_master_legal_apply_ok" text="HLS.CONFIRM"/>
            </a:screenTopToolbar>
            <a:placeHolder id="hls214_apply_id"/>
        </a:screenBody>
    </a:view>
    <a:view-config>
        <c:create-config targetId="hls214_apply_id">
            <p:switch test="/parameter/@bp_class">
                <!-- 法人 -->
                <p:case value="ORG">
                    <c:process-config>
                        <a:form title="HLS212.LEGAL_INFO_APPLY">
                            <a:hBox labelWidth="120">
                                <a:textField name="bp_code" bindTarget="bpQueryDs" prompt="HLS.BP_CODE" readOnly="true"/>
                                <a:textField name="bp_name" bindTarget="bpQueryDs" prompt="HLS.BP_NAME" readOnly="true"/>
                            </a:hBox>
                            <a:hBox labelWidth="120">
                                <a:textField name="bp_class_desc" bindTarget="bpQueryDs" prompt="HLS.BP_CLASS" readOnly="true"/>
                                <a:textField name="organization_code" bindTarget="bpQueryDs" prompt="HLS212.ORGANIZATION_CODE" readOnly="true"/>
                            </a:hBox>
                        </a:form>
                    </c:process-config>
                </p:case>
                <!-- 自然人 -->
                <p:case value="NP">
                    <c:process-config>
                        <a:form title="HLS212.LEGAL_INFO_APPLY">
                            <a:hBox labelWidth="120">
                                <a:textField name="bp_code" bindTarget="bpQueryDs" prompt="HLS.BP_CODE" readOnly="true"/>
                                <a:textField name="bp_name" bindTarget="bpQueryDs" prompt="HLS.BP_NAME" readOnly="true"/>
                            </a:hBox>
                            <a:hBox labelWidth="120">
                                <a:textField name="bp_class_desc" bindTarget="bpQueryDs" prompt="HLS.BP_CLASS" readOnly="true"/>
                                <a:textField name="id_card_desc" bindTarget="bpQueryDs" prompt="HLS212.LEGAL_ID_NO" readOnly="true"/>
                            </a:hBox>
                        </a:form>
                    </c:process-config>
                </p:case>
            </p:switch>
        </c:create-config>
    </a:view-config>
</a:screen>
