ZZDianXin_UI - 郑州电信 演示

workOrderCustomer.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  13. <style>
  14. .toolBox {
  15. background: #f3f3f4;
  16. height: 60px;
  17. padding: 10px 20px;
  18. }
  19. .th-content {
  20. width: 90%;
  21. margin: 0 auto;
  22. }
  23. .time-box {
  24. position: relative;
  25. }
  26. i.tub {
  27. position: absolute;
  28. right: 8px;
  29. top: 8px;
  30. font-size: 18px;
  31. color: #00a0ca;
  32. }
  33. .treeList {
  34. top: 34px!important;
  35. border: 1px solid #e5e6e7!important;
  36. border-top: 0;
  37. height: auto!important;
  38. }
  39. #TreeDemo li {
  40. float: initial;
  41. }
  42. #typeclass {
  43. background: #fff;
  44. }
  45. .inps2,
  46. .inps3,
  47. .inps4 {
  48. display: none;
  49. }
  50. #TreeDemo1 li {
  51. float: initial;
  52. }
  53. #typeclass1 {
  54. background: #fff;
  55. }
  56. #typeclass_market1 {
  57. background: #fff;
  58. }
  59. .addTree1 {
  60. background: #fff;
  61. position: absolute;
  62. width: 100%;
  63. border: 1px solid darkgrey;
  64. right: 0;
  65. top: 26px;
  66. z-index: 10;
  67. display: none;
  68. height: 100px;
  69. overflow-y: auto;
  70. }
  71. </style>
  72. </head>
  73. <body class="gray-bg" style="background: #fefefe;">
  74. <div class="daoHang clearfix">
  75. <div class="dhLeft">
  76. <sapn><i class="syIcon"></i>位置:
  77. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  78. <a href="javaScript:;">报表分析</a>&gt;
  79. <a href="javaScript:;">业务数据分析</a>&gt;
  80. <a href="" style="color: #000;">客诉数量</a>
  81. </sapn>
  82. </div>
  83. <div class="dhRight">
  84. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  85. </div>
  86. </div>
  87. <div class="toolBox">
  88. <div class="th-bar clearfix">
  89. <div class="pull-right">
  90. <div class="form-inline">
  91. <!--<div class="time-box form-group">
  92. <i class="tub fa fa-calendar"></i>
  93. <input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
  94. </div>-->
  95. <div class="form-group">
  96. <select name="" class="form-control orderType2">
  97. </select>
  98. </div>
  99. <div class="time-box form-group">
  100. <i class="tub fa fa-caret-down areaDown" style="color: #676b6d;"></i>
  101. <input class="form-control" type="text" id="typeclass1" readonly="readonly" placeholder="请选择区域">
  102. <input type="text" class="inps2" index="">
  103. <input type="text" class="inps3" index="">
  104. <input type="text" class="inps4" index="">
  105. <input type="hidden" id="typeclassId1" />
  106. <div class="addTree1 treeList1">
  107. <ul id="TreeDemo1" class="ztree">
  108. </ul>
  109. </div>
  110. </div>
  111. <div class="pull-right">
  112. <button class="btns search">搜索</button>
  113. <a href="" class="btns export">导出</a>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <ul class="nav nav-tabs hu-tab">
  120. <li role="presentation" class="active">
  121. <a href="javascript:;">图形</a>
  122. </li>
  123. <li role="presentation">
  124. <a href="javascript:;">表格</a>
  125. </li>
  126. </ul>
  127. <div class="hu-content">
  128. <div class="hu-con-right">
  129. <h2 style="text-align: center; margin-top: 20px;">客诉数量柱状图</h2>
  130. <div id="main" style="width: 100%; height: 400px;"></div>
  131. </div>
  132. <div class="hu-con-left" style="width: 800px; margin: 0 auto;">
  133. <h2 style="text-align: center; margin-top: 20px; display: none;">客诉数量统计</h2>
  134. <table class="layui-hide" id="t_callTotal"></table>
  135. </div>
  136. </div>
  137. <script src="../js/zTree/jquery.ztree.core.js"></script>
  138. <script src="../js/layui/layui.js"></script>
  139. <script src="../js/echarts.min.js"></script>
  140. <script src="../js/select2/js/select2.min.js"></script>
  141. <script>
  142. var token = $.cookie("token");
  143. var stime = ''; //开始时间
  144. var endtime = ''; //结束时间
  145. $(document).ready(function() {
  146. layui.use('laydate', function() {
  147. var laydate = layui.laydate;
  148. //日期
  149. laydate.render({
  150. elem: '#startTime',
  151. range: '~',
  152. theme: '#1ab394',
  153. calendar: 'true'
  154. });
  155. });
  156. helper.getDropList.getDept($('#bumen')); //获取部门
  157. getOrderType1();
  158. getOrderType();
  159. //区域
  160. function getOrderType1() {
  161. $.get(huayi.config.callcenter_url + 'Area/GetAreaList', {
  162. // $.get('http://192.168.4.18:4625/Area/GetAreaList', {
  163. "token": $.cookie("token"),
  164. }, function(result) {
  165. result = $.parseJSON(result);
  166. $.fn.zTree.init($("#TreeDemo1"), setting4, result.data); //实例化树形图
  167. $.fn.zTree.init($("#TreeDemo_market1"), setting4, result.data); //实例化树形图
  168. });
  169. }
  170. var setting4 = {
  171. data: {
  172. key: {
  173. name: "F_AreaName"
  174. },
  175. simpleData: {
  176. enable: true,
  177. idKey: "F_Id",
  178. pIdKey: "F_ParentId",
  179. rootPId: 0
  180. }
  181. },
  182. callback: {
  183. onClick: changeTreeClick
  184. }
  185. }
  186. function changeTreeClick(event, treeId, treeNode) {
  187. chanId = treeNode.F_Id;
  188. changeName = treeNode.F_AreaName;
  189. areaParent = treeNode.getPath();
  190. if(areaParent[1]) {
  191. areaParent1 = areaParent[0].F_AreaName
  192. areaParent2 = areaParent[1].F_AreaName
  193. // areaParent3 = areaParent[2].F_AreaName
  194. areaParentVal1 = areaParent[0].F_Id
  195. areaParentVal2 = areaParent[1].F_Id
  196. // areaParentVal3 = areaParent[2].F_Id
  197. $('#typeclass1').val(areaParent1 + "/" + areaParent2 );
  198. $('#typeclass_market1').val(areaParent1 + "/" + areaParent2 );
  199. $('.inps2').val(areaParent1);
  200. $('.inps3').val(areaParent2);
  201. // $('.inps4').val(areaParent3);
  202. $('.inps2').attr("index",areaParentVal1);
  203. $('.inps3').attr("index",areaParentVal2);
  204. // $('.inps4').attr("index",areaParentVal3);
  205. } else {
  206. layer.msg("请选择最下级菜单");
  207. }
  208. $('.addTree1').hide();
  209. };
  210. $('.areaDown').click(function() {
  211. if($('.treeList1').css('display') == 'block') {
  212. $('.treeList1').css('display', 'none')
  213. } else {
  214. $('.treeList1').css('display', 'block')
  215. }
  216. })
  217. $('#typeclass1').click(function() {
  218. $('.treeList1').css('display', 'block')
  219. })
  220. $('.treeList1').mouseleave(function() {
  221. $(this).css('display', 'none')
  222. })
  223. $('#typeclass_market1').click(function() {
  224. $('.treeList_market1').css('display', 'block')
  225. })
  226. $('.treeList_market1').mouseleave(function() {
  227. $(this).css('display', 'none')
  228. })
  229. //投诉类型
  230. function getOrderType() {
  231. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlag', {
  232. "token": $.cookie("token"),
  233. flag: "GDLX"
  234. }, function(result) {
  235. result = $.parseJSON(result);
  236. var Count = result.data;
  237. $('<option value="" selected="selected">全部</option>').appendTo($(".orderType2"))
  238. $(Count).each(function(i, n) {
  239. $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($(".orderType2"));
  240. })
  241. });
  242. }
  243. /*搜索*/
  244. $(".search").click(function() {
  245. if(tabIndex==0){
  246. partThree();
  247. }else if(tabIndex==1){
  248. getDataList();//获取表格数据
  249. }
  250. })
  251. //导出
  252. $('.export').click(function() {
  253. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  254. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  255. dcexcel(this);
  256. });
  257. function dcexcel(obj) {
  258. var url = huayi.config.callcenter_url + "Business/GetWorkMonthCountReport?isdc=1&token=" + token;
  259. url += "&type=" + $('#orderType2').val()
  260. + "&area=" + $('.inps2').attr("index")
  261. + "&province=" + $('.inps3').attr("index")
  262. + "&city=" + $('.inps4').attr("index");
  263. obj.href = url;
  264. }
  265. var tabIndex=0;
  266. //tab切换
  267. $('.hu-tab li').click(function() {
  268. $(this).addClass('active')
  269. .siblings().removeClass('active');
  270. tabIndex = $(this).index();
  271. $('.hu-content >div').eq(tabIndex).show()
  272. .siblings().hide();
  273. loadDatas(tabIndex);
  274. });
  275. function loadDatas(tabIndex) {
  276. if(tabIndex == 0) {
  277. partThree(); //加载图形
  278. } else if(tabIndex == 1) {
  279. getDataList(); //加载表格
  280. }
  281. }
  282. });
  283. function getDataList() {
  284. var type=$('.orderType2').find('option:selected').text();
  285. if(type=='全部'){
  286. type=''
  287. }
  288. var colsArr = [];
  289. var dataArr = [];
  290. var loadindex;
  291. $.ajax({
  292. type: 'get',
  293. url: huayi.config.callcenter_url + "Business/GetWorkMonthCountReport",
  294. async: true,
  295. dataType: 'json',
  296. beforeSend: function() {
  297. loadindex = layer.load()
  298. },
  299. data: {
  300. sdate: stime,
  301. edate: endtime,
  302. dpt: $('#bumen').val(),
  303. type: type,
  304. token: token,
  305. },
  306. success: function(data) {
  307. if(data.state.toLowerCase() == "success") {
  308. var res = data.data.list;
  309. if(res && res.length > 0) {
  310. dataArr = res;
  311. var newArr = [];
  312. var keys = [];
  313. for (var property in res[0]){
  314. keys.push(property);
  315. }
  316. newArr.push({
  317. field: keys[0],
  318. title: keys[0],
  319. align: 'center',
  320. fixed: true,
  321. width: 150,
  322. });
  323. for(var i = 1, colNL = keys.length; i < colNL; i++) {
  324. newArr.push({
  325. field: keys[i],
  326. title: keys[i],
  327. align: 'center',
  328. });
  329. }
  330. colsArr.push(newArr);
  331. layui.use('table', function() {
  332. var table = layui.table;
  333. //方法级渲染
  334. table.render({
  335. elem: '#t_callTotal',
  336. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  337. even: true, //开启隔行背景
  338. size: 'lg', //sm,lg尺寸的表格
  339. cellMinWidth: 100,
  340. page: true,
  341. cols: colsArr,
  342. data: dataArr,
  343. height: 'full-150',
  344. limit: 10
  345. });
  346. });
  347. }
  348. }
  349. },
  350. }).then(function() {
  351. layer.close(loadindex);
  352. });
  353. }
  354. partThree();
  355. var main = echarts.init(document.getElementById('main'));
  356. main.setOption({
  357. tooltip: {
  358. trigger: 'axis',
  359. axisPointer: {
  360. type: 'cross',
  361. label: {
  362. show: true,
  363. backgroundColor: '#333'
  364. }
  365. },
  366. formatter: function(datas) {
  367. var res = datas[0].name + '<br/>',
  368. val;
  369. for(var i = 0, length = datas.length; i < length; i++) {
  370. val = (datas[i].value);
  371. res += datas[i].seriesName + ':' + val + '<br/>';
  372. }
  373. return res;
  374. }
  375. },
  376. legend: {
  377. data: ["客诉数量"],
  378. textStyle: {
  379. color: '#000'
  380. },
  381. bottom: 'bottom'
  382. },
  383. xAxis: {
  384. name: '月',
  385. data: [],
  386. axisLine: {
  387. lineStyle: {
  388. color: '#000'
  389. }
  390. }
  391. },
  392. yAxis: {
  393. name: '数量',
  394. splitLine: {
  395. show: false
  396. },
  397. axisLine: {
  398. lineStyle: {
  399. color: '#000'
  400. }
  401. }
  402. },
  403. series: []
  404. });
  405. function partThree() {
  406. var index = layer.load(1, {
  407. shade: [0.5, '#030303'] //0.1透明度的白色背景
  408. });
  409. var type=$('.orderType2').find('option:selected').text();
  410. if(type=='全部'){
  411. type=''
  412. }
  413. $.ajax({
  414. type: "get",
  415. url: huayi.config.callcenter_url + "Business/GetWorkMonthCountReport",
  416. async: true,
  417. dataType: "json",
  418. data: {
  419. token: token,
  420. type: type,
  421. area:$('.inps2').attr("index"),//区
  422. province:$('.inps3').attr("index"),//省份
  423. city:$('.inps4').attr("index") //市
  424. },
  425. success: function(data) {
  426. if(data.state.toLowerCase() == "success") {
  427. layer.close(index);
  428. var con = data.data;
  429. main.setOption({
  430. xAxis: {
  431. data: con.chartdata.months
  432. },
  433. series: [{
  434. name: "客诉数量",
  435. type: "bar",
  436. data: con.chartdata.counts
  437. }]
  438. })
  439. }
  440. }
  441. });
  442. }
  443. </script>
  444. </body>
  445. </html>