|
|
@@ -0,0 +1,202 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>工作报表</title>
|
|
|
+ <link rel="shortcut icon" href="favicon.ico">
|
|
|
+ <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
|
|
|
+ <link href="__CSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">
|
|
|
+ <link href="__CSS__/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
|
|
|
+ <link href="__CSS__/animate.min.css" rel="stylesheet">
|
|
|
+ <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
|
|
|
+ <link href="__JS__/layui/css/myLayui.css" rel="stylesheet">
|
|
|
+</head>
|
|
|
+<body class="gray-bg">
|
|
|
+<div class="wrapper wrapper-content animated fadeInRight">
|
|
|
+ <!-- Panel Other -->
|
|
|
+ <div class="ibox float-e-margins">
|
|
|
+ <div class="ibox-title">
|
|
|
+ <h5>工作报表</h5>
|
|
|
+ </div>
|
|
|
+ <div class="ibox-content">
|
|
|
+ <!--搜索框开始-->
|
|
|
+ <form id='commentForm' role="form" method="post" class="form-inline pull-right">
|
|
|
+ <div class="content clearfix m-b">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>留言日期:</label>
|
|
|
+ <input type="text" class="form-control" id="start" value="<?php echo date('Y-m-d',time()-172800);?>" style="width: 100px;"> --
|
|
|
+ <input type="text" class="form-control" id="end" value="<?php echo date('Y-m-d',time()-86400);?>" style="width: 100px;">
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label>客服:</label>
|
|
|
+ <input type="text" class="form-control" id="username" name="user_name">
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <button class="btn btn-primary" type="button" style="margin-top:5px" id="search"><strong>搜 索</strong>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ <!--搜索框结束-->
|
|
|
+ <div class="example-wrap">
|
|
|
+ <div class="example">
|
|
|
+ <table id="cusTable">
|
|
|
+ <thead>
|
|
|
+ <th data-field="user_account">账号</th>
|
|
|
+ <th data-field="user_name">名称</th>
|
|
|
+ <th data-field="user_job_number">工号</th>
|
|
|
+ <th data-field="service_num">接入会话量</th>
|
|
|
+ <th data-field="send_words">总消息量</th>
|
|
|
+ <th data-field="transfer_in">接入转接量</th>
|
|
|
+ <th data-field="reply">回复率</th>
|
|
|
+ <th data-field="answer_problem">答问比</th>
|
|
|
+ <th data-field="conversation">平均会话时长</th>
|
|
|
+ <th data-field="response">平均响应时长</th>
|
|
|
+ <th data-field="appraise">参评率</th>
|
|
|
+ <th data-field="pleased">相对满意度率</th>
|
|
|
+ <th data-field="pleased_num">满意评价次数</th>
|
|
|
+ <th data-field="commonly">一般评价次数</th>
|
|
|
+ <th data-field="no_pleased">不满意评价次数</th>
|
|
|
+ <th data-field="message">留言处理量</th>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- End Example Pagination -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<!-- End Panel Other -->
|
|
|
+<script src="__JS__/jquery.min.js?v=2.1.4"></script>
|
|
|
+<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
|
|
|
+<script src="__JS__/content.min.js?v=1.0.0"></script>
|
|
|
+<script src="__JS__/plugins/bootstrap-table/bootstrap-table.min.js"></script>
|
|
|
+<script src="__JS__/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
|
|
|
+<script src="__JS__/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
|
|
|
+<script src="__JS__/plugins/layer/layer.min.js"></script>
|
|
|
+<script src="__JS__/layui/layui.js"></script>
|
|
|
+<script type="text/javascript">
|
|
|
+
|
|
|
+ layui.use(['form', 'upload'], function(){
|
|
|
+ var form = layui.form;
|
|
|
+
|
|
|
+ form.on('select(message_status)', function(value){
|
|
|
+ $("#message_status").val(value.value);
|
|
|
+ onSearch()
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+</script>
|
|
|
+<script type="text/javascript">
|
|
|
+ function initTable() {
|
|
|
+ //先销毁表格
|
|
|
+ $('#cusTable').bootstrapTable('destroy');
|
|
|
+ //初始化表格,动态从服务器加载数据
|
|
|
+ $("#cusTable").bootstrapTable({
|
|
|
+ method: "get", //使用get请求到服务器获取数据
|
|
|
+ url: "{:url('report/workreport')}", //获取数据的地址
|
|
|
+ striped: true, //表格显示条纹
|
|
|
+ pagination: true, //启动分页
|
|
|
+ pageSize: 10, //每页显示的记录数
|
|
|
+ pageNumber:1, //当前第几页
|
|
|
+ pageList: [5, 10, 15, 20, 25], //记录数可选列表
|
|
|
+ sidePagination: "server", //表示服务端请求
|
|
|
+ paginationFirstText: "首页",
|
|
|
+ paginationPreText: "上一页",
|
|
|
+ paginationNextText: "下一页",
|
|
|
+ paginationLastText: "尾页",
|
|
|
+ queryParamsType : "undefined",
|
|
|
+ queryParams: function queryParams(params) { //设置查询参数
|
|
|
+ var param = {
|
|
|
+ pageNumber: params.pageNumber,
|
|
|
+ pageSize: params.pageSize,
|
|
|
+ searchText:$('#username').val(),
|
|
|
+ start:$('#start').val(),
|
|
|
+ end:$('#end').val()
|
|
|
+ };
|
|
|
+ return param;
|
|
|
+ },
|
|
|
+ onLoadSuccess: function(res){ //加载成功时执行
|
|
|
+ if(111 == res.code){
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ layer.msg("加载成功", {time : 1000});
|
|
|
+ },
|
|
|
+ onLoadError: function(){ //加载失败时执行
|
|
|
+ layer.msg("加载数据失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $(document).ready(function () {
|
|
|
+ //调用函数,初始化表格
|
|
|
+ initTable();
|
|
|
+
|
|
|
+ //当点击查询按钮的时候执行
|
|
|
+ $("#search").bind("click", function(){
|
|
|
+ var start = $('#start').val();
|
|
|
+ var end = $('#end').val();
|
|
|
+ if(start > end){
|
|
|
+ layer.msg('开始时间不能大于结束时间');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取当前时间 年月日
|
|
|
+ var date = new Date();
|
|
|
+ var year = date.getFullYear();
|
|
|
+ var month = date.getMonth() + 1;
|
|
|
+ var day = date.getDate();
|
|
|
+ if (month < 10) {
|
|
|
+ month = "0" + month;
|
|
|
+ }
|
|
|
+ if (day < 10) {
|
|
|
+ day = "0" + day;
|
|
|
+ }
|
|
|
+ var nowDate = year + "-" + month + "-" + day;
|
|
|
+ console.log(nowDate);
|
|
|
+ if(nowDate <= end){
|
|
|
+ layer.msg('结束时间不能大于等于当前时间');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ initTable();
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ function messageDel(id){
|
|
|
+ layer.confirm('确认删除?', {icon: 3, title:'提示'}, function(index){
|
|
|
+ //do something
|
|
|
+ $.getJSON("{:url('Messages/delMessage')}", {'id' : id}, function(res){
|
|
|
+ if(1 == res.code){
|
|
|
+ layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
|
|
|
+ initTable();
|
|
|
+ });
|
|
|
+ }else if(111 == res.code){
|
|
|
+ window.location.reload();
|
|
|
+ }else{
|
|
|
+ layer.alert(res.msg, {title: '友情提示', icon: 2});
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ layer.close(index);
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ layui.use('laydate', function(){
|
|
|
+ var laydate = layui.laydate;
|
|
|
+ laydate.render({
|
|
|
+ elem: '#start'
|
|
|
+ ,type: 'date'
|
|
|
+ });
|
|
|
+
|
|
|
+ laydate.render({
|
|
|
+ elem: '#end'
|
|
|
+ ,type: 'date'
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|