<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script type="text/javascript">
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form;
        form.render();
    });
    function addPro(){
        var div1_value =  $("#mydiv1").text();
        var div2_value =  $("#mydiv2").text();
        if (div1_value==null||div1_value==""){
            layer.msg("请输入工程名称",{icon:3});
            throw SyntaxError;
        }
        if(div2_value==null||div2_value==""){
            layer.msg("请输入工程编号",{icon:3});
            throw SyntaxError;
        }
        $.ajax({
            type: "post",
            url: "${ctx}/project/save",
            data:{projectName:div1_value,projectNo:div2_value},
            dataType: "json",
            success: function(data){
            if(data.success){
                layer.msg(data.msg, {icon: 6,offset:['38%','38%']},function () {
                    parent.location.reload();
                });
            }else{
                layer.msg(data.msg, {icon: 5});
             }
            }
        });
    }
</script>