rock_page_dailychart.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. /**
  3. * 模块:daily.工作日报统计分析
  4. * 来源:http://www.rockoa.com/
  5. */
  6. defined('HOST') or die ('not access');
  7. ?>
  8. <script>
  9. $(document).ready(function(){
  10. var myChart = [],darr=[];
  11. var c = {
  12. getparams:function(xu,tfid,nas,chatlx){
  13. var cans = {
  14. tablename:'todo',url:js.getajaxurl('flowtotal','flowopt','flow'),modenum:'finfybx',
  15. params:{atype:'all',total_fields:tfid,total_type:'sum|money'},xuhao:xu,chatlx:chatlx,
  16. columns:[{
  17. text:nas,dataIndex:'name'
  18. },{
  19. text:'金额',dataIndex:'value'
  20. },{
  21. text:'比例',dataIndex:'bili'
  22. }],
  23. load:function(a){
  24. c.loadcharts(this.xuhao,this.chatlx);
  25. }
  26. };
  27. return cans;
  28. },
  29. reload:function(o1,lx){
  30. darr[lx].reload();
  31. },
  32. loadcharts:function(oi,tlx){
  33. if(!tlx)tlx='pie';
  34. var rows = darr[oi].getData('rows'),i,len=rows.length,v;
  35. var xAxis=[],data=[];
  36. for(i=0;i<len;i++){
  37. if(rows[i].name!='合计'){
  38. xAxis.push(rows[i].name);
  39. v = rows[i].value;if(v=='')v=0;
  40. data.push({value:parseFloat(v),name:rows[i].name});
  41. }
  42. }
  43. if(!myChart[oi])myChart[oi] = echarts.init(get('viewchats'+oi+'_{rand}'));
  44. var option = {
  45. title: {
  46. text: '',
  47. left: 'center'
  48. },
  49. tooltip : {
  50. trigger: 'item',
  51. formatter: "{b} : {c}人 ({d}%)"
  52. },
  53. series: [{
  54. name: '人数',
  55. type: tlx,
  56. data: data
  57. }]
  58. };
  59. if(tlx!='pie'){
  60. option.xAxis={data: xAxis};
  61. option.yAxis={type : 'value'};
  62. }
  63. myChart[oi].setOption(option);
  64. },
  65. search:function(){
  66. var cnas = {
  67. 'dt':get('dt1_{rand}').value
  68. };
  69. darr[0].setparams(cnas, true);
  70. darr[1].setparams(cnas, true);
  71. }
  72. };
  73. darr[1] = $('#view1_{rand}').bootstable({
  74. tablename:'dailyfx',url:publicmodeurl('daily'),storebeforeaction:'bmztweixiedatabefore',storeafteraction:'bmztweixiedataafter',
  75. columns:[{
  76. text:'部门',dataIndex:'name'
  77. },{
  78. text:'未写人数',dataIndex:'value'
  79. }],
  80. load:function(a){
  81. c.loadcharts(1,'pie');
  82. }
  83. });
  84. darr[0] = $('#view0_{rand}').bootstable({
  85. tablename:'dailyfx',url:publicmodeurl('daily'),storebeforeaction:'ztweixiedatabefore',storeafteraction:'ztweixiedataafter',
  86. columns:[{
  87. text:'部门',dataIndex:'deptname',align:'left',sortable:true
  88. },{
  89. text:'姓名',dataIndex:'name',sortable:true
  90. },{
  91. text:'应写',dataIndex:'totaly',sortable:true
  92. },{
  93. text:'已写',dataIndex:'totalx',sortable:true
  94. },{
  95. text:'未写',dataIndex:'totalw',sortable:true
  96. }],
  97. load:function(d){
  98. $('#zttiel0_{rand}').html('日期['+d.ztdt+']未写日报人员');
  99. $('#zttiel1_{rand}').html('日期['+d.ztdt+']根据部门统计未写人员');
  100. }
  101. });
  102. js.initbtn(c);
  103. });
  104. </script>
  105. <div>
  106. <table width="100%">
  107. <tr>
  108. <td nowrap>日期&nbsp;</td>
  109. <td>
  110. <input onclick="js.datechange(this,'date')" style="width:110px" readonly class="form-control datesss" id="dt1_{rand}" >
  111. </td>
  112. <td style="padding-left:10px">
  113. <button class="btn btn-default" click="search" type="button">查看统计</button>
  114. </td>
  115. <td width="90%">
  116. </td>
  117. <td align="right" nowrap>
  118. </td>
  119. </tr>
  120. </table>
  121. </div>
  122. <div class="blank10"></div>
  123. <div align="left">
  124. <table border="0" width="100%" cellspacing="0" cellpadding="0">
  125. <tr valign="top">
  126. <td width="50%">
  127. <div align="left" style="min-width:300px" class="list-group">
  128. <div class="list-group-item list-group-item-info">
  129. <i class="icon-bar-chart"></i> <span id="zttiel0_{rand}">昨天未写人员</span>
  130. <span style="float:right" ><a click="reload,0"><i class="icon-refresh"></i></a></span>
  131. </div>
  132. <div id="view0_{rand}"></div>
  133. </div>
  134. </td>
  135. <td style="padding-left:10px;">
  136. <div align="left" class="list-group">
  137. <div class="list-group-item list-group-item-success">
  138. <i class="icon-bar-chart"></i> <span id="zttiel1_{rand}">根据部门统计已写未写人员</span>
  139. <span style="float:right" ><a click="reload,1"><i class="icon-refresh"></i></a></span>
  140. </div>
  141. <div id="view1_{rand}"></div>
  142. <div id="viewchats1_{rand}" style="width:100%;height:250px;border:1px #dddddd solid;border-top:0px"></div>
  143. </div>
  144. </td>
  145. </tr>
  146. </table>
  147. </div>
粤ICP备19079148号