No Description

workOrderComplain.html 7.7KB

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