郑州第一人民医院UI

index.js 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  1. var waterOptions;
  2. var autoTabSchedulOrNewsTimer = null;// 自动切换 排班信息或重要事项通知的定时器
  3. $(function() {
  4. //维保 巡检 tab切换
  5. $('.wxTab .title_tips').click(function() {
  6. $(this).addClass('active').siblings().removeClass('active');
  7. var index = $(this).index();
  8. $('.contentTop_leftBottomContent').children('div').eq(index).show().siblings().hide()
  9. })
  10. $('.InspectDateBtn').click(function() {
  11. $(this).addClass('active').siblings().removeClass('active');
  12. var dataIndex = $(this).attr('data-index');
  13. $('#hidInspectDateType').val(dataIndex);
  14. getrunninglist(dataIndex);
  15. });
  16. $('.bottomBtns').click(function() {
  17. $(this).addClass('active').siblings().removeClass('active');
  18. $('.timeType').text($(this).text());
  19. var dataIndex = $(this).attr('data-index');
  20. getBottomData(dataIndex);
  21. });
  22. Ajax();
  23. if($("#projectID").attr("index") == "河南省直第三人民医院"){
  24. administrative(0);//科室数量
  25. distribution(0);//配送物品前五
  26. }else{
  27. getrunninglist($('#hidInspectDateType').val()); //维保巡检
  28. }
  29. timeBtn($('.dateBtns'));
  30. timeBtn($('.officeBtns'));
  31. timeBtn($('.bottomDateBtns'));
  32. WXTabtime($('.wxTab'));
  33. //$("#maintenanceInformation").Scroll({ line: 1, speed: 800, timer: 2000 });//维保通知
  34. // getMaps();//获取地图
  35. });
  36. function contractLiClick(thats) {
  37. if ($(thats).attr('data-day') >= 0 && $(thats).attr('data-day') <= 30) {
  38. $(thats).addClass('active').siblings().removeClass('active');
  39. $('.lateTime').text($(thats).attr('data-day'));
  40. $('.htWorld').text('距合同到期');
  41. $('.htWorld').removeClass('active');
  42. $('.htLate').addClass('active');
  43. } else if ($(thats).attr('data-day') > 30) {
  44. $(thats).addClass('active').siblings().removeClass('active');
  45. $('.lateTime').text($(thats).attr('data-day'));
  46. $('.htWorld').text('距合同到期');
  47. $('.htWorld').removeClass('active');
  48. $('.htLate').removeClass('active');
  49. } else {
  50. $(thats).addClass('active').siblings().removeClass('active');
  51. $('.lateTime').text($(thats).attr('data-day') * -1);
  52. $('.htWorld').text('合同已过期');
  53. $('.htWorld').addClass('active');
  54. $('.htLate').addClass('active');
  55. }
  56. // })
  57. }
  58. //项目数量
  59. function getproject() {
  60. $.ajax({
  61. type: "get",
  62. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getprojectrepairuserequipment",
  63. dataType: 'json',
  64. data: {
  65. projectid: $("#projectID").text()
  66. },
  67. async: true,
  68. success: function(data) {
  69. if (data.state == 'success') {
  70. //地图数据
  71. $("#hospital").rollNum({
  72. deVal: data.data.projectnum,
  73. digit: '3'
  74. });
  75. $("#engineer").rollNum({
  76. deVal: data.data.repairusernum,
  77. digit: '3'
  78. });
  79. $("#equipment").rollNum({
  80. deVal: data.data.equipmentnum,
  81. digit: '3'
  82. });
  83. }
  84. }
  85. });
  86. }
  87. //巡检、维保
  88. function getrunninglist(dateTypes) {
  89. $.ajax({
  90. type: "get",
  91. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getrunninglist",
  92. dataType: 'json',
  93. async: true,
  94. data: {
  95. datetype: dateTypes
  96. },
  97. success: function(data) {
  98. if (data.state == 'success') {
  99. if (data.data.rwcount > 0) {
  100. $('.Inspect_nodo').addClass('active')
  101. $('.InspectionIn1_nodo').addClass('active')
  102. $('.InspectionIn2_nodo').addClass('active')
  103. } else {
  104. $('.Inspect_nodo').removeClass('active')
  105. $('.InspectionIn1_nodo').removeClass('active')
  106. $('.InspectionIn2_nodo').removeClass('active')
  107. }
  108. $('.InspectCount').text(data.data.rcount);
  109. $('.Inspect_done').text(data.data.rycount);
  110. $('.Inspect_nodo').text(data.data.rwcount);
  111. if (data.data.rcount == 0) {
  112. $('.yxjCount').text("0.00%");
  113. $('.wxj').text("0.00%");
  114. $('.progressInspect').css('width', "0%");
  115. } else {
  116. var yxpersent = (data.data.rycount / data.data.rcount) * 100;
  117. $('.yxjCount').text(yxpersent.toFixed(2) + "%");
  118. $('.progressInspect').css('width', yxpersent + "%");
  119. $('.wxj').text((100 - yxpersent).toFixed(2) + "%");
  120. }
  121. }
  122. }
  123. });
  124. //维保统计
  125. $.ajax({
  126. type: "get",
  127. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getmaintainlist",
  128. dataType: 'json',
  129. async: true,
  130. data: {
  131. datetype: dateTypes
  132. },
  133. success: function(data) {
  134. if (data.state == 'success') {
  135. if (data.data.mwcount > 0) {
  136. $('.by_nodo').addClass('active')
  137. $('.InspectionInwby_11').addClass('active')
  138. $('.InspectionInwby_21').addClass('active')
  139. } else {
  140. $('.by_nodo').removeClass('active')
  141. $('.InspectionInwby_11').removeClass('active')
  142. $('.InspectionInwby_21').removeClass('active')
  143. }
  144. $('.by_count').text(data.data.mcount);
  145. $('.by_done').text(data.data.mycount);
  146. $('.by_nodo').text(data.data.mwcount);
  147. if (data.data.mwcount == 0) {
  148. $('.byCountNum').text("0.00%");
  149. $('.byCountNum').css('left', "-5%");
  150. $('.byProgress').css('width', "0%");
  151. } else {
  152. var ybypersent = (data.data.mwcount / data.data.mcount) * 100;
  153. $('.byCountNum').text(ybypersent.toFixed(2) + "%");
  154. // console.log(ybypersent)
  155. $('.byCountNum').css('left', (ybypersent - 5) + "%");
  156. $('.byProgress').css('width', ybypersent + "%");
  157. }
  158. }
  159. }
  160. });
  161. }
  162. // 重要事项(项目新闻)
  163. // el 元素id 'importantInformation'
  164. function getnewslist(el) {
  165. $.ajax({
  166. type: "get",
  167. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getnewslist",
  168. dataType: 'json',
  169. data: {
  170. projectid: $("#projectID").text()
  171. },
  172. async: true,
  173. success: function(data) {
  174. if (data.state == 'success') {
  175. $('#' + el).find('ul').html('');
  176. $.each(data.data, function(i, n) {
  177. var str = "";
  178. if (i % 2 == 0) {
  179. str = '<li class="active" title="' + n.title + '">';
  180. if (i < 3) {
  181. str += '<span class="numbers importants">' + parseInt(i + 1) + '</span>';
  182. } else {
  183. str += '<span class="numbers">' + parseInt(i + 1) + '</span>';
  184. }
  185. } else {
  186. str = '<li title="' + n.title + '">'
  187. if (i < 3) {
  188. str += '<span class="numbers importants">' + parseInt(i + 1) + '</span>';
  189. } else {
  190. str += '<span class="numbers">' + parseInt(i + 1) + '</span>';
  191. }
  192. }
  193. str += '<span class="messages">' + n.title + '</span>' +
  194. '<span class="pull-right times">' + n.createtime.substring(0, 10) + '</span>' +
  195. '</li>'
  196. $('#' + el).find('ul').append(str);
  197. });
  198. $('#' + el).Scroll({
  199. line: 1,
  200. speed: 800,
  201. timer: 2000
  202. });
  203. }
  204. }
  205. });
  206. }
  207. // 排班信息
  208. function getSchedulingInfo() {
  209. $.ajax({
  210. type: "get",
  211. url: huayi.config.callcenter_url + "signtokenapi/api/WorkClassUser/getuserlistbyday",
  212. dataType: 'json',
  213. data: {
  214. projectid: $("#projectID").text()
  215. },
  216. async: true,
  217. success: function(data) {
  218. if (data.state === 'success') {
  219. $('#schedulingInfo ul').empty();
  220. data = data.data;
  221. if(data && data.length){
  222. $.each(data, function(i, v) {
  223. var str = "";
  224. if(v.list_class && v.list_class.length){
  225. str += '<li class="scheduling_info clearfix">'+
  226. '<div class="scheduling_dept pull-left">'+ v.name +'</div>'+
  227. '<div class="scheduling_items pull-right">';
  228. $.each(v.list_class, function(j, k){
  229. str += '<div class="scheduling_time">'+
  230. k.code + k.name + ' [' + k.starttime + ' - ' + k.endtime + ']' +
  231. '</div>';
  232. if(k.userlist.length && k.userlist[0]){
  233. str += '<div class="scheduling_personnels">'+
  234. k.userlist[0].user.join(',')
  235. '</div>';
  236. }else{
  237. str += '<div class="scheduling_personnels">--</div>';
  238. }
  239. });
  240. str += '</div>'+
  241. '</li>';
  242. }
  243. $('#schedulingInfo ul').append(str);
  244. });
  245. }
  246. $("#schedulingInfo").Scroll({
  247. line: 1,
  248. speed: 1600,
  249. timer: 4000
  250. });
  251. }
  252. }
  253. });
  254. }
  255. //维保事项
  256. function getmaintenancelist() {
  257. $.ajax({
  258. type: "get",
  259. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getmaintainmsgs",
  260. dataType: 'json',
  261. data: {
  262. projectid: $("#projectID").text()
  263. },
  264. async: true,
  265. success: function(data) {
  266. if (data.state == 'success') {
  267. $('#maintenanceInformation ul').html('');
  268. $.each(data.data, function(i, n) {
  269. var str = "";
  270. if (i % 2 == 0) {
  271. str = '<li title="' + n.content + '">';
  272. if (i < 3) {
  273. str += '<span class="numbers importants">' + parseInt(i + 1) + '</span>';
  274. } else {
  275. str += '<span class="numbers">' + parseInt(i + 1) + '</span>';
  276. }
  277. } else {
  278. str = '<li title="' + n.content + '">'
  279. if (i < 3) {
  280. str += '<span class="numbers importants">' + parseInt(i + 1) + '</span>';
  281. } else {
  282. str += '<span class="numbers">' + parseInt(i + 1) + '</span>';
  283. }
  284. }
  285. str += '<span class="messages">' + n.content + '</span>'
  286. // if(n.state==0){
  287. // str +='<span class="pull-right times newOrder">新工单</span>'
  288. // }else
  289. if (n.state == 3) {
  290. str += '<span class="pull-right times finish">已完成</span>'
  291. } else {
  292. str += '<span class="pull-right times nodo">未完成</span>'
  293. }
  294. str += '</li>'
  295. $('#maintenanceInformation ul').append(str);
  296. });
  297. $("#maintenanceInformation").Scroll({
  298. line: 1,
  299. speed: 800,
  300. timer: 2000
  301. });
  302. }
  303. }
  304. });
  305. }
  306. //合同到期提示
  307. function getContractTimeOut() {
  308. $.ajax({
  309. type: "get",
  310. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getprojecttimeout",
  311. dataType: 'json',
  312. data: {
  313. projectid: $("#projectID").text()
  314. },
  315. async: true,
  316. success: function(data) {
  317. if (data.state == 'success') {
  318. $('#contractTimeOut ul').html('');
  319. $.each(data.data, function(i, n) {
  320. var str = "";
  321. if (i == 0) {
  322. str = '<li class="active" data-day="' + n.day + '" onclick="contractLiClick(this)"><span class="numbers">' +
  323. parseInt(i + 1) + '</span><span>' + n.name + '</span></li>'
  324. } else {
  325. str = '<li data-day="' + n.day + '" onclick="contractLiClick(this)"><span class="numbers" >' + parseInt(i +
  326. 1) + '</span><span>' + n.name + '</span></li>'
  327. }
  328. $('#contractTimeOut ul').append(str);
  329. });
  330. $("#contractTimeOut").ContractScroll({
  331. line: 1,
  332. speed: 800,
  333. timer: 3000
  334. }); //合同到期
  335. $("#contractTimeOut ul").find("li:first").trigger('click')
  336. }
  337. }
  338. });
  339. }
  340. //获取地图
  341. function getMaps(){
  342. $.getJSON('./js/province.json', function(geojson) {
  343. //$.getJSON('https://data.jianshukeji.com/jsonp?filename=geochina/henan.json&callback=?', function (geojson) {
  344. // Initiate the chart
  345. Highcharts.mapChart('containMap', {
  346. chart: {
  347. backgroundColor: 'transparent',
  348. },
  349. credits: {
  350. enabled: false // 禁用版权信息
  351. },
  352. exporting: {
  353. enabled: false
  354. }, //隐藏导出图片
  355. title: {
  356. text: false
  357. },
  358. subtitle: {
  359. text: false
  360. },
  361. tooltip: false,
  362. mapNavigation: {
  363. enabled: false
  364. },
  365. plotOptions: {
  366. series: {
  367. dataLabels: {
  368. enabled: true,
  369. }
  370. }
  371. },
  372. series: [{
  373. nullColor: '#184ec7',
  374. // nullColor: '#0a246f',
  375. mapData: geojson,
  376. data: [{
  377. color: '#2e9ef0',
  378. name: '郑州'
  379. }],
  380. joinBy: 'name',
  381. name: '',
  382. states: {
  383. hover: {
  384. color: '#2891e3'
  385. }
  386. },
  387. borderColor: '#2fa6f3',
  388. dataLabels: {
  389. enabled: true,
  390. format: '{point.name}'
  391. },
  392. showInLegend: false
  393. }]
  394. });
  395. });
  396. }
  397. //地图数据
  398. function getmapData() {
  399. $.ajax({
  400. type: "get",
  401. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getprojectlist",
  402. dataType: 'json',
  403. async: true,
  404. success: function(data) {
  405. if (data.state == 'success') {
  406. $('#mapword ul').html('');
  407. $.each(data.data, function(i, n) {
  408. $('<li>' +
  409. '<p class="mapword_title">' + n.name + '</p>' +
  410. '<p>维保人员: &nbsp;<span class="mapword_count">' + n.repairusernum + '</span>人</p>' +
  411. '<p>维护设备: &nbsp;<span class="mapword_count">' + n.equipmentnum + '</span>台</p>' +
  412. '<p>合同剩余时间: &nbsp;<span class="mapword_count">' + n.remainderday + '</span>天</p>' +
  413. '</li>').appendTo('#mapword ul')
  414. })
  415. // $("#mapword").Scroll({ line: 1, speed: 500, timer: 3000 });//合同到期
  416. }
  417. }
  418. });
  419. }
  420. //底部水电气氧数据
  421. function getBottomData(dateTypes) {
  422. var barWidth, titleText;
  423. if (dateTypes == '0') {
  424. barWidth = 15;
  425. titleText = "日期"
  426. } else if (dateTypes == '2') {
  427. barWidth = 15;
  428. titleText = "月份"
  429. } else {
  430. barWidth = 25;
  431. titleText = "年份"
  432. }
  433. //用水量
  434. $.ajax({
  435. type: "get",
  436. url: huayi.config.callcenter_url + "plcautomationapi/api/plcdata/getwaterdatalist",
  437. async: true,
  438. dataType: 'json',
  439. data: {
  440. datetype: dateTypes,
  441. projectname: $("#projectID").attr("index")
  442. },
  443. success: function(data) {
  444. if (data.state.toLowerCase() == 'success') {
  445. // 用水量
  446. $('#waterCount').highcharts({
  447. chart: {
  448. type: 'column',
  449. backgroundColor: 'transparent',
  450. marginRight: 25,
  451. marginTop: 25
  452. },
  453. title: false,
  454. credits: {
  455. enabled: false // 禁用版权信息
  456. },
  457. exporting: {
  458. enabled: false
  459. }, //隐藏导出图片
  460. legend: {
  461. enabled: false
  462. },
  463. xAxis: {
  464. categories: (function() {
  465. var xAxised = [];
  466. $(data.data).each(function(i, n) {
  467. xAxised.push(n.TimeValue)
  468. })
  469. return xAxised
  470. })(),
  471. crosshair: true,
  472. title: {
  473. text: titleText,
  474. align: 'high',
  475. offset: 0,
  476. x: 25,
  477. y: 8,
  478. style: {
  479. color: '#266cf8'
  480. }
  481. },
  482. lineColor: "#45599d",
  483. tickColor: 'transparent',
  484. labels: {
  485. style: {
  486. color: '#fff'
  487. }
  488. }
  489. },
  490. yAxis: {
  491. min: 0,
  492. title: {
  493. text: '(吨)',
  494. align: 'high',
  495. offset: 0,
  496. rotation: 0,
  497. y: -10,
  498. x: -10,
  499. style: {
  500. color: '#266cf8'
  501. }
  502. },
  503. gridLineDashStyle: 'longdash', //图表内网格线样式
  504. gridLineColor: '#242f5d', //图表内网格线颜色
  505. labels: {
  506. style: {
  507. color: '#fff'
  508. },
  509. step: 1
  510. },
  511. lineColor: '#45599d',
  512. lineWidth: 1
  513. },
  514. plotOptions: {
  515. column: {
  516. borderWidth: 0,
  517. pointWidth: barWidth //柱子之间的距离值
  518. }
  519. },
  520. series: [{
  521. name: '数量',
  522. data: (function() {
  523. var seriesData = [];
  524. $(data.data).each(function(i, n) {
  525. seriesData.push(n.DataValue)
  526. })
  527. // console.log(seriesData)
  528. return seriesData.map(s => +s)
  529. })(),
  530. color: "#46b2f0",
  531. dataLabels: {
  532. enabled: true,
  533. format: '{y}',
  534. style: {
  535. color: '#fff'
  536. }
  537. }
  538. }]
  539. });
  540. }
  541. }
  542. });
  543. //用电量
  544. $.ajax({
  545. type: "get",
  546. url: huayi.config.callcenter_url + "plcautomationapi/api/plcdata/getelectricdatalist",
  547. async: true,
  548. dataType: 'json',
  549. data: {
  550. datetype: dateTypes,
  551. projectname: $("#projectID").attr("index")
  552. },
  553. success: function(data) {
  554. if (data.state.toLowerCase() == 'success') {
  555. // 用电量
  556. $('#electricCount').highcharts({
  557. chart: {
  558. type: 'column',
  559. backgroundColor: 'transparent',
  560. marginRight: 25,
  561. marginTop: 25
  562. },
  563. title: false,
  564. credits: {
  565. enabled: false // 禁用版权信息
  566. },
  567. exporting: {
  568. enabled: false
  569. }, //隐藏导出图片
  570. legend: {
  571. enabled: false
  572. },
  573. xAxis: {
  574. categories: (function() {
  575. var xAxised = [];
  576. $(data.data).each(function(i, n) {
  577. xAxised.push(n.TimeValue)
  578. })
  579. return xAxised
  580. })(),
  581. crosshair: true,
  582. title: {
  583. text: titleText,
  584. align: 'high',
  585. offset: 0,
  586. x: 25,
  587. y: 8,
  588. style: {
  589. color: '#266cf8'
  590. }
  591. },
  592. lineColor: "#45599d",
  593. tickColor: 'transparent',
  594. labels: {
  595. style: {
  596. color: '#fff'
  597. }
  598. }
  599. },
  600. yAxis: {
  601. min: 0,
  602. title: {
  603. text: '(度)',
  604. align: 'high',
  605. offset: 0,
  606. rotation: 0,
  607. y: -10,
  608. x: -10,
  609. style: {
  610. color: '#266cf8'
  611. },
  612. },
  613. gridLineDashStyle: 'longdash', //图表内网格线样式
  614. gridLineColor: '#242f5d', //图表内网格线颜色
  615. labels: {
  616. style: {
  617. color: '#fff'
  618. },
  619. step: 1
  620. },
  621. lineColor: '#45599d',
  622. lineWidth: 1
  623. },
  624. plotOptions: {
  625. column: {
  626. borderWidth: 0,
  627. pointWidth: barWidth //柱子之间的距离值
  628. }
  629. },
  630. series: [{
  631. name: '数量',
  632. data: (function() {
  633. var seriesData = [];
  634. $(data.data).each(function(i, n) {
  635. seriesData.push(n.DataValue)
  636. })
  637. // console.log(seriesData)
  638. return seriesData.map(s => +s)
  639. })(),
  640. color: "#fd3d00",
  641. dataLabels: {
  642. enabled: true,
  643. format: '{y}',
  644. style: {
  645. color: '#fff'
  646. }
  647. }
  648. }]
  649. });
  650. }
  651. }
  652. });
  653. //用气量
  654. $.ajax({
  655. type: "get",
  656. url: huayi.config.callcenter_url + "plcautomationapi/api/plcdata/getgasdatalist",
  657. async: true,
  658. dataType: 'json',
  659. data: {
  660. datetype: dateTypes,
  661. projectname: $("#projectID").attr("index")
  662. },
  663. success: function(data) {
  664. if (data.state.toLowerCase() == 'success') {
  665. // 用电量
  666. // 用气量
  667. $('#gasCount').highcharts({
  668. chart: {
  669. type: 'column',
  670. backgroundColor: 'transparent',
  671. marginRight: 25,
  672. marginTop: 25
  673. },
  674. title: false,
  675. credits: {
  676. enabled: false // 禁用版权信息
  677. },
  678. exporting: {
  679. enabled: false
  680. }, //隐藏导出图片
  681. legend: {
  682. enabled: false
  683. },
  684. xAxis: {
  685. categories: (function() {
  686. var xAxised = [];
  687. $(data.data).each(function(i, n) {
  688. xAxised.push(n.TimeValue)
  689. })
  690. return xAxised
  691. })(),
  692. crosshair: true,
  693. title: {
  694. text: titleText,
  695. align: 'high',
  696. offset: 0,
  697. x: 25,
  698. y: 8,
  699. style: {
  700. color: '#266cf8'
  701. }
  702. },
  703. lineColor: "#45599d",
  704. tickColor: 'transparent',
  705. labels: {
  706. style: {
  707. color: '#fff'
  708. }
  709. }
  710. },
  711. yAxis: {
  712. min: 0,
  713. title: {
  714. text: '(立方)',
  715. align: 'high',
  716. offset: 0,
  717. rotation: 0,
  718. y: -10,
  719. x: -10,
  720. style: {
  721. color: '#266cf8'
  722. },
  723. },
  724. gridLineDashStyle: 'longdash', //图表内网格线样式
  725. gridLineColor: '#242f5d', //图表内网格线颜色
  726. labels: {
  727. style: {
  728. color: '#fff'
  729. },
  730. step: 1
  731. },
  732. lineColor: '#45599d',
  733. lineWidth: 1
  734. },
  735. plotOptions: {
  736. column: {
  737. borderWidth: 0,
  738. pointWidth: barWidth //柱子之间的距离值
  739. }
  740. },
  741. series: [{
  742. name: '数量',
  743. data: (function() {
  744. var seriesData = [];
  745. $(data.data).each(function(i, n) {
  746. seriesData.push(n.DataValue)
  747. })
  748. // console.log(seriesData)
  749. return seriesData.map(s => +s)
  750. })(),
  751. color: "#f8c900",
  752. dataLabels: {
  753. enabled: true,
  754. format: '{y}',
  755. style: {
  756. color: '#fff'
  757. }
  758. }
  759. }]
  760. });
  761. }
  762. }
  763. });
  764. //用氧量
  765. $.ajax({
  766. type: "get",
  767. url: huayi.config.callcenter_url + "plcautomationapi/api/plcdata/getoxygendatalist",
  768. async: true,
  769. dataType: 'json',
  770. data: {
  771. datetype: dateTypes,
  772. projectname: $("#projectID").attr("index")
  773. },
  774. success: function(data) {
  775. if (data.state.toLowerCase() == 'success') {
  776. // 用氧量
  777. $('#oxygenCount').highcharts({
  778. chart: {
  779. type: 'column',
  780. backgroundColor: 'transparent',
  781. marginRight: 25,
  782. marginTop: 25
  783. },
  784. title: false,
  785. credits: {
  786. enabled: false // 禁用版权信息
  787. },
  788. exporting: {
  789. enabled: false
  790. }, //隐藏导出图片
  791. legend: {
  792. enabled: false
  793. },
  794. xAxis: {
  795. categories: (function() {
  796. var xAxised = [];
  797. $(data.data).each(function(i, n) {
  798. xAxised.push(n.TimeValue)
  799. })
  800. return xAxised
  801. })(),
  802. crosshair: true,
  803. title: {
  804. text: titleText,
  805. align: 'high',
  806. offset: 0,
  807. x: 25,
  808. y: 8,
  809. style: {
  810. color: '#266cf8'
  811. }
  812. },
  813. lineColor: "#45599d",
  814. tickColor: 'transparent',
  815. labels: {
  816. style: {
  817. color: '#fff'
  818. }
  819. }
  820. },
  821. yAxis: {
  822. min: 0,
  823. title: {
  824. text: '(立方)',
  825. align: 'high',
  826. offset: 0,
  827. rotation: 0,
  828. y: -10,
  829. x: -10,
  830. style: {
  831. color: '#266cf8'
  832. },
  833. },
  834. gridLineDashStyle: 'longdash', //图表内网格线样式
  835. gridLineColor: '#242f5d', //图表内网格线颜色
  836. labels: {
  837. style: {
  838. color: '#fff'
  839. },
  840. step: 1
  841. },
  842. lineColor: '#45599d',
  843. lineWidth: 1
  844. },
  845. plotOptions: {
  846. column: {
  847. borderWidth: 0,
  848. pointWidth: barWidth //柱子之间的距离值
  849. }
  850. },
  851. series: [{
  852. name: '数量',
  853. data: (function() {
  854. var seriesData = [];
  855. $(data.data).each(function(i, n) {
  856. seriesData.push(n.DataValue)
  857. })
  858. // console.log(seriesData)
  859. return seriesData.map(s => +s)
  860. })(),
  861. color: "#1cd585",
  862. dataLabels: {
  863. enabled: true,
  864. format: '{y}',
  865. style: {
  866. color: '#fff'
  867. }
  868. }
  869. }]
  870. });
  871. }
  872. }
  873. });
  874. }
  875. //退出
  876. function logout() {
  877. window.localStorage.removeItem('token');
  878. window.localStorage.removeItem('headImg');
  879. window.localStorage.removeItem('userName');
  880. window.localStorage.removeItem('userCode');
  881. window.localStorage.removeItem('roleName');
  882. window.localStorage.removeItem('seatFlag');
  883. window.localStorage.removeItem('extno');
  884. window.localStorage.removeItem('group');
  885. window.localStorage.removeItem('deptId');
  886. window.localStorage.removeItem('teamId');
  887. window.localStorage.removeItem('mobile');
  888. location.href = "./login.html";
  889. }
  890. function timeBtn(obj) {
  891. var num = 0;
  892. setInterval(function() {
  893. num++;
  894. if (num == 3) {
  895. num = 0;
  896. }
  897. obj.children('.btns').eq(num).trigger('click');
  898. }, huayi.config.timeBtnTime);
  899. }
  900. function WXTabtime(obj) {
  901. var num = 0;
  902. setInterval(function() {
  903. num++;
  904. if (num == 2) {
  905. num = 0;
  906. }
  907. obj.children('.title_tips').eq(num).trigger('click');
  908. }, huayi.config.wxTabTime);
  909. }
  910. function Ajax() {
  911. var $storages = window.localStorage;
  912. if ($("#projectID").text() == "null" || $("#projectID").text() == "") {
  913. $.ajax({
  914. type: "get",
  915. url: huayi.config.callcenter_url + "equipmentapi/api/RunningChart/getprojecttimeout",
  916. dataType: 'json',
  917. async: true,
  918. success: function(data) {
  919. if (data.state == 'success') {
  920. var selectPro=data.data
  921. $("#projectID").text(selectPro[0].id);
  922. $("#projectID").attr("index", selectPro[0].name);
  923. $("#PjText").text(selectPro[0].name);
  924. $('#pro_images').attr('src', 'images/' + selectPro[0].id + '.png');
  925. $storages.setItem('projectIDc', $("#projectID").text());
  926. $storages.setItem('projectIDName', $("#projectID").attr("index"));
  927. getmaintenancelist(); //维保事项
  928. getContractTimeOut(); //合同到期提示
  929. getBottomData(0);//底部水电气氧数据
  930. getproject(); //项目数量
  931. clearInterval(autoTabSchedulOrNewsTimer); //清楚定时
  932. getnewslist('importantInformation'); //项目新闻
  933. }
  934. }
  935. });
  936. }else{
  937. //getmapData();//地图数据
  938. getContractTimeOut(); //合同到期提示
  939. if($("#projectID").attr("index") == "河南省直第三人民医院"){
  940. getnewslist('schedulingInfo'); //项目新闻
  941. $('#switchTitleTabs').find('.outter').off('click',getSchedulOrNewsInfo);
  942. $('#switchTitleTabs').find('.outter').on('click',getSchedulOrNewsInfo);
  943. autoTabSchedulOrNews(); //自动切换
  944. }else{
  945. clearInterval(autoTabSchedulOrNewsTimer);
  946. getnewslist('importantInformation'); //项目新闻
  947. getmaintenancelist(); //维保事项
  948. }
  949. getBottomData(0);//底部水电气氧数据
  950. getproject(); //项目数量
  951. }
  952. }
  953. function projectTab() {
  954. getContractTimeOut(); //合同到期提示
  955. if($("#projectID").attr("index") == "河南省直第三人民医院"){
  956. getnewslist('schedulingInfo'); //项目新闻
  957. $('#switchTitleTabs').find('.outter').off('click',getSchedulOrNewsInfo);
  958. $('#switchTitleTabs').find('.outter').on('click',getSchedulOrNewsInfo);
  959. autoTabSchedulOrNews(); //自动切换
  960. }else{
  961. clearInterval(autoTabSchedulOrNewsTimer);
  962. getnewslist('importantInformation'); //项目新闻
  963. getmaintenancelist(); //维保事项
  964. }
  965. getproject(); //项目数量
  966. }
  967. // 获取排班信息或重要事项通知
  968. function getSchedulOrNewsInfo(){
  969. $(this).removeClass('title_sign_transparent').siblings().addClass('title_sign_transparent');
  970. if($(this).index() === 0){
  971. getnewslist('schedulingInfo'); //重要事项通知 项目新闻
  972. }else{
  973. getSchedulingInfo();//排班信息
  974. }
  975. }
  976. // 自动切换 排班信息或重要事项通知
  977. function autoTabSchedulOrNews(){
  978. var num = 0;
  979. if(autoTabSchedulOrNewsTimer){
  980. clearInterval(autoTabSchedulOrNewsTimer);
  981. }
  982. autoTabSchedulOrNewsTimer = setInterval(function() {
  983. num++;
  984. if (num === 2) {
  985. num = 0;
  986. }
  987. $('#switchTitleTabs').find('.outter').eq(num).trigger('click');
  988. }, huayi.config.timeBtnTime);
  989. }