<!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-edit" th:object="${crmClueFollow}">
            <input name="followId" th:field="*{followId}" type="hidden">
            <input name="clueId" type="hidden" id="clueId" />
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属线索：</label>
                <div class="col-sm-8">
                	<div class="input-group">
	                    <input name="name"  onclick="selectCustomer()" th:field="*{clue.name}" class="form-control" type="text" placeholder="请选择所属线索 " id="name" required readonly>
	                	<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</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" th:value="${#dates.format(crmClueFollow.followDate, 'yyyy-MM-dd HH:mm')}" 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}" th:field="*{followType}"></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>[[*{followContent}]]</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-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-follow-edit').serialize());
            }
        }

        $("input[name='followDate']").datetimepicker({
        });
        
        /*  跟进管理-新增-选择线索 */
        function selectCustomer() {
        	 var url = ctx + "crm/customer/selectCustomer";
        	 /* var options = {
				title: '选择线索',
				width: "780",
				url: url
			};
			$.modal.openOptions(options);
        	*/
        	 $.modal.open("选择线索", url);
		}
    </script>
</body>
</html>