Нет описания

sourceChannel.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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', '#7931dd', '#7f9d3e','#ff5500','#0a45e7'],
  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. '高新区': false
  146. }
  147. },
  148. xAxis: {
  149. name: '时',
  150. data: [],
  151. axisLine: {
  152. lineStyle: {
  153. color: '#3061a2'
  154. }
  155. },
  156. axisTick: {
  157. alignWithLabel: true,
  158. show: false
  159. },
  160. axisLabel: { //横轴字体颜色
  161. show: true,
  162. textStyle: {
  163. color: '#eff0f4'
  164. }
  165. }
  166. },
  167. yAxis: {
  168. name: '(数量)',
  169. splitLine: {
  170. show: false
  171. },
  172. axisLine: {
  173. lineStyle: {
  174. color: '#3061a2'
  175. }
  176. },
  177. axisLabel: { //横轴字体颜色
  178. show: true,
  179. textStyle: {
  180. color: '#eff0f4'
  181. }
  182. }
  183. },
  184. series: []
  185. });
  186. part_1.on('legendselectchanged', function(params) {
  187. console.log(params.selected)
  188. var option = this.getOption();
  189. var select_key = Object.keys(params.selected);
  190. var select_value = Object.values(params.selected);
  191. console.log(select_value,select_key)
  192. var n = 0;
  193. // select_value.map(res => {
  194. // if(!res){
  195. // n++;
  196. // }
  197. // });
  198. // console.log('n',n)
  199. // if (n == select_value.length ) {
  200. // option.legend[0].selected[params.name] = true;
  201. // }
  202. // $sel.map(res => {
  203. // console.log(res)
  204. // });
  205. this.setOption(option)
  206. });
  207. function partOne(dates,areaOneVal) {
  208. $.ajax({
  209. type: "get",
  210. url: huayi.config.callcenter_url + "info/GetAreaCount24ByDate",
  211. async: true,
  212. dataType: "json",
  213. data: {
  214. date: dates,
  215. branchcode:areaOneVal
  216. },
  217. success: function(data) {
  218. if(data.state.toLowerCase() == "success") {
  219. var con = data.data;
  220. console.log(con)
  221. var part1Axis = con.hours;
  222. var sers = []
  223. $(con.cols).each(function(i, n) {
  224. var obj = {};
  225. obj.name = n;
  226. obj.type = "bar";
  227. obj.smooth = true;
  228. obj.showAllSymbol = true;
  229. obj.symbol = "emptyCircle";
  230. obj.symbolSize = 10;
  231. obj.data = con.counts[i];
  232. sers.push(obj);
  233. console.log(sers)
  234. })
  235. part_1.setOption({
  236. xAxis: {
  237. data: part1Axis
  238. },
  239. legend: {
  240. data: con.cols
  241. },
  242. series: sers
  243. });
  244. }
  245. }
  246. });
  247. }
  248. //part2 //渠道来源
  249. var source = echarts.init(document.getElementById('source'));
  250. source.setOption({
  251. tooltip: {
  252. trigger: 'axis',
  253. axisPointer: {
  254. type: false,
  255. label: {
  256. show: true,
  257. backgroundColor: '#030917'
  258. }
  259. },
  260. },
  261. // legend: {
  262. // top: 'top',
  263. // left: '180px',
  264. // data: [],
  265. // textStyle: {
  266. // color: '#00e9ff'
  267. // }
  268. // },
  269. xAxis: {
  270. // name: '时',
  271. data: [],
  272. axisLine: {
  273. lineStyle: {
  274. color: '#3061a2'
  275. }
  276. },
  277. axisTick: {
  278. alignWithLabel: true,
  279. show: false
  280. },
  281. axisLabel: { //横轴字体颜色
  282. show: true,
  283. textStyle: {
  284. color: '#eff0f4'
  285. }
  286. }
  287. },
  288. yAxis: {
  289. name: '数量',
  290. splitLine: {
  291. show: false
  292. },
  293. axisLine: {
  294. lineStyle: {
  295. color: '#3061a2'
  296. }
  297. },
  298. axisLabel: { //横轴字体颜色
  299. show: true,
  300. textStyle: {
  301. color: '#eff0f4'
  302. }
  303. }
  304. },
  305. series: [{
  306. name: '数量',
  307. type: 'bar',
  308. barWidth: 18,
  309. itemStyle: {
  310. normal: {
  311. color: function(params) {
  312. // build a color map as your need.
  313. var colorList = ['#368cab', '#54b793', '#4b6ab0', '#2531a9'];
  314. return colorList[params.dataIndex]
  315. }
  316. }
  317. },
  318. label: {
  319. normal: {
  320. show: true,
  321. position: 'top', //顶部数据显示位置
  322. textStyle: {
  323. color: '#fff' //顶部数据颜色
  324. },
  325. formatter: '{c}' // 这里是数据展示的时候显示的数据
  326. }
  327. },
  328. data: []
  329. }]
  330. });
  331. function partTwo(start, end,areaOneVal) {
  332. $.ajax({
  333. type: "get",
  334. url: huayi.config.callcenter_url + "info/GetSourcePercentByDate",
  335. dataType: 'json',
  336. async: true,
  337. data: {
  338. start: start,
  339. end: end,
  340. branchcode:areaOneVal
  341. },
  342. success: function(data) {
  343. if(data.state.toLowerCase() == "success") {
  344. // layer.close(index);
  345. var con = data.data;
  346. var qd_legend = [];
  347. var ser_data = [];
  348. $(con).each(function(i, n) {
  349. ser_data.push(n.Count)
  350. qd_legend.push(n.Source);
  351. })
  352. source.setOption({
  353. // legend: {
  354. // data: qd_legend
  355. // },
  356. xAxis: {
  357. data: qd_legend
  358. },
  359. series: {
  360. data: ser_data
  361. }
  362. })
  363. }
  364. }
  365. });
  366. }
  367. // part3 受理区域统计
  368. var part3 = echarts.init(document.getElementById('part3'));
  369. part3.setOption({
  370. color: ['#6ce7ac', '#6a91e0', '#ce2c10', '#cb5f79', '#ae765a', '#569d4e', '#7d55ba', '#ce5aba', '#355cdd', '#44c1c6', '#ceba5e', '#c64444','#ffff00'],
  371. title: {
  372. text: '各区县占比',
  373. x: 'center',
  374. y: '45%',
  375. textStyle: {
  376. fontWeight: 'normal',
  377. fontSize: 16,
  378. color: '#fff'
  379. }
  380. },
  381. tooltip: {
  382. trigger: 'item',
  383. formatter: "{a} <br/>{b} : {c} ({d}%)",
  384. axisPointer: {
  385. crossStyle: {
  386. color: '#fff'
  387. }
  388. }
  389. },
  390. legend: {
  391. // orient: 'vertical',
  392. bottom: 'bottom',
  393. data: ['安阳县','北关区','林州市','龙安区','内黄县','市区','汤阴县','安阳县','文峰区','殷都区','滑县','高新区'],
  394. textStyle: {
  395. color: '#fff'
  396. }
  397. },
  398. series: [{
  399. name: '数据',
  400. type: 'pie',
  401. radius: ['30%', '60%'],
  402. center: ['50%', '50%'],
  403. data: [],
  404. itemStyle: {
  405. emphasis: {
  406. shadowBlur: 10,
  407. shadowOffsetX: 0,
  408. shadowColor: 'rgba(0, 0, 0, 0.5)'
  409. },
  410. normal: {
  411. label: {
  412. show: true,
  413. // formatter: '{b} : {c} ({d}%)'
  414. formatter: '{d}%'
  415. },
  416. labelLine: {
  417. show: true
  418. }
  419. }
  420. },
  421. label: {
  422. normal: {
  423. textStyle: {
  424. color: '#fff'
  425. }
  426. }
  427. }
  428. }]
  429. });
  430. function partThree(start, end,areaOneVal) {
  431. // var index = layer.load(1, {
  432. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  433. // });
  434. $.ajax({
  435. type: "get",
  436. url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
  437. async: true,
  438. dataType: 'json',
  439. data: {
  440. start: start,
  441. end: end,
  442. branchcode:areaOneVal
  443. },
  444. success: function(data) {
  445. if(data.state.toLowerCase() == 'success') {
  446. // layer.close(index);
  447. $('.complaint_typeL').html('');
  448. $('.complaint_typeR').html('');
  449. var con = data.data;
  450. var part_1_legend = [];
  451. var part_1_ser = [];
  452. $(con).each(function(i, n) {
  453. part_1_legend.push(n.AreaName)
  454. var part_1_obj = {};
  455. part_1_obj.value = n.Count;
  456. part_1_obj.name = n.AreaName;
  457. part_1_ser.push(part_1_obj)
  458. if(n.AreaName.indexOf('城乡一体') != -1) {
  459. n.AreaName = "城乡示范"
  460. }
  461. var str = '<li>' +
  462. '<span class="type_name">' + n.AreaName + '</span> <span class="type_count">' + n.Count + '</span>' +
  463. '</li>'
  464. if(i <= 5) {
  465. $(str).appendTo('.complaint_typeL');
  466. } else if(i <= 11&&i >5){
  467. $(str).appendTo('.complaint_typeR');
  468. }
  469. })
  470. part3.setOption({
  471. // legend: {
  472. // selected: {
  473. // '当即办理': false
  474. // }
  475. // },
  476. series: [{
  477. data: part_1_ser
  478. }]
  479. })
  480. }
  481. }
  482. });
  483. }
  484. function Ajax() {
  485. var areaOneVal = helper.cookies.get("areaOneVal");
  486. var areaOneText = helper.cookies.get("areaOneText");
  487. partOne($('#time1').val(),areaOneVal)
  488. partTwo($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaOneVal);
  489. partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal)
  490. }