ZZDianXin_UI - 郑州电信 演示

workOrderComplain.html 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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. partOne();
  103. getDataList();
  104. //getTableDataList(); //获取表格数据
  105. })
  106. //导出
  107. $('.export').click(function() {
  108. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  109. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  110. dcexcel(this);
  111. });
  112. //tab切换
  113. $('.hu-tab li').click(function() {
  114. $(this).addClass('active')
  115. .siblings().removeClass('active');
  116. tabIndex = $(this).index();
  117. $('.hu-content >div').eq(tabIndex).show()
  118. .siblings().hide();
  119. loadDatas();
  120. });
  121. });
  122. function loadDatas() {
  123. if(tabIndex == 0) {
  124. //tu(); //加载图形
  125. } else if(tabIndex == 1) {
  126. getDataList(); //加载表格
  127. }
  128. }
  129. function dcexcel(obj) {
  130. var url = huayi.config.callcenter_url + "Business/GetTypeReport?isdc=1&token=" + token;
  131. url += "&stime=" + stime + "&endtime=" + endtime;
  132. obj.href = url;
  133. }
  134. partOne();
  135. //投诉举报汇总 part1
  136. var quantity = echarts.init(document.getElementById('quantity'));
  137. quantity.setOption({
  138. tooltip: {
  139. trigger: 'item',
  140. formatter: "{a} <br/>{b} : {c} ({d}%)",
  141. axisPointer: {
  142. crossStyle: {
  143. color: '#000'
  144. }
  145. }
  146. },
  147. legend: {
  148. bottom: 'bottom',
  149. data: [],
  150. textStyle: {
  151. color: '#000'
  152. }
  153. },
  154. series: [{
  155. name: '数据',
  156. type: 'pie',
  157. radius: '55%',
  158. center: ['50%', '50%'],
  159. data: [],
  160. itemStyle: {
  161. emphasis: {
  162. shadowBlur: 10,
  163. shadowOffsetX: 0,
  164. shadowColor: 'rgba(0, 0, 0, 0.5)'
  165. },
  166. normal: {
  167. label: {
  168. show: true,
  169. formatter: '{b} : {c} ({d}%)'
  170. },
  171. labelLine: {
  172. show: true
  173. }
  174. }
  175. },
  176. label: {
  177. normal: {
  178. textStyle: {
  179. color: '#000'
  180. }
  181. }
  182. }
  183. }]
  184. });
  185. function getDataList() {
  186. var loadindex = layer.load();
  187. layui.use('table', function() {
  188. var table = layui.table;
  189. //方法级渲染
  190. table.render({
  191. elem: '#t_callTotal',
  192. url: huayi.config.callcenter_url + "Business/GetTypeReport",
  193. method: 'get', //如果无需自定义HTTP类型,可不加该参数
  194. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  195. even: true, //开启隔行背景
  196. size: 'lg', //sm,lg尺寸的表格
  197. where: {
  198. // years: date,
  199. // dpt: $('#bumen').val(),
  200. sdate: stime,
  201. edate: endtime,
  202. token: token
  203. }, //如果无需传递额外参数,可不加该参数
  204. //request: {}, //如果无需自定义请求参数,可不加该参数
  205. response: {
  206. statusName: 'state', //数据状态的字段名称,默认:code
  207. statusCode: 'success', //成功的状态码,默认:0
  208. msgName: 'message', //状态信息的字段名称,默认:msg
  209. //countName: 'total', //数据总数的字段名称,默认:count
  210. //dataName: 'rows', //数据列表的字段名称,默认:data
  211. }, //如果无需自定义数据响应名称,可不加该参数
  212. cols: [
  213. [{
  214. field: 'F_Typeof',
  215. title: '投诉类型',
  216. fixed: true,
  217. align: 'center',
  218. width: 200,
  219. }, {
  220. field: 'Count',
  221. title: '数量',
  222. align: 'center',
  223. sort: true,
  224. //width: '30%',
  225. }]
  226. ],
  227. height: 'full-230',
  228. done:function(){
  229. layer.close(loadindex);
  230. }
  231. });
  232. });
  233. }
  234. function partOne() {
  235. var index = layer.load(1, {
  236. shade: [0.5, '#030303'] //0.1透明度的白色背景
  237. });
  238. $.ajax({
  239. type: "get",
  240. url: huayi.config.callcenter_url + "Business/GetTypeReport",
  241. async: true,
  242. dataType: 'json',
  243. data: {
  244. token: token,
  245. sdate: stime,
  246. edate: endtime
  247. },
  248. success: function(data) {
  249. if(data.state.toLowerCase() == 'success') {
  250. layer.close(index);
  251. var con = data.data;
  252. var part_1_legend = [];
  253. var part_1_ser = [];
  254. $(con).each(function(i, n) {
  255. part_1_legend.push(n.F_Typeof)
  256. var part_1_obj = {};
  257. part_1_obj.value = n.Count;
  258. part_1_obj.name = n.F_Typeof;
  259. part_1_ser.push(part_1_obj)
  260. })
  261. quantity.setOption({
  262. legend: {
  263. data: part_1_legend
  264. },
  265. series: [{
  266. data: part_1_ser
  267. }]
  268. })
  269. }
  270. }
  271. });
  272. }
  273. $('.part1Btn').click(function() {
  274. partOne()
  275. })
  276. </script>
  277. </body>
  278. </html>