<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('线索详情')" />
</head>
<body class="white-bg">
    <section class="section-content">
    <div class="row">
        <div class="col-xs-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content" style="border-style:none;">
                    <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab-detail" data-toggle="tab" aria-expanded="true">详细资料</a></li>
                            <li><a href="#tab-follow" data-toggle="tab" aria-expanded="false">跟进记录</a></li>
                            <li><a href="#tab-task" data-toggle="tab" aria-expanded="false">任务</a></li>
                        </ul>
                        <form id="form-clue-edit" class="form-horizontal" th:object="${crmClue}">
            			<input name="clueId" th:field="*{clueId}" type="hidden">
                        <div class="tab-content">                          
                            <!-- 详细信息 -->
                            <div class="tab-pane active" id="tab-detail">              
                            	<div class="row mt20">
					            	<div class="col-sm-6">						            
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">姓名：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.name}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6"> 
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">公司：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.company}"></div>
							                </div>
							            </div>
					                </div>
				            	</div>                   
				            	
				            	<div class="row">
					            	<div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">地址：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.address}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">职务：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.duty}"></div>
							                </div>
							            </div>
					                </div>
				            	</div> 
				            	
				            	<div class="row">
					            	<div class="col-sm-6"> 
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">手机：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.mobile}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">用户邮箱：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.email}"></div>
							                </div>
							            </div>
					                </div>
				            	</div>       
				            	
				            	<div class="row">
					            	<div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">qq：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.qq}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">微信：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.wechat}"></div>
							                </div>
							            </div>
					                </div>
				            	</div>    
				            	
				            	<div class="row">
					            	<div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">旺旺：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.wangwang}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">MSN：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.msn}"></div>
							                </div>
							            </div>
					                </div>
				            	</div>
				            	
				            	<div class="row">
					            	<div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">性别：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${@dict.getLabel('sys_user_sex', crmClue.sex)}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">线索来源：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${@dict.getLabel('crm_customer_source', crmClue.clueSource)}"></div>
							                </div>
							            </div>
					                </div>
				            	</div>
				            	
				            	<div class="row">
					            	<div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">决策等级：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${@dict.getLabel('person_decision_level', crmClue.decisionLevel)}"></div>
							                </div>
							            </div>
					                </div>
					                <div class="col-sm-6">
							            <div class="form-group">    
							                <label class="col-sm-4 control-label">市场活动：</label>
							                <div class="col-sm-8">
							                    <div class="form-control-static" th:text="${crmClue.marketActivity}"></div>
							                </div>
							            </div>
					                </div>
				            	</div>
				            	
				            	<div class="row">
					            	<div class="col-sm-12">
							            <div class="form-group">
							        		<label class="col-xs-2 control-label">备注：</label>
							            	<div class="col-xs-10">
							                	<div class="form-control-static" th:text="${crmClue.remark}"></div>
							             	</div>
							     	    </div>
					                </div>
				            	</div>
                            </div>
                            <!-- 跟进记录 -->
                            <div class="tab-pane" id="tab-follow">                                 	
									<div class="btn-group-sm" id="toolbarFollow" role="group">
										<a class="btn btn-success" onclick="addFollow();" shiro:hasPermission="crm:clueFollow:add"> 
											<i class="fa fa-plus"></i> 写跟进
										</a>
									</div>
                                <div class="select-table table-striped" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">
								    <table id="bootstrap-tableFollow"></table>
								</div>      
                            </div>  
                            
                            <!-- 任务 -->
                            <div class="tab-pane" id="tab-task">                            
                                <div class="select-table table-striped" style="margin-top: 0px;padding-top: 0px;padding-bottom: 0px;">
								    <table id="bootstrap-table" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
								</div>                            	
                            </div>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
	</section>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
	    var editFlag = [[${@permission.hasPermi('crm:clueFollow:edit')}]];
	    var removeFlag = [[${@permission.hasPermi('crm:clueFollow:remove')}]];
	    var followTypeDatas = [[${@dict.getType('follow_type')}]];
	    var customerTypeDatas = [[${@dict.getType('crm_customer_type')}]];
	    var prefix = ctx + "crm/clueFollow";
		var clueId= [[${clueId}]];
	    
	    $(function() {	    	
	        var options = {
	            id: "bootstrap-tableFollow",
			    toolbar: "toolbarFollow",
	            url: prefix + "/list",
	            createUrl: prefix + "/add",
	            updateUrl: prefix + "/edit/{id}",
	            removeUrl: prefix + "/remove",
	            exportUrl: prefix + "/export",
		        sortName: "followDate",
		        sortOrder: "desc",
	            modalName: "线索跟进记录",
                showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
	            columns: [
	            {
	                field : 'followId', 
	                title : '跟进ID',
	                visible: false
	            },
	            {
	                field : 'followDate', 
	                title : '跟进时间',
		            sortable: true
	            },
	            {
	                field : 'followType', 
	                title : '跟进方式',
	                formatter: function(value, row, index) {
	                   return $.table.selectDictLabel(followTypeDatas, value);
	                },
		            sortable: true
	           	},
	            {
	                field : 'followContent', 
	                title : '跟进结果'
	            },
                {
                    field : 'createBy', 
                    title : '录入人',
		            sortable: true
                },
                {
                    field : 'createTime', 
                    title : '录入时间',
		            sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.followId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.followId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
	        };
	        $.table.init(options);
	    });

        /*跟进*/
		 function addFollow()
		 {
			 $.modal.open('添加跟进', prefix + '/addFollow/'+clueId);
		 }
    </script>
</body>
</html>


