<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增线索跟进记录，来自线索详情')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-follow-add" th:object="${crmCLue}">
        	<input name="clueId" type="hidden" id="clueId"  th:field="*{clueId}" />
            <div class="form-group">    
                <label class="col-sm-3 control-label">所属线索：</label>
                <div class="col-sm-8">
                    <div class="form-control-static" th:text="${crmCLue.name}"></div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">跟进时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="followDate" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text" required>
                    </div>
                </div>
            </div>            
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">跟进类型：</label>
                <div class="col-sm-8">
                    <select name="followType" class="form-control m-b" th:with="type=${@dict.getType('follow_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">跟进结果：</label>
                <div class="col-sm-8">
                    <textarea name="followContent" class="form-control" required></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "crm/clueFollow"
        $("#form-follow-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
				var data=$('#form-follow-add').serialize();
				$.operate.save(prefix + "/add", data+"&tableId=bootstrap-tableFollow");
			}
        }

        $("input[name='followDate']").datetimepicker({
        });
    </script>
</body>
</html>