| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>业务数据报表</title>
- <!--[if lt IE 9]>
- <meta http-equiv="refresh" content="0;ie.html" />
- <![endif]-->
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
- <link rel="stylesheet" href="../js/layui/css/layui.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <style>
- .zxt-top {
- background: #f3f3f4;
- height: 60px;
- padding: 10px 20px;
- }
-
- .topCon {
- float: none !important;
- margin-right: 45px;
- }
-
- .zxt-content {
- display: inline-block;
- width: 90%;
- margin: 20px 5%;
- }
- .select2-container--default .select2-selection--single{
- border-color: #e5e6e7;
- }
- </style>
- </head>
- <body class="gray-bg" style="background: #fefefe;">
- <div class="zxtable">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn><i class="syIcon"></i>位置:
- <a id="ReIndex" href="javaScript:;">首页</a>>
- <a href="javaScript:;">报表分析</a>>
- <a href="javaScript:;">业务数据分析</a>>
- <a href="" class="nowPosition">业务数据报表</a>
- </sapn>
- </div>
- <div class="dhRight">
- <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
- </div>
- </div>
- <div class="zxt-top clearfix">
- <div class="topCon">
- <div class="form-inline th-bar clearfix">
- <div class="time-box form-group">
- <i class="tub fa fa-calendar"></i>
- <input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
- </div>
- <div class="time-box form-group">
- 部门:
- <select id="bumen">
- <option value="">请选择</option>
- </select>
- </div>
- <div class="form-group tool_bars pull-right">
- <button class="btns sear">搜索</button>
- <a class="btns export">导出</a>
- </div>
- </div>
- </div>
- </div>
- <div class="zxt-content">
- <table class="layui-hide" id="t_callTotal"></table>
- </div>
- </div>
- <script src="../js/layui/layui.js"></script>
- <script src="../js/select2/js/select2.min.js"></script>
- <script>
- var token = $.cookie("token");
- var stime = ''; //开始时间
- var endtime = ''; //结束时间
- var dpt = ''; //部门
- $(function() {
- var regNum = /^[0-9]+$/;
- layui.use('laydate', function() {
- var laydate = layui.laydate;
- //日期
- laydate.render({
- elem: '#startTime',
- range: '~',
- theme: '#1ab394',
- calendar: 'true'
- });
- });
- getDept(); //获取部门下拉
- getTableDataList(); //获取表格数据
- //搜索事件
- $(".sear").click(function() {
- dpt = $('#bumen').val();
- dpt = dpt === null ? '' : dpt;
- stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
- endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
- getTableDataList(); //获取表格数据
- });
- //导出
- $('.export').click(function() {
- dpt = $('#bumen').val();
- dpt = dpt === null ? '' : dpt;
- stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
- endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
- dcexcel(this);
- });
- });
- function dcexcel(obj) {
- var url = huayi.config.callcenter_url + "WOReport/ExptList?token=" + token;
- url += "&stime=" + stime + "&endtime=" + endtime + "&deptid=" + dpt;
- obj.href = url;
- }
- //加载表格
- function getTableDataList() {
- layui.use('table', function() {
- var table = layui.table;
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "WOReport/GetDataList", // 数据接口
- data: {
- stime: stime, // 开始时间
- endtime: endtime, // 结束时间
- deptid: dpt, // 部门id
- token: token
- },
- async: true,
- success: function(r) {
- var obj = JSON.parse(r);
- var data = obj.data.dtNew;
- //方法级渲染
- table.render({
- elem: '#t_callTotal',
- skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
- even: true, //开启隔行背景
- size: 'md', //sm,lg,md尺寸的表格
- cellMinWidth: 160,
- data: data,
- page: true,
- cols: [
- [
- {
- field: '部门',
- title: '部门',
- align: 'center',
- fixed: true,
- //sort: true,
- width: 150,
- }, {
- field: '工号',
- title: '工号',
- align: 'center',
- width: '',
- },
- {
- field: '姓名',
- title: '姓名',
- align: 'center',
- width: '',
- },
- {
- field: '建单量',
- title: '建单量',
- align: 'center',
- width: '',
- },
- {
- field: '接单量',
- title: '接单量',
- align: 'center',
- width: '',
- },
- {
- field: '未处理量',
- title: '未处理量',
- align: 'center',
- width: '',
- },
- {
- field: '异常量',
- title: '异常量',
- align: 'center',
- width: '',
- },
- {
- field: '已处理量',
- title: '已处理量',
- align: 'center',
- width: '',
- }
- // {
- // field: '平均通话总时长',
- // title: '平均通话总时长',
- // align: 'center',
- // templet: '<div><span class="color_73926">{{d.平均通话总时长}}</span></div>',
- // width: '',
- // },
- ]
- ],
- //height: 'full-150'
- });
- }
- });
- });
- }
- function getDept() {
- //部门下拉数据
- $("#bumen").select2({
- width: 'resolve',
- minimumResultsForSearch: -1,
- ajax: {
- type: "get",
- url: huayi.config.callcenter_url + "Department/GetDeptList",
- async: true,
- dataType: "json",
- data: function(params) {
- return {
- token: token,
- pid: params.id
- }
- },
- processResults: function(data) {
- return {
- results: data.data
- }
- },
- cache: true
- },
- placeholder: "请选择",
- });
- }
- </script>
- </body>
- </html>
|