<!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-project-edit" th:object="${riskProject}">
        <input id="projectId" name="projectId" th:field="*{projectId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">项目编号：</label>
            <div class="col-sm-8">
                <input id="projectCode" name="projectCode" th:field="*{projectCode}" 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="projectName" name="projectName" th:field="*{projectName}" 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">
                <select name="projectType" class="form-control m-b" th:field="*{projectType}" required>
                    <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="orgName" name="orgName" th:field="*{orgName}" 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="clientName" name="clientName" th:field="*{clientName}" 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="projectManager" name="projectManager" th:field="*{projectManager}" 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="assessor" name="assessor" th:field="*{assessor}" 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="riskLevel" class="form-control m-b" th:field="*{riskLevel}">
                    <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">
                <select name="projectStatus" class="form-control m-b" th:field="*{projectStatus}">
                    <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="dueDate" name="dueDate" class="form-control" type="text" placeholder="yyyy-MM-dd"
                    th:value="${riskProject.dueDate != null ? #dates.format(riskProject.dueDate, '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/project";

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

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