郑州第一人民医院UI

index-1.js 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. //科室切换
  2. $(function() {
  3. $(".bottomBtns1").click(function() {
  4. $(this).addClass('active').siblings().removeClass('active');
  5. var dataIndex = $(this).attr('data-index');
  6. administrative(dataIndex);
  7. });
  8. $(".bottomBtns2").click(function() {
  9. $(this).addClass('active').siblings().removeClass('active');
  10. var dataIndex = $(this).attr('data-index');
  11. distribution(dataIndex);
  12. });
  13. });
  14. //科室数量
  15. function administrative(dataIndex) {
  16. $.ajax({
  17. type: "get",
  18. url: huayi.config.callcenter_url + "distributionapi/api/distributionappchart/getdepartmentwocount",
  19. async: true,
  20. dataType: 'json',
  21. data: {
  22. datetype: dataIndex,
  23. projectid:$("#projectID").text()
  24. },
  25. success: function(data) {
  26. if(data.state.toLowerCase() == 'success') {
  27. // 用电量
  28. $('#departmentsCount').highcharts({
  29. chart: {
  30. type: 'column',
  31. backgroundColor: 'transparent',
  32. marginRight: 25,
  33. marginTop: 25
  34. },
  35. title: false,
  36. credits: {
  37. enabled: false // 禁用版权信息
  38. },
  39. exporting: {
  40. enabled: false
  41. }, //隐藏导出图片
  42. legend: {
  43. enabled: false
  44. },
  45. xAxis: {
  46. categories: (function() {
  47. var xAxised = [];
  48. var dpartLength=data.data.list_dep;
  49. var dapLe;
  50. if (dpartLength.length<5) {
  51. dapLe=dpartLength.length;
  52. }else{
  53. dapLe=5;
  54. }
  55. for(var i = 0; i < dapLe; i++) {
  56. xAxised.push(dpartLength[i].departmentname)
  57. }
  58. return xAxised
  59. })(),
  60. crosshair: true,
  61. title: {
  62. text: "科室",
  63. align: 'high',
  64. offset: 0,
  65. x: 25,
  66. y: 8,
  67. style: {
  68. color: '#266cf8'
  69. }
  70. },
  71. lineColor: "#45599d",
  72. tickColor: 'transparent',
  73. labels: {
  74. style: {
  75. color: '#fff'
  76. }
  77. }
  78. },
  79. yAxis: {
  80. min: 0,
  81. title: {
  82. text: '数量',
  83. align: 'high',
  84. offset: 0,
  85. rotation: 0,
  86. y: -10,
  87. x: -10,
  88. style: {
  89. color: '#266cf8'
  90. },
  91. },
  92. gridLineDashStyle: 'longdash', //图表内网格线样式
  93. gridLineColor: '#242f5d', //图表内网格线颜色
  94. labels: {
  95. style: {
  96. color: '#fff'
  97. },
  98. step: 1
  99. },
  100. lineColor: '#45599d',
  101. lineWidth: 1
  102. },
  103. plotOptions: {
  104. column: {
  105. borderWidth: 0,
  106. pointWidth: 15 //柱子之间的距离值
  107. }
  108. },
  109. series: [{
  110. name: '数量',
  111. data: (function() {
  112. var seriesData = [];
  113. var dpartLength=data.data.list_dep
  114. var dapLe;
  115. if (dpartLength.length<5) {
  116. dapLe=dpartLength.length;
  117. }else{
  118. dapLe=5;
  119. }
  120. for(var i = 0; i < dapLe; i++) {
  121. seriesData.push(dpartLength[i].departmentwonum)
  122. }
  123. // console.log(seriesData)
  124. return seriesData.map(s => +s)
  125. })(),
  126. color: "#7787ff",
  127. dataLabels: {
  128. enabled: true,
  129. format: '{y}',
  130. style: {
  131. color: '#fff'
  132. }
  133. }
  134. }]
  135. });
  136. }
  137. }
  138. });
  139. }
  140. //配送物品前五
  141. function distribution(dataIndex){
  142. $.ajax({
  143. type: "get",
  144. url: huayi.config.callcenter_url + "distributionapi/api/distributionappchart/getgoodswocount",
  145. async: true,
  146. dataType: 'json',
  147. data: {
  148. datetype: dataIndex,
  149. projectid:$("#projectID").text()
  150. },
  151. success: function(data) {
  152. if(data.state.toLowerCase() == 'success') {
  153. // 用电量
  154. $('#distribCount').highcharts({
  155. chart: {
  156. type: 'bar',
  157. backgroundColor: 'transparent',
  158. marginRight: 25,
  159. marginTop: 25
  160. },
  161. title: false,
  162. credits: {
  163. enabled: false // 禁用版权信息
  164. },
  165. exporting: {
  166. enabled: false
  167. }, //隐藏导出图片
  168. legend: {
  169. enabled: false
  170. },
  171. xAxis: {
  172. categories: (function() {
  173. var xAxised = [];
  174. var dpartLength=data.data.list_goods
  175. if(dpartLength.length > 3){
  176. for(var i = 0; i < 5; i++) {
  177. xAxised.push(dpartLength[i].goodsname)
  178. }
  179. }
  180. return xAxised
  181. })(),
  182. crosshair: true,
  183. title: {
  184. text: "科室",
  185. align: 'high',
  186. offset: 10,
  187. x: 10,
  188. y: -20,
  189. style: {
  190. color: '#266cf8'
  191. }
  192. },
  193. lineColor: "#45599d",
  194. tickColor: 'transparent',
  195. labels: {
  196. style: {
  197. color: '#fff'
  198. }
  199. }
  200. },
  201. yAxis: {
  202. min: 0,
  203. title: {
  204. text: '数量',
  205. align: 'high',
  206. offset: 0,
  207. rotation: 0,
  208. y: -10,
  209. x: -10,
  210. style: {
  211. color: '#266cf8'
  212. },
  213. },
  214. gridLineDashStyle: 'longdash', //图表内网格线样式
  215. gridLineColor: '#242f5d', //图表内网格线颜色
  216. labels: {
  217. style: {
  218. color: '#fff'
  219. },
  220. step: 1
  221. },
  222. lineColor: '#45599d',
  223. lineWidth: 0
  224. },
  225. plotOptions: {
  226. bar: {
  227. borderWidth: 0,
  228. pointWidth: 15 //柱子之间的距离值
  229. }
  230. },
  231. series: [{
  232. name: '数量',
  233. data: (function() {
  234. var seriesData = [];
  235. var dpartLength=data.data.list_goods
  236. if(dpartLength.length > 3){
  237. for(var i = 0; i < 5; i++) {
  238. seriesData.push(dpartLength[i].goodswonum)
  239. }
  240. }
  241. return seriesData.map(s => +s)
  242. })(),
  243. color: "#8782f4",
  244. dataLabels: {
  245. enabled: true,
  246. format: '{y}',
  247. style: {
  248. color: '#fff'
  249. }
  250. }
  251. }]
  252. });
  253. }
  254. }
  255. });
  256. }