<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('通话列表')" />
</head>
<body class="gray-bg">
    <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<p class="select-title">通话列表</p>
				<form id="notice-form">
					<div class="select-list">
						<ul>
							<li>
								客户号码：<input type="text" name="outside"/>
							</li>
							<li>
								号码区号：<input type="text" name="areacode"/>
							</li>
							<li class="select-time">
								<label>呼叫时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>

	        <div class="col-sm-12 select-table table-striped">
	            <table id="bootstrap-table"></table>
	        </div>
    	</div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "totalCalls";
        $(function() {
            var options = {
				uniqueId: "id",
                url: prefix + "/list",
                modalName: "通话",
                columns: [
				{
					field : 'routePhone',
					title : '中继号码'
				},
				{
					field : 'outside',
					title : '客户号码'
				},
				{
					field : 'areacode',
					title : '号码区号'
				},
				{
					field : 'cityGsd',
					title : '归属地'
				},
				{
					field : 'inside',
					title : '坐席号码'
				},
				{
					field : 'seatName',
					title : '坐席账号'
				},
				{
					field : 'department',
					title : '所属部门'
				},
				{
					field : 'other',
					title : '第三方号码'
				},
				{
					field : 'aj',
					title : '按键'
				},
				{
					field : 'start',
					title : '呼叫时间'
				},
				{
					field : 'talk',
					title : '通话时间'
				},
				{
					field : 'end',
					title : '呼叫结束时间'
				},
				{
					field : 'listTime',
					title : '排队时长'
				},
				{
					field : 'ringTime',
					title : '振铃时长'
				},
				{
					field : 'calltime',
					title : '通话时长'
				},
				{
					field : 'endType',
					title : '结束类型',
					formatter: function(value, item, index) {
						if (item.endType == '1') {
							return '排队放弃';
						} else if (item.endType == '2') {
							return '呼入漏接';
						}else if (item.endType == '3') {
							return '呼入接听后挂断';
						}else if (item.endType == '4') {
							return '外呼无人接听挂断';
						}else if (item.endType == '5') {
							return '外呼接听后挂断';
						}else if (item.endType == '0') {
							return '呼入放弃';
						}else{
							return '呼入放弃';
						}

					}
				},
				{
					field : 'terminalType',
					title : '终端类型',
					formatter: function(value, item, index) {
						if (item.terminalType == '1') {
							return 'WEB';
						}
						else if (item.terminalType == '2') {
							return '话机';
						}else{
							return '未知';
						}

					}
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>