ZZDianXin_UI - 郑州电信 演示

workOrderComplain.html 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>工单类型</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link rel="stylesheet" href="../js/layui/css/layui.css" />
  10. <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
  11. <link rel="stylesheet" href="../css/init.css" />
  12. <style>
  13. .toolBox {
  14. background: #f3f3f4;
  15. height: 60px;
  16. padding: 10px 20px;
  17. }
  18. .th-content {
  19. width: 90%;
  20. margin: 0 auto;
  21. }
  22. </style>
  23. </head>
  24. <body class="gray-bg" style="background: #fefefe;">
  25. <div class="daoHang clearfix">
  26. <div class="dhLeft">
  27. <sapn><i class="syIcon"></i>位置:
  28. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  29. <a href="javaScript:;">报表分析</a>&gt;
  30. <a href="javaScript:;">业务数据分析</a>&gt;
  31. <a href="" style="color: #000;">工单类型</a>
  32. </sapn>
  33. </div>
  34. <div class="dhRight">
  35. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  36. </div>
  37. </div>
  38. <div class="toolBox">
  39. <div class="th-bar clearfix">
  40. <div class="pull-right">
  41. <div class="form-inline">
  42. <div class="time-box form-group">
  43. <i class="tub fa fa-calendar"></i>
  44. <input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
  45. </div>
  46. <!--<div class="time-box form-group">
  47. 部门:
  48. <select id="bumen">
  49. <option value="">请选择</option>
  50. </select>
  51. </div>-->
  52. <div class="pull-right">
  53. <button class="btns search">搜索</button>
  54. <a href="" class="btns export">导出</a>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <ul class="nav nav-tabs hu-tab">
  61. <li role="presentation" class="active">
  62. <a href="javascript:;">图形</a>
  63. </li>
  64. <li role="presentation">
  65. <a href="javascript:;">表格</a>
  66. </li>
  67. </ul>
  68. <div class="hu-content">
  69. <div class="hu-con-right">
  70. <h2 style="text-align: center; margin-top: 20px;">数据饼状图</h2>
  71. <div id="quantity" style="width: 100%;height: 500px;"></div>
  72. </div>
  73. <div class="hu-con-left" style="width: 80%; margin: 0 auto;">
  74. <h2 style="text-align: center; margin-top: 20px; display: none;">投诉原因统计</h2>
  75. <table class="layui-hide" id="t_callTotal"></table>
  76. </div>
  77. </div>
  78. <script src="../js/layui/layui.js"></script>
  79. <script src="../js/echarts.min.js"></script>
  80. <script src="../js/highcharts.js"></script>
  81. <script src="../js/select2/js/select2.min.js"></script>
  82. <script>
  83. var token = $.cookie("token");
  84. var stime = ''; //开始时间
  85. var endtime = ''; //结束时间
  86. $(document).ready(function() {
  87. layui.use('laydate', function() {
  88. var laydate = layui.laydate;
  89. //日期
  90. laydate.render({
  91. elem: '#startTime',
  92. range: '~',
  93. theme: '#1ab394',
  94. calendar: 'true'
  95. });
  96. });
  97. helper.getDropList.getDept($('#bumen')); //获取部门
  98. /*搜索*/
  99. $(".search").click(function() {
  100. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  101. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  102. if(tabIndex==0){
  103. partOne();
  104. }else if(tabIndex==1){
  105. getDataList();
  106. }
  107. //getTableDataList(); //获取表格数据
  108. })
  109. //导出
  110. $('.export').click(function() {
  111. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  112. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  113. dcexcel(this);
  114. });
  115. var tabIndex=0;
  116. //tab切换
  117. $('.hu-tab li').click(function() {
  118. $(this).addClass('active')
  119. .siblings().removeClass('active');
  120. tabIndex = $(this).index();
  121. $('.hu-content >div').eq(tabIndex).show()
  122. .siblings().hide();
  123. loadDatas(tabIndex);
  124. });
  125. });
  126. function loadDatas(tabIndex) {
  127. if(tabIndex == 0) {
  128. //tu(); //加载图形
  129. } else if(tabIndex == 1) {
  130. getDataList(); //加载表格
  131. }
  132. }
  133. function dcexcel(obj) {
  134. var url = huayi.config.callcenter_url + "Business/GetTypeReport?isdc=1&token=" + token;
  135. url += "&stime=" + stime + "&endtime=" + endtime;
  136. obj.href = url;
  137. }
  138. partOne();
  139. //投诉举报汇总 part1
  140. var quantity = echarts.init(document.getElementById('quantity'));
  141. quantity.setOption({
  142. tooltip: {
  143. trigger: 'item',
  144. formatter: "{a} <br/>{b} : {c} ({d}%)",
  145. axisPointer: {
  146. crossStyle: {
  147. color: '#000'
  148. }
  149. }
  150. },
  151. legend: {
  152. bottom: 'bottom',
  153. data: [],
  154. textStyle: {
  155. color: '#000'
  156. }
  157. },
  158. series: [{
  159. name: '数据',
  160. type: 'pie',
  161. radius: '55%',
  162. center: ['50%', '50%'],
  163. data: [],
  164. itemStyle: {
  165. emphasis: {
  166. shadowBlur: 10,
  167. shadowOffsetX: 0,
  168. shadowColor: 'rgba(0, 0, 0, 0.5)'
  169. },
  170. normal: {
  171. label: {
  172. show: true,
  173. formatter: '{b} : {c} ({d}%)'
  174. },
  175. labelLine: {
  176. show: true
  177. }
  178. }
  179. },
  180. label: {
  181. normal: {
  182. textStyle: {
  183. color: '#000'
  184. }
  185. }
  186. }
  187. }]
  188. });
  189. function getDataList() {
  190. var loadindex = layer.load();
  191. layui.use('table', function() {
  192. var table = layui.table;
  193. //方法级渲染
  194. table.render({
  195. elem: '#t_callTotal',
  196. url: huayi.config.callcenter_url + "Business/GetTypeReport",
  197. method: 'get', //如果无需自定义HTTP类型,可不加该参数
  198. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  199. even: true, //开启隔行背景
  200. size: 'lg', //sm,lg尺寸的表格
  201. where: {
  202. // years: date,
  203. // dpt: $('#bumen').val(),
  204. sdate: stime,
  205. edate: endtime,
  206. token: token
  207. }, //如果无需传递额外参数,可不加该参数
  208. //request: {}, //如果无需自定义请求参数,可不加该参数
  209. response: {
  210. statusName: 'state', //数据状态的字段名称,默认:code
  211. statusCode: 'success', //成功的状态码,默认:0
  212. msgName: 'message', //状态信息的字段名称,默认:msg
  213. //countName: 'total', //数据总数的字段名称,默认:count
  214. //dataName: 'rows', //数据列表的字段名称,默认:data
  215. }, //如果无需自定义数据响应名称,可不加该参数
  216. cols: [
  217. [{
  218. field: 'F_Typeof',
  219. title: '投诉类型',
  220. fixed: true,
  221. align: 'center',
  222. width: 200,
  223. }, {
  224. field: 'Count',
  225. title: '数量',
  226. align: 'center',
  227. sort: true,
  228. //width: '30%',
  229. }]
  230. ],
  231. height: 'full-230',
  232. done:function(){
  233. layer.close(loadindex);
  234. }
  235. });
  236. });
  237. }
  238. function partOne() {
  239. var index = layer.load(1, {
  240. shade: [0.5, '#030303'] //0.1透明度的白色背景
  241. });
  242. $.ajax({
  243. type: "get",
  244. url: huayi.config.callcenter_url + "Business/GetTypeReport",
  245. async: true,
  246. dataType: 'json',
  247. data: {
  248. token: token,
  249. sdate: stime,
  250. edate: endtime
  251. },
  252. success: function(data) {
  253. if(data.state.toLowerCase() == 'success') {
  254. layer.close(index);
  255. var con = data.data;
  256. var part_1_legend = [];
  257. var part_1_ser = [];
  258. $(con).each(function(i, n) {
  259. part_1_legend.push(n.F_Typeof)
  260. var part_1_obj = {};
  261. part_1_obj.value = n.Count;
  262. part_1_obj.name = n.F_Typeof;
  263. part_1_ser.push(part_1_obj)
  264. })
  265. quantity.setOption({
  266. legend: {
  267. data: part_1_legend
  268. },
  269. series: [{
  270. data: part_1_ser
  271. }]
  272. })
  273. }
  274. }
  275. });
  276. }
  277. $('.part1Btn').click(function() {
  278. partOne()
  279. })
  280. </script>
  281. </body>
  282. </html>