<!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-material-edit" th:object="${riskMaterial}">
        <input id="materialId" name="materialId" th:field="*{materialId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">资料名称：</label>
            <div class="col-sm-8">
                <input id="materialName" name="materialName" th:field="*{materialName}" 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="materialType" class="form-control m-b" th:field="*{materialType}">
                    <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="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">
                <input id="sourceChannel" name="sourceChannel" th:field="*{sourceChannel}" 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="ownerName" name="ownerName" th:field="*{ownerName}" 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="materialStatus" class="form-control m-b" th:field="*{materialStatus}">
                    <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="filePath" name="filePath" th:field="*{filePath}" 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="submitDate" name="submitDate" class="form-control" type="text" placeholder="yyyy-MM-dd"
                    th:value="${riskMaterial.submitDate != null ? #dates.format(riskMaterial.submitDate, '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/material";

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

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