郑州第一人民医院UI

receiptDepartment.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. $(function() {
  2. getdepartments()
  3. laydate.render({
  4. elem: '#startTime',
  5. range: '~',
  6. theme: '#114a97',
  7. done: function(value, date) {
  8. partOne();
  9. }
  10. });
  11. laydate.render({
  12. elem: '#phone_time',
  13. range: '~',
  14. theme: '#114a97',
  15. done: function(value, date) {
  16. partTwo();
  17. }
  18. });
  19. // laydate.render({
  20. // elem: '#tody_time',
  21. // theme: '#114a97',
  22. // done: function(value, date) {
  23. // partOne();
  24. // }
  25. // });
  26. Ajax();
  27. $(".areaOne").change(function() {
  28. var areaOneVal = $(this).val();
  29. var areaOneText = $(".areaOne").find("option:selected").text();
  30. helper.cookies.set("areaOneVal", areaOneVal, 7);
  31. helper.cookies.set("areaOneText", areaOneText, 7);
  32. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $(
  33. 'phone_time').val().split(' ~ ')[1], areaOneVal);
  34. partThree($('#tody_time').val(), areaOneVal);
  35. });
  36. $(".depart").change(function() {
  37. var areaOneVal = helper.cookies.get("areaOneVal");
  38. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $(
  39. '#phone_time').val().split(' ~ ')[1], areaOneVal);
  40. })
  41. })
  42. // 获取班组
  43. function getdepartments() {
  44. $("#bzdatas").html('');
  45. equipmentdata = []
  46. $("#bzdatas").append('<option value="">请选择班组</option>');
  47. $.ajax({
  48. type: "get",
  49. url: huayi.config.callcenter_url + "equipmentapi/api/WoRepairBase/getallbzcount",
  50. async: true,
  51. headers: {
  52. "content-type": "application/json;charset=utf-8",
  53. "Authorization": "Bearer " + window.localStorage.getItem('token')
  54. }, //请求头类型
  55. success: function(data) {
  56. var leveldata = []
  57. console.log(JSON.parse(data))
  58. if (JSON.parse(data).state.toLowerCase() == 'success') {
  59. leveldata = JSON.parse(data).data
  60. $(leveldata).each(function(q, p) {
  61. console.log(p)
  62. $("<option value='" + p.role_name + "'>" + p.role_name + "</option>").appendTo("#bzdatas");
  63. // $("#bzdatas").selectpicker('refresh');
  64. });
  65. } else {
  66. $("#bzdatas").empty();
  67. // $("#bzdatas").selectpicker('refresh');
  68. }
  69. }
  70. });
  71. }
  72. $("#bzdatas").change(function() {
  73. partTwo()
  74. partThree()
  75. })
  76. // 跳轉
  77. $(".index").click(function() {
  78. window.open('detail.html', '_self')
  79. })
  80. $(".second").click(function() {
  81. window.open('second.html', '_self')
  82. })
  83. $(".third").click(function() {
  84. window.open('third.html', '_self')
  85. })
  86. $(".fourth").click(function() {
  87. window.open('fourth.html', '_self')
  88. })
  89. $(".nav_middle").click(function() {
  90. window.open('index.html', '_self')
  91. })
  92. // $("#department").click(function(){
  93. // window.open('receiptDepartment.html','_self')
  94. // })
  95. $("#sourceChannel").click(function() {
  96. window.open('sourceChannel.html', '_self')
  97. })
  98. $("#call").click(function() {
  99. window.open('TelephoneDetails.html', '_self')
  100. })
  101. $("#complaint").click(function() {
  102. window.open('complaintsReport.html', '_self')
  103. })
  104. //part 1 //工单状态统计 对接完毕
  105. var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
  106. phoneTimeCount.setOption({
  107. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  108. tooltip: {
  109. trigger: 'axis',
  110. axisPointer: {
  111. type: 'cross',
  112. label: {
  113. show: true,
  114. backgroundColor: '#333'
  115. }
  116. }
  117. },
  118. grid: {
  119. left: '2%',
  120. right: '5%',
  121. bottom: '6%',
  122. containLabel: true
  123. },
  124. legend: {
  125. top: 'top',
  126. left: '180px',
  127. data: [],
  128. textStyle: {
  129. color: '#00e9ff'
  130. }
  131. },
  132. xAxis: {
  133. name: '月份',
  134. data: [],
  135. axisLine: {
  136. lineStyle: {
  137. color: '#3061a2'
  138. }
  139. },
  140. axisTick: {
  141. alignWithLabel: true,
  142. show: false
  143. },
  144. axisLabel: { //横轴字体颜色
  145. show: true,
  146. textStyle: {
  147. color: '#eff0f4'
  148. }
  149. }
  150. },
  151. yAxis: {
  152. name: '(数量)',
  153. splitLine: {
  154. show: false
  155. },
  156. axisLine: {
  157. lineStyle: {
  158. color: '#3061a2'
  159. }
  160. },
  161. axisLabel: { //横轴字体颜色
  162. show: true,
  163. textStyle: {
  164. color: '#eff0f4'
  165. }
  166. }
  167. },
  168. series: []
  169. });
  170. function partOne() {
  171. // var index = layer.load(1, {
  172. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  173. // });
  174. $.ajax({
  175. type: "get",
  176. url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/getlistsbypages",
  177. async: true,
  178. headers: {
  179. "content-type": "application/json;charset=utf-8",
  180. "Authorization": "Bearer " + window.localStorage.getItem('token')
  181. }, //请求头类型
  182. data: {
  183. // pageindex:1,
  184. // pagesize:10,
  185. // state:'',
  186. stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0], //开始时间
  187. etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1], //结束时间
  188. },
  189. dataType: 'json',
  190. success: function(data) {
  191. if (data.state.toLowerCase() == 'success') {
  192. // layer.close(index);
  193. // console.log(data)
  194. var con = data.data;
  195. // var jieDans = result.data.a;
  196. var counts = con.counts;
  197. var sers = [];
  198. $(counts).each(function(i, n) {
  199. var obj = {};
  200. obj.name = con.cols[i];
  201. obj.type = "line";
  202. obj.smooth = true;
  203. obj.showAllSymbol = true;
  204. obj.symbol = "emptyCircle";
  205. obj.symbolSize = 10;
  206. obj.data = n;
  207. sers.push(obj)
  208. });
  209. phoneTimeCount.setOption({
  210. xAxis: {
  211. data: con.months
  212. },
  213. legend: {
  214. data: con.cols
  215. },
  216. series: sers
  217. });
  218. }
  219. }
  220. });
  221. }
  222. //part 2 //各部门工单情况
  223. function partTwo() {
  224. $.ajax({
  225. type: "get",
  226. url: huayi.config.callcenter_url + "/equipmentapi/api/worepairbase/gettjlists",
  227. dataType: 'json',
  228. async: true,
  229. headers: {
  230. "content-type": "application/json;charset=utf-8",
  231. "Authorization": "Bearer " + window.localStorage.getItem('token')
  232. }, //请求头类型
  233. data: {
  234. daytype: $('#timeType').val(),
  235. isdjtype: '动态',
  236. Jwocode: $('#bzdatas').val(),
  237. stime: $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], //开始时间
  238. etime: $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1], //结束时间
  239. },
  240. success: function(data) {
  241. if (data.state.toLowerCase() == 'success') {
  242. $('.thead tr').html('');
  243. $('#scroll_table tbody').html('');
  244. var con = data.data;
  245. // console.log(con)
  246. var thead = con[0];
  247. $.each(thead, function(k, val) {
  248. // console.log(k)
  249. $('<td>' + k + '</td>').appendTo('.thead tr');
  250. })
  251. $(con).each(function(j, n) {
  252. var str = '<tr>'
  253. $.each(thead, function(j, m) {
  254. $.each(n, function(k, val) {
  255. if (j == k) {
  256. if (val == '') {
  257. val = 0;
  258. }
  259. str += '<td>' + val + '</td>'
  260. }
  261. })
  262. })
  263. str += '</tr>';
  264. $('#scroll_table tbody').append(str);
  265. })
  266. }
  267. }
  268. });
  269. }
  270. $("#timeType").change(function() {
  271. partTwo()
  272. partThree()
  273. })
  274. // part3 工单处理时间分布
  275. var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
  276. sitProportion.setOption({
  277. color: ['#4ab7c7', '#2484d9', '#2e39c1'],
  278. tooltip: {
  279. trigger: 'axis',
  280. axisPointer: {
  281. type: 'shadow',
  282. label: {
  283. show: true,
  284. backgroundColor: '#333'
  285. }
  286. },
  287. formatter: function(datas) {
  288. var res = datas[0].name + '<br/>',
  289. val;
  290. for (var i = 0, length = datas.length; i < length; i++) {
  291. // val = (datas[i].value) + '%';
  292. val = (datas[i].value);
  293. res += datas[i].seriesName + ':' + val + '<br/>';
  294. }
  295. return res;
  296. }
  297. },
  298. legend: {
  299. top: 'top',
  300. left: '165px',
  301. data: ['完结单率', '满意度'],
  302. textStyle: {
  303. color: '#00e9ff'
  304. }
  305. },
  306. grid: {
  307. left: '2%',
  308. right: '5%',
  309. bottom: '5%',
  310. containLabel: true
  311. },
  312. xAxis: {
  313. name: '类型',
  314. data: [],
  315. axisLine: {
  316. lineStyle: {
  317. color: '#3061a2'
  318. }
  319. },
  320. axisTick: {
  321. alignWithLabel: true,
  322. show: false
  323. },
  324. axisLabel: { //横轴字体颜色
  325. show: true,
  326. interval: '0',
  327. textStyle: {
  328. color: '#65ABE7'
  329. }
  330. }
  331. },
  332. yAxis: {
  333. name: '(百分比)',
  334. nameTextStyle: {
  335. color: "#65ABE7",
  336. fontSize: 12,
  337. },
  338. splitLine: {
  339. show: false
  340. },
  341. type: 'value',
  342. axisLabel: {
  343. show: true,
  344. interval: 'auto',
  345. textStyle: {
  346. color: '#65ABE7', //字体颜色
  347. fontSize: 12 //字体大小
  348. },
  349. formatter: '{value} %'
  350. },
  351. show: true
  352. },
  353. series: [{
  354. name: '完结单率',
  355. type: 'bar',
  356. data: []
  357. }, {
  358. name: '满意度',
  359. type: 'bar',
  360. data: []
  361. }],
  362. });
  363. // 跳轉
  364. $(".index").click(function() {
  365. window.open('detail.html', '_self')
  366. })
  367. $(".second").click(function() {
  368. window.open('second.html', '_self')
  369. })
  370. $(".third").click(function() {
  371. window.open('third.html', '_self')
  372. })
  373. $(".fourth").click(function() {
  374. window.open('fourth.html', '_self')
  375. })
  376. $(".nav_middle").click(function() {
  377. window.open('index.html', '_self')
  378. })
  379. function partThree() {
  380. $.ajax({
  381. type: "get",
  382. headers: {
  383. "content-type": "application/json;charset=utf-8",
  384. "Authorization": "Bearer " + window.localStorage.getItem('token')
  385. }, //请求头类型
  386. url: huayi.config.callcenter_url + "equipmentapi/api/worepairbase/gettjliststh",
  387. dataType: 'json',
  388. async: true,
  389. data: {
  390. daytype: $('#timeType').val(),
  391. isdjtype: '动态',
  392. Jwocode: $('#bzdatas').val(),
  393. stime: $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], //开始时间
  394. etime: $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1], //结束时间
  395. },
  396. success: function(data) {
  397. if (data.state.toLowerCase() == 'success') {
  398. var con = data.data;
  399. var xdatas = []
  400. var xdatas2 = []
  401. for (var i = 0; i < con.finishwodlv.length; i++) {
  402. xdatas.push(con.finishwodlv[i].slice(0, -1))
  403. }
  404. for (var i = 0; i < con.mydlv.length; i++) {
  405. xdatas2.push(con.mydlv[i].slice(0, -1))
  406. }
  407. sitProportion.setOption({
  408. xAxis: {
  409. data: con.bzname
  410. },
  411. series: [{
  412. data: xdatas
  413. }, {
  414. data: xdatas2
  415. }],
  416. });
  417. }
  418. }
  419. });
  420. }
  421. //表格滚动
  422. var area = document.getElementById('scroll_table');
  423. var iliHeight = 34; //单行滚动的高度
  424. var speed = 20; //滚动的速度
  425. var time;
  426. var delay = 1000;
  427. area.scrollTop = 0;
  428. area.innerHTML += area.innerHTML; //克隆一份一样的内容
  429. function startScroll() {
  430. time = setInterval("scrollUp()", speed);
  431. area.scrollTop++;
  432. }
  433. function scrollUp() {
  434. if (area.scrollTop % iliHeight == 0) {
  435. clearInterval(time);
  436. setTimeout(startScroll, delay);
  437. } else {
  438. area.scrollTop++;
  439. if (area.scrollTop >= area.scrollHeight / 2) {
  440. area.scrollTop = 0;
  441. }
  442. }
  443. }
  444. setTimeout(startScroll, delay)
  445. function Ajax() {
  446. partOne()
  447. partTwo();
  448. partThree();
  449. }