<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>公司基础资料设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="decorator" content="base"/>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/static/css/reset.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <%--<h3>基础资料</h3>--%>
    <div class="layui-tab">

    </div>
    <div class="layui-card " style="height: 600px">
        <div class="layui-card-body mb-10">
            <%--<h1 class="title mb-10">--%>
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin-bottom: 10px">
                    <ul class="layui-tab-title">
                        <sfTags:pagePermission authFlag="SIT_XTSZ_GSZL_GSZL_T" html='<a href="${ctx}/siteCompany/companyInfo"><li class="layui-this">公司基础资料设置</li></a>'/>
                    </ul>
                </div>
               <%-- <div class="f-r">
                    <sfTags:pagePermission authFlag="SIT_XTSZ_GSZL_XGZL_B" html='<button class="layui-btn resive"><i class="layui-icon fs-16">&#xe642;</i>编辑资料</button>'/>
                    <sfTags:pagePermission authFlag="SIT_XTSZ_GSZL_XGZL_B" html='<button class="layui-btn updatePasswork"><i class="layui-icon fs-16">&#xe642;</i>编辑密码</button>'/>
                </div>--%>
                <div class="f-r layui-hide updateSave">
                    <button class="layui-btn saveBtn"><i class="layui-icon fs-16">&#xe654;</i>保存</button>
                    <button class="layui-btn closeBtn"><i class="layui-icon fs-16">&#x1006;</i>取消</button>
                </div>
            <%--</h1>--%>
            <form class="layui-form " action="" id="formData" lay-filter="test2">
                <div class="layui-form-item layui-col-xs3">
                    <label class="layui-form-label">服务商名称：</label>
                    <div class="layui-input-block" id="corporator" style="line-height: 39px;">
                        <input type="text" class="layui-input layui-bg-gray corporator" value="${data.columns.name}"
                               disabled>
                    </div>
                </div>
                <div class="layui-form-item  layui-col-xs3">
                    <label class="layui-form-label">联系人：</label>
                    <div class="layui-input-block" id="contacts" style="line-height: 39px;">
                        <input type="text" class="layui-input layui-bg-gray contacts" value="${data.columns.contacts}"
                               disabled>
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs3">
                    <label class="layui-form-label">联系电话：</label>
                    <div class="layui-input-block" id="mobile" style="line-height: 39px;">
                        <input type="text" class="layui-input layui-bg-gray mobile" value="${data.columns.telephone}" disabled>
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs9 provinceCq">
                    <label class="layui-form-label">企业地址：</label>
                    <div class="layui-input-block">
                        <div class="layui-col-lg2 layui-col-sm3 pr-20 grays">
                            <select class="provinces" name="provinces" lay-verify="provinces" lay-filter="provinces" disabled>
                                <option value="${data.columns.province}">${data.columns.province}</option>
                            </select>
                        </div>
                        <div class="layui-col-lg2 layui-col-sm3 pr-20">
                            <select class="citys" lay-verify="citys" lay-filter="citys" disabled >
                                <option value="${data.columns.city}">${data.columns.city}</option>
                            </select>
                        </div>
                        <div class="layui-col-lg2 layui-col-sm3 pr-20">
                            <select class="areas" lay-verify="areas" lay-filter="areas" disabled>
                                <option value="${data.columns.area}">${data.columns.area}</option>
                            </select>
                        </div>
                        <div class="layui-col-lg6 layui-col-sm3">
                            <input type="text" id="detailAddre" lay-verify="required" class="layui-input layui-col-lg2 layui-bg-gray" disabled
                                   value="${data.columns.address}">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-col-xs9 layui-hide proCityArea">
                    <label class="layui-form-label">企业地址：</label>
                    <div class="layui-input-block">
                        <div class="layui-col-lg2 layui-col-sm3 pr-20 grays">
                            <select class="province" id="province" name="province" lay-verify="province" lay-filter="province" lay-search>
                                <option value="">请选择省</option>
                                <c:forEach items="${province}" var="pro">
                                    <option value="${pro.columns.ProvinceName}" title="${pro.columns.ProvinceID}" <c:if test="${data.columns.province == pro.columns.ProvinceName}">selected</c:if>>${pro.columns.ProvinceName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-lg2 layui-col-sm3 pr-20">
                            <select class="city" id="city" lay-verify="city" lay-filter="city" lay-search>
                                <option value="">请选择市</option>
                                <c:forEach items="${city}" var="cityList">
                                    <option value="${cityList.columns.CityName}" title="${cityList.columns.CityID}" <c:if test="${data.columns.city==cityList.columns.CityName}">selected</c:if>>${cityList.columns.CityName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-lg2 layui-col-sm3 pr-20">
                            <select class="area" id="area" lay-verify="area" lay-filter="area" lay-search>
                                <option value="">请选择县/区</option>
                                <c:forEach items="${area}" var="areaList">
                                    <option value="${areaList.columns.DistrictName}" <c:if test="${data.columns.area==areaList.columns.DistrictName}">selected</c:if>>${areaList.columns.DistrictName}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="layui-col-lg6 layui-col-sm3">
                            <input type="text" id="detailAddress" lay-verify="required" class="layui-input layui-col-lg2 layui-bg-gray" disabled
                                   value="${data.columns.address}" placeholder="请输入详细地址">
                        </div>
                    </div>
                </div>
                <div class="layui-form-text layui-col-xs9 icon mb-10 over" id="table">
                    <label class="layui-form-label">相关资质：</label>
                    <div class="layui-col-xs1 pl-120 layui-hide imgUploader">
                        <div class="upload-container uploader" >
                            <img src="" alt="img " class="placeholder">
                        </div>
                    </div>
                    <input type="hidden" name="imgs" id="imgs"  value="${data.columns.license_img}" >
                    <c:choose>
                        <c:when test="${data.columns.license_img eq null}">
                            <div class="layui-col-xs1 bj-img upload-container listImg">

                            </div>
                        </c:when>
                        <c:when test="${data.columns.license_img eq ''}">
                            <div class="layui-col-xs1 bj-img upload-container listImg">

                            </div>
                        </c:when>
                        <c:otherwise>
                            <c:forEach items="${images}" var="img">
                            <div class="layui-col-xs1 bj-img listImg">
                                <img src="${commonStaticImgPath}${img}"  data-img="${commonStaticImgPath}${img}" height="700" width="1200"/>
                                <input type="hidden" class="imgPicker" value="${data.columns.license_img}"/>
                            </div>
                            </c:forEach>
                        </c:otherwise>
                    </c:choose>

                </div>
            </form>
            <input type="hidden" id="idVal" name="idVal" value="${data.columns.id}">
                <div class="clear"></div>
        </div>


    </div>
    <%--<div class="layui-card">
        <div class="layui-card-body mb-10">
                &lt;%&ndash;<h1 class="title mb-10">&ndash;%&gt;
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin-bottom: 10px">
                    <ul class="layui-tab-title">
                      <a href="${ctx}/companyInformationSetting/baseInformation"><li class="layui-this">收款信息设置</li></a>
                    </ul>
                </div>
                <div class="modify f-r ">
                    <button class="layui-btn modifyBtn"><i class="layui-icon fs-16">&#xe642;</i>编辑</button>
                </div>
                <div class="f-r layui-hide saveClose">
                    <button class="layui-btn save"><i class="layui-icon fs-16">&#xe654;</i>保存</button>
                    <button class="layui-btn close"><i class="layui-icon fs-16">&#x1006;</i>取消</button>
                </div>
                <form id="formSoursa" class="layui-form">
                 <div class="layui-form-item  layui-col-xs3">
                    <label class="layui-form-label">开户名称：</label>
                    <div class="layui-input-block" style="line-height: 39px;">
                        <input type="text" id="accountName" name="accountName"  lay-verify="required" autocomplete="off"
                               class="layui-input layui-bg-gray" value="${receipt.accountName}" disabled>
                    </div>
                </div>
                    <div class="layui-form-item  layui-col-xs3">
                        <label class="layui-form-label">开户银行：</label>
                        <div class="layui-input-block" style="line-height: 39px;">
                            <input type="text" id="openingBank" name="openingBank"  lay-verify="required" autocomplete="off"
                                   class="layui-input layui-bg-gray" value="${receipt.openingBank}" disabled>
                        </div>
                    </div>
                    <div class="layui-form-item  layui-col-xs3">
                        <label class="layui-form-label">汇款账号：</label>
                        <div class="layui-input-block" style="line-height: 39px;">
                            <input type="text" id="accountNumber" name="accountNumber"  lay-verify="required"
                                   autocomplete="off" class="layui-input layui-bg-gray" disabled value="${receipt.accountNumber}">
                        </div>
                    </div>

                        <div class="layui-form-item  layui-col-xs3">
                            <label class="layui-form-label">支付宝名称：</label>
                            <div class="layui-input-block" >
                                <input type="text" id="alipayName"  name="alipayName" required lay-verify="required" autocomplete="off"
                                       class="layui-input layui-bg-gray" value="${receipt.alipayName}" disabled>
                            </div>
                        </div>
                        <div class="layui-form-item  layui-col-xs3">
                            <label class="layui-form-label">支付宝账号：</label>
                            <div class="layui-input-block">
                                <input type="text" id="alipayNumber" name="alipayNumber" required lay-verify="required" autocomplete="off"
                                       class="layui-input layui-bg-gray" value="${receipt.alipayNumber}" disabled>
                            </div>
                        </div>
                </form>
                    <div class="clear"></div>
            </div>


        </div>--%>
</div>


<div class="hide" id="sitePasswork" style="height: 100%;">
    <div class="layui-card" style="height: 500px">
        <input type="hidden" id="siteId" value="${siteId}">
        <input type="hidden" id="userId" value="${userId}">
        <div class="layui-card-body layui-form sitePasswork">
                <div class="layui-form-item  layui-col-xs10">
                    <label class="layui-form-label"><span class="mark">*</span>原密码：</label>
                    <div class="layui-input-block">
                        <input type="password" flag="password" id="primaryPassword" required lay-verify="required" placeholder="请输入原密码" autocomplete="off" class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item  layui-col-xs10">
                    <label class="layui-form-label"><span class="mark">*</span>新密码：</label>
                    <div class="layui-input-block">
                        <input type="password" flag="password" id="newPassword" required lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item  layui-col-xs10">
                    <label class="layui-form-label"><span class="mark">*</span>确认密码：</label>
                    <div class="layui-input-block">
                        <input type="password" flag="password" id="confirmPasswork"   required placeholder="请输入新密码" autocomplete="off" class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item text-c" style="margin-top: 40px;">
                    <button class="layui-btn" lay-submit lay-filter="component-form-element">保存</button>
                </div>
        </div>
    </div>
</div>

<div id="lookImg" class="hide pos-r">
    <div style="position:relative;width:100%;height:500px;">
        <div class="w-500 h-500 lookImg">
            <img src="" width="80%" id="image">
        </div>
    </div>
</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/data.js"></script>
<script type="text/javascript">
    //初始数据
    layui.use(['form', 'table', 'upload', 'jquery'], function () {
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table
            ,$ = layui.jquery;
        var reg = /^\d{16,19}$/;//汇款账号为16位或19位正则
        var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;//手机号正则
        var passwordReg = /^[0-9A-Za-z]{6,20}$/;//密码只能是6-20位数字字母组合

        $('.resive').click(function () {
            $(".updateSave").removeClass("layui-hide");
            $(".resive").addClass("layui-hide");
            $("#formData").each(function(){
                $(this).find("input").removeClass("layui-bg-gray");
                $(this).find("input").attr("disabled",false);
            })
            $(".provinceCq").addClass("layui-hide");
            $(".proCityArea").removeClass("layui-hide");
            $(".imgSpan").removeClass("layui-hide");
            $(".imgUploader").addClass("layui-hide");
            $(".listImg").addClass("layui-hide");
        })
        /*start 编辑资料取消按钮*/
        $('.closeBtn').click(function () {
            $(".updateSave").addClass("layui-hide");
            $(".resive").removeClass("layui-hide");
            $("#formData").each(function(){
                $(this).find("input").addClass("layui-bg-gray");
                $(this).find("input").attr("disabled",true);
            })
            $(".provinceCq").removeClass("layui-hide");
            $(".proCityArea").addClass("layui-hide");
            $(".imgUploader").addClass("layui-hide");
            $(".imgSpan").addClass("layui-hide");
            $(".listImg").removeClass("layui-hide");
            window.location.reload();
        })

        /*start 编辑资料的保存按钮 end*/
        $(".saveBtn").click(function () {
            var idVal = $("#idVal").val();//id
            var corporator = $(".corporator").val();//法人代表
            if(isBlank(corporator)){
                layer.msg("法人代表不能为空!",{icon:2});
                return;
            }
            var contacts = $(".contacts").val();//联系人
            if(isBlank(contacts)){
                layer.msg("联系人不能为空!",{icon:2});
                return;
            }
            var mobile = $(".mobile").val();//联系电话
            if(isBlank(mobile)){
                layer.msg("联系电话不能为空!",{icon:2});
                return;
            }else if(!phoneReg.test(mobile)){
                layer.msg("请输入有效的手机号码!",{icon:2});
                return;
            }
            var province = $(".province").val();//省
            if(isBlank(province)){
                layer.msg("企业地址的省份不能为空!",{icon:2});
                return;
            }
            var city = $(".city").val();//市
            if(isBlank(city)){
                layer.msg("企业地址的市不能为空!",{icon:2});
                return;
            }
            var area = $(".area").val();//区
            if(isBlank(area)){
                layer.msg("企业地址的区/县不能为空!",{icon:2});
                return;
            }
            var detailAddress = $("#detailAddress").val();//详细地址
            if(isBlank(detailAddress)){
                layer.msg("企业地址的详细地址不能为空!",{icon:2});
                return;
            }
             //var imgs = $("#imgs").val();//营业执照
            var imgs = $("input[name='imgs']").val();
             if(isBlank(imgs)){
                 layer.msg("营业执照不能为空!",{icon:2});
                 return;
             }
            $.ajax({
                type: "POST",
                url: "${ctx}/siteCompany/saveBtn",
                data: {
                    idVal: idVal,
                    corporator: corporator,
                    contacts: contacts,
                    mobile: mobile,
                    province: province,
                    city: city,
                    area: area,
                    detailAddress: detailAddress,
                     imgs: imgs
                },
                success: function (result) {
                    if (result.code == "200") {
                        $(".updateSave").addClass("layui-hide");
                        $(".resive").removeClass("layui-hide");
                        $("#formData").each(function(){
                            $(this).find("input").addClass("layui-bg-gray");
                            $(this).find("input").attr("disabled",true);
                        })
                        $(".provinceCq").removeClass("layui-hide");
                        $(".proCityArea").addClass("layui-hide");
                        $(".imgUploader").addClass("layui-hide");
                        $(".imgSpan").addClass("layui-hide");
                        $(".listImg").removeClass("layui-hide");
                        $(".listImg").remove();
                        layer.msg("编辑资料成功！",{icon:1});
                        window.location.reload();
                        /*layer.msg("编辑资料成功！",{icon:1,time:1000},function(){
                            window.location.href="{ctx}/siteCompany/companyInfo";
                        });*/
                    } else if (result.code == "205") {
                        layer.msg("编辑资料失败！",{icon:2});
                        return;
                    }
                },
                error: function () {
                    layer.msg("编辑资料失败！",{icon:2});
                    return;
                }
            });
        })

        $(".modifyBtn").click(function () {
            $(".saveClose").removeClass("layui-hide");
            $(".modifyBtn").addClass("layui-hide");
            $("#formSoursa").find("input").removeClass("layui-bg-gray").attr("disabled",false);
            $('.resive').attr("disabled",true);
            $(".passwordBtn").attr("disabled",true);
        })

        $(".updatePasswork").click(function () {
            $(".sitePasswork").find("input").val('');
            layer.open({
                type: 1,
                title: '编辑密码',
                area: ['600px', '300px'],
                content: $('#sitePasswork')
            });
        })
        var ckecksite = false;
        form.on('submit(component-form-element)', function (data) {
            if(ckecksite){
                return
            }
            var primaryPassword = $("#primaryPassword").val();
            var newPassword = $("#newPassword").val();
            var confirmPasswork = $("#confirmPasswork").val();
            var userId = $("#userId").val();

            if(!passwordReg.test(newPassword)){
                layer.msg("密码只能是6-20位数字字母组合!",{icon:2});
                return;
            }else if(!passwordReg.test(confirmPasswork)){
                layer.msg("密码只能是6-20位数字字母组合!",{icon:2});
                return;
            }
            if(confirmPasswork != newPassword){
                layer.msg("两次输入的密码不一致！",{icon:2});
                return
            }
            ckecksite = true;

            $.ajax({
                type: "POST",
                url: "${ctx}/siteCompany/updateSitePasswork",
                data: {
                    userId: userId,
                    newPassword:newPassword,
                    primaryPassword:primaryPassword
                },
                success: function (result) {
                    ckecksite = false;
                    if(result.code =='200'){
                        layer.closeAll()
                        layer.msg("编辑成功！",{icon:1,time:2000},function(){
                            parent.window.location.href="${ctx}/login"
                        })
                    }else if(result.code =='201'){
                        layer.msg("新密码和旧密码不能一致！",{icon:2})
                    }else if(result.code =='202'){
                        layer.msg("旧密码不正确！",{icon:2})
                    }else {
                        layer.msg("保存失败！",{icon:2})
                    }

                }
            })

        })

        $(".listImg img").click(function(){
            var img = $(this).attr("data-img");
            $("#lookImg img").attr('src',img);
            layer.open({
                type:1,
                title:'查看图片',
                area:['500px','550px'],
                content:$("#lookImg")
            })
        })


        /*start 公司收款设置取消按钮 end*/
        $(".close").click(function () {
            $(".modifyBtn").removeClass("layui-hide");
            $(".saveClose").addClass("layui-hide");
            $("#formSoursa").find("input").addClass("layui-bg-gray").attr("disabled",true);

            $('.resive').attr("disabled",false);
            $(".passwordBtn").attr("disabled",false);
            window.location.reload();
        })

        /*start 收款设置中保存按钮 end*/
        $(".save").click(function () {
            var accountName = $("#accountName").val();

            var openingBank = $("#openingBank").val();

            var accountNumber = $("#accountNumber").val();
            if (!isBlank(accountNumber)&& !reg.test(accountNumber)) {
                layer.msg("汇款账号为16位或19位的数字！",{icon:2});
                return;
            }
            var alipayName = $("#alipayName").val();
            var alipayNumber = $("#alipayNumber").val();
            $.ajax({
                type: "post",
                url: "${ctx}/siteReceipt/saveSiteReceipt",
                data: {
                    accountName: accountName,
                    openingBank: openingBank,
                    accountNumber: accountNumber,
                    alipayName: alipayName,
                    alipayNumber: alipayNumber
                },
                success: function (result) {
                    if (result.code == "200") {
                        layer.msg("保存成功！",{icon:1,time:2000},function(){
                            window.location.reload();
                        });
                    } else{
                        console.log(result)
                        layer.msg("保存失败！",{icon:2});
                        return;
                    }
                },
                error: function () {
                    layer.msg("保存失败！",{icon:2});
                    return;
                }
            })
        })

        form.on('select(province)', function (data) {
            var province = $(data.elem).find("option:selected").attr("title");
            $("#city").empty();
            $("#detailAddress").val("");
            if (isBlank(province)) {
                $("#city").append("<option value=''>请选择市</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getCitysByProId",
                data: {
                    province: province
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!",{icon:2})
                        return
                    }
                    var html = "";
                    for (var i = 0; i < result.length; i++) {
                        var city = result[i];
                        html = html + '<option value="' + city.columns.CityName + '" title="' + city.columns.CityID + '">' + city.columns.CityName + '</option>';
                    }
                    $("#city").append(html);
                    form.render('select');
                },
                complete: function () {
                    var city = $("#city").find("option:selected").attr("title");
                    $("#area").empty()
                    if (isBlank(city)) {
                        $("#area").append("<option value=''>请选择县/区</option>");
                        return "";
                    }
                    $.ajax({
                        type: "POST",
                        url: "${ctx}/main/redirect/getAreaByCityId",
                        data: {
                            city: city
                        },
                        success: function (result) {
                            if (result == "205") {
                                layer.msg("暂无数据!",{icon:2})
                                return
                            }
                            var html = "";
                            for (var i = 0; i < result.length; i++) {
                                var area = result[i];
                                html = html + '<option value="' + area.columns.DistrictName + '" >' + area.columns.DistrictName + '</option>';
                            }
                            $("#area").append(html);
                            form.render('select');
                        }
                    });
                }

            });

        });

        form.on('select(city)', function (data) {
            var city = $(data.elem).find("option:selected").attr("title");
            $("#area").empty();
            $("#detailAddress").val("");
            if (isBlank(city)) {
                $("#area").append("<option value=''>请选择县/区</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getAreaByCityId",
                data: {
                    city: city
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!",{icon:2})
                        return
                    }
                    var html = "";
                    for (var i = 0; i < result.length; i++) {
                        var area = result[i];
                        html = html + '<option value="' + area.columns.DistrictName + '" >' + area.columns.DistrictName + '</option>';
                    }
                    $("#area").append(html);
                    form.render('select');
                }
            });

        });

       //图片删除
        $(".del").click(function(){
            $(this).parent(".imgSpan").remove();
            $(".imgUploader").removeClass("layui-hide");
            $(".imgSpan").addClass("layui-hide");
            $(".listImg").addClass("layui-hide");
            $("input[name='imgs']").val("");
        })

        var upload = layui.upload;
        //执行实例---- 上传图片
        //执行实例
        var uploadInst = upload.render({
            elem: '.uploader' //绑定元素
            , url: '${ctx}/common/uploadFile' //上传接口
            ,number: 1
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('.placeholder').attr('src', result); //图片链接（base64）
                    $(".pic").show();
                });
            }
            , done: function (res) {
                console.log(res)
                //上传完毕回调
                if(res.code > 0){
                    return layer.msg("上传失败！",{icon:2});
                }
                var imgPath = res.path;
                $('.placeholder').attr('src', '${commonStaticImgPath}'+imgPath); //图片链接（base64）
                $(".placeholder").show();
                $(".del").removeClass("layui-hide");
                $("#imgs").val(imgPath);
            }
            , error: function () {
                //请求异常回调
            }
        });

    })

    function isBlank(val) {
        if (val == null || val == '' || val == undefined) {
            return true;
        }
        return false;
    }

</script>
</body>
</html>
