
<h:screen xmlns:h="http://www.hand-china.com/hap">

    <script id="scriptB"><![CDATA[

     var viewModel = kendo.observable({
            enabled: false,
            isEnabled: true,
            data: {},
            natrualData:{},
            legalData:{},
            dataGuarantor: []

        });
     function guarantorSelect(e){
        viewModel.legalData.set("bpId",e.item.bpId);
        viewModel.legalData.set("bpType",e.item.bpType);
        viewModel.legalData.set("bpTypeDesc",e.item.bpTypeDesc);
        viewModel.legalData.set("guarantorName",e.item.bpName);
        viewModel.legalData.set("guarantorType",e.item.bpType);
        viewModel.legalData.set("guarantorBpId",e.item.bpId);
        viewModel.legalData.set("bpCode",e.item.bpCode);
        viewModel.legalData.set("legalForm",e.item.legalForm);
        viewModel.legalData.set("legalRepresentative",e.item.legalRepresentative);
        viewModel.legalData.set("actualController",e.item.actualController);
        viewModel.legalData.set("industry",e.item.industry);
        viewModel.legalData.set("registeredDate",e.item.registeredDate);
        viewModel.legalData.set("registeredPlace",e.item.registeredPlace);
        viewModel.legalData.set("registeredCapital",e.item.registeredCapital);
        viewModel.legalData.set("paidInCapital",e.item.paidInCapital);
        viewModel.legalData.set("foundedDate",e.item.foundedDate);
        viewModel.legalData.set("enterpriseUnifiedCreditCode",e.item.enterpriseUnifiedCreditCode);
        viewModel.legalData.set("primaryBusiness",e.item.primaryBusiness);
        viewModel.legalData.set("mainProducts",e.item.mainProducts);
    }
    function guarantorQuery(e){
         e.param['bpClass'] = "ORG";
    }

    window.onload = function(){
        var url = '${base.contextPath}/prj/project/guarantor/detail/query?projectId='+${RequestParameters.projectId}+'&guarantorBpId='+${RequestParameters.bpId};
        $.ajax({
            type : 'GET',
            url : url,
            contentType : "application/json; charset=utf-8",
            success : function(datas) {
                for(var i = 0; i < datas.rows.length; i++)
                {
                    for(var v in datas.rows[i])
                    {
                        viewModel.legalData.set(v,datas.rows[i][v]);
                    }
                }
            }
        });
    }

    ]]></script>
    <style>
        .col-sm-3{
            width:16%;
        }
        .col-sm-1{
            width:9%;
        }
        .col-sm-7 {
            width: 41%;
        }
        .col-sm-11 {
            width: 91%;
        }

    </style>

    <h:hlsForm title="担保人注册信息-法人" id="section-22">
        <h:hlsHBox>
            <h:hlsLov name="guarantorName"
                      id="guarantorNameL"
                      code="LOV_GUARANTOR"
                      colspan="3"
                      contextPath="${base.contextPath}"
                      data-bind="enabled: enabled, value:legalData.bpCode,text:legalData.guarantorName"
                      locale="${base.locale}"
                      placeholder="担保人名称"
                      prompt="担保人名称"
                      promptColspan="1"
                      select="guarantorSelect"
                      query="guarantorQuery"
                      style="width: 100%"/>
            <h:hlsMaskedTextBox name="bpTypeDesc" id="bpTypeL"
                                bind="enabled: isEnabled, value:legalData.bpTypeDesc" colspan="3"
                                prompt="商业伙伴类型"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="bpCode" id="bpCodeL"
                                bind="enabled: isEnabled, value:legalData.bpCode" colspan="3"
                                prompt="商业伙伴编码"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="legalForm" id="legalFormL"
                                bind="enabled: isEnabled, value:legalData.legalForm" colspan="3"
                                prompt="企业性质"
                                promptColspan="1" style="width:100%"/>
        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="legalRepresentative" id="legalRepresentativeL"
                                bind="enabled: isEnabled, value:legalData.legalRepresentative" colspan="3"
                                prompt="法定代表人"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="actualController" id="actualControllerL"
                                bind="enabled: isEnabled, value:legalData.actualController" colspan="3"
                                prompt="实际控制人"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="industry" id="industryL"
                                bind="enabled: isEnabled, value:legalData.industry" colspan="7"
                                prompt="所属行业"
                                promptColspan="1" style="width:100%"/>
        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="registeredDate" id="registeredDateL"
                                bind="enabled: isEnabled, value:legalData.registeredDate" colspan="3"
                                prompt="注册时间"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="registeredPlace" id="registeredPlaceL"
                                bind="enabled: isEnabled, value:legalData.registeredPlace" colspan="7"
                                prompt="注册地址"
                                promptColspan="1" style="width:100%"/>
            <h:hlsNumericTextBox name="registeredCapital" id="registeredCapitalL"
                                 bind="enabled: isEnabled, value:legalData.registeredCapital" colspan="3"
                                 prompt="注册资本"
                                 promptColspan="1" style="width:100%"/>
        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsNumericTextBox name="paidInCapital" id="paidInCapitalL"
                                 bind="enabled: isEnabled, value:legalData.paidInCapital" colspan="3"
                                 prompt="实收资本"
                                 promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="foundedDate" id="foundedDateL"
                                bind="enabled: isEnabled, value:legalData.foundedDate" colspan="3"
                                prompt="成立时间"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="enterpriseUnifiedCreditCode" id="enterpriseUnifiedCreditCodeL"
                                bind="enabled: isEnabled, value:legalData.enterpriseUnifiedCreditCode" colspan="3"
                                prompt="统一社会信用代码"
                                promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="primary" id="primaryBussL"
                                bind="enabled: isEnabled, value:legalData.primaryiness" colspan="3"
                                prompt="担保方式"
                                promptColspan="1" style="width:100%"/>
        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="primaryBusiness" id="primaryBusinessL"
                                bind="enabled: isEnabled, value:legalData.primaryBusiness" colspan="11"
                                prompt="主营业务"
                                promptColspan="1" style="width:100%"/>

        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="mainProducts" id="mainProductsL"
                                bind="enabled: isEnabled, value:legalData.mainProducts" colspan="11"
                                prompt="经营范围"
                                promptColspan="1" style="width:100%"/>

        </h:hlsHBox>
    </h:hlsForm>

</h:screen>