| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>工单地区</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../js/layui/css/layui.css" />
- <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <style>
- .toolBox {
- background: #f3f3f4;
- height: 60px;
- padding: 10px 20px;
- }
-
- .th-content {
- width: 90%;
- margin: 0 auto;
- }
- </style>
- </head>
- <body class="gray-bg" style="background: #fefefe;">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn><i class="syIcon"></i>位置:
- <a href="javaScript:;" id="ReIndex">首页</a>>
- <a href="javaScript:;">报表分析</a>>
- <a href="javaScript:;">业务数据分析</a>>
- <a href="" style="color: #000;">工单地区</a>
- </sapn>
- </div>
- <div class="dhRight">
- <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
- </div>
- </div>
- <div class="toolBox">
- <div class="th-bar clearfix">
- <div class="pull-right">
- <div class="form-inline">
- <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="pull-right">
- <button class="btns search">搜索</button>
- <a href="" class="btns export">导出</a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="th-content">
- <table class="layui-hide" id="t_callTotal"></table>
- </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 = ''; //结束时间
- $(document).ready(function() {
- layui.use('laydate', function() {
- var laydate = layui.laydate;
- //日期
- laydate.render({
- elem: '#startTime',
- range: '~',
- theme: '#1ab394',
- calendar: 'true'
- });
- });
- helper.getDropList.getDept($('#bumen'));//获取部门
- getTableDataList(); //获取表格数据
- /*搜索*/
- $(".search").click(function() {
- stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
- endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
- getTableDataList(); //获取表格数据
- })
- //导出
- $('.export').click(function() {
- 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 + "GDPos/ExportExcel?token=" + token;
- url += "&stime=" + stime + "&endtime=" + endtime + "&dpt=" + $('#bumen').val();
- obj.href = url;
- }
- //加载表格
- function getTableDataList() {
- var colsArr = [];
- var dataArr = [];
- var loadindex;
- $.ajax({
- type: 'get',
- url: huayi.config.callcenter_url + "GDPos/GetDataList",
- async: true,
- dataType: 'json',
- beforeSend:function(){
- loadindex = layer.load()
- },
- data: {
- stime: stime,
- endtime: endtime,
- dpt: $('#bumen').val(),
- token: token,
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var res = data.data;
- if(res) {
- var newArr = [];
- dataArr = res.dt;
- var colname = res.colname;
- if(colname && colname.length > 0) {
- newArr.push({
- field: colname[0],
- title: colname[0],
- align: 'center',
- fixed: true,
- sort: true,
- width: 150,
- });
- for(var i = 1, colNL = colname.length; i < colNL - 1; i++){
- newArr.push({
- field: colname[i],
- title: colname[i],
- align: 'center',
- //fixed: true,
- //sort: true,
- //width: 150,
- });
- }
- newArr.push({
- field: '总计',
- title: '总计',
- align: 'center',
- fixed: 'right',
- templet: function(d){
- return '<span class="color_73926">'+ d.总计 +'</span>'
- },
- sort: true,
- //width: 150,
- });
- }
- colsArr.push(newArr);
- layui.use('table', function() {
- var table = layui.table;
- //方法级渲染
- table.render({
- elem: '#t_callTotal',
- skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
- even: true, //开启隔行背景
- size: 'lg', //sm,lg尺寸的表格
- cellMinWidth: 100,
- page: true,
- data: dataArr,
- cols: colsArr,
- height: 'full-150'
- });
- });
- }
- }
- },
- }).then(function(){layer.close(loadindex);});
- }
- </script>
- </body>
- </html>
|