暫無描述

sourceChannel.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. var areaOneVal = helper.cookies.get("areaOneVal");
  2. var areaOneText = helper.cookies.get("areaOneText");
  3. if (areaOneVal) {
  4. var areaOneVal = helper.cookies.get("areaOneVal");
  5. } else{
  6. var areaOneVal="sqs12345"
  7. }
  8. $(function() {
  9. laydate.render({
  10. elem: '#time1',
  11. format: 'yyyy-MM-dd',
  12. theme: '#114a97',
  13. done: function(value, date) {
  14. var areaOneVal=$(".areaOne").val();
  15. partOne(value,areaOneVal)
  16. }
  17. });
  18. laydate.render({
  19. elem: '#time2',
  20. range: '~',
  21. format: 'yyyy-MM-dd',
  22. theme: '#114a97',
  23. done: function(value, date) {
  24. var areaOneVal=$(".areaOne").val();
  25. partTwo(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],areaOneVal)
  26. }
  27. });
  28. laydate.render({
  29. elem: '#time3',
  30. range: '~',
  31. theme: '#114a97',
  32. done: function(value, date) {
  33. var areaOneVal=$(".areaOne").val();
  34. partThree(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],areaOneVal)
  35. }
  36. });
  37. Ajax();
  38. $(".areaOne").change(function() {
  39. var areaOneVal=$(this).val();
  40. var areaOneText=$(".areaOne").find("option:selected").text();
  41. helper.cookies.set("areaOneVal", areaOneVal, 7);
  42. helper.cookies.set("areaOneText", areaOneText, 7);
  43. partOne($('#time1').val(),areaOneVal);
  44. partTwo($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaOneVal);
  45. partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal);
  46. // Ajax()
  47. });
  48. })
  49. // 跳轉
  50. $(".index").click(function(){
  51. window.open('detail.html','_self')
  52. })
  53. $(".second").click(function(){
  54. window.open('second.html','_self')
  55. })
  56. $(".third").click(function(){
  57. window.open('third.html','_self')
  58. })
  59. $(".fourth").click(function(){
  60. window.open('fourth.html','_self')
  61. })
  62. $("#department").click(function(){
  63. window.open('receiptDepartment.html','_self')
  64. })
  65. $("#call").click(function(){
  66. window.open('TelephoneDetails.html','_self')
  67. })
  68. $("#complaint").click(function(){
  69. window.open('complaintsReport.html','_self')
  70. })
  71. $(".nav_middle").click(function(){
  72. window.open('index.html','_self')
  73. })
  74. //区县筛选
  75. //deprtment();
  76. function deprtment() {
  77. $.getJSON( huayi.config.callcenter_url +"CountyBranch/GetBranchListS", function(result) {
  78. if(result.state.toLowerCase() == "success") {
  79. goodslist = result.data;
  80. // 第五屏
  81. $(".areaOne").empty();
  82. $(goodslist).each(function(i, n) {
  83. $('<option value="' + n.F_Code
  84. + '">' + n.F_Name
  85. + '</option>').appendTo($(".areaOne"));
  86. });
  87. if (areaOneVal) {
  88. $(".areaOne").val(areaOneVal);
  89. }
  90. }
  91. });
  92. }
  93. //part 1 //受理群众区域统计 对接完毕
  94. var part_1 = echarts.init(document.getElementById('part_1'));
  95. part_1.setOption({
  96. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  97. tooltip: {
  98. trigger: 'axis',
  99. axisPointer: {
  100. type: 'cross',
  101. label: {
  102. show: true,
  103. backgroundColor: '#333'
  104. }
  105. }
  106. },
  107. toolbox: {
  108. x:100,
  109. y:20,
  110. show : true,
  111. feature : {
  112. mark : {show: true},
  113. magicType : {show: true, type: ['line', 'bar']},
  114. },
  115. iconStyle:{
  116. normal:{
  117. color:'#ffaa00',//设置颜色
  118. }
  119. }
  120. },
  121. grid: {
  122. left: '2%',
  123. right: '5%',
  124. bottom: '6%',
  125. containLabel: true
  126. },
  127. legend: {
  128. top: 'top',
  129. left: '180px',
  130. data: [],
  131. textStyle: {
  132. color: '#00e9ff'
  133. },
  134. selected: {
  135. '市区': true,
  136. '文峰区': false,
  137. '北关区': false,
  138. '殷都区': false,
  139. '龙安区': false,
  140. '安阳县': false,
  141. '汤阴县': false,
  142. '内黄县': false,
  143. '滑县': false,
  144. '林州市': false
  145. }
  146. },
  147. xAxis: {
  148. name: '时',
  149. data: [],
  150. axisLine: {
  151. lineStyle: {
  152. color: '#3061a2'
  153. }
  154. },
  155. axisTick: {
  156. alignWithLabel: true,
  157. show: false
  158. },
  159. axisLabel: { //横轴字体颜色
  160. show: true,
  161. textStyle: {
  162. color: '#eff0f4'
  163. }
  164. }
  165. },
  166. yAxis: {
  167. name: '(数量)',
  168. splitLine: {
  169. show: false
  170. },
  171. axisLine: {
  172. lineStyle: {
  173. color: '#3061a2'
  174. }
  175. },
  176. axisLabel: { //横轴字体颜色
  177. show: true,
  178. textStyle: {
  179. color: '#eff0f4'
  180. }
  181. }
  182. },
  183. series: []
  184. });
  185. part_1.on('legendselectchanged', function(params) {
  186. console.log(params.selected)
  187. var option = this.getOption();
  188. var select_key = Object.keys(params.selected);
  189. var select_value = Object.values(params.selected);
  190. console.log(select_value,select_key)
  191. var n = 0;
  192. // select_value.map(res => {
  193. // if(!res){
  194. // n++;
  195. // }
  196. // });
  197. // console.log('n',n)
  198. // if (n == select_value.length ) {
  199. // option.legend[0].selected[params.name] = true;
  200. // }
  201. $sel.map(res => {
  202. console.log(res)
  203. });
  204. this.setOption(option)
  205. });
  206. function partOne(dates,areaOneVal) {
  207. $.ajax({
  208. type: "get",
  209. url: huayi.config.callcenter_url + "info/GetAreaCount24ByDate",
  210. async: true,
  211. dataType: "json",
  212. data: {
  213. date: dates,
  214. branchcode:areaOneVal
  215. },
  216. success: function(data) {
  217. if(data.state.toLowerCase() == "success") {
  218. var con = data.data;
  219. console.log(con)
  220. var part1Axis = con.hours;
  221. var sers = []
  222. $(con.cols).each(function(i, n) {
  223. var obj = {};
  224. obj.name = n;
  225. obj.type = "bar";
  226. obj.smooth = true;
  227. obj.showAllSymbol = true;
  228. obj.symbol = "emptyCircle";
  229. obj.symbolSize = 10;
  230. obj.data = con.counts[i];
  231. sers.push(obj);
  232. console.log(sers)
  233. })
  234. part_1.setOption({
  235. xAxis: {
  236. data: part1Axis
  237. },
  238. legend: {
  239. data: con.cols
  240. },
  241. series: sers
  242. });
  243. }
  244. }
  245. });
  246. }
  247. //part2 //渠道来源
  248. var source = echarts.init(document.getElementById('source'));
  249. source.setOption({
  250. tooltip: {
  251. trigger: 'axis',
  252. axisPointer: {
  253. type: false,
  254. label: {
  255. show: true,
  256. backgroundColor: '#030917'
  257. }
  258. },
  259. },
  260. // legend: {
  261. // top: 'top',
  262. // left: '180px',
  263. // data: [],
  264. // textStyle: {
  265. // color: '#00e9ff'
  266. // }
  267. // },
  268. xAxis: {
  269. // name: '时',
  270. data: [],
  271. axisLine: {
  272. lineStyle: {
  273. color: '#3061a2'
  274. }
  275. },
  276. axisTick: {
  277. alignWithLabel: true,
  278. show: false
  279. },
  280. axisLabel: { //横轴字体颜色
  281. show: true,
  282. textStyle: {
  283. color: '#eff0f4'
  284. }
  285. }
  286. },
  287. yAxis: {
  288. name: '数量',
  289. splitLine: {
  290. show: false
  291. },
  292. axisLine: {
  293. lineStyle: {
  294. color: '#3061a2'
  295. }
  296. },
  297. axisLabel: { //横轴字体颜色
  298. show: true,
  299. textStyle: {
  300. color: '#eff0f4'
  301. }
  302. }
  303. },
  304. series: [{
  305. name: '数量',
  306. type: 'bar',
  307. barWidth: 18,
  308. itemStyle: {
  309. normal: {
  310. color: function(params) {
  311. // build a color map as your need.
  312. var colorList = ['#368cab', '#54b793', '#4b6ab0', '#2531a9'];
  313. return colorList[params.dataIndex]
  314. }
  315. }
  316. },
  317. label: {
  318. normal: {
  319. show: true,
  320. position: 'top', //顶部数据显示位置
  321. textStyle: {
  322. color: '#fff' //顶部数据颜色
  323. },
  324. formatter: '{c}' // 这里是数据展示的时候显示的数据
  325. }
  326. },
  327. data: []
  328. }]
  329. });
  330. function partTwo(start, end,areaOneVal) {
  331. $.ajax({
  332. type: "get",
  333. url: huayi.config.callcenter_url + "info/GetSourcePercentByDate",
  334. dataType: 'json',
  335. async: true,
  336. data: {
  337. start: start,
  338. end: end,
  339. branchcode:areaOneVal
  340. },
  341. success: function(data) {
  342. if(data.state.toLowerCase() == "success") {
  343. // layer.close(index);
  344. var con = data.data;
  345. var qd_legend = [];
  346. var ser_data = [];
  347. $(con).each(function(i, n) {
  348. ser_data.push(n.Count)
  349. qd_legend.push(n.Source);
  350. })
  351. source.setOption({
  352. // legend: {
  353. // data: qd_legend
  354. // },
  355. xAxis: {
  356. data: qd_legend
  357. },
  358. series: {
  359. data: ser_data
  360. }
  361. })
  362. }
  363. }
  364. });
  365. }
  366. // part3 受理区域统计
  367. var part3 = echarts.init(document.getElementById('part3'));
  368. part3.setOption({
  369. color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e', '#7d55ba', '#ce5aba', '#355cdd', '#44c1c6', '#ceba5e', '#c64444'],
  370. title: {
  371. text: '各区县占比',
  372. x: 'center',
  373. y: '45%',
  374. textStyle: {
  375. fontWeight: 'normal',
  376. fontSize: 16,
  377. color: '#fff'
  378. }
  379. },
  380. tooltip: {
  381. trigger: 'item',
  382. formatter: "{a} <br/>{b} : {c} ({d}%)",
  383. axisPointer: {
  384. crossStyle: {
  385. color: '#fff'
  386. }
  387. }
  388. },
  389. legend: {
  390. // orient: 'vertical',
  391. bottom: 'bottom',
  392. data: ['安阳县','北关区','林州市','龙安区','内黄县','市区','汤阴县','安阳县','文峰区','殷都区'],
  393. textStyle: {
  394. color: '#fff'
  395. }
  396. },
  397. series: [{
  398. name: '数据',
  399. type: 'pie',
  400. radius: ['30%', '60%'],
  401. center: ['50%', '50%'],
  402. data: [],
  403. itemStyle: {
  404. emphasis: {
  405. shadowBlur: 10,
  406. shadowOffsetX: 0,
  407. shadowColor: 'rgba(0, 0, 0, 0.5)'
  408. },
  409. normal: {
  410. label: {
  411. show: true,
  412. // formatter: '{b} : {c} ({d}%)'
  413. formatter: '{d}%'
  414. },
  415. labelLine: {
  416. show: true
  417. }
  418. }
  419. },
  420. label: {
  421. normal: {
  422. textStyle: {
  423. color: '#fff'
  424. }
  425. }
  426. }
  427. }]
  428. });
  429. function partThree(start, end,areaOneVal) {
  430. // var index = layer.load(1, {
  431. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  432. // });
  433. $.ajax({
  434. type: "get",
  435. url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
  436. async: true,
  437. dataType: 'json',
  438. data: {
  439. start: start,
  440. end: end,
  441. branchcode:areaOneVal
  442. },
  443. success: function(data) {
  444. if(data.state.toLowerCase() == 'success') {
  445. // layer.close(index);
  446. $('.complaint_typeL').html('');
  447. $('.complaint_typeR').html('');
  448. var con = data.data;
  449. var part_1_legend = [];
  450. var part_1_ser = [];
  451. $(con).each(function(i, n) {
  452. part_1_legend.push(n.AreaName)
  453. var part_1_obj = {};
  454. part_1_obj.value = n.Count;
  455. part_1_obj.name = n.AreaName;
  456. part_1_ser.push(part_1_obj)
  457. if(n.AreaName.indexOf('城乡一体') != -1) {
  458. n.AreaName = "城乡示范"
  459. }
  460. var str = '<li>' +
  461. '<span class="type_name">' + n.AreaName + '</span> <span class="type_count">' + n.Count + '</span>' +
  462. '</li>'
  463. if(i <= 5) {
  464. $(str).appendTo('.complaint_typeL');
  465. } else if(i <= 11&&i >5){
  466. $(str).appendTo('.complaint_typeR');
  467. }
  468. })
  469. part3.setOption({
  470. // legend: {
  471. // selected: {
  472. // '当即办理': false
  473. // }
  474. // },
  475. series: [{
  476. data: part_1_ser
  477. }]
  478. })
  479. }
  480. }
  481. });
  482. }
  483. function Ajax() {
  484. var areaOneVal = helper.cookies.get("areaOneVal");
  485. var areaOneText = helper.cookies.get("areaOneText");
  486. partOne($('#time1').val(),areaOneVal)
  487. partTwo($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaOneVal);
  488. partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal)
  489. }