<!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-report-edit" th:object="${riskReport}">
        <input id="reportId" name="reportId" th:field="*{reportId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">报告编号：</label>
            <div class="col-sm-8">
                <input id="reportCode" name="reportCode" th:field="*{reportCode}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">报告名称：</label>
            <div class="col-sm-8">
                <input id="reportName" name="reportName" th:field="*{reportName}" 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">
                <input id="projectName" name="projectName" th:field="*{projectName}" 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="reportType" class="form-control m-b" th:field="*{reportType}">
                    <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" th:field="*{versionNo}" 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="reviewer" name="reviewer" th:field="*{reviewer}" 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="reportStatus" class="form-control m-b" th:field="*{reportStatus}">
                    <option value="0">草稿</option>
                    <option value="1">审核中</option>
                    <option value="2">已发布</option>
                    <option value="3">已归档</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">发布时间：</label>
            <div class="col-sm-8">
                <input id="publishDate" name="publishDate" class="form-control" type="text" placeholder="yyyy-MM-dd"
                    th:value="${riskReport.publishDate != null ? #dates.format(riskReport.publishDate, '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" th:field="*{remark}"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "risk/report";

    $("#form-report-edit").validate({
        focusCleanup: true
    });

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