| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- <!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>
- <ul class="nav nav-tabs hu-tab">
- <li role="presentation" class="active">
- <a href="javascript:;">图形</a>
- </li>
- <li role="presentation">
- <a href="javascript:;">表格</a>
- </li>
- </ul>
- <div class="hu-content">
- <div class="hu-con-right">
- <h2 style="text-align: center; margin-top: 20px;">数据饼状图</h2>
- <div id="quantity" style="width: 100%;height: 500px;"></div>
- </div>
- <div class="hu-con-left" style="width: 80%; margin: 0 auto;">
- <h2 style="text-align: center; margin-top: 20px; display: none;">投诉原因统计</h2>
- <table class="layui-hide" id="t_callTotal"></table>
- </div>
- </div>
- <script src="../js/layui/layui.js"></script>
- <script src="../js/echarts.min.js"></script>
- <script src="../js/highcharts.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')); //获取部门
- /*搜索*/
- $(".search").click(function() {
- stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
- endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
- if(tabIndex==0){
- partOne();
- }else if(tabIndex==1){
- getDataList();
- }
- //getTableDataList(); //获取表格数据
- })
- //导出
- $('.export').click(function() {
- stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
- endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
- dcexcel(this);
- });
- var tabIndex=0;
- //tab切换
- $('.hu-tab li').click(function() {
- $(this).addClass('active')
- .siblings().removeClass('active');
- tabIndex = $(this).index();
- $('.hu-content >div').eq(tabIndex).show()
- .siblings().hide();
- loadDatas(tabIndex);
- });
-
- });
- function loadDatas(tabIndex) {
- if(tabIndex == 0) {
- //tu(); //加载图形
- } else if(tabIndex == 1) {
- getDataList(); //加载表格
- }
- }
- function dcexcel(obj) {
- var url = huayi.config.callcenter_url + "Business/GetTypeReport?isdc=1&token=" + token;
- url += "&stime=" + stime + "&endtime=" + endtime;
- obj.href = url;
- }
-
- partOne();
- //投诉举报汇总 part1
- var quantity = echarts.init(document.getElementById('quantity'));
- quantity.setOption({
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#000'
- }
- }
- },
- legend: {
- bottom: 'bottom',
- data: [],
- textStyle: {
- color: '#000'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: '55%',
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal: {
- label: {
- show: true,
- formatter: '{b} : {c} ({d}%)'
- },
- labelLine: {
- show: true
- }
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#000'
- }
- }
- }
- }]
- });
-
- function getDataList() {
- var loadindex = layer.load();
- layui.use('table', function() {
- var table = layui.table;
- //方法级渲染
- table.render({
- elem: '#t_callTotal',
- url: huayi.config.callcenter_url + "Business/GetTypeReport",
- method: 'get', //如果无需自定义HTTP类型,可不加该参数
- skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
- even: true, //开启隔行背景
- size: 'lg', //sm,lg尺寸的表格
- where: {
- // years: date,
- // dpt: $('#bumen').val(),
- sdate: stime,
- edate: endtime,
- token: token
- }, //如果无需传递额外参数,可不加该参数
- //request: {}, //如果无需自定义请求参数,可不加该参数
- response: {
- statusName: 'state', //数据状态的字段名称,默认:code
- statusCode: 'success', //成功的状态码,默认:0
- msgName: 'message', //状态信息的字段名称,默认:msg
- //countName: 'total', //数据总数的字段名称,默认:count
- //dataName: 'rows', //数据列表的字段名称,默认:data
- }, //如果无需自定义数据响应名称,可不加该参数
- cols: [
- [{
- field: 'F_Typeof',
- title: '投诉类型',
- fixed: true,
- align: 'center',
- width: 200,
- }, {
- field: 'Count',
- title: '数量',
- align: 'center',
- sort: true,
- //width: '30%',
- }]
- ],
- height: 'full-230',
- done:function(){
- layer.close(loadindex);
- }
- });
- });
- }
- function partOne() {
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Business/GetTypeReport",
- async: true,
- dataType: 'json',
- data: {
- token: token,
- sdate: stime,
- edate: endtime
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- layer.close(index);
- var con = data.data;
- var part_1_legend = [];
- var part_1_ser = [];
- $(con).each(function(i, n) {
- part_1_legend.push(n.F_Typeof)
- var part_1_obj = {};
- part_1_obj.value = n.Count;
- part_1_obj.name = n.F_Typeof;
- part_1_ser.push(part_1_obj)
-
- })
-
-
- quantity.setOption({
- legend: {
- data: part_1_legend
- },
- series: [{
- data: part_1_ser
- }]
- })
- }
- }
- });
- }
- $('.part1Btn').click(function() {
- partOne()
- })
- </script>
- </body>
- </html>
|