<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增模板')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-template-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">模板名称：</label>
            <div class="col-sm-8">
                <input id="templateName" name="templateName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">模板类型：</label>
            <div class="col-sm-8">
                <select name="templateType" class="form-control m-b">
                    <option value="1">尽调模板</option>
                    <option value="2">评估模板</option>
                    <option value="3">风控清单</option>
                    <option value="4">标准函件</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">版本号：</label>
            <div class="col-sm-8">
                <input id="versionNo" name="versionNo" class="form-control" type="text" value="V1.0">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">适用场景：</label>
            <div class="col-sm-8">
                <input id="applicableScene" name="applicableScene" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">维护人：</label>
            <div class="col-sm-8">
                <input id="maintainer" name="maintainer" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">模板状态：</label>
            <div class="col-sm-8">
                <select name="templateStatus" class="form-control m-b">
                    <option value="0">草稿</option>
                    <option value="1">已发布</option>
                    <option value="2">停用</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">发布时间：</label>
            <div class="col-sm-8">
                <input id="publishTime" name="publishTime" class="form-control" type="text" placeholder="yyyy-MM-dd">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea name="remark" class="form-control"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "risk/template";

    $("#form-template-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-template-add').serialize());
        }
    }
</script>
</body>
</html>
