<!-- 平台管理-企业查询(新增) -->
<style>
    .base-extend .col-xs-10{
        padding:0 0.1rem;
    }
    .base-extend .form-horizontal .required:after{
        top:0.05rem;
    }
</style>

<div class="modal fade businessDialog" id="myModal-updateEnterPriseBusinessEntry" data-backdrop="static">
    <div class="modal-dialog" style="width:8rem;">
        <form class="form-horizontal" id="updateEnterPriseBusinessEntryForm">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true" style="font-size:0.18rem">×</span><span class="sr-only">关闭</span>
                </button>
                <span class="modal-title">修改平台</span>
            </div>
            <div class="modal-content" style="height:3.5rem;overflow-y:auto;overflow-x:hidden;">
                <div class="newTabAddUpdateBox" style="position:static;border:none;padding-left:0.2rem;padding-right:0.2rem;padding-bottom:0;">
                    <input type="hidden" name="basicId" th:value="${platform?.id}">
                    <span tag:token/>
                    <div class="row">
                        <table>
                            <tr>
                                <td width="20%">
                                    <span class="required_fileds_star">企业名称</span>：
                                </td>
                                <td width="80%" class="enter" style="background-color:#F1F1F1">
                                    <input type="text" name="wholeKeyWord" id="wholeKeyWord" th:value="${platform?.platformName}" readOnly class="form-control" style="background-color:#F1F1F1 !important;color:#808080;margin:0 !important;" >
                                </td>
                            </tr>
                            <!-- <tr>
                                <td width="20%">
                                    <span class="required_fileds_star">起息日是否计息</span>：
                                </td>
                                <td width="80%" class="enter">
                                    <select name="isInterest" id="isInterest" class="form-control">
                                        <option value="1" th:selected="${platform?.interestBearing==1}">是</option>
                                        <option value="0" th:selected="${platform?.interestBearing==0}">否</option>
                                    </select>
                                </td>
                            </tr> -->
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary btn-default btn-white btn-info colorbtn addSure">确定</button>
                <button class="btn btn-default btn-default btn-white btn-info canclebtn" data-dismiss="modal">取消</button>
            </div>
        </form>
    </div>
</div>
<script>

    $(function(){
        $('.addSure,#searchWholename').removeClass("loadingCircle");

        //表单验证
        function entBusinessEntryFormValid(e){
            $("#updateEnterPriseBusinessEntryForm").validate({
                promptPosition : "bottomLeft",
                submitHandler : function(form) {
                    var postdata = {
                        'id': $("[name=basicId]").val(),
                        'platformName': $("#wholeKeyWord").val(),
                        'interestBearing' : $("#isInterest").val()
                    },formchoose = '#myModal-updateEnterPriseBusinessEntry';

                    $('.addSure').addClass("loadingCircle");

                    $.ajax({
                        url:'/platform/update',
                        type:'post',
                        data:postdata,
                        success:function(data){
                            if( data.success ){
                                new $.zui.Messager('修改平台成功', {
                                    type: 'success'
                                }).show();
                                $('.addSure').removeClass("loadingCircle");
                                //关闭弹框
                                $(formchoose).modal("hide");
                                //弹框被隐藏, 且过渡效果执行完毕
                                $(formchoose).off('hidden.zui.modal').on('hidden.zui.modal', function(){
                                    //刷新表格
                                    $(".yk_rightcontent").load('/platform/platformList');
                                });
                            }else{
                                new $.zui.Messager('修改平台失败:'+ data.msg, {
                                    type: 'danger'
                                }).show();
                                $('.addSure').removeClass("loadingCircle");
                                //关闭弹框
                                //$(formchoose).modal("hide");
                            }
                        },
                        error:function(status){
                            new $.zui.Messager('修改平台出错:'+status, {
                                type: 'danger'
                            }).show();
                            $('.addSure').removeClass("loadingCircle");
                            //关闭弹框
                            //$(formchoose).modal("hide");
                        }
                    })
                },
                rules : {
                    'isInterest':{
                        required : true
                    }
                },
                messages : {
                    'isInterest':{
                        required : '请选择起息日是否计息'
                    }
                }
            })
        };
        entBusinessEntryFormValid();

        //确定保存按钮
        $(".addSure").click(entBusinessEntryFormValid);
    })

</script>
