0
0

repair_order.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. function task() {
  2. $.get('/api/Orders_v2/task',{org_id:orgid, mode: 1},function (res) {
  3. if(res.status === 0) {
  4. var list = res.data.data;
  5. if(list.length > 0){
  6. var str = '';
  7. for (var i=0;i<list.length;i++){
  8. str += '<tr>';
  9. // str += '<td>'+list[i]['TODO_ID']+'</td>';
  10. // str += '<td>'+list[i]['TASK_TYPE']+'</td>';
  11. str += '<td class="table-project-name">'+list[i]['CONTENT']+'</td>';
  12. str += '<td>'+list[i]['REPAIR_NAME']+'</td>';
  13. str += '<td class="table-task-name">'+list[i]['DEP']+'</td>';
  14. str += '<td>'+list[i]['HANDOUT_TIME']+'</td>';
  15. str += '<td>'+list[i]['executor']+'</td>';
  16. if (list[i]['TODO_MODE'] == '待领取') {
  17. str += '<td style="color: #FD0000;">' + list[i]['TODO_MODE'] + '</td>';
  18. } else {
  19. str += '<td style="color: #11F000;">' + list[i]['TODO_MODE'] + '</td>';
  20. }
  21. str += '</tr>';
  22. }
  23. $('#task-order').html(str);
  24. }
  25. if (list.length > 11) {
  26. $(function(){
  27. var text=$("#task-order:first");
  28. var clear;
  29. text.hover(function(){
  30. clearInterval(clear);
  31. },function(){
  32. clear=setInterval(function(){
  33. var field=text.find("tr:first");
  34. var high=field.height();
  35. text.animate({ marginTop:-high+"px"},600,function(){
  36. field.css("marginTop",0).appendTo(text);
  37. text.css("marginTop",0);
  38. })
  39. },5000)//滚动间隔时间
  40. }).trigger("mouseleave");//自动滚动
  41. });
  42. }
  43. }
  44. })
  45. }
  46. function todo() {
  47. $.get('/api/Orders_v2/hidden_todo_day',{orgid:orgid, mode: 1},function (data) {
  48. if(data.status == 0){
  49. if(data.data.data.length > 0){
  50. var optionChart = echarts.init(document.getElementById("order-day"));
  51. option = {
  52. legend: {
  53. top: '0',
  54. textStyle: {
  55. fontSize: 16,
  56. fontWeight: 'normal',
  57. color: '#FFFFFF',
  58. },
  59. },
  60. grid: {
  61. top: '35%',
  62. left: '5%',
  63. right: '5%',
  64. containLabel: true
  65. },
  66. tooltip: {
  67. trigger: 'item',
  68. formatter: "{b}: {c}个"
  69. },
  70. title: {
  71. text: Math.floor(data.data.ratio * 100) / 100 + '%',
  72. subtext: '已完成占比',
  73. x: 'center',
  74. y: '45%',
  75. textStyle: {
  76. fontSize: 36,
  77. fontWeight: 'normal',
  78. color: '#3DE8FC',
  79. },
  80. subtextStyle: {
  81. fontSize: 18,
  82. fontWeight: 'normal',
  83. align:"center",
  84. color:'#FFFFFF'
  85. },
  86. },
  87. series: [{
  88. type: 'pie',
  89. radius: ['40%', '70%'],
  90. center: ['50%', '60%'],
  91. color: ['#1372BD', '#72BBF1'],
  92. // itemStyle:{
  93. // normal: {
  94. // borderWidth: 5,
  95. // borderColor: '#031845',
  96. // }
  97. // },
  98. data: data.data.data,
  99. labelLine: {
  100. normal: {
  101. show: true,
  102. length: 50,
  103. length2: 50,
  104. lineStyle: {
  105. color: '#52FFFF',
  106. width: 2
  107. }
  108. }
  109. },
  110. label: {
  111. normal: {
  112. formatter: '{b} {c}个',
  113. color: '#fff',
  114. fontSize: 16,
  115. }
  116. }
  117. }]
  118. };
  119. optionChart.setOption(option);
  120. }
  121. }
  122. });
  123. }
  124. function orders(type) {
  125. $.get('/api/Orders_v2/hidden_week_month',{orgid:orgid, type:type, mode:1},function (data) {
  126. if(data.status == 0){
  127. if(data.data.list.length > 0){
  128. if(type == 1) {
  129. $('#order-name').html('周分析');
  130. } else {
  131. $('#order-name').html('月分析');
  132. }
  133. var patrolChart = echarts.init(document.getElementById("order"));
  134. patrolOption = null;
  135. patrolOption = {
  136. color: ['#2986CF','#50E2CB'],
  137. legend: {
  138. data:['工单总量', '完成工单量'],
  139. textStyle: { color: "#FFFDFE" },
  140. top: 10
  141. // icon: "circle",
  142. },
  143. grid: {
  144. top: '25%',
  145. left: '3%',
  146. right: '3%',
  147. bottom: '1%',
  148. containLabel: true
  149. },
  150. tooltip: {},
  151. dataset: {
  152. dimensions: ['day','工单总量','完成工单量'],
  153. source: data.data.list,
  154. },
  155. xAxis: {
  156. type: 'category',
  157. axisLine: {
  158. lineStyle: {
  159. color: '#fff',
  160. width: 1,
  161. }
  162. },
  163. },
  164. yAxis: {
  165. axisLabel: {
  166. color:'#fff',
  167. }
  168. },
  169. series: [
  170. {
  171. type: 'bar',
  172. // barMaxWidth: 30,
  173. label: {
  174. normal: {
  175. show: true,
  176. position: 'top',
  177. color: '#fff'
  178. }
  179. },
  180. },
  181. {
  182. type: 'bar',
  183. // barMaxWidth: 30,
  184. label: {
  185. normal: {
  186. show: true,
  187. position: 'top',
  188. color: '#fff'
  189. }
  190. },
  191. }
  192. ]
  193. };
  194. if (patrolOption && typeof patrolOption === "object") {
  195. patrolChart.setOption(patrolOption, true);
  196. }
  197. }
  198. }
  199. });
  200. }
  201. task();
  202. orders(1);
  203. todo();
  204. setInterval(function () {
  205. task();
  206. todo();
  207. },5000*30);
  208. setInterval(function () {
  209. setTimeout(function(){
  210. orders(1);
  211. },5000);
  212. setTimeout(function(){
  213. orders(2);
  214. },10000);
  215. },15000);
  216. function realSysTime(clock) {
  217. var now = new Date();
  218. var year = now.getFullYear(); //获取年份
  219. var month = now.getMonth(); //获取月份
  220. var date = now.getDate(); //获取日期
  221. var day = now.getDay(); //获取星期
  222. var hour = now.getHours(); //获取小时
  223. var minute = now.getMinutes(); //获取分钟
  224. var seconds = now.getSeconds(); //获取秒
  225. month = month + 1;
  226. var arr_week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
  227. var week = arr_week[day];
  228. if (month<10) {
  229. month = '0'+month
  230. }
  231. if (date<10) {
  232. date = '0'+date
  233. }
  234. if (hour<10) {
  235. hour = '0'+hour
  236. }
  237. if (minute<10) {
  238. minute = '0'+minute
  239. }
  240. if (seconds<10) {
  241. seconds = '0'+seconds
  242. }
  243. var time = year + "年" + month + "月" + date + "日 " + week + " " + hour + ":" + minute + ":" + seconds;
  244. clock.innerHTML = time;
  245. }
  246. function show() {
  247. window.setInterval("realSysTime(clock)", 1000);
  248. }
  249. window.onload=show();