<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('药学警戒表新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">最后更新时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="lastUpdateTime" id="lastUpdateTime" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="name" id="name" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">介绍:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="introduction" id="introduction" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">警戒创建人:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="alertCreator" id="alertCreator" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">创建时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="createdAt" id="createdAt" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var lastUpdateTime = $("input[name='lastUpdateTime']").val();
           var name = $("input[name='name']").val();
           var introduction = $("input[name='introduction']").val();
           var alertCreator = $("input[name='alertCreator']").val();
           var createdAt = $("input[name='createdAt']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "dtp/sdtpzskcxpharmacovigilance/sDtpZskcxPharmacovigilanceAdd",
            data : {
                "lastUpdateTime": lastUpdateTime,
                "name": name,
                "introduction": introduction,
                "alertCreator": alertCreator,
                "createdAt": createdAt,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
